/* ==========================================================================
   CSS PRINCIPAL - ESTILO XATAKA PREMIUM (CON MODOS CLARO Y OSCURO)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES DE DISEÑO & TOKENS DE COLOR
   -------------------------------------------------------------------------- */
:root {
    /* Fuentes */
    --font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Tema Oscuro por Defecto */
    --bg-main: hsl(224, 25%, 12%);
    --bg-card: hsl(224, 25%, 16%);
    --bg-card-hover: hsl(224, 25%, 19%);
    --bg-header: hsla(224, 25%, 12%, 0.85);
    --border-color: hsla(224, 25%, 25%, 0.6);
    --border-color-hover: hsla(224, 25%, 35%, 0.8);
    
    --text-primary: hsl(0, 0%, 95%);
    --text-secondary: hsl(224, 12%, 75%);
    --text-muted: hsl(224, 12%, 55%);
    
    /* Accents */
    --accent: hsl(214, 100%, 50%); /* ChutDigital Blue */
    --accent-rgb: 0, 102, 255;
    --accent-hover: hsl(214, 100%, 55%);
    --accent-glow: hsla(214, 100%, 50%, 0.2);
    
    --meta-bg: hsla(214, 100%, 50%, 0.1);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    
    /* Anuncios */
    --ad-sim-bg: hsl(224, 25%, 9%);
    --ad-sim-border: dashed 2px hsla(214, 100%, 50%, 0.3);
    --ad-sim-text: hsl(224, 12%, 70%);

    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modificaciones para Modo Claro */
html.dark {
    /* El modo oscuro es el por defecto, pero forzamos variables para coherencia */
}

html:not(.dark) {
    --bg-main: hsl(220, 20%, 97%);
    --bg-card: hsl(0, 0%, 100%);
    --bg-card-hover: hsl(220, 20%, 95%);
    --bg-header: rgba(255, 255, 255, 0.85);
    --border-color: hsla(220, 20%, 88%, 0.7);
    --border-color-hover: hsla(220, 20%, 80%, 0.9);
    
    --text-primary: hsl(224, 25%, 12%);
    --text-secondary: hsl(224, 12%, 35%);
    --text-muted: hsl(224, 10%, 50%);
    
    --accent: hsl(214, 100%, 45%);
    --accent-rgb: 0, 92, 230;
    --accent-hover: hsl(214, 100%, 40%);
    --accent-glow: hsla(214, 100%, 45%, 0.15);
    
    --meta-bg: hsla(214, 100%, 45%, 0.08);
    --shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
    
    --ad-sim-bg: hsl(220, 20%, 92%);
    --ad-sim-border: dashed 2px hsla(214, 100%, 45%, 0.3);
    --ad-sim-text: hsl(224, 12%, 40%);
}

/* --------------------------------------------------------------------------
   2. REINICIO & ESTILOS BASE
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

input, button, textarea {
    font-family: inherit;
    background: none;
    border: none;
    outline: none;
}

button {
    cursor: pointer;
}

.site-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* --------------------------------------------------------------------------
   3. CABECERA & NAVEGACIÓN (HEADER)
   -------------------------------------------------------------------------- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

/* Logotipo */
.logo {
    display: flex;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 24px;
    letter-spacing: -0.5px;
}

.site-logo-img {
    height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
    /* Efecto de borde blanco ajustado a la silueta de las letras (para PNGs transparentes) */
    filter: drop-shadow(1.5px 0 0 #ffffff) 
            drop-shadow(-1.5px 0 0 #ffffff) 
            drop-shadow(0 1.5px 0 #ffffff) 
            drop-shadow(0 -1.5px 0 #ffffff);
}

.footer-logo .site-logo-img {
    height: 50px;
}

/* Navegación Desktop */
.nav-desktop {
    display: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 24px;
}

.nav-links a {
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 8px 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Acciones en Header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Buscador */
.search-form {
    display: none;
    align-items: center;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 4px 6px 4px 16px;
    max-width: 220px;
    transition: var(--transition);
}

.search-form:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input {
    width: 100%;
    font-size: 14px;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: 50%;
    background-color: var(--bg-card);
    transition: var(--transition);
}

.search-btn:hover {
    color: var(--accent);
    background-color: var(--bg-card-hover);
}

/* Dropdown Autocompletado */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    z-index: 2000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
}

.autocomplete-dropdown.active {
    display: flex;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: var(--bg-card-hover);
}

.autocomplete-item-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.autocomplete-item-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.autocomplete-item-title {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.autocomplete-item-cat {
    font-size: 11px;
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 4px;
}

.autocomplete-loading,
.autocomplete-no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Interruptor Tema */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--accent);
    background-color: var(--bg-card);
    border-color: var(--accent);
}

/* Alternancia de iconos según tema */
html.dark .sun-icon { display: block; }
html.dark .moon-icon { display: none; }
html:not(.dark) .sun-icon { display: none; }
html:not(.dark) .moon-icon { display: block; }

/* Botón Hamburguesa móvil */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2.5px;
    background-color: var(--text-primary);
    border-radius: 4px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Menú móvil desplegable */
.mobile-nav-menu {
    display: none;
    position: fixed;
    top: 71px;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    padding: 20px;
    box-shadow: var(--shadow);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.mobile-nav-menu.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.mobile-nav-links a {
    display: block;
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    color: var(--accent);
}

.mobile-search-box form {
    display: flex;
    gap: 8px;
}

.mobile-search-input {
    flex-grow: 1;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.mobile-search-btn {
    background-color: var(--accent);
    color: #000;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
}

/* Contenedores de Anuncios */
.header-ad-wrap {
    display: flex;
    justify-content: center;
    padding: 15px 0 0 0;
}

.footer-ad-wrap {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

/* --------------------------------------------------------------------------
   4. HERO GRID DE PORTADA (DESTACADOS)
   -------------------------------------------------------------------------- */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
    margin-top: 16px;
}

/* Tarjeta Hero General */
.hero-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: var(--shadow-sm);
}

.hero-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(0deg, rgba(10, 15, 25, 0.9) 0%, rgba(10, 15, 25, 0.4) 60%, rgba(10, 15, 25, 0.1) 100%);
    transition: var(--transition);
}

/* Para el modo claro, cambiamos el gradiente ligeramente para legibilidad */
html:not(.dark) .hero-card-overlay {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 65%, rgba(0, 0, 0, 0.15) 100%);
}

.hero-card-content {
    position: relative;
    z-index: 3;
    padding: 24px;
    color: #fff; /* Siempre blanco sobre el fondo oscuro del overlay */
}

.hero-tag {
    display: inline-block;
    background-color: var(--accent);
    color: #000;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    gap: 12px;
}

.hero-card:hover .hero-card-img {
    transform: scale(1.04);
}

.hero-card:hover .hero-card-overlay {
    opacity: 0.95;
}

/* --------------------------------------------------------------------------
   5. DISEÑO DE COLUMNAS PRINCIPAL + SIDEBAR
   -------------------------------------------------------------------------- */
.columns-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
    margin-bottom: 60px;
}

/* --------------------------------------------------------------------------
   6. FEED DE ARTÍCULOS (LISTADO)
   -------------------------------------------------------------------------- */
.section-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--accent);
    border-radius: 4px;
}

.articles-feed {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Tarjeta de artículo del feed */
.post-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.post-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.post-card-img-wrap {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.post-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-card:hover .post-card-img {
    transform: scale(1.03);
}

.post-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.post-card-header {
    margin-bottom: 12px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
}

.post-card-category {
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card-divider {
    color: var(--text-muted);
}

.post-card-date {
    color: var(--text-muted);
}

.post-card-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

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

.post-card-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.post-card-author {
    font-weight: 600;
}

.post-card-readtime {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Mensajes de buscador vacío */
.no-results {
    text-align: center;
    padding: 40px 20px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--bg-card);
}

.no-results h3 {
    margin-bottom: 8px;
}

.no-results p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.btn-back {
    display: inline-block;
    background-color: var(--accent);
    color: #000;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
}

.btn-back:hover {
    background-color: var(--accent-hover);
}

/* --------------------------------------------------------------------------
   7. BARRA LATERAL (SIDEBAR)
   -------------------------------------------------------------------------- */
.sidebar-area {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.2px;
    margin-bottom: 16px;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 8px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent);
}

.about-widget p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Widget de publicidad en Sidebar */
.ad-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ad-widget-label {
    align-self: flex-start;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

/* Lista Popular */
.popular-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.popular-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.popular-rank {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    color: var(--border-color-hover);
    transition: var(--transition);
}

.popular-item:hover .popular-rank {
    color: var(--accent);
}

.popular-item-info {
    display: flex;
    flex-direction: column;
}

.popular-category {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
}

.popular-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    margin-top: 2px;
}

.popular-item:hover .popular-title {
    color: var(--accent);
}

/* Formulario Boletín */
.newsletter-widget p {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-input {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.newsletter-input:focus {
    border-color: var(--accent);
}

.newsletter-btn {
    background-color: var(--accent);
    color: #000;
    font-weight: 700;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: center;
    transition: var(--transition);
}

.newsletter-btn:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Redes Sociales en Footer */
.social-links {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.social-links a:hover {
    background-color: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   8. ARTÍCULO DETALLADO (READING VIEW)
   -------------------------------------------------------------------------- */
.article-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-top: 16px;
}

.article-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}

.article-body {
    padding: 24px;
}

/* Encabezado del artículo */
.article-header {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.article-category {
    display: inline-block;
    background-color: var(--meta-bg);
    color: var(--accent);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.article-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.article-meta-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-meta-author {
    font-weight: 700;
    color: var(--text-primary);
}

/* Tabla de Contenidos Dinámica */
.table-of-contents {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
}

.toc-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-list a {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.toc-list a::before {
    content: "•";
    color: var(--accent);
    font-weight: bold;
}

.toc-list a:hover {
    color: var(--accent);
    padding-left: 4px;
}

/* Estilos de Contenido del Artículo */
.article-rich-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-rich-text p {
    margin-bottom: 20px;
}

.article-rich-text a {
    color: var(--accent);
    text-decoration: underline;
    font-weight: 600;
    transition: var(--transition);
}

.article-rich-text a:hover {
    color: var(--accent-hover);
}

.article-rich-text h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 36px;
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    scroll-margin-top: 90px; /* Para no quedar tapado por el header al navegar por el TOC */
}

.article-rich-text h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 12px;
    scroll-margin-top: 90px;
}

.article-rich-text ul,
.article-rich-text ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.article-rich-text li {
    margin-bottom: 8px;
}

.article-rich-text strong {
    color: var(--text-primary);
}

.article-rich-text blockquote {
    border-left: 4px solid var(--accent);
    padding: 12px 20px;
    margin: 24px 0;
    background-color: var(--bg-main);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-primary);
}

.article-rich-text code {
    background-color: var(--bg-main);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 14px;
}

/* Enlaces de compartir */
.share-article {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.share-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.share-btn-wrap {
    display: flex;
    gap: 8px;
}

.share-social-btn {
    background-color: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.share-social-btn:hover {
    background-color: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   9. PÁGINAS LEGALES Y DE CONTACTO
   -------------------------------------------------------------------------- */
.legal-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-sm);
    margin-top: 16px;
    margin-bottom: 40px;
}

.legal-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.legal-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.legal-content h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 12px;
}

.legal-content p, .legal-content ul {
    font-size: 14.5px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}

.legal-content ul {
    padding-left: 20px;
}

.legal-content li {
    margin-bottom: 8px;
}

/* Formulario de Contacto */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
}

.form-control:focus {
    border-color: var(--accent);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-submit-btn {
    background-color: var(--accent);
    color: #000;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    align-self: flex-start;
    transition: var(--transition);
}

.form-submit-btn:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* --------------------------------------------------------------------------
   10. SIMULADORES DE GOOGLE ADSENSE (DISEÑO PREMIUM)
   -------------------------------------------------------------------------- */
.adsense-simulator-box {
    background-color: var(--ad-sim-bg);
    border: var(--ad-sim-border);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.ads-sim-label {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--accent);
    color: #000;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border-bottom-left-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

.ads-sim-content {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: auto;
}

.ads-sim-icon-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 50%;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ads-sim-details {
    display: flex;
    flex-direction: column;
}

.ads-sim-details h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.ads-sim-details p {
    font-size: 11px;
    color: var(--text-muted);
}

.ads-sim-details code {
    background-color: var(--bg-card);
    color: var(--accent);
    padding: 1px 4px;
    border-radius: var(--radius-sm);
}

.ads-sim-details small {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Simulador de Barra de Anclaje (Bottom Anchor) */
.adsense-anchor-simulator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: hsl(224, 25%, 10%);
    border-top: 2px solid var(--accent);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

html:not(.dark) .adsense-anchor-simulator {
    background-color: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.adsense-anchor-close {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.adsense-anchor-close:hover {
    background-color: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.adsense-anchor-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ads-sim-icon {
    font-size: 18px;
}

.ads-sim-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.ads-sim-text span {
    color: var(--text-muted);
}

/* Contenedor de Anuncios reales de AdSense */
.adsense-container {
    display: flex;
    flex-direction: column;
    position: relative;
}

.adsense-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

/* --------------------------------------------------------------------------
   11. BANNER FLOTANTE DE COOKIES (GDPR / PRIVACIDAD)
   -------------------------------------------------------------------------- */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: none; /* Controlado por JS */
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html:not(.dark) .cookie-banner {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.cookie-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.cookie-icon {
    font-size: 28px;
    line-height: 1;
}

.cookie-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cookie-content a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cookie-btn {
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.cookie-accept {
    background-color: var(--accent);
    color: #000;
}

.cookie-accept:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 10px var(--accent-glow);
}

.cookie-decline {
    background-color: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.cookie-decline:hover {
    background-color: var(--bg-card-hover);
}

/* --------------------------------------------------------------------------
   12. PANEL DE ADMINISTRACIÓN (ADMIN STYLES)
   -------------------------------------------------------------------------- */
.admin-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-top: 16px;
    margin-bottom: 40px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-badge {
    background-color: var(--accent);
    color: #000;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13.5px;
}

.btn-logout {
    font-size: 13px;
    font-weight: 700;
    color: hsl(0, 84%, 60%);
    border: 1px solid hsla(0, 84%, 60%, 0.3);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.btn-logout:hover {
    background-color: hsla(0, 84%, 60%, 0.1);
}

/* Login box */
.login-box {
    max-width: 400px;
    margin: 80px auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.admin-table th {
    font-weight: 700;
    color: var(--text-primary);
}

.admin-table td {
    color: var(--text-secondary);
}

.admin-action-links {
    display: flex;
    gap: 12px;
}

.link-delete {
    color: hsl(0, 84%, 60%);
}

.link-delete:hover {
    text-decoration: underline;
}

.admin-section-actions {
    margin-bottom: 24px;
}

.btn-create-post {
    display: inline-block;
    background-color: var(--accent);
    color: #000;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.btn-create-post:hover {
    background-color: var(--accent-hover);
}

/* Alert Boxes de Admin */
.alert-box {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

.alert-success {
    background-color: hsla(145, 80%, 40%, 0.15);
    border: 1px solid hsl(145, 80%, 40%);
    color: hsl(145, 80%, 45%);
}

.alert-danger {
    background-color: hsla(0, 84%, 60%, 0.1);
    border: 1px solid hsl(0, 84%, 60%);
    color: hsl(0, 84%, 65%);
}

/* --------------------------------------------------------------------------
   13. PIE DE PÁGINA (FOOTER)
   -------------------------------------------------------------------------- */
.main-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 20px;
    margin-top: auto;
}

.footer-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 20px;
    height: 2px;
    background-color: var(--accent);
}

.footer-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-logo {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 22px;
    margin-bottom: 16px;
}

.footer-logo .logo-brand {
    color: var(--text-primary);
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col ul a {
    font-size: 13.5px;
    color: var(--text-secondary);
}

.footer-col ul a:hover {
    color: var(--accent);
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.footer-bottom-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.disclaimer-text {
    font-style: italic;
}

/* --------------------------------------------------------------------------
   14. ANIMACIONES (KEYFRAMES)
   -------------------------------------------------------------------------- */
@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   15. MEDIA QUERIES (DISEÑO RESPONSIVO)
   -------------------------------------------------------------------------- */

/* Tablet Portrait (768px y superiores) */
@min-media-width-768 {
    /* Aquí se activan estilos para tablets */
}

@media (min-width: 768px) {
    .header-container {
        height: auto !important;
        min-height: 70px;
        padding: 12px 20px !important;
    }
    
    .nav-desktop {
        display: block;
    }
    
    .nav-desktop-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
    
    .nav-row-1,
    .nav-row-2 {
        gap: 20px !important;
    }
    
    .nav-row-1 a,
    .nav-row-2 a {
        padding: 4px 0 !important;
    }
    
    
    .search-form {
        display: flex;
    }
    
    .hamburger {
        display: none;
    }
    
    .hero-grid {
        grid-template-columns: 2fr 1fr;
        height: 480px;
    }
    
    .hero-card {
        height: 100%;
    }
    
    .hero-card-secondary-wrap {
        display: grid;
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
        gap: 16px;
        height: 100%;
    }
    
    .hero-card-secondary-wrap .hero-card-content {
        padding: 20px;
    }
    
    .hero-title {
        font-size: 18px;
    }
    
    .hero-card-principal .hero-title {
        font-size: 32px;
    }
    
    .columns-layout {
        grid-template-columns: 1fr 300px;
    }
    
    .post-card {
        flex-direction: row;
        height: 240px;
    }
    
    .post-card-img-wrap {
        width: 350px;
        height: 100%;
        flex-shrink: 0;
    }
    
    .article-title {
        font-size: 36px;
    }
    
    .article-body {
        padding: 40px;
    }
    
    .footer-container {
        grid-template-columns: 2fr 1fr 1fr;
    }
    
    .footer-bottom-wrap {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .cookie-banner {
        max-width: 500px;
        left: auto;
        right: 24px;
        bottom: 24px;
    }
}

/* Escritorio Ancho (1024px y superiores) */
@media (min-width: 1024px) {
    .columns-layout {
        grid-template-columns: 1fr 320px;
        gap: 40px;
    }
    
    .sidebar-widget {
        padding: 28px;
    }
}

/* --------------------------------------------------------------------------
   16. ESTILOS DE MENÚ DESPLEGABLE PREMIUM (DROPDOWN)
   -------------------------------------------------------------------------- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Icono de flecha giratoria */
.nav-dropdown-toggle svg {
    transition: transform 0.3s ease;
}
.nav-dropdown:hover .nav-dropdown-toggle svg {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 12px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    color: var(--text-secondary) !important;
    transition: var(--transition);
    text-align: left;
}

.nav-dropdown-menu a::after {
    display: none !important; /* Quitar la línea inferior del menú principal */
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
    color: var(--accent) !important;
    background-color: hsla(174, 100%, 41%, 0.08);
}
