/* CSS Variables */
        :root {
            --color-primary: #1a5f7a;
            --color-primary-dark: #134b61;
            --color-secondary: #57c5b6;
            --color-accent: #f97316;
            --color-accent-hover: #ea580c;
            --color-bg: #fafafa;
            --color-bg-alt: #ffffff;
            --color-bg-card: #ffffff;
            --color-text: #1f2937;
            --color-text-muted: #6b7280;
            --color-text-light: #9ca3af;
            --color-border: #e5e7eb;
            --color-shadow: rgba(0, 0, 0, 0.1);
            --color-shadow-strong: rgba(0, 0, 0, 0.15);
            
            --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
            --font-serif: Georgia, 'Times New Roman', serif;
            
            --space-xs: 0.25rem;
            --space-sm: 0.5rem;
            --space-md: 1rem;
            --space-lg: 1.5rem;
            --space-xl: 2rem;
            --space-2xl: 3rem;
            --space-3xl: 4rem;
            
            --radius-sm: 0.375rem;
            --radius-md: 0.5rem;
            --radius-lg: 0.75rem;
            --radius-xl: 1rem;
            
            --transition-fast: 150ms ease;
            --transition-base: 250ms ease;
            --transition-slow: 350ms ease;
            
            --max-width: 75rem;
            --content-width: 50rem;
        }
        
        /* Dark Theme */
        @media (prefers-color-scheme: dark) {
            :root {
                --color-primary: #57c5b6;
                --color-primary-dark: #3da99b;
                --color-secondary: #1a5f7a;
                --color-bg: #111827;
                --color-bg-alt: #1f2937;
                --color-bg-card: #1f2937;
                --color-text: #f3f4f6;
                --color-text-muted: #9ca3af;
                --color-text-light: #6b7280;
                --color-border: #374151;
                --color-shadow: rgba(0, 0, 0, 0.3);
                --color-shadow-strong: rgba(0, 0, 0, 0.4);
            }
        }
        
        /* Reset & Base */
        *, *::before, *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        
        html {
            scroll-behavior: smooth;
            font-size: 100%;
        }
        
        body {
            font-family: var(--font-sans);
            font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
            line-height: 1.7;
            color: var(--color-text);
            background: var(--color-bg);
            min-height: 100vh;
        }
        
        /* Typography */
        h1, h2, h3, h4 {
            font-weight: 700;
            line-height: 1.3;
            color: var(--color-text);
        }
        
        h1 {
            font-size: clamp(1.875rem, 1.5rem + 1.5vw, 2.75rem);
            letter-spacing: -0.025em;
        }
        
        h2 {
            font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
            margin-bottom: var(--space-lg);
            padding-bottom: var(--space-sm);
            border-bottom: 3px solid var(--color-primary);
            display: inline-block;
        }
        
        h3 {
            font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
            margin-bottom: var(--space-md);
            color: var(--color-primary);
        }
        
        p {
            margin-bottom: var(--space-md);
        }
        
        a {
            color: var(--color-primary);
            text-decoration: none;
            transition: color var(--transition-fast);
        }
        
        a:hover, a:focus {
            color: var(--color-accent);
        }
        
        a:focus {
            outline: 2px solid var(--color-accent);
            outline-offset: 2px;
        }
        
        /* Layout */
        .container {
            width: 100%;
            max-width: var(--max-width);
            margin: 0 auto;
            padding: 0 var(--space-md);
        }
        
        .content-wrapper {
            display: grid;
            grid-template-columns: 1fr;
            gap: var(--space-xl);
        }
        
        @media (min-width: 64rem) {
            .content-wrapper {
                grid-template-columns: 1fr 18rem;
            }
        }
        
        /* Skip Link */
        .skip-link {
            position: absolute;
            top: -100%;
            left: var(--space-md);
            background: var(--color-primary);
            color: white;
            padding: var(--space-sm) var(--space-md);
            border-radius: var(--radius-md);
            z-index: 1000;
            transition: top var(--transition-fast);
        }
        
        .skip-link:focus {
            top: var(--space-md);
            outline: 2px solid var(--color-accent);
        }
        
        /* Header */
        .site-header {
            background: var(--color-bg-alt);
            border-bottom: 1px solid var(--color-border);
            padding: var(--space-md) 0;
            box-shadow: 0 2px 10px var(--color-shadow);
        }
        
        .header-inner {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: var(--space-md);
        }
        
        .site-logo {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--color-primary);
        }
        
        .nav-links {
            display: flex;
            gap: var(--space-lg);
            list-style: none;
        }
        
        .nav-links a {
            font-weight: 500;
            padding: var(--space-xs) var(--space-sm);
            border-radius: var(--radius-sm);
            transition: background var(--transition-fast), color var(--transition-fast);
        }
        
        .nav-links a:hover {
            background: var(--color-primary);
            color: white;
        }
        
        /* Main Content */
        main {
            padding: var(--space-2xl) 0;
        }
        
        /* Article Header */
        .article-header {
            text-align: center;
            margin-bottom: var(--space-3xl);
            padding: var(--space-xl) var(--space-lg);
            border-bottom: 1px solid var(--color-border);
        }
        
        .article-header h1 {
            margin-bottom: var(--space-lg);
            background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            max-width: 48rem;
            margin-left: auto;
            margin-right: auto;
            padding: 0 var(--space-lg);
        }
        
        .article-meta {
            display: flex;
            justify-content: center;
            gap: var(--space-lg);
            flex-wrap: wrap;
            color: var(--color-text-muted);
            font-size: 0.9rem;
            margin-bottom: var(--space-lg);
        }
        
        .article-intro {
            max-width: 45rem;
            margin: 0 auto;
            font-size: 1.125rem;
            color: var(--color-text-muted);
        }
        
        /* Table of Contents */
        .toc {
            background: var(--color-bg-card);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
            margin-bottom: var(--space-2xl);
            box-shadow: 0 4px 15px var(--color-shadow);
        }
        
        .toc-title {
            font-size: 1.125rem;
            font-weight: 600;
            margin-bottom: var(--space-md);
            color: var(--color-primary);
        }
        
        .toc-list {
            list-style: none;
            counter-reset: toc-counter;
        }
        
        .toc-list li {
            counter-increment: toc-counter;
            margin-bottom: var(--space-sm);
        }
        
        .toc-list a {
            display: flex;
            align-items: center;
            padding: var(--space-sm);
            border-radius: var(--radius-sm);
            transition: background var(--transition-fast), transform var(--transition-fast);
        }
        
        .toc-list a::before {
            content: counter(toc-counter);
            width: 1.75rem;
            height: 1.75rem;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--color-primary);
            color: white;
            border-radius: 50%;
            font-size: 0.75rem;
            font-weight: 600;
            margin-right: var(--space-sm);
            flex-shrink: 0;
        }
        
        .toc-list a:hover {
            background: var(--color-bg);
            transform: translateX(4px);
        }
        
        /* Content Sections */
        .content-section {
            margin-bottom: var(--space-3xl);
            scroll-margin-top: 5rem;
        }
        
        .content-section p {
            text-align: justify;
            hyphens: auto;
        }
        
        /* Cards */
        .card {
            background: var(--color-bg-card);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
            box-shadow: 0 4px 15px var(--color-shadow);
            transition: transform var(--transition-base), box-shadow var(--transition-base);
        }
        
        .card:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px var(--color-shadow-strong);
        }
        
        /* Info Box */
        .info-box {
            background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
            color: white;
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
            margin: var(--space-xl) 0;
        }
        
        .info-box h3 {
            color: white;
            margin-bottom: var(--space-sm);
        }
        
        /* Bet Types Grid */
        .bet-types-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
            gap: var(--space-md);
            margin: var(--space-xl) 0;
        }
        
        .bet-type-card {
            background: var(--color-bg-card);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-md);
            padding: var(--space-md);
            text-align: center;
            transition: border-color var(--transition-fast), transform var(--transition-fast);
        }
        
        .bet-type-card:hover {
            border-color: var(--color-primary);
            transform: scale(1.02);
        }
        
        .bet-type-card strong {
            display: block;
            color: var(--color-primary);
            font-size: 1.1rem;
            margin-bottom: var(--space-xs);
        }
        
        /* Sidebar */
        .sidebar {
            display: flex;
            flex-direction: column;
            gap: var(--space-lg);
        }
        
        .sidebar-widget {
            background: var(--color-bg-card);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
        }
        
        .sidebar-widget h3 {
            font-size: 1rem;
            margin-bottom: var(--space-md);
            padding-bottom: var(--space-sm);
            border-bottom: 2px solid var(--color-secondary);
        }
        
        .sidebar-list {
            list-style: none;
        }
        
        .sidebar-list li {
            padding: var(--space-sm) 0;
            border-bottom: 1px solid var(--color-border);
        }
        
        .sidebar-list li:last-child {
            border-bottom: none;
        }
        
        /* Warning Box */
        .warning-box {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
            border-left: 4px solid var(--color-accent);
            border-radius: var(--radius-md);
            padding: var(--space-lg);
            margin: var(--space-xl) 0;
            color: #92400e;
        }
        
        @media (prefers-color-scheme: dark) {
            .warning-box {
                background: linear-gradient(135deg, #451a03, #78350f);
                color: #fde68a;
            }
        }
        
        .warning-box strong {
            display: block;
            margin-bottom: var(--space-sm);
            font-size: 1.1rem;
        }
        
        /* FAQ Section */
        .faq-list {
            display: flex;
            flex-direction: column;
            gap: var(--space-md);
        }
        
        .faq-item {
            border: 1px solid var(--color-border);
            border-radius: var(--radius-md);
            overflow: hidden;
        }
        
        .faq-item summary {
            padding: var(--space-md);
            background: var(--color-bg-alt);
            cursor: pointer;
            font-weight: 600;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: background var(--transition-fast);
        }
        
        .faq-item summary:hover {
            background: var(--color-border);
        }
        
        .faq-item summary:focus {
            outline: 2px solid var(--color-primary);
            outline-offset: -2px;
        }
        
        .faq-item summary::marker {
            content: '';
        }
        
        .faq-item summary::after {
            content: '+';
            font-size: 1.5rem;
            color: var(--color-primary);
            transition: transform var(--transition-fast);
        }
        
        .faq-item[open] summary::after {
            transform: rotate(45deg);
        }
        
        .faq-answer {
            padding: var(--space-md);
            background: var(--color-bg-card);
        }
        
        /* Footer */
        .site-footer {
            background-color: #151922; /* Match header dark color */
            border-top: 1px solid rgba(255, 255, 255, 0.05);
            padding: 60px 0 30px;
            margin-top: 4rem;
            color: #a0aec0; /* Softer text color for footer */
            font-size: 0.95rem;
        }

        /* Main Grid Layout */
        .footer-content {
            display: grid;
            /* Forces exactly 4 equal columns */
            grid-template-columns: repeat(4, 1fr); 
            gap: 40px;
            margin-bottom: 60px;
        }

        /* Individual Column Styles */
        .footer-section h4 {
            color: #ffffff; /* White headings */
            font-size: 1.1rem;
            font-weight: 700;
            margin-bottom: 24px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 2px solid var(--accent-color); /* Highlight underline */
            display: inline-block;
            padding-bottom: 8px;
        }

        /* Reset Lists inside Footer */
        .footer-section ul,
        .footer-menu-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .footer-section li {
            margin-bottom: 12px;
        }

        /* Link Styles */
        .footer-section a {
            color: #a0aec0;
            text-decoration: none;
            transition: all 0.2s ease;
            display: inline-block;
        }

        .footer-section a:hover {
            color: var(--accent-color); /* Use your teal color */
            transform: translateX(5px); /* Subtle slide effect */
        }

        /* Footer Bottom (Copyright) */
        .footer-bottom {
            border-top: 1px solid rgba(255, 255, 255, 0.05);
            padding-top: 30px;
            text-align: center;
            font-size: 0.85rem;
            color: #718096;
        }

        /* =========================================
        Responsive Footer (Mobile)
        ========================================= */

        @media (max-width: 900px) {
            /* Tablet: 2 columns */
            .footer-content {
                grid-template-columns: repeat(2, 1fr);
                gap: 30px;
            }
        }

        @media (max-width: 600px) {
            /* Mobile: 1 column */
            .footer-content {
                grid-template-columns: 1fr;
                text-align: center; /* Center align looks better on mobile */
            }

            .footer-section h4 {
                margin-top: 20px;
                /* Center the underline on mobile */
                margin-left: auto;
                margin-right: auto;
            }
        }
        
        /* Print Styles */
        @media print {
            header, .sidebar, .toc, .skip-link {
                display: none;
            }
            
            body {
                font-size: 12pt;
                color: black;
                background: white;
            }
            
            .content-wrapper {
                display: block;
            }
        }

        /* ============================================
   IMAGES STYLES - Scommesse Pallavolo
   ============================================ */

/* === CSS Variables for Images === */
:root {
    --img-radius: 0.75rem;
    --img-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    --img-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.18);
    --img-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --img-scale-hover: 1.02;
}

/* === Base Image Styles === */
.article-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--img-radius);
    box-shadow: var(--img-shadow);
    transition: var(--img-transition);
    object-fit: cover;
}

.article-image:hover {
    box-shadow: var(--img-shadow-hover);
    transform: scale(var(--img-scale-hover));
}

/* === Image Container === */
.image-container {
    position: relative;
    margin: var(--space-xl) 0;
    overflow: hidden;
    border-radius: var(--img-radius);
}

.image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.03) 100%);
    pointer-events: none;
    border-radius: var(--img-radius);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-container:hover::after {
    opacity: 1;
}

/* === Hero Image Specific Styles === */
.hero-image-container {
    position: relative;
    margin: 0 0 var(--space-2xl) 0;
    overflow: hidden;
    border-radius: var(--img-radius);
    max-width: 100%;
}

.hero-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    object-position: center;
    border-radius: var(--img-radius);
    box-shadow: 0 8px 30px rgba(26, 95, 122, 0.2);
    transition: var(--img-transition);
}

.hero-image:hover {
    transform: scale(1.01);
    box-shadow: 0 12px 40px rgba(26, 95, 122, 0.25);
}

/* Hero Image Overlay Gradient */
.hero-image-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to top, rgba(26, 95, 122, 0.1), transparent);
    pointer-events: none;
    border-radius: 0 0 var(--img-radius) var(--img-radius);
    z-index: 1;
}

/* === Section Images === */
.section-image-container {
    position: relative;
    margin: var(--space-lg) 0 var(--space-xl) 0;
    border-radius: var(--img-radius);
    overflow: hidden;
}

.section-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--img-radius);
    box-shadow: var(--img-shadow);
    transition: var(--img-transition);
    object-fit: cover;
}

.section-image:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--img-shadow-hover);
}

/* === Image Caption === */
.image-caption {
    display: block;
    margin-top: var(--space-sm);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: center;
    font-style: italic;
}

/* === Responsive Image Styles === */

/* Tablet */
@media (max-width: 64rem) {
    .hero-image {
        max-height: 350px;
    }
    
    .section-image-container {
        margin: var(--space-md) 0 var(--space-lg) 0;
    }
}

/* Mobile */
@media (max-width: 48rem) {
    :root {
        --img-radius: 0.5rem;
        --img-scale-hover: 1.01;
    }
    
    .hero-image-container {
        margin: 0 calc(var(--space-md) * -1) var(--space-xl) calc(var(--space-md) * -1);
        border-radius: 0;
    }
    
    .hero-image {
        max-height: 280px;
        border-radius: 0;
    }
    
    .section-image-container {
        margin: var(--space-md) 0;
    }
    
    .article-image:hover,
    .section-image:hover,
    .hero-image:hover {
        transform: none;
    }
    
    .image-caption {
        font-size: 0.8125rem;
        padding: 0 var(--space-sm);
    }
}

/* Small Mobile */
@media (max-width: 30rem) {
    .hero-image {
        max-height: 220px;
    }
    
    .section-image {
        border-radius: var(--radius-sm);
    }
}

/* === Dark Theme Adjustments === */
@media (prefers-color-scheme: dark) {
    :root {
        --img-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        --img-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
    }
    
    .hero-image {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    }
    
    .hero-image:hover {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    }
    
    .hero-image-container::before {
        background: linear-gradient(to top, rgba(17, 24, 39, 0.2), transparent);
    }
    
    .image-container::after {
        background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.1) 100%);
    }
}

/* === Reduced Motion Preferences === */
@media (prefers-reduced-motion: reduce) {
    .article-image,
    .section-image,
    .hero-image {
        transition: none;
    }
    
    .article-image:hover,
    .section-image:hover,
    .hero-image:hover {
        transform: none;
    }
}

/* === Loading States === */
.article-image[loading="lazy"],
.section-image[loading="lazy"] {
    background: linear-gradient(90deg, var(--color-bg) 25%, var(--color-bg-alt) 50%, var(--color-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* === Print Styles === */
@media print {
    .hero-image-container,
    .section-image-container,
    .image-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .article-image,
    .section-image,
    .hero-image {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .hero-image {
        max-height: 300px;
    }
}

/* === Aspect Ratio Containers (optional utility classes) === */
.aspect-2-1 {
    aspect-ratio: 2 / 1;
}

.aspect-16-10 {
    aspect-ratio: 16 / 10;
}

.aspect-16-9 {
    aspect-ratio: 16 / 9;
}

/* === Focus States for Accessibility === */
.article-image:focus,
.section-image:focus,
.hero-image:focus {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

/* === Image with Border Accent === */
.image-accent-border {
    border: 3px solid transparent;
    border-image: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) 1;
}

.image-accent-border:hover {
    border-image: linear-gradient(135deg, var(--color-secondary), var(--color-primary)) 1;
}


/* =========================================
   Header & Navigation Styles
   ========================================= */

/* Variables for colors based on your screenshot */
:root {
    --header-bg: #151922;      /* Dark background */
    --header-text: #ffffff;    /* White text */
    --accent-color: #4fd1c5;   /* Teal/Cyan accent */
    --menu-height: 70px;
}

/* Base Header Layout */
.site-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    height: var(--menu-height);
    position: sticky; /* Keeps header at top while scrolling */
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    width: 100%;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- Logo Styles --- */
.site-logo a {
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    color: var(--header-text);
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.site-logo .highlight {
    color: var(--accent-color);
}

/* --- Desktop Menu Styles --- */

/* Reset list styles */
.menu-desktop {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px; /* Space between items */
    align-items: center;
}

/* Menu Links */
.menu-desktop li a {
    text-decoration: none;
    color: #e2e8f0; /* Slightly off-white for better reading */
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

/* Hover Effect: Color Change */
.menu-desktop li a:hover {
    color: var(--accent-color);
}

/* Hover Effect: Animated Underline */
.menu-desktop li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.menu-desktop li a:hover::after {
    width: 100%;
}

/* Active Page State (optional, assumes WP adds current-menu-item class) */
.menu-desktop li.current-menu-item a {
    color: var(--accent-color);
}

/* --- Mobile vs Desktop Visibility --- */

/* Default: Hide burger on desktop */
.mobile-controls {
    display: none;
}

/* Media Query for Mobile/Tablet (Adjust breakpoint as needed) */
@media (max-width: 768px) {
    
    /* Hide desktop nav */
    .site-nav--desktop {
        display: none;
    }

    /* Show burger */
    .mobile-controls {
        display: block;
    }
}

/* --- Burger Button Styling (Matches your JS) --- */
.burger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 1001;
}

.burger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--header-text);
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.burger span:last-child {
    margin-bottom: 0;
}

/* Burger Active State Animation */
.burger.is-active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.burger.is-active span:nth-child(2) {
    opacity: 0;
}
.burger.is-active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* =========================================
   Mobile Menu & Overlay Styles
   ========================================= */

/* --- The Dark Overlay (Backdrop) --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black */
    backdrop-filter: blur(5px); /* Modern frosted glass effect */
    z-index: 1090; /* Below the menu, above the header */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* --- The Sliding Menu Container --- */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%; /* Covers most of the screen on mobile */
    max-width: 350px; /* Don't get too wide on tablets */
    height: 100vh;
    background-color: var(--header-bg); /* Matches header color #151922 */
    z-index: 1100; /* Highest priority */
    transform: translateX(100%); /* Hidden to the right by default */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* Smooth slide animation */
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.mobile-menu.is-open {
    transform: translateX(0); /* Slide in */
}

.mobile-menu__close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--header-text);
    font-size: 32px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.3s ease;
}

.mobile-menu__close:hover {
    color: var(--accent-color);
}


.mobile-menu__inner {
    padding: 80px 20px 40px; 
    overflow-y: auto; 
}

.menu-mobile {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-mobile li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Subtle separator */
    opacity: 0; /* Hidden initially for animation */
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Staggered animation when menu opens */
.mobile-menu.is-open .menu-mobile li {
    opacity: 1;
    transform: translateY(0);
}

/* Delays for each item to appear one by one */
.mobile-menu.is-open .menu-mobile li:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.is-open .menu-mobile li:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.is-open .menu-mobile li:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.is-open .menu-mobile li:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.is-open .menu-mobile li:nth-child(5) { transition-delay: 0.3s; }

.menu-mobile li a {
    display: block;
    padding: 15px 0;
    color: var(--header-text);
    font-size: 1.125rem; /* 18px */
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

/* Hover effect for links */
.menu-mobile li a:hover {
    color: var(--accent-color);
    padding-left: 10px; /* Slight movement to the right */
}

/* Active page style */
.menu-mobile li.current-menu-item a {
    color: var(--accent-color);
    font-weight: 600;
}

body.home .menu-item-home,
body.home li.current-menu-item.menu-item-home {
  display: none !important;
}

/* =========================================
   Mobile Header Fixes
   ========================================= */

.mobile-controls {
    flex-shrink: 0; 
    margin-left: 15px; 
}

@media (max-width: 480px) {
    
    .site-logo a {
        font-size: 18px; 
        letter-spacing: -0.5px; 
        display: block; 
        white-space: nowrap; 
        overflow: hidden; 
        text-overflow: ellipsis;
        max-width: 240px; 
    }

    .header-container {
        padding: 0 15px;
    }
}

/* =========================================
   404 Page Styles
   ========================================= */

.error-404 {
    padding: 80px 0 100px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh; /* Ensures it takes up good vertical space */
}

.error-content {
    max-width: 600px;
    margin: 0 auto;
}

/* Big 404 Number styling */
.error-code {
    font-size: 10rem; /* Very large text */
    font-weight: 800;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px var(--accent-color); /* Outline effect */
    opacity: 0.8;
    margin-bottom: 0;
    font-family: var(--font-sans);
    position: relative;
    display: inline-block;
}

/* Add a glowing effect to the number */
.error-code::after {
    content: '404';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-color);
    opacity: 0.1;
    filter: blur(10px);
    z-index: -1;
}

/* "Palla Fuori" Title */
.error-title {
    font-size: 2.5rem;
    color: #ffffff;
    margin-top: -20px; /* Pull it up closer to the number */
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.error-text {
    font-size: 1.1rem;
    color: #a0aec0;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* Home Button */
.btn-home {
    display: inline-block;
    background-color: var(--accent-color);
    color: #151922; /* Dark text on bright button */
    padding: 15px 35px;
    border-radius: 5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    margin-bottom: 40px;
}

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 209, 197, 0.4); /* Glow effect on hover */
    color: #000;
}

/* Search Form Styling inside 404 */
.error-search p {
    color: #718096;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.error-search form {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.error-search input[type="search"] {
    width: 100%;
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid #2d3748;
    background-color: #1a202c;
    color: #fff;
    outline: none;
    transition: border-color 0.3s;
}

.error-search input[type="search"]:focus {
    border-color: var(--accent-color);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .error-code {
        font-size: 6rem;
    }
    
    .error-title {
        font-size: 1.8rem;
    }
}

#crumbs {
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    text-align: center; 
}

#crumbs a {
    text-decoration: none;
    color: #0073aa; 
}

#crumbs a:hover {
    text-decoration: underline;
}

#crumbs .current {
    font-weight: bold;
    color: rgb(255, 255, 255);
}

aside, .sidebar, .widget-area {
    display: none;
}

.content-wrapper {
    display: flex;
    justify-content: center; 
    width: 100%;
}

article {
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}