/* --- RESET & VARIABLES --- */
:root {
    --color-sage: #74837c;
    --primary-color: var(--color-sage);
    /* Define primary color */
    --color-slate: #53605b;
    --color-cream: #fcfbf9;
    --color-white: #ffffff;
    --font-main: 'EB Garamond', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-cream);
    color: var(--color-slate);
    font-family: var(--font-main);
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3,
h4 {
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.75rem;
}

p {
    font-size: 1.125rem;
    color: rgba(83, 96, 91, 0.85);
}

@media (min-width: 768px) {
    h1 {
        font-size: 5rem;
    }

    h2 {
        font-size: 3.5rem;
    }
}

/* --- UTILITIES --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-center {
    text-align: center;
}

.text-sage {
    color: var(--color-sage);
}

.uppercase {
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Soft Reveal Animation Classes */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* For visually hiding labels but keeping them accessible to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- NAVIGATION --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.5s ease;
    color: var(--color-slate);
}

.navbar.scrolled {
    background-color: rgba(252, 251, 249, 0.95);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav-links {
    display: none;
    /* Hidden by default on mobile, styled as overlay below */
}

.nav-links a {
    margin-left: 2.5rem;
    font-size: 1.125rem;
    letter-spacing: 0.05em;
}

/* Base styles for the hamburger button */
.hamburger {
    display: block;
    /* Visible on mobile */
    cursor: pointer;
    z-index: 1001;
    /* Reset button styles */
    background: none;
    border: none;
    padding: 0;
    color: #fff;
    /* Default color on hero */
}

.navbar.scrolled .hamburger,
.navbar.menu-open .hamburger {
    color: var(--color-slate);
    /* Dark color on scrolled/open nav */
}

.nav-links a:hover {
    color: var(--color-sage);
}

/* --- Nav Link Hover Underline --- */
.nav-links a {
    position: relative;
    padding-bottom: 6px;
    /* Creates space for the underline */
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease-out;
}

.nav-links a:hover::after {
    width: 100%;
}

.navbar:not(.scrolled) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar:not(.scrolled) .logo a,
.navbar:not(.scrolled) .nav-links a {
    color: #fff;
}

.navbar:not(.scrolled):not(.menu-open) {
    background-color: transparent;
    box-shadow: none;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
        /* Reset mobile styles */
        position: static;
        height: auto;
        width: auto;
        background-color: transparent;
        flex-direction: row;
        transform: none;
        transition: none;
    }

    .hamburger {
        display: none;
    }
}

/* --- MOBILE NAVIGATION (using .nav-links) --- */
@media (max-width: 767px) {
    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--color-cream);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        z-index: 999;
    }

    .nav-links a {
        margin-left: 0;
        font-size: 1.5rem;
    }

    /* When menu is open, slide nav-links into view */
    .navbar.menu-open .nav-links {
        transform: translateX(0);
    }

    /* Ensure navbar has a background when menu is open, even at top of page */
    .navbar.menu-open {
        background-color: var(--color-cream);
        border-bottom: none;
    }
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #333;
    /* Fallback */
}

.hero video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 1;
    transform: translate(-50%, -50%);
    object-fit: cover;
    filter: brightness(0.75);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--color-white);
    padding: 0 1.5rem;
}

/* Ensure all text inside hero is white, overriding default 'p' styles */
.hero-content p {
    color: var(--color-white);
    opacity: 0.9;
    /* Slightly soften the subtitle text */
}

.hero-btn {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.8rem 2rem;
    border: 1px solid var(--color-white);
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.9rem;
    background-color: rgba(0, 0, 0, 0.2);
    /* Add a subtle dark background */
    transition: all 0.3s ease;
}

.hero-btn:hover {
    background-color: var(--color-white);
    color: var(--color-slate);
}

/* --- ABOUT SECTION --- */
.section {
    padding: 6rem 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

.img-wrapper {
    width: 100%;
    height: 0;
    padding-bottom: 133%;
    /* 3:4 Aspect Ratio */
    position: relative;
    overflow: hidden;
    background-color: #e5e5e5;
    /* Placeholder color */
}

.img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s ease;
}

.img-wrapper:hover img {
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .section {
        padding: 8rem 0;
    }

    .about-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }

    .order-2 {
        order: 2;
    }

    /* Text right */
}

/* --- MISSION (Divider) --- */
.mission-section {
    background-color: rgba(116, 131, 124, 0.1);
    /* Sage with opacity */
    padding: 6rem 0;
}

.divider-line {
    width: 100px;
    height: 1px;
    background-color: var(--color-sage);
    margin: 2rem auto;
}

.mission-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-top: 3rem;
    text-align: left;
}

@media (min-width: 768px) {
    .mission-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- PRODUCTS --- */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 4rem;
}

.product-card {
    cursor: pointer;
}

.product-card h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.product-card:hover h3 {
    color: var(--color-sage);
}

.square-img {
    padding-bottom: 100%;
    /* 1:1 Aspect Ratio */
}

.btn-outline {
    display: inline-block;
    margin-top: 3rem;
    padding: 1rem 2.5rem;
    border: 1px solid var(--color-sage);
    color: var(--color-sage);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.4s ease;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: var(--color-slate);
    z-index: -1;
    transition: width 0.4s ease;
}

.btn-outline:hover {
    color: var(--color-white);
}

.btn-outline:hover::before {
    width: 100%;
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* --- DELIVERY INFO --- */
.delivery-section {
    background-color: var(--color-slate);
    color: var(--color-cream);
}

.delivery-section p {
    color: rgba(252, 251, 249, 0.8);
}

.link-arrow {
    display: inline-block;
    margin-top: 1rem;
    border-bottom: 1px solid rgba(252, 251, 249, 0.5);
    padding-bottom: 0.25rem;
    font-size: 1.25rem;
}

.link-arrow:hover {
    border-bottom-color: var(--color-cream);
}

/* --- FOOTER --- */
footer {
    background-color: var(--color-cream);
    padding: 6rem 0 3rem;
    border-top: 1px solid rgba(116, 131, 124, 0.2);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.footer-col h4 {
    color: var(--color-sage);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-col p {
    margin-bottom: 0.5rem;
    color: var(--color-slate);
}

.newsletter-form {
    display: flex;
    border-bottom: 1px solid rgba(83, 96, 91, 0.3);
    padding-bottom: 0.5rem;
}

.newsletter-form input {
    background: transparent;
    border: none;
    width: 100%;
    outline: none;
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--color-slate);
}

.newsletter-form button {
    background: transparent;
    border: none;
    color: var(--color-sage);
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.copyright {
    text-align: center;
    margin-top: 4rem;
    font-size: 0.9rem;
    opacity: 0.5;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Page-specific styles for charts and tabs */
[data-tab-content] {
    display: none;
}

[data-tab-content].active {
    display: block;
}

/* =============================================
        Subpage & Report Styles
        ============================================= */

/* --- Subpage Hero Section --- */
.sub-hero {
    position: relative;
    height: 40vh;
    min-height: 250px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.sub-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.sub-hero .hero-content {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.sub-hero h1 {
    font-size: 3rem;
    font-family: 'EB Garamond', serif;
}

.sub-hero p {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    color: #fff;
}

/* --- Page Content Layout --- */
.page-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 2rem 2rem 2rem;
}

.report-section {
    padding: 3rem 0;
    border-bottom: 1px solid #eee;
}

.report-section:last-child {
    border-bottom: none;
}

.report-intro {
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
    text-align: center;
}

.report-intro h2 {
    font-size: 2.5rem;
    font-family: 'EB Garamond', serif;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.report-intro p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
}

.alternate-bg {
    background-color: #f1f3f5;
    border-radius: 8px;
    padding: 3rem 2rem;
}

/* --- Report Grids & Cards (Flexbox for centering) --- */
.report-grid-4,
.report-grid-5 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.report-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    text-align: center;
}

.report-grid-4 .report-card {
    flex-basis: 400px;
}

.report-grid-5 .report-card {
    flex-basis: 250px;
}

.report-card h3 {
    font-family: 'EB Garamond', serif;
    font-size: 1.3rem;
    margin: 0.5rem 0;
    color: var(--primary-color);
}

.report-card p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
}

.report-card .text-4xl {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* --- Chart & Tab Styles --- */
.tab-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-link {
    padding: 0.75rem 1.5rem;
    border: 1px solid #ddd;
    background: #f7f7f7;
    color: #555;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
}

.tab-link:hover {
    background: #eee;
}

.tab-link.active {
    background-color: var(--primary-color);
    color: var(--color-white);
    border-color: var(--primary-color);
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.chart-grid-single {
    max-width: 800px;
    margin: 0 auto;
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* --- Comparison Table Styles --- */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th,
td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

thead th {
    background-color: #f9f9f9;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Add subtle striping to table rows */
tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.5);
}

tbody tr:hover {
    background-color: #fcfcfc;
}

td.highlight {
    font-weight: 700;
    color: var(--primary-color);
}

/* --- Navbar Dropdown Styles --- */
.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0.5rem 0.5rem 0;
    /* Remove left padding to counteract browser default */
    min-width: 200px;
    z-index: 1000;
    list-style: none;
    overflow: hidden;
    /* Ensures children respect border-radius */
}

.dropdown-menu a {
    color: #333;
    padding: 0.75rem 1.5rem;
    display: block;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.dropdown-menu a:hover {
    background-color: #f1f3f5;
}

/* Show dropdown on hover */
.dropdown:hover .dropdown-menu {
    display: block;
}

/* Remove hover underline from dropdown toggle */
.dropdown-toggle::after {
    display: none !important;
}

/* --- Dropdown style for transparent navbar state --- */
.navbar:not(.scrolled) .dropdown-menu {
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    /* For Safari support */
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 0 4px 4px;
}

.navbar:not(.scrolled) .dropdown-menu a {
    color: #fff;
}

/* Corrected hover state for transparent dropdown */
.navbar:not(.scrolled) .dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}