/* Version: v1.0.2 */
/* --- RESILIENT CSS RESET --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Palette */
    --primary-green: #1C2E26;
    --bg-cream: #FAF9F6;
    --accent-gold: #CBA135;
    --text-warm-gray: #3E3C38;
    --white: #FFFFFF;
    
    /* Configuration */
    --font-main: 'Inter', sans-serif;
    --nav-height: 90px;
    --transition-speed: 0.4s;
    --border-radius-standard: 8px;
    --border-radius-image: 12px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base size */
    scroll-snap-type: y proximity;
    scroll-padding-top: var(--nav-height);
}

/* Disable scroll snapping on mobile for a smoother touch experience */
@media (max-width: 900px) {
    html {
        scroll-snap-type: none;
    }
}

body {
    font-family: var(--font-main);
    color: var(--text-warm-gray);
    background-color: var(--bg-cream);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

/* --- VISUAL FX: GRAIN TEXTURE --- */
.bg-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9000;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: var(--primary-green);
    position: relative;
    line-height: 1.1;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.4rem, 8vw, 5.6rem); /* Reduced by 20% for elegant editorial feel */
    text-transform: uppercase;
    line-height: 0.95;
    letter-spacing: -0.04em;
}

/* Adjust H1 size for Danish and Swedish for better fit */
html[lang="da"] h1,
html[lang="sv"] h1 {
    font-size: clamp(2rem, 6.4vw, 4.8rem); /* Reduced by 20% */
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.7rem, 3.4vw, 2.55rem); /* Reduced by 15% */
    position: relative;
    z-index: 2;
    line-height: 1.2; /* Adjusted for better multi-line balance */
    margin-top: 2rem; /* Added spacing from chapter numbers */
}

h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

p, li {
    font-weight: 400;
    font-size: 1.15rem;
    color: var(--text-warm-gray);
    max-width: 60ch;
    line-height: 1.7; /* Optimized for readability */
}

/* --- LAYOUT UTILITIES --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

.section-padding {
    padding: 8rem 0; /* Reduced slightly for safety */
    width: 100%;
}

/* GRID SYSTEM - Explicitly defined */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr; /* Default mobile */
    gap: 4rem;
    margin-top: 4rem;
    width: 100%;
    align-items: start; /* Prevents neighbor stretching */
    height: auto; /* Ensure container grows/shrinks with content */
    overflow: visible; /* Ensure shadows and content aren't clipped */
    position: relative;
    z-index: 5;
}

@media (min-width: 900px) {
    .grid-2 {
        display: grid;
        /* Default state: Equal width */
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        width: 100%;
        align-items: start;
        /* Smoothly animate the column width changes */
        transition: grid-template-columns 0.6s cubic-bezier(0.25, 1, 0.5, 1), gap 0.6s ease;
    }

    /* State: Card Active - 65/35 Split */
    .grid-2.expand-left {
        grid-template-columns: 1.85fr 1fr;
        gap: 2.5rem; 
    }

    .grid-2.expand-right {
        grid-template-columns: 1fr 1.85fr;
        gap: 2.5rem;
    }
}

/* Ensure content inside doesn't break when squeezed */
.card, .content-block {
    min-width: 0; /* Prevents grid blowout */
    transition: all 0.5s ease;
}

/* --- IMAGES (Strict Sizing) --- */
.visual-image {
    display: block;
    width: 100%;
    max-width: 100%; /* Stop explosion */
    height: auto;
    object-fit: cover;
    border-radius: var(--border-radius-image); 
    box-shadow: 0 15px 35px rgba(28, 46, 38, 0.08);
    transition: transform 0.4s ease;
}

.visual-image:hover {
    transform: scale(1.01);
}

/* Ensure images don't break out of the card's z-space */
.card .visual-image {
    z-index: 0; 
    /* The parallax script adds transforms here, which is fine as long as the PARENT card handles the stacking */
}

/* Hero Visuals */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    margin-top: -4rem;
}

@media (min-width: 900px) {
    .hero-grid {
        grid-template-columns: 1.2fr 0.8fr; /* Text wider than image */
        gap: 0;
    }
    
    .hero-content {
        z-index: 2;
        margin-right: 8%; /* Increased gap to ensure text doesn't crowd image */
    }
    
    .hero-image-wrapper {
        z-index: 1;
        width: 100%;
    }
}

.hero-img {
    max-height: 70vh; /* Constraint height */
}

/* Card Visuals */
.card-img {
    margin-bottom: 2rem;
    max-height: 300px;
}

.tool-img {
    max-height: 500px;
}

/* --- NAVBAR (Fixed & Flex) --- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    z-index: 10000;
    transition: background-color var(--transition-speed), padding var(--transition-speed);
    background-color: transparent; /* Default transparent */
}

#navbar.scrolled {
    background-color: var(--primary-green);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--primary-green);
    transition: color var(--transition-speed);
    z-index: 10002;
}

#navbar.scrolled .logo {
    color: var(--white);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-green);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: color var(--transition-speed);
}

#navbar.scrolled .nav-links a {
    color: var(--white);
}

.nav-links a.active, .nav-links a:hover {
    color: var(--accent-gold) !important;
}

/* Anchor Points */
.nav-anchor {
    position: relative;
    top: -100px; /* Offset for sticky nav */
    display: block;
    visibility: hidden;
}

/* Sticky Drape Sections */
section, .hero-section {
    position: sticky;
    top: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--bg-cream); 
    box-shadow: 0 -10px 40px rgba(28, 46, 38, 0.03);
    z-index: 2;
    overflow: visible; /* Changed from hidden to prevent content clipping on mobile/zoom */
    scroll-snap-align: start;
}

/* Ensure Lectures sits on top of the next section to prevent overlap during animation/resize */
#lectures {
    z-index: 10;
    position: relative; 
}

section.bg-light {
    background-color: #F5F4F0; 
}

/* Disable sticky when expanded to allow full scrolling of content */
section.section-expanded {
    position: relative !important;
    top: auto !important;
    z-index: 50 !important; /* Bring to top to ensure it sits over previous sticky items if any */
}

/* --- IMAGES & VISUALS --- */

/* Subtitle */
.subtitle {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text-warm-gray);
    margin-top: 1.5rem;
    display: block;
    border-left: 4px solid var(--accent-gold); 
    padding-left: 1.5rem;
    letter-spacing: 0.02em;
    max-width: 45ch; /* Optimized width for readability */
}

/* Chapter Numbers */
.chapter-number {
    position: absolute;
    top: -6rem;
    left: -3rem;
    font-family: 'Playfair Display', serif;
    font-size: 15rem;
    font-weight: 700;
    color: transparent;
    -webkit-text-stroke: 2px rgba(28, 46, 38, 0.06); 
    z-index: 0;
    line-height: 1;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
    font-style: italic;
    opacity: 0.8; 
}

/* Buttons */
.read-more-btn {
    background-color: var(--primary-green); 
    border: none;
    border-radius: var(--border-radius-standard); 
    color: var(--white); 
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: auto; 
    margin-bottom: 4rem; 
    padding: 1rem 2rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    align-self: flex-start;
}

.read-more-btn:hover {
    background-color: #2a453c; 
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(28, 46, 38, 0.2);
}

.read-more-btn .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 1.2rem;
    line-height: 0;
    transition: transform 0.4s ease;
    margin-right: 8px; /* Added spacing between icon and text */
}

.read-more-btn.active .icon {
    transform: rotate(45deg);
}

/* Cards */
.card {
    background: var(--white);
    padding: 3.5rem;
    border: none;
    border-radius: var(--border-radius-image); 
    box-shadow: 0 10px 40px rgba(45, 64, 57, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s; /* Instant z-index switch */
    position: relative; /* Context */
    z-index: 1; /* Default state */
}

.card.is-expanded, .content-block.is-expanded {
    grid-column: 1 / -1;
}

/* If a content block is expanded, we might want to hide its neighboring image in the grid for true full width */
.is-expanded + .tool-image-wrapper {
    display: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(45, 64, 57, 0.1);
}

/* Accordion */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    /* Ensure opacity matches height duration for sync */
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

.accordion-content.expanded {
    opacity: 1;
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
    border-left: 3px solid var(--accent-gold);
    padding-left: 1.5rem;
    padding-right: 0.5rem;
    /* Removed overflow-y: auto to let page scale */
}

/* Forms */
.form-container {
    max-width: 600px;
    margin-top: 3rem;
}

.form-group {
    margin-bottom: 2rem;
}

input, select, textarea {
    width: 100%;
    padding: 1.2rem;
    border: 1px solid #D1D1C7; /* Improved visibility on off-white background */
    background: var(--white);
    border-radius: var(--border-radius-standard);
    color: var(--text-warm-gray);
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    accent-color: var(--accent-gold); /* Override system colors where supported */
}

select {
    color-scheme: dark; /* Forces dark-mode OS controls to minimize blue flash */
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 4px rgba(203, 161, 53, 0.1); /* Subtle warm glow */
}

/* Dropdown styling attempt */
select option {
    background-color: var(--white);
    color: var(--text-warm-gray);
    padding: 1rem;
}

/* Note: Browser support for styling <option> hover/checked is limited */
select option:checked, select option:hover {
    background-color: var(--accent-gold) !important;
    color: var(--white) !important;
}

#form-status {
    margin-bottom: 1.5rem;
    font-weight: 600;
    transition: all 0.4s ease;
    border-radius: var(--border-radius-standard);
    min-height: 0;
    overflow: hidden;
}

#form-status.success {
    color: #1C2E26;
    background-color: rgba(203, 161, 53, 0.15); /* Warm Gold Tint */
    border: 1px solid var(--accent-gold);
    padding: 1.2rem;
}

#form-status.error {
    color: #d32f2f;
    background-color: #ffebee;
    border: 1px solid #d32f2f;
    padding: 1.2rem;
}

button[type="submit"] {
    background-color: var(--accent-gold);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-standard);
    padding: 1.2rem;
    width: 100%;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
}

button[type="submit"]:hover {
    background-color: #b58d2a;
    transform: translateY(-2px);
}

/* Quote */
.quote-section {
    text-align: center;
    background-color: var(--bg-cream);
    z-index: 2;
    position: relative;
}

.quote-content {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--primary-green);
    line-height: 1.3;
    max-width: 30ch;
    margin: 0 auto 2rem;
    font-style: italic;
}

/* Footer */
.contact-footer {
    margin-top: 4rem;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-warm-gray);
    opacity: 0.6;
    border-top: 1px solid rgba(28, 46, 38, 0.1);
    padding-top: 2rem;
}

/* Mobile Menu & Language */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--primary-green);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10002;
    padding: 0.5rem;
}

#navbar.scrolled .mobile-menu-btn {
    color: var(--white);
}

.mobile-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: var(--primary-green);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

.mobile-overlay.active {
    right: 0;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
}

.mobile-nav-links a {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.lang-switch {
    display: flex;
    gap: 1rem;
    margin-left: 1.5rem;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(45, 64, 57, 0.2);
    transition: border-color var(--transition-speed);
}

#navbar.scrolled .lang-switch {
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-green);
    opacity: 0.5;
    transition: all 0.3s;
    padding: 0;
}

#navbar.scrolled .lang-btn {
    color: var(--white);
}

.mobile-overlay .lang-btn {
    color: var(--white);
    font-size: 1.2rem;
}

.lang-btn.active, .lang-btn:hover {
    opacity: 1;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 900px) {
    section, .hero-section {
        position: relative !important;
        top: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    .hero-section {
        padding-top: calc(var(--nav-height) + 4rem) !important;
    }

    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
    
    .section-padding { padding: 5rem 0; }
    h1 { font-size: 3.5rem; }
    .chapter-number { font-size: 6rem; top: -2rem; left: 0; right: 0; text-align: center; margin: auto; width: 100%; }
    
    .grid-2, .hero-grid {
        gap: 3rem;
        margin-top: 2rem;
        display: flex; /* Fallback to flex column for mobile */
        flex-direction: column;
    }

    .hero-content {
        margin-right: 0;
        text-align: center;
    }
    
    .hero-image-wrapper {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .hero-img {
        max-height: 50vh;
    }
    
    .visual-image {
        /* Filter reset for mobile */
        filter: none; 
        transform: none !important;
    }
    
    .subtitle {
        border-left: none;
        padding-left: 0;
        text-align: center;
    }
}

/* Expanded Text Wrapper Internal Styles */
.expanded-text-wrapper {
    padding: 1.5rem 0;
}

.expanded-text-wrapper p, .expanded-text-wrapper li {
    max-width: 100%;
}

.expanded-text-wrapper ul {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
}

.expanded-text-wrapper li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    font-size: 1rem;
    line-height: 1.6;
}

.expanded-text-wrapper li::before {
    content: '•';
    color: var(--accent-gold);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* FAQ Styles */
.faq-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border-bottom: 1px solid rgba(28, 46, 38, 0.1);
    transition: all 0.3s ease;
}

/* Remove default focus outline and handle active state */
.faq-trigger {
    background: none;
    border: none;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
    padding: 1.5rem 0;
    outline: none;
}

.faq-trigger:focus-visible .faq-question {
    color: var(--accent-gold);
}

.faq-question {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-green);
    transition: color 0.3s;
}

.faq-trigger .icon {
    font-size: 1.5rem;
    color: var(--primary-green);
    transition: transform 0.4s ease;
}

.faq-trigger.active .icon {
    transform: rotate(45deg);
}
