@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 {
    --bg-primary: #FBF8F5;
    --bg-secondary: #F2E8E3;
    --text-main: #241F20;
    --accent: #A45D68;
    --accent-sec: #C99A8E;
    --highlight: #E7C9C2;
    --white: #FFFFFF;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
}

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

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

/* Typography */
.text-center { text-align: center; }
.section-title { font-size: 2.5rem; margin-bottom: 1rem; }
.section-subtitle { font-size: 1.1rem; color: #555; margin-bottom: 3rem; font-weight: 300; }
.caption { font-size: 0.85rem; color: #666; font-style: italic; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #8c4e58;
    color: var(--white);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--text-main);
}

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

.btn-link {
    background: transparent;
    color: var(--accent);
    padding: 0;
    font-weight: 600;
    border-bottom: 1px solid transparent;
}

.btn-link:hover {
    border-bottom-color: var(--accent);
}

/* Header */
header {
    background-color: var(--white);
    border-bottom: 1px solid var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-trigger svg {
    width: 20px;
    height: 20px;
    fill: var(--text-main);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(251, 248, 245, 0.98);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10vh;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.close-search {
    position: absolute;
    top: 2rem;
    right: 3rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
}

.search-form {
    width: 80%;
    max-width: 800px;
    position: relative;
}

.search-form input {
    width: 100%;
    font-size: 2rem;
    padding: 1rem 0;
    border: none;
    border-bottom: 2px solid var(--text-main);
    background: transparent;
    font-family: var(--font-heading);
    outline: none;
    color: var(--text-main);
}

#search-results {
    width: 80%;
    max-width: 800px;
    margin-top: 2rem;
    text-align: left;
}

.search-result-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--bg-secondary);
}

.search-result-item h4 {
    margin-bottom: 0.5rem;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 80vh;
    background-color: var(--bg-secondary);
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 10%;
}

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

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    color: #444;
}

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

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sections */
.section-padding {
    padding: 6rem 0;
}

.bg-alt {
    background-color: var(--white);
}

/* Featured Facts */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.fact-card {
    background-color: var(--white);
    padding: 2.5rem;
    border: 1px solid var(--bg-secondary);
    transition: var(--transition);
}

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

.fact-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

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

.fact-card p {
    margin-bottom: 1.5rem;
    color: #555;
}

/* Categories */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background-color: var(--bg-secondary);
    text-align: center;
    transition: var(--transition);
    text-decoration: none;
}

.category-item:hover {
    background-color: var(--highlight);
    color: var(--text-main);
}

.category-item h3 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.1rem;
}

/* Article Cards */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.article-card {
    display: flex;
    flex-direction: column;
}

.article-img-wrap {
    overflow: hidden;
    margin-bottom: 1.5rem;
    aspect-ratio: 4/3;
}

.article-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-img-wrap img {
    transform: scale(1.05);
}

.article-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.article-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.article-card p {
    color: #555;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.article-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

/* Myths & Facts Accordion */
.accordion {
    max-width: 800px;
    margin: 0 auto;
}

.accordion-item {
    border-bottom: 1px solid var(--bg-secondary);
    margin-bottom: 1rem;
}

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

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

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

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

.accordion-content-inner {
    padding: 0 0 1.5rem 0;
    color: #444;
}

.fact-badge {
    display: inline-block;
    background-color: var(--highlight);
    color: var(--text-main);
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    border-radius: 2px;
}

/* History Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--accent-sec);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: -8px;
    background-color: var(--white);
    border: 3px solid var(--accent);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left { left: 0; }
.right { left: 50%; }

.right::after {
    left: -8px;
}

.timeline-content {
    padding: 20px 30px;
    background-color: var(--white);
    position: relative;
    border-radius: 4px;
    border: 1px solid var(--bg-secondary);
}

.timeline-content h3 {
    margin-bottom: 10px;
    color: var(--accent);
}

/* History Timeline Additions */
.era-intro {
    color: #444;
}

.era-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
}

.era-details.expanded {
    opacity: 1;
}

.era-details-inner {
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

.timeline-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 1rem;
}

/* Glossary & Ingredients Grid */
.dictionary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.dict-term {
    background: var(--white);
    padding: 2rem;
    border-left: 4px solid var(--accent-sec);
}

.dict-term h3 {
    margin-bottom: 0.5rem;
}

.dict-term h4 {
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: #666;
    margin-top: 1rem;
    margin-bottom: 0.2rem;
}

/* Detailed Article View Layout (for guides page) */
.article-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}
.article-hero-img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    margin-bottom: 3rem;
}
.article-body {
    max-width: 700px;
    margin: 0 auto;
}
.article-body h2 {
    margin: 2.5rem 0 1rem;
    font-size: 1.8rem;
}
.article-body p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #333;
}
.article-body ul {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}
.article-body li {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}
.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Footer */
footer {
    background-color: var(--text-main);
    color: var(--bg-secondary);
    padding: 5rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand .logo {
    color: var(--white);
    margin-bottom: 1rem;
    display: inline-block;
}

.footer-brand p {
    color: #aaa;
    max-width: 300px;
}

.footer-links h4 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

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

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

.footer-links a {
    color: #aaa;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 2rem;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

/* Cookie Notice */
.cookie-notice {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: var(--white);
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    z-index: 3000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--bg-secondary);
    transform: translateY(150%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-notice.show {
    transform: translateY(0);
}

.cookie-text {
    max-width: 70%;
}

.cookie-text h4 {
    margin-bottom: 0.5rem;
}

.cookie-text p {
    font-size: 0.9rem;
    color: #555;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .hero-content {
        padding: 4rem 2rem;
        text-align: center;
        align-items: center;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .timeline::after {
        left: 31px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    .timeline-item::after {
        left: 15px;
    }
    .right {
        left: 0%;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--white);
        border-bottom: 1px solid var(--bg-secondary);
        padding: 2rem;
    }
    .main-nav.active {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    .mobile-menu-btn {
        display: block;
    }
    .cookie-notice {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    .cookie-text {
        max-width: 100%;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
}