@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --primary-plum: #352534;
    --bg-ivory: #F7F2EC;
    --accent-rose: #B98F91;
    --accent-sage: #879487;
    --accent-clay: #C8A69A;
    --text-charcoal: #292728;
    
    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-ivory);
    color: var(--text-charcoal);
    line-height: 1.6;
    font-size: 16px;
    font-weight: 300;
}

h1, h2, h3, h4, .serif {
    font-family: var(--font-display);
    color: var(--primary-plum);
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: var(--primary-plum);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-rose);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography Utility */
.text-center { text-align: center; }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mt-lg { margin-top: var(--spacing-lg); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid var(--primary-plum);
    transition: all 0.3s ease;
    background: transparent;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-plum);
    color: var(--bg-ivory);
}

.btn-primary:hover {
    background-color: var(--accent-rose);
    border-color: var(--accent-rose);
    color: var(--bg-ivory);
}

.btn-secondary {
    color: var(--primary-plum);
}

.btn-secondary:hover {
    background-color: var(--primary-plum);
    color: var(--bg-ivory);
}

/* Utility Strip */
.utility-strip {
    background-color: var(--primary-plum);
    color: var(--bg-ivory);
    text-align: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--accent-clay);
    background-color: var(--bg-ivory);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    text-align: left;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--primary-plum);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--accent-sage);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-charcoal);
}

.main-nav a:hover {
    color: var(--accent-rose);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-plum);
    cursor: pointer;
}

/* Layout Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-padding {
    padding: var(--spacing-xl) 0;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--accent-clay);
}

.hero-content {
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--accent-clay);
}

.hero-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-sage);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-charcoal);
    max-width: 450px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.hero-image {
    position: relative;
    height: 100%;
    min-height: 500px;
}

.hero-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Editorial Sections */
.editorial-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--spacing-xl);
}

.editorial-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Information Panels (Cards) */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    border: 1px solid var(--accent-clay);
    padding: 2rem;
    background: var(--bg-ivory);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(53, 37, 52, 0.05);
}

.info-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.info-card p {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(41, 39, 40, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-ivory);
    padding: 3rem;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--primary-plum);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--primary-plum);
    cursor: pointer;
}

/* Tabs (Ingredients) */
.tabs-container {
    display: flex;
    border: 1px solid var(--accent-clay);
    min-height: 500px;
}

.tabs-sidebar {
    width: 250px;
    border-right: 1px solid var(--accent-clay);
    background: var(--bg-ivory);
}

.tab-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1.5rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--accent-clay);
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1rem;
}

.tab-btn:hover {
    background: rgba(185, 143, 145, 0.1);
}

.tab-btn.active {
    background: var(--primary-plum);
    color: var(--bg-ivory);
}

.tab-content-area {
    flex-grow: 1;
    padding: 3rem;
    background: #fff;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ingredient-meta {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--accent-clay);
}

/* Accordion (FAQ & Guides) */
.accordion-item {
    border-bottom: 1px solid var(--accent-clay);
}

.accordion-item:first-child {
    border-top: 1px solid var(--accent-clay);
}

.accordion-header {
    width: 100%;
    text-align: left;
    padding: 1.5rem 0;
    background: none;
    border: none;
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--primary-plum);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header::after {
    content: '+';
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1.5rem;
}

.accordion-header.active::after {
    content: '−';
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content-inner {
    padding-bottom: 1.5rem;
    color: var(--text-charcoal);
}

/* Is This Normal Tool */
.diagnostic-tool {
    background: #fff;
    border: 1px solid var(--accent-clay);
    padding: 3rem;
    text-align: center;
}

.symptom-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.symptom-btn {
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--accent-sage);
    border-radius: 50px;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.symptom-btn:hover, .symptom-btn.active {
    background: var(--accent-sage);
    color: var(--bg-ivory);
}

.diagnostic-result {
    padding: 2rem;
    background: var(--bg-ivory);
    border-left: 4px solid var(--accent-rose);
    text-align: left;
    display: none;
}

.diagnostic-result.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Disclaimer Block */
.safety-disclaimer {
    background: rgba(185, 143, 145, 0.1);
    border: 1px solid var(--accent-rose);
    padding: 1.5rem;
    margin: 2rem 0;
    font-size: 0.9rem;
}

.safety-disclaimer strong {
    color: var(--primary-plum);
}

/* Policy TOC */
.policy-toc {
    background: #fff;
    border: 1px solid var(--accent-clay);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.policy-toc h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--primary-plum);
    font-family: var(--font-display);
}

.policy-toc ul {
    list-style: none;
    padding: 0;
    column-count: 1;
}

@media (min-width: 768px) {
    .policy-toc ul {
        column-count: 2;
        column-gap: 2rem;
    }
}

.policy-toc ul li {
    margin-bottom: 0.5rem;
}

.policy-toc ul a {
    color: var(--primary-plum);
    font-weight: 500;
    font-size: 0.95rem;
}

.policy-toc ul a:hover {
    color: var(--accent-rose);
    text-decoration: underline;
}

/* Forms */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--accent-clay);
    background: #fff;
    font-family: var(--font-body);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Article Styling */
.article-content {
    max-width: 800px;
    margin: 0 auto;
}

.article-content h2 {
    margin: 2rem 0 1rem;
}

.article-content h3 {
    margin: 1.5rem 0 0.5rem;
}

.article-content p, .article-content ul {
    margin-bottom: 1.5rem;
}

.article-content ul {
    padding-left: 2rem;
}

.article-image {
    margin: 2rem 0;
    border: 1px solid var(--accent-clay);
}

/* Footer */
.site-footer {
    background-color: var(--primary-plum);
    color: var(--bg-ivory);
    padding: 4rem 2rem 2rem;
    border-top: 1px solid var(--accent-clay);
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .brand-name {
    color: var(--bg-ivory);
    margin-bottom: 1rem;
}

.footer-brand p {
    color: rgba(247, 242, 236, 0.7);
    max-width: 300px;
}

.footer-col h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--accent-clay);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col ul a {
    color: rgba(247, 242, 236, 0.8);
}

.footer-col ul a:hover {
    color: var(--bg-ivory);
}

.footer-col p {
    color: rgba(247, 242, 236, 0.8);
    line-height: 1.6;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(200, 166, 154, 0.2);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(247, 242, 236, 0.6);
}

/* Cookie Banner Improvements */
.cookie-banner {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 420px;
    max-width: calc(100% - 4rem);
    background: var(--bg-ivory);
    border: 1px solid var(--accent-clay);
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(53, 37, 52, 0.25);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    color: var(--text-charcoal);
    font-family: var(--font-body);
}

.cookie-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    color: var(--primary-plum);
    font-family: var(--font-display);
}

.cookie-content p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.cookie-content a {
    color: var(--primary-plum);
    text-decoration: underline;
    font-weight: 500;
}

.cookie-content a:hover {
    color: var(--accent-rose);
}

.cookie-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.cookie-actions .btn {
    width: 100%;
}

.cookie-preferences {
    max-height: 70vh;
    overflow-y: auto;
}

.cookie-preferences h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: var(--primary-plum);
    font-family: var(--font-display);
}

.cookie-toggle-group {
    display: flex;
    flex-direction: column;
}

.cookie-toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--accent-clay);
}

.cookie-toggle-item:last-of-type {
    border-bottom: none;
}

.toggle-info {
    padding-right: 1rem;
}

.toggle-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    color: var(--primary-plum);
    font-weight: 600;
}

.toggle-info p {
    font-size: 0.8rem;
    margin-bottom: 0;
    color: var(--accent-sage);
}

/* Toggle Switch CSS */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--accent-clay);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-ivory);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-plum);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .hero-image {
        min-height: 400px;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .tabs-container {
        flex-direction: column;
    }
    .tabs-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--accent-clay);
        display: flex;
        overflow-x: auto;
    }
    .tab-btn {
        width: auto;
        white-space: nowrap;
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none; /* Mobile menu implementation via JS toggles a class here */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-ivory);
        border-bottom: 1px solid var(--accent-clay);
        padding: 2rem;
    }
    .main-nav.active {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 1.5rem;
    }
    .mobile-menu-btn {
        display: block;
    }
    .header-action {
        display: none;
    }
    .hero-content {
        padding: 2rem;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .cookie-banner {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        padding: 1.5rem;
        margin: 0;
    }
}