/* ============================================
   UNIVERSAL BLOG - DESIGN SYSTEM
   ACTIVE THEME: Italian Cuisine
   
   Current Theme Mapping:
   - Primary Accent: Tomato Red (HSL 9, 80%, 55%)
   - Secondary Accent: Basil Green (HSL 140, 50%, 45%) 
   - Tertiary Accent: Olive Oil Gold (HSL 45, 85%, 50%)
   - Flag Colors: Green (140, 70%, 35%), White, Red (0, 80%, 50%)
   - Background: Warm cream (HSL 40, 30%, 98%)
   - Text: Espresso brown (HSL 25, 30%, 15%)
   
   Research-based design following modern food blog
   best practices from top performers like Pinch of Yum,
   Half Baked Harvest, and Minimalist Baker.
   ============================================ */

/* ============================================
   COLOR VARIABLES - SEMANTIC NAMING
   All colors exposed for easy theme switching
   ============================================ */

:root {
    /* Primary Brand Colors */
    --primary-accent-h: 9;
    --primary-accent-s: 80%;
    --primary-accent-l: 55%;
    --primary-accent: hsl(var(--primary-accent-h), var(--primary-accent-s), var(--primary-accent-l));
    --primary-accent-light: hsl(var(--primary-accent-h), var(--primary-accent-s), 95%);
    --primary-accent-dark: hsl(var(--primary-accent-h), var(--primary-accent-s), 40%);
    --primary-accent-contrast: hsl(0, 0%, 100%);
    
    /* Secondary & Tertiary Accents */
    --secondary-accent: hsl(140, 50%, 45%);
    --tertiary-accent: hsl(45, 85%, 50%);
    --error-accent: hsl(0, 75%, 55%);
    
    /* Flag/Theme Colors (Italian tricolor) */
    --flag-color-1: hsl(140, 70%, 35%);
    --flag-color-2: hsl(0, 0%, 100%);
    --flag-color-3: hsl(0, 80%, 50%);
    
    /* Surface & Background Colors */
    --body-bg: hsl(40, 30%, 98%);
    --surface-bg: hsl(40, 25%, 96%);
    --surface-raised: hsl(0, 0%, 100%);
    --header-bg: hsl(0, 0%, 100%, 0.9);
    --footer-bg: hsl(25, 30%, 15%);
    
    /* Text Colors */
    --text-primary: hsl(25, 30%, 15%);
    --text-secondary: hsl(25, 20%, 35%);
    --text-muted: hsl(25, 15%, 55%);
    --text-inverse: hsl(0, 0%, 85%);
    
    /* Link Colors */
    --link-color: var(--primary-accent);
    --link-hover: var(--primary-accent-dark);
    
    /* Border Colors */
    --border-color: hsl(30, 10%, 88%);
    --border-light: hsl(35, 10%, 93%);
    
    /* Design Tokens */
    --radius: 0.5rem;
    --radius-sm: 0.25rem;
    --radius-lg: 1rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Spacing Scale */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 1rem;      /* 16px */
    --space-4: 1.5rem;    /* 24px */
    --space-5: 2rem;      /* 32px */
    --space-6: 3rem;      /* 48px */
    --space-7: 4rem;      /* 64px */
    --space-8: 6rem;      /* 96px */
    
    /* Container Widths */
    --container-max: 1280px;
    --container-narrow: 720px;
    --container-padding: var(--space-4);
    
    /* Typography Scale (fluid with clamp) - Optimized for Playfair + Lato pairing */
    --step--1: clamp(0.875rem, 0.85rem + 0.125vw, 0.9375rem);    /* Small text */
    --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);           /* Body text */
    --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);           /* H3 */
    --step-2: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);         /* H2 */
    --step-3: clamp(2rem, 1.75rem + 1.25vw, 2.625rem);           /* H1 */
    --step-4: clamp(2.5rem, 2.15rem + 1.75vw, 3.5rem);           /* Hero titles */
    
    /* Font Families - Food Blog Typography */
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-ui: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
    
    /* Line Heights */
    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* ============================================
   ALTERNATE THEME PRESETS
   Uncomment one section to swap themes instantly
   ============================================ */

/* ASIAN CUISINE THEME - Inspired by soy, ginger, and bamboo */
/*
:root {
    --brand-h: 25;
    --brand-s: 70%;
    --brand-l: 45%;
    --bg: hsl(35, 20%, 97%);
    --surface: hsl(35, 18%, 95%);
    --text: hsl(20, 25%, 18%);
    --text-light: hsl(20, 18%, 38%);
    --muted: hsl(20, 12%, 58%);
    --border: hsl(30, 8%, 86%);
    --border-light: hsl(35, 8%, 91%);
    --success: hsl(120, 40%, 40%);
    --warning: hsl(38, 80%, 48%);
}
*/

/* MEDITERRANEAN THEME - Ocean blues, olive greens, sun-baked earth */
/*
:root {
    --brand-h: 195;
    --brand-s: 65%;
    --brand-l: 48%;
    --bg: hsl(45, 35%, 97%);
    --surface: hsl(45, 28%, 95%);
    --text: hsl(30, 28%, 16%);
    --text-light: hsl(30, 22%, 36%);
    --muted: hsl(30, 14%, 54%);
    --border: hsl(40, 12%, 87%);
    --border-light: hsl(45, 12%, 92%);
    --success: hsl(100, 45%, 42%);
    --warning: hsl(45, 88%, 52%);
}
*/

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

html {
    font-size: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--body-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

h1 { 
    font-size: var(--step-3); 
    line-height: 1.1;  /* Tighter line-height for article headers */
}

h2 { 
    font-size: var(--step-2); 
    margin-top: var(--space-6); 
}

h3 { font-size: var(--step-1); margin-top: var(--space-5); }
h4 { font-size: var(--step-0); font-weight: 600; margin-top: var(--space-4); }

p {
    margin-bottom: var(--space-4);
}

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

a:hover {
    color: var(--link-hover);
}

a:focus-visible {
    outline: 2px solid var(--primary-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

strong { font-weight: 600; }
em { font-style: italic; }

/* ============================================
   LAYOUT PRIMITIVES
   ============================================ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.container-narrow {
    max-width: var(--container-narrow);
}

.main-content {
    flex: 1;
}

/* ============================================
   ITALIAN THEME ACCENTS
   ============================================ */

/* Theme Accent Strip - Top of page */
.site-theme-accent-strip {
    height: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: linear-gradient(
        to right,
        var(--flag-color-1) 0%,
        var(--flag-color-1) 33.33%,
        var(--flag-color-2) 33.33%,
        var(--flag-color-2) 66.66%,
        var(--flag-color-3) 66.66%,
        var(--flag-color-3) 100%
    );
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Decorative Theme Divider */
.site-theme-divider {
    width: 120px;
    height: 3px;
    margin: var(--space-4) auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: linear-gradient(
        to right,
        var(--flag-color-1) 0%,
        var(--flag-color-1) 33.33%,
        var(--flag-color-2) 33.33%,
        var(--flag-color-2) 66.66%,
        var(--flag-color-3) 66.66%,
        var(--flag-color-3) 100%
    );
    border-radius: 2px;
}

/* ============================================
   SKIP LINK (Accessibility)
   ============================================ */

.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-4);
    background: var(--primary-accent);
    color: var(--primary-accent-contrast);
    padding: var(--space-2) var(--space-4);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-ui);
    border-radius: var(--radius);
    z-index: 200;
    box-shadow: var(--shadow-lg);
}

.skip-link:focus {
    top: var(--space-3);
}

/* ============================================
   SITE HEADER
   ============================================ */

.site-header {
    background-color: var(--surface-raised);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-4) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background-color: var(--header-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding-top: calc(var(--space-4) + 6px);
}

/* Prominent Theme Flag Accent Bar in Header */
.header-accent-bar {
    height: 16px;
    background: linear-gradient(
        to right,
        var(--flag-color-1) 0%,
        var(--flag-color-1) 33.33%,
        var(--flag-color-2) 33.33%,
        var(--flag-color-2) 66.66%,
        var(--flag-color-3) 66.66%,
        var(--flag-color-3) 100%
    );
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.logo {
    flex-shrink: 0;
}

.logo img {
    display: block;
    height: 58px;
    width: auto;
}

.main-nav {
    flex: 1;
    min-width: 200px;
}

.nav-list {
    display: flex;
    gap: var(--space-4);
    list-style: none;
    flex-wrap: wrap;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    padding: var(--space-2) var(--space-1);
    display: block;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* ============================================
   MOBILE HAMBURGER MENU (JavaScript-enhanced)
   ============================================ 
   
   Z-INDEX HIERARCHY:
   - mobile-menu-overlay: 99 (backdrop - BEHIND everything)
   - site-header: 100 (sticky header)
   - main-nav: 999 (slide-in menu - mobile only)
   - mobile-menu-button: 1001 (hamburger icon - mobile only)
*/

.mobile-menu-button {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    transition: all var(--transition-base);
    position: relative;
}

.mobile-menu-button:hover {
    opacity: 0.7;
}

.mobile-menu-button:focus-visible {
    outline: 2px solid var(--primary-accent);
    outline-offset: 2px;
}

.hamburger {
    width: 28px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-base);
    position: relative;
    display: block;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 28px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

/* Active state - Hamburger transforms to X */
.mobile-menu-button.is-active .hamburger {
    background-color: transparent;
}

.mobile-menu-button.is-active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-button.is-active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    pointer-events: none;
}

.mobile-menu-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Mobile Header */
@media (max-width: 767px) {
    .header-inner {
        gap: var(--space-3);
    }
    
    .mobile-menu-button {
        display: flex;
        z-index: 1001;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 280px;
        max-width: 85vw;
        background-color: var(--surface-raised);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        padding: var(--space-7) var(--space-4);
        overflow-y: auto;
    }
    
    .main-nav.is-open {
        transform: translateX(0);
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0;
        margin-top: var(--space-4);
    }
    
    .nav-link {
        font-size: var(--step-0);
        padding: var(--space-3) var(--space-2);
        border-bottom: 1px solid var(--border-light);
        display: block;
        transition: all var(--transition-base);
    }
    
    .nav-link:hover,
    .nav-link:focus {
        background-color: var(--bg-primary);
        padding-left: var(--space-3);
    }
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    text-align: center;
    padding: var(--space-7) 0 var(--space-6);
}

.page-title {
    margin-bottom: var(--space-3);
    font-family: var(--font-heading);
}

.page-description {
    font-size: var(--step-1);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   CATEGORY FILTER BUTTONS
   ============================================ */

.category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

.filter-btn {
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-weight: 500;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border-color);
    background-color: var(--surface-raised);
    color: var(--text-primary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    background-color: var(--primary-accent-light);
}

.filter-btn.active {
    background-color: var(--primary-accent);
    color: var(--primary-accent-contrast);
    border-color: var(--primary-accent);
}

.filter-btn:focus-visible {
    outline: 2px solid var(--primary-accent);
    outline-offset: 2px;
}

/* ============================================
   ARTICLE GRID
   ============================================ */

.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-7);
}

@media (min-width: 768px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
}

@media (min-width: 1024px) {
    .article-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   ARTICLE CARD
   ============================================ */

.article-card {
    display: flex;
    flex-direction: column;
    background-color: var(--surface-raised);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    border-top: 3px solid transparent;
}

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

.card-image-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: var(--surface-bg);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.card-content {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-category {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-accent);
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-1);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(
        to right,
        var(--flag-color-1),
        var(--flag-color-2),
        var(--flag-color-3)
    ) 1;
    border-image-slice: 1;
}

.card-title {
    font-size: var(--step-1);
    margin-bottom: var(--space-3);
    margin-top: var(--space-2);  /* Reduced from default H2 margin */
    line-height: var(--leading-tight);
}

.card-title a {
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

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

.card-excerpt {
    font-size: var(--step--1);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--step--1);
    color: var(--text-muted);
}

.card-author {
    font-weight: 500;
}

.meta-separator {
    opacity: 0.5;
}

/* ============================================
   COMPACT ARTICLE CARDS (Category/Tag Pages)
   ============================================ */

.article-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-4);
}

.article-card-compact {
    border-top-width: 2px;
}

.article-card-compact .card-content {
    padding: var(--space-3);
}

.article-card-compact .card-category {
    display: none;  /* Hide category on compact cards */
}

.article-card-compact .card-title {
    font-size: var(--step-0);
    margin-bottom: var(--space-2);
    margin-top: 0;
}

.article-card-compact .card-title a {
    font-family: var(--font-ui);
    font-weight: 600;
}

.article-card-compact .card-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: var(--space-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-compact .card-meta {
    font-size: 0.8125rem;
}

.article-card-compact .card-image-link {
    aspect-ratio: 4 / 3;
}

@media (min-width: 768px) {
    .article-grid-compact {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-6) 0 var(--space-7);
    flex-wrap: wrap;
}

.pagination-link {
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-weight: 500;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pagination-link:hover {
    background-color: var(--surface-bg);
    color: var(--text-primary);
}

.pagination-numbers {
    display: flex;
    gap: var(--space-1);
    list-style: none;
}

.pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: var(--space-2);
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pagination-number:hover {
    background-color: var(--surface-bg);
    color: var(--text-primary);
}

.pagination-number.active {
    background-color: var(--primary-accent);
    color: var(--primary-accent-contrast);
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    padding: var(--space-2);
    color: var(--text-muted);
}

/* Mobile Pagination */
@media (max-width: 640px) {
    .pagination-numbers {
        display: none;
    }
}

/* ============================================
   ARTICLE PAGE
   ============================================ */

.article-header {
    padding: var(--space-7) 0 var(--space-5);
}

.article-category {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-accent);
    margin-bottom: var(--space-3);
    padding: var(--space-1) var(--space-3);
    background: linear-gradient(
        135deg,
        hsla(140, 70%, 35%, 0.08) 0%,
        hsla(0, 0%, 100%, 0.08) 50%,
        hsla(0, 80%, 50%, 0.08) 100%
    );
    border-left: 3px solid var(--flag-color-1);
    border-right: 3px solid var(--flag-color-3);
    border-radius: var(--radius-sm);
}

.article-title {
    font-family: var(--font-heading);
    font-size: var(--step-4);
    margin-bottom: var(--space-4);
}

.article-excerpt {
    font-family: var(--font-ui);
    font-size: var(--step-1);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-ui);
    font-size: var(--step--1);
    color: var(--text-muted);
    flex-wrap: wrap;
}

.article-author {
    font-style: normal;
    font-weight: 500;
}

.article-author a {
    color: var(--text-secondary);
}

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

.reading-time {
    font-weight: 500;
}

/* ============================================
   HERO IMAGE
   ============================================ */

.article-hero {
    margin-bottom: var(--space-7);
    background-color: var(--surface-bg);
    position: relative;
    border-top: 3px solid transparent;
    border-image: linear-gradient(
        to right,
        var(--flag-color-1),
        var(--flag-color-2),
        var(--flag-color-3)
    ) 1;
    border-image-slice: 1 0 0 0;
}

/* Full-bleed utility: allow hero figure to span edge-to-edge */
.article-hero.full-bleed {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
    object-fit: cover;
}

.hero-caption {
    font-family: var(--font-ui);
    font-size: var(--step--1);
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-3);
    background-color: var(--surface-bg);
}

/* ============================================
   ARTICLE BODY (Rich Content)
   ============================================ */

.article-body {
    font-family: var(--font-body);
    margin-bottom: var(--space-7);
    line-height: 1.8;  /* Increased line-height for better readability */
}

.article-body p {
    line-height: 1.8;  /* Consistent increased line-height */
}

.content-section {
    padding: var(--space-5) 0;
}

.lead {
    font-size: var(--step-1);
    line-height: var(--leading-relaxed);
    color: var(--text-light);
    margin-bottom: var(--space-5);
}

/* Lists */
.article-body ul,
.article-body ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-5);
}

.article-body li {
    margin-bottom: var(--space-2);
    line-height: var(--leading-relaxed);
}

.article-body ul {
    list-style-type: disc;
}

.article-body ol {
    list-style-type: decimal;
}

.article-body li > ul,
.article-body li > ol {
    margin-top: var(--space-2);
    margin-bottom: 0;
}

/* Blockquote - Theme flag accent styling */
blockquote {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-5);
    padding-left: var(--space-6);
    background: linear-gradient(
        to right,
        var(--flag-color-1) 0px,
        var(--flag-color-1) 4px,
        var(--flag-color-2) 4px,
        var(--flag-color-2) 8px,
        var(--flag-color-3) 8px,
        var(--flag-color-3) 12px,
        var(--primary-accent-light) 12px
    );
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow-sm);
    position: relative;
}

blockquote p {
    font-size: var(--step-1);
    font-style: italic;
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-3);
}

blockquote footer {
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-style: normal;
    color: var(--text-secondary);
}

blockquote cite {
    font-style: italic;
}

/* Code Blocks - High contrast for warm theme */
pre {
    margin: var(--space-5) 0;
    padding: var(--space-4);
    background-color: var(--text);
    color: hsl(40, 30%, 95%);
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: var(--step--1);
    line-height: var(--leading-relaxed);
    border: 1px solid hsl(25, 20%, 25%);
}

code {
    font-family: var(--font-mono);
}

p code,
li code {
    background-color: var(--surface-bg);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    border: 1px solid var(--border-color);
}

/* Tables */
.content-table {
    width: 100%;
    margin: var(--space-5) 0;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: var(--step--1);
}

.content-table thead {
    background-color: var(--surface-bg);
    border-bottom: 2px solid var(--border-color);
}

.content-table th {
    text-align: left;
    font-weight: 600;
    padding: var(--space-3);
    color: var(--text-primary);
}

.content-table td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border-light);
}

.content-table tbody tr:hover {
    background-color: var(--surface-bg);
}

/* Responsive Table */
@media (max-width: 640px) {
    .content-table {
        font-size: 0.875rem;
    }
    
    .content-table th,
    .content-table td {
        padding: var(--space-2);
    }
}

/* Figures */
.content-figure {
    margin: var(--space-6) 0;
}

.figure-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
}

.content-figure figcaption {
    font-family: var(--font-ui);
    font-size: var(--step--1);
    color: var(--text-muted);
    text-align: center;
    margin-top: var(--space-2);
    font-style: italic;
}

/* Ensure images in content are responsive */
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

/* ============================================
   ARTICLE FOOTER (Tags)
   ============================================ */

.article-footer {
    padding: var(--space-5) 0;
    border-top: 1px solid var(--border-light);
}

.article-tags {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.tags-label {
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--text-secondary);
}

.tag {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: var(--step--1);
    padding: var(--space-1) var(--space-3);
    background-color: var(--surface-bg);
    color: var(--text-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.tag:hover {
    background-color: hsl(140, 50%, 95%);
    color: hsl(140, 50%, 35%);
    border-color: var(--secondary-accent);
}

/* ============================================
   ARTICLE NAVIGATION (Next/Prev) - Compact
   ============================================ */

.article-nav {
    background-color: var(--surface-bg);
    padding: var(--space-5) 0;
    margin-top: var(--space-7);
}

.article-nav .container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}

@media (min-width: 768px) {
    .article-nav .container {
        grid-template-columns: 1fr 1fr;
    }
}

.article-nav-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3);  /* Reduced from space-4 */
    background-color: var(--body-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.article-nav-link:hover {
    border-color: var(--primary-accent);
    box-shadow: var(--shadow);  /* Reduced from shadow-md */
}

.article-nav-next {
    text-align: right;
}

.nav-label {
    font-family: var(--font-ui);
    font-size: 0.75rem;  /* Smaller */
    font-weight: 600;
    color: var(--primary-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-title {
    font-family: var(--font-ui);
    font-size: var(--step--1);  /* Reduced from step-0 */
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   BUTTONS
   ============================================ */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    font-size: var(--step-0);
    font-weight: 600;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-base);
    line-height: 1;
}

.button-primary {
    background: linear-gradient(
        135deg,
        var(--flag-color-1) 0%,
        var(--primary-accent) 30%,
        var(--primary-accent) 70%,
        var(--flag-color-3) 100%
    );
    color: var(--primary-accent-contrast);
    position: relative;
    overflow: hidden;
}

.button-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.button-primary:hover::before {
    left: 100%;
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.button-secondary {
    background-color: var(--surface-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.button-secondary:hover {
    background-color: var(--body-bg);
    border-color: var(--primary-accent);
}

.button:focus-visible {
    outline: 2px solid var(--primary-accent);
    outline-offset: 2px;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    max-width: 500px;
    margin: 0 auto;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--step-2);
    margin-bottom: var(--space-3);
}

.empty-state-description {
    font-size: var(--step-0);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-5);
}

/* ============================================
   SITE FOOTER
   ============================================ */

.site-footer {
    background-color: var(--footer-bg);
    color: var(--text-inverse);
    padding: var(--space-6) 0;
    margin-top: auto;
    position: relative;
}

/* Prominent Theme Flag Border on Footer */
.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(
        to right,
        var(--flag-color-1) 0%,
        var(--flag-color-1) 33.33%,
        var(--flag-color-2) 33.33%,
        var(--flag-color-2) 66.66%,
        var(--flag-color-3) 66.66%,
        var(--flag-color-3) 100%
    );
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Subtle theme accent pattern on footer */
.site-footer::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        var(--flag-color-1) 0px,
        var(--flag-color-1) 20px,
        transparent 20px,
        transparent 40px,
        var(--primary-accent) 40px,
        var(--primary-accent) 60px,
        transparent 60px,
        transparent 80px,
        var(--flag-color-3) 80px,
        var(--flag-color-3) 100px,
        transparent 100px,
        transparent 120px
    );
    opacity: 0.3;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-text {
    font-size: var(--step--1);
    margin: 0;
}

.footer-nav {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.footer-link {
    font-size: var(--step--1);
    color: var(--text-inverse);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: hsl(0, 0%, 100%);
}

/* ============================================
   UTILITIES
   ============================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .site-header,
    .site-footer,
    .article-nav,
    .pagination,
    .skip-link {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
    
    a {
        color: var(--text);
        text-decoration: underline;
    }
}


/* ============================================
   VIDEO HERO SUPPORT
   Minimal additions for video background hero
   ============================================ */

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

/* Ensure overlay sits above video/image */
.hero-home .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35); /* Default fallback */
    z-index: 1;
}

/* Content must be above overlay */
.hero-home .hero-content {
    position: relative;
    z-index: 2;
}

/* Keep existing .hero-image behavior */
.hero-home .hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}
