/* ============================================
   Coffee & Espresso Guide - Custom Design Override
   Theme: Artisan Brewer - Rich Espresso & Warm Gold
   Fonts: Cormorant Garamond (headings) + Nunito (body)
   ============================================ */

:root {
    /* Theme's original variable names (used by style.css selectors) */
    --primary-color: #6F4E37;
    --primary-dark: #5A3E2B;
    --secondary-color: #C4A265;
    --accent-color: #D4764E;
    --text-dark: #2C1810;
    --text-light: #7A6B5D;
    --bg-light: #FAF7F2;
    --bg-white: #FFFFFF;
    --border-color: #E0D5C7;

    /* Custom variable names (used in custom selectors) */
    --color-primary: #6F4E37;
    --color-primary-dark: #5A3E2B;
    --color-primary-light: #8B6F47;
    --color-secondary: #C4A265;
    --color-accent: #D4764E;
    --color-bg: #FAF7F2;
    --color-bg-warm: #F5EDE1;
    --color-text: #2C1810;
    --color-text-light: #7A6B5D;
    --color-border: #E0D5C7;
    --color-white: #FFFFFF;
    --color-dark: #2C1810;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #6F4E37 0%, #5A3E2B 50%, #3E2A1A 100%);
    --gradient-warm: linear-gradient(135deg, #C4A265 0%, #D4764E 100%);
    --gradient-glass: linear-gradient(135deg, rgba(111, 78, 55, 0.08) 0%, rgba(196, 162, 101, 0.05) 100%);

    /* Typography */
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Nunito', 'Segoe UI', sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(111, 78, 55, 0.08);
    --shadow-md: 0 4px 12px rgba(111, 78, 55, 0.12);
    --shadow-lg: 0 8px 30px rgba(111, 78, 55, 0.15);
    --shadow-glow: 0 0 20px rgba(196, 162, 101, 0.2);

    /* Layout */
    --border-radius: 10px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE TYPOGRAPHY
   ============================================ */
body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }
body { font-size: clamp(1rem, 1.5vw, 1.1rem); }

/* Override theme's Playfair Display font */
body, .page-content, .post-body, .nav-link, .btn, p, li, td, th, span, a {
    font-family: var(--font-body) !important;
}

h1, h2, h3, h4, h5, h6, .hero-title, .section-title, .post-title, .article-title, .feature-card h3, .category-card h3, .page-title, .toc-summary, .footer h3, .footer h4 {
    font-family: var(--font-heading) !important;
}

/* ============================================
   HEADER & NAV
   ============================================ */
.header {
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    padding: 0.75rem 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-img {
    height: 44px;
    width: auto;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
}

.nav-link {
    color: var(--color-text-light);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    border-bottom: none !important;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-secondary) !important;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle .hamburger,
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
    background: var(--color-text);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }
    .nav-menu.active {
        display: flex;
    }
    .nav-link {
        border-bottom: none !important;
        padding: 0.75rem 1rem;
    }
    .nav-link:hover {
        border-bottom: none !important;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: var(--gradient-hero);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 600px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin-bottom: 2rem;
}

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

.hero-image {
    flex-shrink: 0;
    max-width: 420px;
}

.hero-img {
    width: 100%;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background: var(--color-accent);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: #FFFFFF;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #FFFFFF;
}

/* ============================================
   FEATURES / TRUST SECTION
   ============================================ */
.features {
    padding: 5rem 0;
    background: var(--color-white);
}

.section-title {
    text-align: center;
    font-family: var(--font-heading);
    color: var(--color-dark);
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--color-bg);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--color-border);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-secondary);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    color: var(--color-dark);
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--color-text-light);
    line-height: 1.7;
}

/* ============================================
   LATEST POSTS / ARTICLES
   ============================================ */
.latest-posts,
.latest-section {
    padding: 5rem 0;
    background: var(--color-bg);
}

.articles-grid,
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.article-card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-card .post-content {
    padding: 1.5rem !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-card .post-content p {
    flex-grow: 1;
}

.article-card .article-category {
    display: inline-block;
    background: var(--color-bg-warm);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}

.article-header {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-icon {
    font-size: 2.5rem;
    color: #FFFFFF;
}

.article-content {
    padding: 1.5rem 2rem 2rem;
}

.article-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.article-title a {
    color: var(--color-dark);
    text-decoration: none;
    transition: var(--transition);
}

.article-title a:hover {
    color: var(--color-primary);
}

.article-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.article-excerpt {
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-readmore {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.article-readmore:hover {
    color: var(--color-accent);
}

.posts-cta {
    text-align: center;
    margin-top: 3rem;
}

/* ============================================
   HOW WE TEST SECTION
   ============================================ */
.how-we-test {
    padding: 5rem 0;
    background: var(--color-white);
}

.test-content-wrapper {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.test-text {
    flex: 1;
}

.test-text h2 {
    text-align: left !important;
}

.test-text p {
    line-height: 1.8;
    color: var(--color-text-light);
}

.test-text ul {
    list-style: none;
    padding-left: 0;
}

.test-text ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--color-text-light);
    line-height: 1.7;
}

.test-text ul li::before {
    content: '☕';
    position: absolute;
    left: 0;
}

.test-image {
    flex: 1;
    max-width: 440px;
}

/* ============================================
   CATEGORIES
   ============================================ */
.categories {
    padding: 5rem 0;
    background: var(--color-bg);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-warm);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-card h3 {
    font-family: var(--font-heading);
    color: var(--color-dark);
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
}

.category-card p {
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.category-link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.category-link:hover {
    color: var(--color-accent);
}

/* ============================================
   AFFILIATE DISCLOSURE
   ============================================ */
.affiliate-disclosure {
    padding: 2rem 0;
    background: var(--color-bg-warm);
}

.disclosure-content {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.disclosure-content h3 {
    font-family: var(--font-heading);
    color: var(--color-dark);
    margin-bottom: 1rem;
}

.disclosure-content p {
    color: var(--color-text-light);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* ============================================
   BLOG POST STYLES
   ============================================ */
.blog-post {
    padding: 0;
}

.post-header {
    background: var(--gradient-hero);
    padding: 4rem 0 3rem;
    color: #FFFFFF;
}

.breadcrumbs {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.breadcrumbs a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumbs a:hover {
    color: #FFFFFF;
}

.breadcrumbs span {
    margin: 0 0.5rem;
    opacity: 0.6;
}

.breadcrumbs .current {
    opacity: 0.9;
}

.post-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-meta {
    font-size: 0.95rem;
    opacity: 0.85;
}

.post-content {
    padding: 3rem 0;
}

.post-body {
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.85;
}

.post-body h2 {
    font-family: var(--font-heading);
    color: var(--color-dark);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.post-body h3 {
    color: var(--color-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-body p {
    margin-bottom: 1.25rem;
    color: var(--color-text);
}

.post-body a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: var(--color-secondary);
    text-underline-offset: 3px;
    transition: var(--transition);
}

.post-body a:hover {
    color: var(--color-accent);
}

.post-body ul, .post-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.post-body li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.post-body img {
    border-radius: var(--border-radius);
    max-width: 100%;
    height: auto;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-body th, .post-body td {
    border: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    text-align: left;
}

.post-body th {
    background: var(--color-bg-warm);
    font-family: var(--font-heading);
    color: var(--color-dark);
}

.post-body blockquote {
    border-left: 4px solid var(--color-secondary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--color-bg-warm);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--color-text-light);
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.toc-details {
    background: var(--color-bg-warm);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    padding: 0;
}

.toc-summary {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-dark);
    cursor: pointer;
    padding: 1rem 1.5rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toc-summary::-webkit-details-marker {
    display: none;
}

.toc-summary::after {
    content: '\25B8';
    font-size: 1rem;
    transition: transform 0.25s ease;
    color: var(--color-primary);
}

.toc-details[open] .toc-summary::after {
    transform: rotate(90deg);
}

.toc-details[open] .toc-summary {
    border-bottom: 1px solid var(--color-border);
}

.table-of-contents {
    padding: 1rem 1.5rem 1.5rem;
    margin: 0;
}

.table-of-contents ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.table-of-contents a {
    color: var(--color-text-light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
    line-height: 1.5;
}

.table-of-contents a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* ============================================
   AFFILIATE NOTICE
   ============================================ */
.affiliate-notice {
    background: var(--color-bg-warm);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
}

.affiliate-notice p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.7;
    margin: 0;
}

/* ============================================
   RELATED POSTS
   ============================================ */
.related-posts {
    padding: 3rem 0;
    background: var(--color-bg);
}

.related-posts .section-title {
    margin-bottom: 2rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.post-card .post-title {
    font-size: 1.1rem;
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
}

.post-card .post-title a {
    color: var(--color-dark);
    text-decoration: none;
}

.post-card .post-title a:hover {
    color: var(--color-primary);
}

.post-excerpt {
    color: var(--color-text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

.read-more {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--color-accent);
}

/* ============================================
   POST NAVIGATION
   ============================================ */
.post-navigation {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.nav-link {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
    flex: 1;
}

.nav-link:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-warm);
}

.nav-label {
    font-size: 0.8rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-title {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-dark);
    margin-top: 0.25rem;
}

/* ============================================
   SEE ALSO
   ============================================ */
.post-body h2:last-of-type,
.post-body h2 + p:last-of-type {
    margin-bottom: 1.5rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--color-dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 4rem 0 2rem;
}

.footer h3 {
    font-family: var(--font-heading);
    color: #FFFFFF;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.footer h4 {
    font-family: var(--font-heading);
    color: var(--color-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    font-size: 0.9rem;
}

.footer ul {
    list-style: none;
    padding: 0;
}

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

.footer ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer ul li a:hover {
    color: var(--color-secondary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.affiliate-disclosure {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.85rem !important;
    margin-top: 0.75rem;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ============================================
   PAGE HEADER (non-blog pages)
   ============================================ */
.page-header {
    background: var(--gradient-hero);
    padding: 4rem 0 3rem;
    text-align: center;
    color: #FFFFFF;
}

.page-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
}

.page-content {
    padding: 3rem 0;
}

.page-body {
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.85;
}

/* ============================================
   BLOG LISTING
   ============================================ */
.blog-listing {
    padding: 3rem 0;
}

.posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* ============================================
   SCROLL ANIMATIONS (SAFE - no opacity:0 default)
   ============================================ */
.post-card,
.feature-card,
.article-card,
.category-card {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.post-card.visible,
.feature-card.visible,
.article-card.visible,
.category-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero .container {
        flex-direction: column;
    }

    .hero-image {
        max-width: 100%;
    }

    .test-content-wrapper {
        flex-direction: column;
    }

    .test-image {
        max-width: 100%;
    }

    .post-navigation {
        flex-direction: column;
    }

    .features-grid,
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 3rem 0;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .hero-buttons {
        flex-direction: column;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .header, .hero-buttons, .post-navigation, .related-posts, .nav-toggle, .features, .categories {
        display: none !important;
    }

    /* Affiliate disclosure must remain visible - legal requirement */
    .affiliate-disclosure {
        color: #000 !important;
        font-size: 0.85rem !important;
        display: block !important;
        visibility: visible !important;
    }

    .post-body, .page-body {
        max-width: 100%;
    }
}