/*
Theme Name: Hydrogen Water Science
Description: A modern, engaging theme for hydrogen water science content inspired by IFLScience
Version: 2.0
Author: Hydrogen Water Team
*/

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00a8cc;
    --secondary-color: #ff6b35;
    --accent-color: #4ecdc4;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-light: #e9ecef;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-heavy: 0 8px 30px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --border-radius-small: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    font-size: 16px;
}

body.menu-open {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--bg-white);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--primary-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.site-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: var(--transition);
}

.site-title:hover {
    color: var(--secondary-color);
    transform: scale(1.02);
}

.site-tagline {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Navigation */
.main-navigation {
    position: relative;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-small);
    transition: var(--transition);
    position: relative;
}

.main-navigation a:hover {
    color: var(--primary-color);
    background-color: rgba(0, 168, 204, 0.1);
}

.main-navigation a.active {
    color: var(--primary-color);
    background-color: rgba(0, 168, 204, 0.15);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 2px 0;
    transition: var(--transition);
    border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Hero Section */
.hero-section {
    background: var(--bg-white);
    padding: 4rem 0;
    margin-bottom: 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-placeholder {
    background: var(--bg-light);
    border: 2px dashed var(--border-light);
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    color: var(--text-light);
    font-weight: 500;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* About Section */
.about-section {
    background: var(--bg-light);
    padding: 5rem 0;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.about-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0;
}

/* Services Section */
.services-section {
    background: var(--bg-white);
    padding: 5rem 0;
}

.services-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.services-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.service-image {
    height: 200px;
    overflow: hidden;
}

.service-image .image-placeholder {
    height: 100%;
    min-height: 200px;
    padding: 2rem;
}

.service-content {
    padding: 2rem;
}

.service-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.service-content p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Latest Articles Section */
.latest-articles {
    background: var(--bg-light);
    padding: 5rem 0;
}

.latest-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.latest-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 3rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.article-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.article-image {
    height: 200px;
    overflow: hidden;
}

.article-image .image-placeholder {
    height: 100%;
    min-height: 200px;
    padding: 2rem;
}

.article-content {
    padding: 2rem;
}

.article-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.article-content h3 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

.article-content h3 a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--secondary-color);
}

.articles-cta {
    text-align: center;
}

.no-articles {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

/* Study Filters */
.study-filters {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 3rem;
}

.study-filters h3 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    padding: 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-small);
    background: var(--bg-white);
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 168, 204, 0.1);
}

/* Study Cards */
.studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.study-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 0;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    overflow: hidden;
    border: 1px solid var(--border-light);
    position: relative;
}

.study-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-color);
}

.study-card-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.study-card h3 {
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
}

.study-card h3 a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.study-card h3 a:hover {
    color: var(--primary-color);
}

.study-meta {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.study-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.study-card-body {
    padding: 0 1.5rem 1rem;
}

.study-excerpt {
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.study-categories {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.category-tag:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-light);
}

.study-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
}

.read-study-btn, .read-simple-btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-small);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    flex: 1;
    text-align: center;
}

.read-study-btn {
    background: var(--primary-color);
    color: white;
}

.read-study-btn:hover {
    background: #0088aa;
    color: white;
    transform: translateY(-2px);
}

.read-simple-btn {
    background: var(--secondary-color);
    color: white;
}

.read-simple-btn:hover {
    background: #e55a2b;
    color: white;
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius-small);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    background: #0088aa;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-dark);
    border: 2px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Study Count */
.study-count {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* No Studies Message */
.no-studies {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.no-studies h2 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.no-studies p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    gap: 0.5rem;
}

.pagination a, .pagination span {
    padding: 0.75rem 1rem;
    background: var(--bg-white);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: var(--border-radius-small);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    font-weight: 600;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Footer */
.site-footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-branding h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.footer-branding p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: var(--accent-color);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-section a:hover {
    opacity: 1;
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    opacity: 0.6;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-white);
        box-shadow: var(--shadow-heavy);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 5rem 2rem 2rem;
        gap: 0;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        margin: 0;
        border-bottom: 1px solid var(--border-light);
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
        border-radius: 0;
        text-align: left;
    }
    
    .nav-menu a:hover {
        background: none;
        color: var(--primary-color);
    }
    
    .nav-menu a.active {
        background: none;
        color: var(--primary-color);
        font-weight: 700;
    }
    
    /* Mobile menu overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Hero Section Mobile */
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    /* About Section Mobile */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .about-text h2 {
        font-size: 2rem;
    }
    
    .about-features {
        text-align: left;
    }
    
    /* Services Section Mobile */
    .services-content h2 {
        font-size: 2rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* Articles Section Mobile */
    .latest-content h2 {
        font-size: 2rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .studies-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .study-actions {
        flex-direction: column;
    }
    
    .study-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .homepage-hero {
        padding: 2rem 0;
    }
    
    .homepage-hero h1 {
        font-size: 2rem;
    }
    
    .study-filters {
        padding: 1.5rem;
    }
    
    .study-card-header,
    .study-card-body,
    .study-actions {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* WordPress Core Styles */
.alignleft {
    float: left;
    margin: 0 20px 20px 0;
}

.alignright {
    float: right;
    margin: 0 0 20px 20px;
}

.aligncenter {
    display: block;
    margin: 0 auto 20px;
}

.wp-caption {
    max-width: 100%;
    margin-bottom: 20px;
}

.wp-caption-text {
    font-size: 14px;
    color: var(--text-light);
    text-align: center;
    margin-top: 10px;
}

/* Form Styles */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-small);
    font-size: 16px;
    transition: var(--transition);
    background: var(--bg-white);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 168, 204, 0.1);
}

/* Button Styles */
input[type="submit"],
button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
}

input[type="submit"]:hover,
button:hover {
    background: #0088aa;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* WordPress Admin Bar Adjustment */
body.admin-bar .site-header {
    margin-top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        margin-top: 46px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-40 {
    margin-bottom: 40px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-40 {
    margin-top: 40px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}