/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-green: #2d7d32;
    --light-green: #4caf50;
    --dark-green: #1b5e20;
    --primary-blue: #1976d2;
    --light-blue: #42a5f5;
    --dark-blue: #0d47a1;
    --accent-orange: #ff9800;
    --accent-yellow: #ffc107;
    --text-dark: #2c3e50;
    --text-gray: #546e7a;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --border-light: #e0e0e0;
    
    /* Typography */
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Lato', sans-serif;
    
    /* Spacing */
    --container-padding: 1rem;
    --section-padding: 4rem 0;
        gap: 0.5rem;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Prevent horizontal overflow on small screens */
html { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }

/* Utility: sticky footer for simple content pages */
.sticky-footer {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.sticky-footer main {
    flex: 1 0 auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Header Styles */
.header {
    background: var(--white);
    box-sizing: border-box;
    width: 100%;
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem var(--container-padding);
    z-index: 1600; /* sit above most content */
}

.nav__logo h1 {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green);
    text-decoration: none;
}

.nav-logo-img {
    display: inline-block;
    width: 160px;
    height: auto;
    object-fit: contain;
}

.nav__menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav__menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav__menu a:hover {
    color: var(--primary-green);
}

.search-icon {
    font-size: 1.2rem;
    color: var(--primary-blue);
}

.nav__toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* Hero Section */
.hero {
    position: relative;
    color: var(--white);
    padding: 6rem 0 3rem;
    text-align: center;
    margin-top: 0; /* header is fixed */
    background-image: url('../img/photo-1504674900247-0877df9cc836.avif');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 520px;
    display: flex;
    align-items: center;
}

.hero { overflow: hidden; }

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(18, 24, 31, 0.55); /* dark overlay */
}

.hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 3rem 0;
}

.hero__brand .hero__logo {
    font-family: var(--font-primary);
    color: var(--white);
    font-size: 1.1rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.hero__logo-img {
    display: inline-block;
    width: 220px; /* increased size for desktop */
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.28));
}

.hero__title {
    font-family: var(--font-primary);
    font-size: 2.8rem; /* slightly smaller to let logo breathe */
    font-weight: 800;
    margin-bottom: 0.6rem;
    color: var(--white);
}

.hero__subtitle {
    font-size: 1.1rem;
    margin-bottom: 2.2rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255,255,255,0.95);
}

.hero__features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0.5rem auto 2rem;
    align-items: center;
}

.feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255,255,255,0.95);
    padding: 0.5rem 1rem;
}

.feature i {
    color: #3ddc84; /* green check */
    font-size: 1.8rem;
}

.feature-text strong {
    display: block;
    font-family: var(--font-primary);
    font-size: 1rem;
}

.feature-sub {
    font-size: 0.9rem;
    opacity: 0.9;
}

.hero__search {
    max-width: 820px;
    margin: 0 auto;
}

.search-form {
    display: flex;
    background: var(--white);
    border-radius: 6px;
    padding: 0.25rem;
    box-shadow: 0 10px 30px rgba(2,6,23,0.35);
}

.search-input {
    flex: 1;
    border: none;
    padding: 1.2rem 1.5rem;
    font-size: 1.05rem;
    border-radius: 6px 0 0 6px;
    outline: none;
}

.search-btn {
    background: var(--accent-orange);
    color: var(--white);
    border: none;
    padding: 1.15rem 2rem;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s ease;
}

.search-btn--green {
    background: var(--light-green);
    color: #fff;
}

.search-btn--green:hover {
    background: var(--primary-green);
}

/* Lead Magnet Section */
.lead-magnet {
    background: var(--light-gray);
    padding: var(--section-padding);
}

.lead-magnet__content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.lead-magnet h2 {
    font-family: var(--font-primary);
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    width: 100%;
}

.form-select,
.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: var(--font-secondary);
    transition: border-color 0.3s ease;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-green);
}

.cta-btn {
    background: var(--accent-orange);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.cta-btn:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Featured Editorials Section */
.featured-editorials {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
}

.editorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.editorial-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.editorial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.editorial-image {
    height: 250px;
    overflow: hidden;
}

.editorial-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.editorial-card:hover .editorial-image img {
    transform: scale(1.05);
}

.editorial-content {
    padding: 1.5rem;
}

.editorial-content h3 {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.editorial-content p {
    color: var(--text-gray);
    margin-bottom: 1rem;
}

/* Editorial article typography (article pages) */
.editorial-article {
    font-family: var(--font-secondary);
    color: var(--text-dark);
}

.editorial-article h1 {
    font-family: var(--font-primary);
    font-size: 2.6rem; /* larger hero title for the article */
    line-height: 1.12;
    margin: 1.5rem 0 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #000;
}

.editorial-article h2 {
    font-family: var(--font-primary);
    font-size: 1.6rem; /* emphasize each topic */
    line-height: 1.25;
    margin: 1.6rem 0 0.8rem; /* extra space above each topic */
    color: #000; /* keep headings black per request */
    font-weight: 700;
}

.editorial-article h3 {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    margin: 1.1rem 0 0.5rem;
    color: #000;
    font-weight: 700;
}

.editorial-article p {
    color: #000;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.75;
}

.editorial-article blockquote {
    border-left: 4px solid var(--light-green);
    background: rgba(76, 175, 80, 0.04);
    padding: 0.85rem 1rem;
    margin: 0 0 1.25rem;
    font-style: italic;
    color: #000;
}

/* Responsive adjustments for article typography */
@media (max-width: 768px) {
    .editorial-article h1 { font-size: 2.2rem; }
    .editorial-article h2 { font-size: 1.45rem; }
    .editorial-article p  { font-size: 1rem; line-height: 1.7; }
}

@media (max-width: 480px) {
    .editorial-article h1 { font-size: 1.9rem; }
    .editorial-article h2 { font-size: 1.25rem; }
    .editorial-article p  { font-size: 0.98rem; line-height: 1.6; }
}

.read-more {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--dark-green);
}

/* Digital Products Section */
.digital-products {
    background: var(--light-gray);
    padding: var(--section-padding);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-content {
    padding: 1.5rem;
    text-align: center;
}

.product-content h3 {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.product-content p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

.learn-more-btn {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.learn-more-btn:hover {
    background: var(--dark-blue);
}

.product-gallery {
    text-align: center;
    margin-top: 4rem;
}

.product-gallery h3 {
    font-family: var(--font-primary);
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gallery-item {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-3px);
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.gallery-item h4 {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* Extra gallery block hidden by default and revealed via JS */
.gallery-extra {
    display: none;
    opacity: 0;
    transform: translateY(8px);
}
.gallery-extra.revealed {
    display: block;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Extra editorials block hidden by default */
.editorials-extra {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    padding-top: 1.5rem;
}
.editorials-extra.revealed {
    display: block;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Center the show more button under editorials */
.featured-editorials #show-more-editorials {
    display: block;
    margin: 1.5rem auto 0;
    text-align: center;
}

.shop-all-btn {
    background: var(--accent-orange);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-all-btn:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer__content {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.footer__social h3 {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--primary-green);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.3s ease;
}

.social-icons a:hover {
    background: var(--light-green);
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    text-align: center;
}

.footer__links a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer__links a:hover {
    color: var(--accent-yellow);
}

.footer__bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--text-gray);
    color: var(--text-gray);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav__menu {
        position: fixed;
        /* open just below the header; 56px is a sensible mobile header height */
        top: 56px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 2500; /* ensure menu sits above header/hero */
        -webkit-overflow-scrolling: touch;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }

    .nav__menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        z-index: 2500;
        pointer-events: auto;
    }

    .nav__toggle {
        display: block;
    }

    .nav-logo-img {
        width: 130px;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__logo-img {
        width: 180px;
    }

    .hero__subtitle {
        font-size: 1rem;
    }

    .hero__topics {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .search-form {
        flex-direction: column;
        border-radius: var(--border-radius);
        width: 100%;
        max-width: 640px; /* keep a sensible max width on tablet */
        margin-left: auto;
        margin-right: auto;
    }

    .search-input {
        border-radius: var(--border-radius);
        margin-bottom: 0.5rem;
    }

    .search-btn {
        border-radius: var(--border-radius);
    }

    .editorials-grid {
        grid-template-columns: 1fr;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .footer__content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer__links {
        justify-content: center;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    :root {
        --container-padding: 0.5rem;
        --section-padding: 2rem 0;
    }

    .hero {
        padding: 6rem 0 2rem;
    }

    /* Ensure search doesn't overflow on small phones */
    .hero__search {
        max-width: calc(100% - 2rem);
        padding: 0 1rem;
        box-sizing: border-box;
    }

    .search-form {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        gap: 0.4rem;
    }

    .search-input, .search-btn {
        box-sizing: border-box;
        padding: 0.7rem 0.9rem;
        font-size: 1rem;
    }

    .hero__title {
        font-size: 1.75rem;
    }

    .hero__logo-img {
        width: 140px;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    /* Additional safeguards against horizontal overflow on very small screens */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
        box-sizing: border-box;
        max-width: 100%;
    }

    .hero__content {
        max-width: 100%;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        box-sizing: border-box;
    }

    /* Ensure fixed or absolutely positioned elems don't extend outside viewport */
    .header, .nav, .hero, .search-form, .product-gallery {
        box-sizing: border-box;
        max-width: 100vw;
        overflow-x: hidden;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus,
a:focus {
    outline: 2px solid var(--accent-yellow);
    outline-offset: 2px;
}

/* Loading animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero__content,
.lead-magnet__content,
.section-header,
.editorial-card,
.product-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Ensure lists inside article copy align with the paragraph text
   and have comfortable spacing. Using `inside` keeps bullets
   aligned with the text block rather than indented further. */
.editorial-article ul {
    list-style-type: disc;
    list-style-position: inside;
    padding-left: 0; /* remove default browser indent */
    margin: 0 0 1.25rem 0;
}

.editorial-article li {
    margin-bottom: 0.5rem;
    /* ensure wrapped lines align nicely when bullets are inside */
}

/* Search results modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Article hero image using an <img> for precise cropping */
.article-hero {
    width: 100%;
    display: block;
    overflow: hidden;
}
.article-hero-img {
    width: 100%;
    height: 340px; /* smaller hero height */
    object-fit: cover;
    /* object-position tuned to show the eye: center vertically shifted slightly */
    object-position: center 40%;
    display: block;
}

@media (max-width: 768px) {
    .article-hero-img { height: 300px; object-position: center 45%; }
}

@media (max-width: 480px) {
    .article-hero-img { height: 240px; object-position: center 50%; }
}
.modal-overlay[aria-hidden="false"] {
    display: flex;
}
.search-modal {
    background: var(--white);
    width: min(1000px, 95%);
    max-height: 80vh;
    overflow: auto;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}
.modal-header h3 { margin: 0; font-family: var(--font-primary); }
.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-body { padding: 1rem; }
.search-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.search-result-card {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: var(--light-gray);
    padding: 0.75rem;
    border-radius: 8px;
}
.search-result-card img { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; }
.search-result-card h4 { margin: 0; font-size: 1rem; }
.search-no-results { text-align: center; color: var(--text-gray); padding: 2rem; }
