/* ==========================================================================
   RED DAKAR - DESIGN SYSTEM v4.0 (CINEMATIC TECH & LIGHT/DARK)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700;900&display=swap');

:root {
    /* --- PALETA MODO OSCURO (Default) --- */
    --primary: #f97316;       /* Naranja Dakar */
    --primary-glow: rgba(249, 115, 22, 0.4);
    --bg-main: #0a0a0a;       /* Negro Profundo */
    --bg-card: #141417;       /* Zinc 900 */
    --text-main: #ffffff;
    --text-muted: #a1a1aa;    /* Zinc 400 */
    --border-color: rgba(255, 255, 255, 0.08);
    --glass: rgba(10, 10, 10, 0.7);
    --transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- VARIABLES MODO CLARO --- */
body.light-mode {
    --bg-main: #f4f4f5;       /* Zinc 100 */
    --bg-card: #ffffff;       /* Blanco Puro */
    --text-main: #09090b;     /* Zinc 950 */
    --text-muted: #52525b;    /* Zinc 600 */
    --border-color: rgba(0, 0, 0, 0.1);
    --glass: rgba(244, 244, 245, 0.8);
}

/* --- ESTILOS BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* --- UTILIDADES DE COLOR DINÁMICO (Adiós Tailwind Fijo) --- */
.txt-primary { color: var(--primary) !important; }
.txt-main { color: var(--text-main) !important; }
.txt-muted { color: var(--text-muted) !important; }
.bg-main { background-color: var(--bg-main) !important; }
.bg-card { background-color: var(--bg-card) !important; }
.border-dakar { border-color: var(--border-color) !important; }

/* Ajuste para el texto en Outline en modo claro */
body.light-mode .text-outline {
    -webkit-text-stroke: 1px var(--text-muted);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Montserrat', sans-serif;
    transition: background-color 0.6s ease, color 0.6s ease;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Bloqueo de scroll para menú abierto */
body.no-scroll { overflow: hidden; }

/* Scrollbar Personalizado */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

/* --- HEADER DINÁMICO --- */
.main-header-bar {
    position: fixed;
    top: 0; width: 100%; z-index: 1000;
    padding: 1.5rem 0;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.main-header-bar.scrolled { padding: 1rem 0; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }

.logo {
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-main);
}

/* --- BOTÓN THEME SWITCHER --- */
.theme-switch {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 42px; height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.theme-switch:hover { transform: scale(1.1); border-color: var(--primary); color: var(--primary); }

/* --- HERO SECTION CINEMÁTICO --- */
/* --- HERO SECTION REDEFINIDO (MÁXIMA NITIDEZ) --- */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    background-color: #050505; /* Fondo negro profundo para que la foto resalte */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Evitamos que la imagen se vea lavada */
    image-rendering: auto; 
}

/* EL SECRETO: El Scrim Cinematográfico */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    /* Degradado doble: sombra arriba para el logo y sombra abajo para el título. 
       El centro (entre el 30% y el 70%) queda TOTALMENTE TRANSPARENTE para que la foto sea nítida. */
    background: linear-gradient(to bottom, 
                rgba(0,0,0,0.8) 0%, 
                rgba(0,0,0,0) 30%, 
                rgba(0,0,0,0) 70%, 
                rgba(0,0,0,0.9) 100%);
    z-index: 1;
}

/* Forzamos que en el Hero el texto SIEMPRE sea blanco con sombra para que destaque */
#hero-title, .hero-content p, .hero-content span {
    color: #ffffff !important;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
    position: relative;
    z-index: 2;
}

/* En Modo Claro, no queremos que el Hero se vuelva gris/blanco */
body.light-mode .hero-section::before {
    /* Mantenemos el degradado oscuro para que el texto blanco sea legible 
       y la imagen no se vea lavada con el fondo claro */
    background: linear-gradient(to bottom, 
                rgba(0,0,0,0.7) 0%, 
                rgba(0,0,0,0) 40%, 
                rgba(0,0,0,0) 60%, 
                rgba(0,0,0,0.8) 100%);
}

/* Transición suave para que la foto no "salte" */
#article-hero {
    transition: background-image 0.8s ease-in-out;
}

.hero-content { position: relative; z-index: 2; width: 100%; padding: 0 1.5rem; }

#hero-title {
    font-size: clamp(2.5rem, 8vw, 7.5rem);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -3px;
    margin-bottom: 1.5rem;
}

/* --- TEXT HELPERS (Identidad Dakar) --- */
.text-outline {
    color: transparent;
    -webkit-text-stroke: 1px var(--text-muted);
}
body.light-mode .text-outline { -webkit-text-stroke: 1px var(--text-muted); }

/* --- GRID DE NOTICIAS --- */
.main-content { padding: 6rem 0; }

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* TARJETAS ESTILO DAKAR STUDIOS */
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 3rem; /* EL SELLO DAKAR */
    overflow: hidden;
    transition: var(--transition);
    display: flex; flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}

.article-card-image {
    width: 100%; height: 280px;
    object-fit: cover;
    filter: grayscale(25%); /* Efecto cinemático */
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card:hover .article-card-image {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.article-card-content { padding: 2.5rem; flex-grow: 1; }

.article-card-content h3 {
    font-size: 1.8rem; font-weight: 900;
    text-transform: uppercase; line-height: 1.1; margin-bottom: 1rem;
}

.article-card-content h3 a { color: var(--text-main); text-decoration: none; }

.article-meta {
    font-size: 0.7rem; font-weight: 900;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--primary); margin-bottom: 1rem;
}
/* --- BOTONES PREMIUM --- */
.button-hero, .button-platform-cta, .btn-cta {
    display: inline-block;
    padding: 1.25rem 3rem;
    background: var(--primary);
    color: beige;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 10px 30px var(--primary-glow);
    transition: var(--transition);
}

.button-hero:hover { transform: translateY(-3px); filter: brightness(1.1); }
.read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0.35rem 1.25rem; /* ↓ altura */
    background: var(--primary);

    font-size: 0.7rem;
    letter-spacing: 0.08em;

    color: #000;
    font-weight: 600;
    text-transform: uppercase;

    border-radius: 999px;
    text-decoration: none;

    box-shadow: 0 4px 12px var(--primary-glow);
    transition: all 0.25s ease;
}

.read-more:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}


/* --- HAMBURGUESA MÓVIL --- */
.menu-toggle {
    display: flex; flex-direction: column; justify-content: space-between;
    width: 30px; height: 18px;
    background: transparent; border: none; cursor: pointer; z-index: 2000;
}

.menu-toggle span {
    width: 100%; height: 2px;
    background-color: var(--text-main);
    border-radius: 10px;
    transition: var(--transition);
}

.menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --- PANEL MENÚ MÓVIL (Full Screen Cinematic) --- */
.mobile-menu-panel {
    position: fixed; inset: 0;
    background: var(--bg-main);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 1500;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(-20px);
    transition: var(--transition);
}

.mobile-menu-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }

.mobile-menu-panel ul { list-style: none; text-align: center; }

.mobile-menu-panel ul a {
    font-size: 3rem; font-weight: 900;
    text-transform: uppercase; color: var(--text-main);
    text-decoration: none; letter-spacing: -2px;
    display: block; margin: 1.5rem 0;
    transition: var(--transition);
}

.mobile-menu-panel ul a:hover { color: var(--primary); }

.mobile-social-extra { margin-top: 3rem; display: flex; gap: 2rem; font-size: 1.5rem; }

/* --- PAGINACIÓN --- */
.pagination-btn {
    width: 45px; height: 45px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 900;
    cursor: pointer;
    transition: var(--transition);
}
.pagination-btn.active { background: var(--primary); color: #000; border-color: var(--primary); }

/* --- FOOTER --- */
.main-footer {
    background: var(--bg-card);
    padding: 5rem 0 2rem;
    border-radius: 4rem 4rem 0 0;
    border-top: 1px solid var(--border-color);
}

/* --- AJUSTES MÓVIL (Celulares) --- */
@media (max-width: 768px) {
    #hero-title { font-size: 3.5rem; letter-spacing: -1px; }
    
    .articles-grid {
        grid-template-columns: 1fr;
        padding: 0 1.5rem;
    }

    .article-card { border-radius: 2rem; }
    
    .main-header-bar { padding: 1rem 0; }

    .mobile-menu-panel ul a { font-size: 2.2rem; }
}

/* --- REACCIONES MODERNAS --- */
.reaction-btn-modern {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    border-radius: 99px;
    font-weight: 900;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.reaction-btn-modern i {
    font-size: 1.1rem;
    transition: var(--transition);
}

.reaction-btn-modern:hover {
    border-color: var(--primary);
    color: var(--text-main);
    transform: translateY(-3px);
}

.reaction-btn-modern.selected {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

.reaction-btn-modern.selected i {
    color: #000;
}

/* Ajuste para el modo claro en el cuerpo del artículo */
body.light-mode .prose {
    color: #333 !important;
}

body.light-mode #comments-section {
    background: #ffffff;
    border-color: rgba(0,0,0,0.05);
}

/* --- NOTIFICACIONES TOAST PREMIUM --- */
.toast-notification {
    position: fixed;
    top: 100px;
    right: 25px;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 1.2rem 2.5rem;
    border-radius: 1.5rem;
    border-left: 5px solid var(--primary);
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    z-index: 9999;
    
    /* Animación de entrada */
    opacity: 0;
    visibility: hidden;
    transform: translateX(100px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    gap: 15px;
}

.toast-notification.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.toast-notification p {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin: 0;
}

/* Icono Dakar para el Toast */
.toast-notification::before {
    content: '\f11e'; /* Icono de meta/bandera de FontAwesome */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--primary);
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .toast-notification {
        top: auto;
        bottom: 40px;
        left: 20px;
        right: 20px;
        transform: translateY(100px);
        justify-content: center;
    }
}

.select-filter {
    padding: 0.8rem 1.2rem;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 900;
    cursor: pointer;
    transition: var(--transition);
}

/* --- ESTILOS ESPECÍFICOS PARA PÁGINAS LEGALES --- */

.legal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 3rem;
    padding: 3rem; /* En móvil se ajusta con el media query */
    transition: var(--transition);
}

@media (min-width: 768px) {
    .legal-card { padding: 5rem; }
}

.legal-info-box {
    background-color: rgba(128, 128, 128, 0.05); /* Fondo sutil que sirve en ambos modos */
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
}

.info-label {
    display: block;
    color: var(--text-muted);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 9px;
    margin-bottom: 0.5rem;
}

.legal-text-content h3 {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.legal-text-content p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
}

.legal-list {
    list-style: none;
    padding: 0;
}

.legal-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.legal-important-box {
    background-color: rgba(249, 115, 22, 0.05); /* Naranja muy suave */
    border-left: 4px solid var(--primary);
    padding: 2rem;
    border-radius: 2rem;
}

.legal-important-box h4 {
    color: var(--text-main);
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

/* Corregir el color del Hero en Modo Claro */
body.light-mode .hero-section::before {
    background: linear-gradient(to bottom, rgba(244, 244, 245, 0.5), var(--bg-main));
}

body.light-mode .text-outline {
    -webkit-text-stroke: 1px #000; /* Outline negro en modo claro */
}

/* Ajuste de lectura para artículos */
#article-content p {
    margin-bottom: 1.8rem;
    font-size: 1.15rem;
}

/* En modo claro, queremos que el texto sea más oscuro para contraste */
body.light-mode #article-content {
    color: #27272a !important; /* Zinc 800 */
}

/* Inputs dinámicos */
.bg-main { background-color: var(--bg-main) !important; }
.border-dakar { border-color: var(--border-color) !important; }