/* =========================================
   1. VARIABLES & THEME SETUP
   ========================================= */
:root {
    /* --- FORCED DARK THEME PALETTE --- */
    /* Primary Colors: Greens & Dark Tones */
    --color-primary: #3da556;       /* Bright Green */
    --color-primary-dark: #2d8a42;  /* Darker Green */
    --color-primary-light: #4fc06a; /* Light Green */
    
    /* Secondary & Accents */
    --color-secondary: #d4b76a;     /* Gold/Sand (Tennis Court) */
    --color-secondary-light: #e4c77a;
    --color-accent: #e85d04;        /* Clay Orange */
    --color-accent-hover: #ff7b33;  /* Brighter Orange */
    
    /* Backgrounds (Dark Mode Only) */
    --color-bg: #111111;            /* Deep Black/Gray */
    --color-bg-alt: #1a1a18;        /* Slightly lighter */
    --color-surface: #222220;       /* Surface cards */
    --color-surface-elevated: #2a2a28;
    
    /* Text Colors */
    --color-text: #f0efe9;          /* Off-white */
    --color-text-muted: #a5a5a0;    /* Gray text */
    --color-text-light: #858580;    /* Light gray */
    
    /* Borders & Shadows */
    --color-border: #333330;
    --color-shadow: rgba(0, 0, 0, 0.5);
    --color-shadow-strong: rgba(0, 0, 0, 0.8);

    /* Typography */
    --font-heading: 'Georgia', 'Times New Roman', serif;
    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'Consolas', 'Monaco', monospace;
    
    /* Spacing & Layout */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;
    --max-width-content: 720px;
    --wide-width: 1200px;
    
    /* UI Elements */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* =========================================
   2. GLOBAL RESET & BASE STYLES
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg); /* Enforced Dark Background */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* =========================================
   3. HEADER & NAVIGATION
   ========================================= */
/* Main Header Container */
header.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #111111; /* Solid Dark Background */
    border-bottom: 1px solid rgba(196, 163, 90, 0.2); /* Subtle Gold Line */
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.top-navigation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: 0 var(--space-sm);
    height: 70px; /* Fixed height for consistency */
}

/* --- DESKTOP MENU ("ATP Professional" Style) --- */
@media (min-width: 768px) {
    
    .top-navigation-bar {
        justify-content: center; /* Center the menu on desktop */
    }

    /* Reset default nav styles */
    .site-nav--desktop {
        height: 100%;
        display: flex;
        align-items: center;
    }

    /* Menu List */
    .menu-desktop {
        display: flex;
        list-style: none;
        gap: 0;
        height: 100%;
        margin: 0;
        padding: 0;
    }

    /* Menu Links */
    .menu-desktop a {
        display: flex;
        align-items: center;
        height: 100%;
        padding: 0 25px;
        font-family: var(--font-heading);
        font-weight: 700;
        font-size: 0.95rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #aaaaaa; /* Muted gray default */
        text-decoration: none;
        transition: all 0.2s ease;
        border-bottom: 3px solid transparent;
    }

    /* Hover State */
    .menu-desktop a:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.05);
        border-bottom-color: var(--color-secondary); /* Gold Line */
    }

    /* Active Page State */
    .menu-desktop .current-menu-item a {
        color: #ffffff;
        border-bottom-color: var(--color-accent); /* Orange Line for active */
    }

    /* CRITICAL: Hide Mobile Elements on Desktop */
    #mobile-menu, 
    .mobile-menu-overlay,
    .mobile-controls,
    .menu-mobile,
    ul[class*="menu-mobile"] {
        display: none !important;
    }
}

/* --- MOBILE MENU (Slide-Out Drawer) --- */
@media (max-width: 767px) {
    /* Hide Desktop Menu */
    .site-nav--desktop {
        display: none !important;
    }

    /* Burger Button Position */
    .top-navigation-bar {
        justify-content: flex-end;
    }
    
    .mobile-controls {
        display: block;
    }

    /* The Drawer Container */
    #mobile-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        background: linear-gradient(170deg, #1a1a1a 0%, #0d2e16 100%);
        z-index: 999;
        display: flex !important;
        flex-direction: column;
        padding: 2rem;
        transform: translateX(100%); /* Hidden by default */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }

    /* Open State */
    #mobile-menu.is-open {
        transform: translateX(0);
    }

    /* Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.7);
        backdrop-filter: blur(3px);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

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

    /* Mobile Links */
    .menu-mobile {
        list-style: none;
        margin-top: 2rem;
    }

    .menu-mobile li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .menu-mobile a {
        display: block;
        padding: 15px 0;
        font-family: var(--font-heading);
        font-size: 1.2rem;
        color: #ffffff;
        text-decoration: none;
    }
    
    .menu-mobile a:hover {
        color: var(--color-secondary);
        padding-left: 10px;
    }
}

/* Burger Button Styles */
.burger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    width: 44px;
    height: 44px;
}
.burger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #ffffff;
    margin: 5px auto;
    transition: 0.3s;
}
.burger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-active span:nth-child(2) { opacity: 0; }
.burger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu__close {
    background: none; border: none; font-size: 2rem; color: #fff; align-self: flex-end;
}

/* =========================================
   4. PROGRESS BAR
   ========================================= */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
    width: 0%;
    z-index: 99999;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(232, 93, 4, 0.5);
}

/* Fix for WordPress Admin Bar */
body.admin-bar .progress-bar { top: 32px; }
@media screen and (max-width: 782px) {
    body.admin-bar .progress-bar { top: 46px; }
}

/* =========================================
   5. CONTENT & TYPOGRAPHY
   ========================================= */
main {
    width: 100%;
    max-width: var(--max-width-content);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-sm);
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-text);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: clamp(2rem, 3vw, 3.5rem);
    color: var(--color-primary-light); /* Green Accent */
}

h2 {
    color: var(--color-secondary); /* Gold */
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 10px;
    margin-top: var(--space-xl);
}

p {
    margin-bottom: var(--space-md);
    font-size: 1.1rem;
}

/* Links inside content */
#main-content a {
    color: var(--color-secondary);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 183, 106, 0.3);
}
#main-content a:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.hero-image {
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

/* Table of Contents */
nav[aria-label="Tabla de contenidos"] {
    background: var(--color-surface-elevated);
    padding: 2rem;
    border-radius: var(--radius-md);
    margin: 2rem 0;
    border: 1px solid var(--color-border);
}
nav[aria-label="Tabla de contenidos"] a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
}
nav[aria-label="Tabla de contenidos"] a:hover {
    color: var(--color-primary-light);
}

/* =========================================
   6. FOOTER
   ========================================= */
.site-footer {
    background: #000000;
    padding: 3rem 1rem;
    margin-top: auto;
    border-top: 1px solid #333;
    text-align: center;
    color: #888;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-disclaimer {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.footer-legal {
    font-size: 0.75rem;
    opacity: 0.7;
}

.footer-menu-list {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-menu-list a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

.footer-menu-list a:hover {
    color: var(--color-secondary);
}

/* =========================================
   FIX: H3 HEADER COLOR
   ========================================= */
h3 {
    color: var(--color-secondary-light) !important; 
    margin-top: 2.5rem; 
    margin-bottom: 1rem;
}

/* =========================================
   FOOTER REDESIGN (4-Column Layout)
   ========================================= */

/* 1. Footer Container */
.site-footer {
    /* Deep dark background like the reference */
    background-color: #111111; 
    color: #b0b0b0; /* Soft gray text */
    padding: var(--space-xl) 0 var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto; /* Pushes footer to bottom if page is short */
    font-size: 0.95rem;
}

.footer-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* 2. Grid System */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 equal columns */
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* 3. Typography & Headings */
.footer-heading {
    /* Gold/Yellow color like the reference */
    color: var(--color-secondary, #c4a35a); 
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
    font-weight: 700;
    border-bottom: none; /* Remove default theme borders if any */
    padding-bottom: 0;
}

/* 4. Lists & Links */
.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    margin-bottom: 12px;
    line-height: 1.5;
    color: #b0b0b0;
}

.footer-list a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-list a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* 5. Special Styling for "Important Notices" (Column 1) */
.footer-col--warning .warning-text {
    color: #ff6b6b; /* Reddish color for warnings */
}

.footer-col--warning a {
    color: #ff6b6b;
    font-weight: bold;
}

/* 6. Footer Bottom / Copyright */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-md);
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

/* 7. Responsive Design (Mobile) */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
        gap: var(--space-xl);
        text-align: center; /* Center align text on mobile looks better for footers */
    }
    
    .footer-heading {
        font-size: 1.4rem;
        margin-bottom: var(--space-sm);
    }
}

/* =========================================
   CSS LOGO DESIGN
   ========================================= */

/* Logo Container */
.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-right: auto; /* Pushes nav to the center/right */
    z-index: 101; /* Above other elements */
}

/* 1. The Tennis Ball Icon (Pure CSS) */
.logo-icon {
    position: relative;
    width: 32px;
    height: 32px;
    background: #ccff00; /* Neon Tennis Yellow */
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(204, 255, 0, 0.4); /* Neon Glow */
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* The curve on the ball */
.logo-ball-curve {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 70%;
    height: 70%;
    border-right: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;
    border-radius: 50%;
    opacity: 0.8;
}

/* Animation on Hover */
.site-logo:hover .logo-icon {
    transform: rotate(45deg) scale(1.1);
}

/* 2. The Text */
.logo-text {
    font-family: 'Georgia', serif; /* Premium serif font */
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1;
    text-transform: capitalize;
}

/* 3. The Highlight (Gold part) */
.logo-highlight {
    color: var(--color-secondary); /* Gold color from variables */
    font-style: italic;
    margin-left: 2px;
}

/* Mobile Adjustment */
@media (max-width: 767px) {
    .logo-text {
        font-size: 1.3rem; /* Slightly smaller on phone */
    }
    .logo-icon {
        width: 28px;
        height: 28px;
    }
}

/* =========================================
   404 ERROR PAGE STYLES
   ========================================= */

.error-404-container {
    min-height: 60vh; /* Takes up most of the screen */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    background: var(--color-bg);
}

/* 1. The Tennis Ball (Pure CSS) */
.tennis-ball-scene {
    position: relative;
    width: 100px;
    height: 120px; /* Extra height for bounce */
    margin-bottom: 2rem;
}

.ball {
    width: 80px;
    height: 80px;
    background: #ccff00; /* Tennis Yellow */
    border-radius: 50%;
    position: relative;
    z-index: 2;
    overflow: hidden;
    box-shadow: inset -5px -5px 15px rgba(0,0,0,0.2);
    animation: bounce 1.5s infinite ease-in-out;
}

/* The white curves on the ball */
.ball .line {
    position: absolute;
    width: 70px;
    height: 70px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    opacity: 0.9;
}

.ball .line-1 {
    top: -35px;
    left: 15px;
}

.ball .line-2 {
    bottom: -35px;
    right: 15px;
}

/* Shadow underneath */
.shadow {
    width: 60px;
    height: 10px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    margin: 10px auto 0;
    animation: shadow-scale 1.5s infinite ease-in-out;
    filter: blur(4px);
}

/* 2. Typography */
.error-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--color-accent); /* Orange */
    margin-bottom: 0;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.error-code {
    font-family: var(--font-heading);
    font-size: 8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.05); /* Very subtle background text */
    line-height: 0.8;
    margin-top: -20px;
    margin-bottom: 20px;
    z-index: 0;
}

.error-desc {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    margin-bottom: 3rem;
    max-width: 500px;
}

/* 3. Button */
.btn-home {
    display: inline-block;
    padding: 15px 40px;
    background: var(--color-secondary); /* Gold */
    color: #000000;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 183, 106, 0.3);
}

.btn-home:hover {
    background: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

/* 4. Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes shadow-scale {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(0.6); opacity: 0.2; }
}

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

/* Link styling within breadcrumbs */
#crumbs a {
    text-decoration: none;
    color: #0073aa; 
}

/* Hover effect for links */
#crumbs a:hover {
    text-decoration: underline;
}

/* Current page styling */
#crumbs .current {
    font-weight: bold;
    color: rgb(255, 255, 255);
}

/* Styling for CL Page Template */
.cl-main {
    padding-left: 20px;     /* Left padding */
    padding-right: 20px;    /* Right padding */
    max-width: 1200px;      /* Limit content width */
    margin-left: auto;      /* Center content */
    margin-right: auto;     /* Center content */
    box-sizing: border-box; /* Ensure padding doesn't break layout */
    padding: 0px 24px;

}

/* Mobile adjustments */
@media (max-width: 768px) {
    .cl-main {
        padding-left: 15px;
        padding-right: 15px;
    }
}


/* Guide style */
.guides-list {margin: 40px 0;}
.guide-item {display: flex; gap: 30px; padding: 30px 0; border-bottom: 1px solid #eaeaea;}
.guide-item:last-child {border-bottom: none;}
/* Thumbnail styles */
.guide-thumbnail {flex: 0 0 200px;}
.guide-thumbnail a {display: block; text-decoration: none;}
.guide-thumbnail img {width: 100%; height: auto; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: transform 0.3s ease;}
.guide-thumbnail a:hover img {transform: scale(1.03);}
/* Content styles */
.guide-content {flex: 1; min-width: 0;}
.guide-header {display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; gap: 20px;}
.guide-title {margin: 0; font-size: 1.5em; line-height: 1.3;}
.guide-title a {text-decoration: none;  transition: color 0.2s ease;}
.guide-title a:hover {}
.guide-meta {flex-shrink: 0; font-size: 0.9em;  white-space: nowrap;}
.guide-excerpt { line-height: 1.7; font-size: 1em;}
/* Pagination style */
.guides-pagination {margin: 60px 0 40px; text-align: center;}
.guides-pagination .page-numbers {display: inline-block; padding: 10px 18px; margin: 0 4px; border: 1px solid #ddd; border-radius: 6px; text-decoration: none; color: #333; transition: all 0.2s ease; font-size: 0.95em;}
.guides-pagination .page-numbers.current {background-color: #0073aa; color: white; border-color: #0073aa;}
.guides-pagination .page-numbers:hover:not(.current) {background-color: #f8f8f8; border-color: #0073aa; color: #0073aa;}
@media (max-width: 768px) {
    .guide-item {flex-direction: column; gap: 20px;}
    .guide-thumbnail {flex: 0 0 auto; max-width: 100%;}
    .guide-thumbnail img {max-width: 100%; border-radius: 6px;}
    .guide-header {flex-direction: column; gap: 10px;}
    .guide-meta {white-space: normal;}
    .guides-pagination .page-numbers {padding: 8px 14px; margin: 0 2px;}
}
@media (max-width: 480px) {
    .guide-item {padding: 25px 0;}
    .guide-title {font-size: 1.3em;}
    .guides-pagination .page-numbers {padding: 6px 12px; font-size: 0.9em;}
}

.content-header img {max-width: 100%;}