/**
 * JigsawStation Design System
 * CSS Variables for consistent styling across all pages
 */

/* ==========================================================================
   CSS Reset
   ========================================================================== */

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

/* ==========================================================================
   CSS Variables - Light Mode (Default)
   ========================================================================== */

:root {
    /* Colors - Refined Palette: Clean whites with slate accent */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --slate-900: #0f172a;
    --cyan-500: #06b6d4;
    --cyan-600: #0891b2;

    /* Typography */
    --font-display: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Spacing */
    --spacing-unit: 8px;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* New design tokens */
    --nh-bg:      #ffffff;
    --nh-surface: #f7f8fa;
    --nh-surface2:#eef0f4;
    --nh-border:  #e2e6ed;
    --nh-text:    #1a202c;
    --nh-sub:     #4a5568;
    --nh-muted:   #a0aec0;
    --nh-accent:  #7AAACE;
    --nh-hi:      #5b8fb5;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

body {
    font-family: var(--font-body);
    background-color: #ffffff;
    background-repeat: repeat;
    color: var(--slate-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Site Header (global — used by Header.astro on every page)
   ========================================================================== */

header {
    background: #1E3A8A;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: none;
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: 'Raleway', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.logo-icon img { width: 100%; height: 100%; object-fit: contain; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Browse dropdown */
.nav-browse-wrap { position: relative; }

.nav-browse {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    transition: color 0.2s;
}
.nav-browse:hover,
.nav-browse-wrap:hover .nav-browse { color: #ffffff; }

.nav-browse-caret {
    width: 10px;
    height: 6px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.nav-browse-wrap:hover .nav-browse-caret { transform: rotate(180deg); }

.nav-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    min-width: 200px;
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 200;
}

/* Invisible bridge so hover isn't lost mid-travel */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -10px;
    right: -10px;
    height: 12px;
}

.nav-browse-wrap:hover .nav-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nh-muted);
    padding: 4px 10px 2px;
    margin: 0;
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--nh-border);
    margin: 5px 4px;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 0.82rem;
    color: var(--nh-sub);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.nav-dropdown-item:hover { background: var(--nh-surface2); color: var(--nh-text); }
.nav-dropdown-item span { font-size: 0.9rem; width: 18px; text-align: center; }

.nav-dropdown-all { font-weight: 600; color: var(--nh-accent); }
.nav-dropdown-all:hover { color: var(--nh-accent); }

.theme-toggle {
    position: relative;
    width: 58px;
    height: 30px;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { border-color: rgba(255, 255, 255, 0.65); background: rgba(255, 255, 255, 0.06); }

.theme-toggle .theme-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    pointer-events: none;
    transition: opacity 0.2s, color 0.2s;
    z-index: 2;
}
.theme-toggle .sun-icon { left: 5px; color: #1E3A8A; }
.theme-toggle .moon-icon { right: 5px; color: #ffffff; }

/* Sliding thumb */
.theme-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 2px;
    transform: translateY(-50%);
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: #ffffff;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s;
    z-index: 1;
}

/* Light mode: thumb left, sun shows, moon dims */
body.light-mode .theme-toggle .moon-icon { opacity: 0.25; }

/* Dark mode: thumb slides right, moon shows, sun dims */
body.dark-mode .theme-toggle::after {
    left: calc(100% - 25px);
    background: #1a2234;
}
body.dark-mode .theme-toggle .sun-icon { opacity: 0.25; }
body.dark-mode .theme-toggle .moon-icon { color: rgba(255, 255, 255, 0.95); }

@media (prefers-color-scheme: dark) {
    body:not(.light-mode) .theme-toggle::after {
        left: calc(100% - 25px);
        background: #1a2234;
    }
    body:not(.light-mode) .theme-toggle .sun-icon { opacity: 0.25; }
    body:not(.light-mode) .theme-toggle .moon-icon { color: rgba(255, 255, 255, 0.95); }
}

@media (max-width: 1023px) {
    .header-content { padding: 14px 24px; }
}

@media (max-width: 767px) {
    .header-content { padding: 12px 16px; }
}

/* ==========================================================================
   Dark Mode - Manual Toggle
   ========================================================================== */

body.dark-mode {
    /* Color Variable Overrides */
    --white: #1a1a1a;
    --gray-50: #1f1f1f;
    --gray-100: #2a2a2a;
    --gray-200: #3a3a3a;
    --gray-300: #4a4a4a;
    --gray-600: #a0a0a0;
    --gray-700: #d1d1d1;
    --gray-900: #f5f5f5;
    --slate-900: #f5f5f5;

    /* Background & Text */
    background-color: #111827;
    color: #f5f5f5;
    --nh-bg:      #111827;
    --nh-surface: #1a2234;
    --nh-surface2:#1e2840;
    --nh-border:  #2d3a50;
    --nh-text:    #e2e8f0;
    --nh-sub:     #94a3b8;
    --nh-muted:   #4a5568;
    --nh-accent:  #7AAACE;
    --nh-hi:      #9bbede;
}

/* Dark Mode - Puzzle Items */
body.dark-mode .puzzle-item {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
}

body.dark-mode .puzzle-item:hover {
    border-color: #4a4a4a;
}

body.dark-mode .puzzle-image-wrapper {
    background: #3a3a3a;
}

body.dark-mode .puzzle-name {
    color: #f5f5f5;
}

body.dark-mode .puzzle-category {
    color: #a0a0a0;
}

/* Dark Mode - Category Buttons */
body.dark-mode .category-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #a0a0a0;
}

body.dark-mode .category-btn:hover {
    color: #f5f5f5;
    background: #3a3a3a;
    border-color: #4a4a4a;
}

body.dark-mode .category-btn.active {
    background: var(--cyan-600);
    border-color: var(--cyan-600);
    color: white;
}

/* Dark Mode - Badges & Overlays */
body.dark-mode .play-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
}

body.dark-mode .play-btn {
    background: rgba(42, 42, 42, 0.95);
}

body.dark-mode .spinner {
    border-color: #3a3a3a;
    border-top-color: var(--cyan-600);
}

/* Dark Mode - Stats */
body.dark-mode .stat strong {
    color: #f5f5f5;
}

/* Dark Mode - Footer */
body.dark-mode footer {
    background: #1f1f1f;
    border-top: 1px solid #3a3a3a;
}

body.dark-mode .footer-section h3 {
    color: #f5f5f5;
}

body.dark-mode .footer-links a {
    color: #a0a0a0;
}

body.dark-mode .footer-links a:hover {
    color: var(--cyan-500);
}

body.dark-mode .footer-bottom {
    border-top: 1px solid #3a3a3a;
}

body.dark-mode .footer-copyright {
    color: #a0a0a0;
}

body.dark-mode .social-link {
    background: #3a3a3a;
    color: #a0a0a0;
}

body.dark-mode .social-link:hover {
    background: var(--cyan-600);
    color: white;
}

/* Dark Mode - Section Headers */
body.dark-mode .section-header h1,
body.dark-mode .section-header h2 {
    color: #f5f5f5;
}

/* Dark Mode - Breadcrumb */
body.dark-mode .breadcrumb {
    color: #a0a0a0;
}

body.dark-mode .breadcrumb a {
    color: #a0a0a0;
}

body.dark-mode .breadcrumb a:hover {
    color: var(--cyan-500);
}

/* Dark Mode - Category Hero */
body.dark-mode .category-hero {
    background: linear-gradient(135deg, #2a3a4a 0%, #1f2f3f 100%);
}

body.dark-mode .category-title {
    color: #f5f5f5;
}

body.dark-mode .category-description {
    color: #d1d1d1;
}

/* Dark Mode - Difficulty Filter */
body.dark-mode .filter-label {
    color: #f5f5f5;
}

body.dark-mode .difficulty-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #a0a0a0;
}

body.dark-mode .difficulty-btn:hover {
    color: #f5f5f5;
    background: #3a3a3a;
    border-color: #4a4a4a;
}

body.dark-mode .difficulty-btn.active {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #f5f5f5;
}

/* Dark Mode - Content Pages */
body.dark-mode .content-container h1,
body.dark-mode .content-section h2,
body.dark-mode .content-section h3 {
    color: #f5f5f5;
}

body.dark-mode .content-section p,
body.dark-mode .content-section li {
    color: #d1d1d1;
}

body.dark-mode .content-container .last-updated {
    color: #a0a0a0;
}

body.dark-mode .content-section a {
    color: var(--cyan-500);
}

body.dark-mode .content-section a:hover {
    color: var(--cyan-400);
}

body.dark-mode .section-header p {
    color: #a0a0a0;
}

/* ==========================================================================
   Dark Mode - System Preference (Auto-detect)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    body:not(.light-mode) {
        /* Color Variable Overrides */
        --white: #1a1a1a;
        --gray-50: #1f1f1f;
        --gray-100: #2a2a2a;
        --gray-200: #3a3a3a;
        --gray-300: #4a4a4a;
        --gray-600: #a0a0a0;
        --gray-700: #d1d1d1;
        --gray-900: #f5f5f5;
        --slate-900: #f5f5f5;

        /* Background & Text */
        background-color: #111827;
        color: #f5f5f5;
    }

    /* Auto Dark Mode - Header tokens (drives the redesigned header via CSS variables) */
    body:not(.light-mode) {
        --nh-bg:      #111827;
        --nh-surface: #1a2234;
        --nh-surface2:#1e2840;
        --nh-border:  #2d3a50;
        --nh-text:    #e2e8f0;
        --nh-sub:     #94a3b8;
        --nh-muted:   #4a5568;
        --nh-accent:  #7AAACE;
        --nh-hi:      #9bbede;
    }

    /* Auto Dark Mode - Puzzle Items */
    body:not(.light-mode) .puzzle-item {
        background: #2a2a2a;
        border: 1px solid #3a3a3a;
    }

    body:not(.light-mode) .puzzle-item:hover {
        border-color: #4a4a4a;
    }

    body:not(.light-mode) .puzzle-image-wrapper {
        background: #3a3a3a;
    }

    body:not(.light-mode) .puzzle-name {
        color: #f5f5f5;
    }

    body:not(.light-mode) .puzzle-category {
        color: #a0a0a0;
    }

    /* Auto Dark Mode - Category Buttons */
    body:not(.light-mode) .category-btn {
        background: #2a2a2a;
        border-color: #3a3a3a;
        color: #a0a0a0;
    }

    body:not(.light-mode) .category-btn:hover {
        color: #f5f5f5;
        background: #3a3a3a;
        border-color: #4a4a4a;
    }

    body:not(.light-mode) .category-btn.active {
        background: var(--cyan-600);
        border-color: var(--cyan-600);
        color: white;
    }

    /* Auto Dark Mode - Badges & Overlays */
    body:not(.light-mode) .play-overlay {
        background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
    }

    body:not(.light-mode) .play-btn {
        background: rgba(42, 42, 42, 0.95);
    }

    body:not(.light-mode) .spinner {
        border-color: #3a3a3a;
        border-top-color: var(--cyan-600);
    }

    /* Auto Dark Mode - Logo & Stats */
    body:not(.light-mode) .logo {
        color: #f5f5f5;
    }

    body:not(.light-mode) .stat strong {
        color: #f5f5f5;
    }

    /* Auto Dark Mode - Theme Toggle */
    body:not(.light-mode) .theme-toggle {
        background: rgba(255, 255, 255, 0.1);
    }

    body:not(.light-mode) .theme-toggle:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    body:not(.light-mode) .theme-toggle svg {
        fill: #f5f5f5;
    }

    /* Auto Dark Mode - Footer */
    body:not(.light-mode) footer {
        background: #1f1f1f;
        border-top: 1px solid #3a3a3a;
    }

    body:not(.light-mode) .footer-section h3 {
        color: #f5f5f5;
    }

    body:not(.light-mode) .footer-links a {
        color: #a0a0a0;
    }

    body:not(.light-mode) .footer-links a:hover {
        color: var(--cyan-500);
    }

    body:not(.light-mode) .footer-bottom {
        border-top: 1px solid #3a3a3a;
    }

    body:not(.light-mode) .footer-copyright {
        color: #a0a0a0;
    }

    body:not(.light-mode) .social-link {
        background: #3a3a3a;
        color: #a0a0a0;
    }

    body:not(.light-mode) .social-link:hover {
        background: var(--cyan-600);
        color: white;
    }

    /* Auto Dark Mode - Section Headers */
    body:not(.light-mode) .section-header h1,
    body:not(.light-mode) .section-header h2 {
        color: #f5f5f5;
    }

    body:not(.light-mode) .section-header p {
        color: #a0a0a0;
    }
}

/**
 * JigsawStation Reusable Components
 * Button, card, modal, and other shared UI components
 */

/* ==========================================================================
   Buttons
   ========================================================================== */

.category-btn {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3);
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.category-btn:hover {
    color: var(--slate-900);
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.category-btn.active {
    color: white;
    background: var(--cyan-600);
    border-color: var(--cyan-600);
}

/* ==========================================================================
   Main Container
   ========================================================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 3);
}

/* ==========================================================================
   Puzzle Grid - Dense catalog layout
   ========================================================================== */

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
}

@media (max-width: 768px) {
    .container {
        padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 2);
    }
    .puzzle-grid,
    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: calc(var(--spacing-unit) * 1.5);
    }
}

@media (min-width: 768px) and (max-width: 1200px) {
    .puzzle-grid,
    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 1200px) {
    .puzzle-grid,
    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* ==========================================================================
   Cards - Puzzle Items
   ========================================================================== */

.puzzle-item {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--gray-200);
}

.puzzle-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
}

.puzzle-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio - more compact */
    overflow: hidden;
    background: var(--gray-100);
}

.puzzle-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.puzzle-item:hover .puzzle-image {
    transform: scale(1.03);
}

/* Puzzle Card Info */
.puzzle-info {
    padding: calc(var(--spacing-unit) * 1.5);
}

.puzzle-name {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.puzzle-category {
    font-size: 12px;
    color: var(--gray-600);
    text-transform: capitalize;
    font-weight: 500;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

/* ==========================================================================
   Overlays - Glass-morphism Play Overlay
   ========================================================================== */

.play-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.puzzle-item:hover .play-overlay {
    opacity: 1;
}

.play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.puzzle-item:hover .play-btn {
    transform: scale(1.05);
}

.play-icon {
    width: 24px;
    height: 24px;
    fill: var(--cyan-600);
    margin-left: 2px;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--cyan-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: calc(var(--spacing-unit) * 12) calc(var(--spacing-unit) * 4);
    color: var(--gray-600);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: calc(var(--spacing-unit) * 3);
    opacity: 0.2;
    fill: var(--gray-600);
}

.empty-state p {
    font-size: 16px;
}

/* ==========================================================================
   Stats Bar
   ========================================================================== */

.stats-bar {
    display: flex;
    gap: calc(var(--spacing-unit) * 3);
    padding: calc(var(--spacing-unit) * 1) 0;
    font-size: 13px;
    color: var(--gray-600);
}

.stat {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
}

.stat strong {
    color: var(--slate-900);
    font-weight: 600;
    font-family: var(--font-display);
}

/* ==========================================================================
   Site Footer (global — used by Footer.astro on every page)
   ========================================================================== */

.hp-footer {
    border-top: 1px solid var(--nh-border);
    background: var(--nh-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 36px;
    color: var(--nh-muted);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
}

.hp-footer-links { display: flex; gap: 28px; }
.hp-footer-links a {
    color: var(--nh-muted);
    text-decoration: none;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s;
}
.hp-footer-links a:hover { color: var(--nh-accent); }

@media (max-width: 767px) {
    .hp-footer { padding: 18px 16px; flex-direction: column; gap: 10px; text-align: center; }
    .hp-footer-links { flex-wrap: wrap; justify-content: center; gap: 16px; }
}

@media (min-width: 1600px) {
    .hp-footer { max-width: 1600px; }
}

/* ==========================================================================
   Content Pages (About, FAQ, Privacy, Terms, Cookies, Contact)
   ========================================================================== */

.content-page,
.static-page {
    min-height: calc(100vh - 200px);
}

.content-container {
    max-width: 900px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 3);
}

.content-container h1 {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -0.02em;
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.content-container .last-updated {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.content-section {
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.content-section h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: calc(var(--spacing-unit) * 2);
    margin-top: calc(var(--spacing-unit) * 3);
}

.content-section h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    margin-top: calc(var(--spacing-unit) * 2);
}

.content-section p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.content-section ul,
.content-section ol {
    margin-left: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.content-section li {
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.content-section a {
    color: var(--cyan-600);
    text-decoration: underline;
}

.content-section a:hover {
    color: var(--cyan-500);
}

/* ==========================================================================
   Breadcrumb Navigation
   ========================================================================== */

.breadcrumb {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.breadcrumb a {
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--cyan-600);
}

.breadcrumb-separator {
    margin: 0 calc(var(--spacing-unit) * 1);
    opacity: 0.5;
}

/* ==========================================================================
   Category Hero Section
   ========================================================================== */

.category-hero {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    padding: calc(var(--spacing-unit) * 6) 0;
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.category-hero-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3);
}

.category-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -0.02em;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.category-description {
    font-size: 16px;
    color: var(--gray-700);
    max-width: 700px;
    line-height: 1.7;
}

/* ==========================================================================
   Difficulty Filter
   ========================================================================== */

.difficulty-filter-section {
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.filter-label {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.difficulty-filter {
    display: flex;
    gap: calc(var(--spacing-unit) * 1.5);
    flex-wrap: wrap;
    align-items: center;
}

.difficulty-btn {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3);
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.difficulty-btn:hover {
    color: var(--slate-900);
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.difficulty-btn.active {
    color: var(--slate-900);
    background: var(--gray-100);
    border-color: var(--gray-300);
}

/* ==========================================================================
   Stats Section (Category Page)
   ========================================================================== */

.stats-section {
    display: flex;
    gap: calc(var(--spacing-unit) * 4);
    padding: calc(var(--spacing-unit) * 2) 0;
    margin-bottom: calc(var(--spacing-unit) * 3);
    font-size: 14px;
    color: var(--gray-600);
}

.stats-section .stat strong {
    color: var(--slate-900);
    font-weight: 600;
    font-family: var(--font-display);
    font-size: 24px;
}

/* ==========================================================================
   Responsive Component Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .category-btn {
        flex-shrink: 0;
        font-size: 13px;
        padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 2.5);
    }

    .puzzle-name {
        font-size: 13px;
    }

    .puzzle-category {
        font-size: 11px;
    }

    .category-hero {
        padding: calc(var(--spacing-unit) * 4) 0;
    }

    .category-title {
        font-size: 28px;
    }

    .category-description {
        font-size: 14px;
    }

    .difficulty-filter {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: calc(var(--spacing-unit) * 1);
    }

    .difficulty-filter::-webkit-scrollbar {
        display: none;
    }

    .difficulty-btn {
        flex-shrink: 0;
        font-size: 13px;
        padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 2.5);
    }
}
