﻿/* ================== BASE LAYOUT ================== */
/* ================== THEME TOKENS ================== */

/* ===============================
   VERSION DESKTOP (? 1024px)
   Reacciones más grandes y anchas
   =============================== */
/* =========================
   SIDEBAR TOP IMPRESIONES (PC)
   ========================= */
/* ============================================
   SIDEBAR (versión sobria + plegable)
   ============================================ */

.top-impressions-sidebar {
    position: fixed;
    left: 1.5rem;
    top: 7rem;
    /* tamaño base (expandido) */
    width: 300px;
    max-height: 75vh;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    /* 🎨 Fondo sólido sobrio */
    background: #0d1117;
    /* 🎨 Borde delgado sobrio */
    border: 1px solid #1f2937;
    /* 🎨 Sombra suave, no agresiva */
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
    color: #f3f4f6;
    overflow: hidden;
    z-index: 990;
    /* Animación para expandir/colapsar */
    transition: transform .25s ease;
}
.top-impressions-sidebar--collapsed {
    transform: translateX(-110%) !important;
}
.floating-news-actions {
    position: fixed !important;
    right: 2.2rem !important;
    bottom: 2.6rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.9rem !important;
    z-index: 1200 !important;
}

.floating-btn {
    width: 64px !important;
    height: 64px !important;
    border-radius: 999px !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.7rem !important; /* icono más grande */
    cursor: pointer !important;
    box-shadow: 0 10px 25px rgba(0,0,0,.45) !important;
    background: radial-gradient(circle at top, #1d4ed8, #020617) !important;
    color: #f9fafb !important;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease !important;
}

    .floating-btn:hover {
        transform: translateY(-2px) scale(1.02) !important;
        box-shadow: 0 14px 30px rgba(0,0,0,.55) !important;
    }

    .floating-btn:active {
        transform: translateY(0) scale(0.98) !important;
        box-shadow: 0 6px 14px rgba(0,0,0,.4) !important;
    }

/* Botón principal (aleatorio) */
.floating-btn-main {
    background: radial-gradient(circle at top, #22c55e, #064e3b) !important;
}

/* Botón TOP ⭐ */
.floating-btn-top {
    background: radial-gradient(circle at top, #fbbf24, #7c2d12) !important;
}

/* Botón refrescar ⟳ */
.floating-btn-secondary {
    background: radial-gradient(circle at top, #e5e7eb, #111827) !important;
    color: #0f172a !important;
}

.news-sort-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin: 0 0 1rem 0;
    padding: 0.35rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.news-sort-label {
    padding: 0 0.35rem;
    font-size: 0.86rem;
    font-weight: 700;
    color: #64748b;
}

.news-sort-btn {
    min-width: 92px;
    min-height: 36px;
    padding: 0.42rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #334155;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.news-sort-btn:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.08);
}

.news-sort-btn.is-active {
    background: #0f172a;
    color: #f8fafc;
    border-color: #0f172a;
}

[data-theme="dark"] .news-sort-toolbar {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(148, 163, 184, 0.28);
}

[data-theme="dark"] .news-sort-label {
    color: #cbd5e1;
}

[data-theme="dark"] .news-sort-btn {
    color: #e2e8f0;
}

[data-theme="dark"] .news-sort-btn.is-active {
    background: #38bdf8;
    border-color: #38bdf8;
    color: #082f49;
}

.news-detail-body {
    margin: 0;
    background: #05080d;
    color: #f8fafc;
}

#header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: linear-gradient(180deg, #000, #0c0f14);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

.navbar-brand img {
    width: 54px;
    height: 54px;
}

#header .nav-desktop a {
    color: #fff;
    opacity: .9;
    font-weight: 500;
    text-decoration: none;
}

#header .nav-desktop a:hover {
    opacity: 1;
}

@media (max-width: 991.98px) {
    #navbarNav {
        background: #0b1220;
        border: 1px solid rgba(148, 163, 184, 0.28);
        border-radius: 14px;
        padding: 8px;
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mobile-nav a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 12px;
        border-radius: 12px;
        background: rgba(255, 255, 255, .04);
        border: 1px solid rgba(255, 255, 255, .08);
        color: #fff;
        font-size: 1.05rem;
        text-decoration: none;
    }

    .mobile-nav a:active {
        transform: scale(.98);
    }

    .mobile-sep {
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .12), transparent);
        margin: 4px 2px;
    }
}

.news-detail-page {
    min-height: 100vh;
    padding: 3rem 1rem;
    background: radial-gradient(900px 520px at 20% 0%, rgba(37, 99, 235, 0.14), transparent 60%), linear-gradient(180deg, #05080d 0%, #0a0f18 100%);
}

.news-detail-article {
    width: min(860px, 100%);
    margin: 0 auto;
    color: #f8fafc;
}

.news-detail-back {
    display: inline-flex;
    margin-bottom: 1.5rem;
    color: #60a5fa;
    font-weight: 700;
    text-decoration: none;
}

.news-detail-header h1 {
    margin: 0.85rem 0 0.7rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.04;
    letter-spacing: 0;
    color: #ffffff;
}

.news-detail-author {
    color: #cbd5e1;
    font-size: 0.98rem;
}

.news-detail-image {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.news-detail-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 1.5rem 0;
    overflow: hidden;
    border-radius: 8px;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.news-detail-video.is-social-vertical,
.news-detail-video.is-tweet {
    max-width: 520px;
    aspect-ratio: 4 / 5.2;
    margin-left: auto;
    margin-right: auto;
}

.news-detail-video iframe,
.news-detail-video video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #020617;
}

.news-detail-video-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: -0.5rem 0 1.5rem;
}

.news-video-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0 0.9rem;
    border: 0;
    border-radius: 6px;
    background: #16a34a;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.news-video-upload-btn:disabled {
    cursor: wait;
    opacity: 0.72;
}

.news-video-upload-status {
    color: #cbd5e1;
    font-size: 0.92rem;
}

.news-video-upload-status a {
    color: #93c5fd;
    font-weight: 800;
}

.news-video-upload-status.is-success {
    color: #86efac;
}

.news-video-upload-status.is-error {
    color: #fca5a5;
}

.news-detail-summary {
    font-size: 1.18rem;
    line-height: 1.75;
    color: #f8fafc;
}

.news-detail-context {
    margin-top: 2rem;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(203, 213, 225, 0.28);
    border-bottom: 1px solid rgba(203, 213, 225, 0.28);
}

.news-detail-context h2 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: #ffffff;
}

.news-detail-context p {
    margin: 0;
    color: #e5e7eb;
    line-height: 1.65;
}

.news-detail-source {
    display: inline-flex;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}


/* ============================================
   Sidebar PLEGADO (modo compacto)
   ============================================ */

.top-impressions-sidebar--collapsed {
    width: 62px; /* solo iconos */
    padding: 0.8rem;
}

    .top-impressions-sidebar--collapsed .top-impressions-header,
    .top-impressions-sidebar--collapsed .top-impressions-list {
        display: none; /* ocultamos el contenido */
    }
/* ===============================
   TÍTULOS: permitir 2 líneas + ...
   =============================== */

.top-impressions-text {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Máximo dos líneas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25rem;
    max-height: calc(1.25rem * 2); /* Forzamos el alto total = 2 líneas */
    margin-right: 0.4rem;
    white-space: normal; /* Permite el salto */
}

/* Ícono para colapsar/expandir */
/* Ícono para colapsar/expandir (PC) */
.top-impressions-toggle {
    position: absolute;
    top: 50%;
    right: -30px; /* que salga más hacia afuera */
    transform: translateY(-50%);
    width: 38px;
    height: 78px;
    border-radius: 999px;
    cursor: pointer;
    background-color: Green; /* mismo tono que el fondo dark */
    border: 1px solid #1e293b;
    box-shadow: 0 14px 30px rgba(15,23,42,0.9), 0 0 20px rgba(59,130,246,0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    color: #e5e7eb;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, opacity 0.15s ease;
}

    /* Flecha */
    .top-impressions-toggle .toggle-icon {
        font-size: 1.3rem;
        line-height: 1;
        transition: transform 0.2s ease;
    }

    /* Etiqueta vertical TOP para que se note que es un panel */
    .top-impressions-toggle::after {
        content: "TOP";
        font-size: 0.65rem;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        opacity: 0.8;
    }

    /* Hover más notorio */
    .top-impressions-toggle:hover {
        background: #0b1220;
        box-shadow: 0 18px 40px rgba(15,23,42,0.95), 0 0 28px rgba(59,130,246,0.6);
        transform: translateY(-50%) translateX(1px);
    }

/* Cuando el sidebar esté colapsado, rotamos la flecha */
.top-impressions-sidebar--collapsed .top-impressions-toggle .toggle-icon {
    transform: rotate(180deg);
}



/* título y subtítulo */
.top-impressions-header {
    margin-bottom: 0.6rem;
}

.top-impressions-title {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    opacity: 0.95;
}

.top-impressions-subtitle {
    display: block;
    font-size: 0.78rem;
    color: rgba(209,213,219,0.9);
}

/* lista de noticias */
.top-impressions-list {
    list-style: none;
    margin: 0.4rem 0 0 0;
    padding: 0;
    max-height: 58vh;
    overflow-y: auto;
    scrollbar-width: thin;
}
.top-impressions-visitas {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.05rem;
    font-size: 0.75rem;
}

.top-impressions-score-main {
    font-size: 0.9rem;
    font-weight: 700;
}

.top-impressions-score-sub {
    font-size: 0.7rem;
    opacity: 0.8;
}
/* ============================
   RESALTAR NOTICIA ENCONTRADA
   ============================ */

.news-item--highlight .news-card {
    box-shadow: 0 0 0 2px #fbbf24, 0 18px 40px rgba(250, 204, 21, 0.55);
    transform: translateY(-3px);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}

    .news-item--highlight .news-card::after {
        content: "📍 Aquí está";
        position: absolute;
        top: 10px;
        right: 16px;
        padding: 0.18rem 0.5rem;
        border-radius: 999px;
        font-size: 0.7rem;
        background: rgba(250, 204, 21, 0.96);
        color: #1f2937;
        box-shadow: 0 10px 20px rgba(15,23,42,0.45);
    }

@keyframes highlight-pulse {
    0% {
        transform: translateY(-3px) scale(1);
    }

    50% {
        transform: translateY(-5px) scale(1.01);
    }

    100% {
        transform: translateY(-3px) scale(1);
    }
}

.news-item--highlight .news-card {
    animation: highlight-pulse 1.2s ease-out 2;
}

/* cada item */
.top-impressions-item {
    margin-bottom: 0.35rem;
}

.top-impressions-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.35rem;
    border-radius: 999px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

/* número de ranking */
.top-impressions-rank {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f59e0b;
    color: #000;
}


/* número de visitas */
.top-impressions-visitas {
    font-size: 0.78rem;
    font-weight: 700;
    color: #bfdbfe;
}

/* hover PC */
.top-impressions-link:hover {
    background: rgba(15,23,42,0.85);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(15,23,42,0.9);
}

/* Solo PC: en móvil/tablet NO se muestra este sidebar */
@media (max-width: 1023.98px) {
    .top-impressions-sidebar {
        display: none !important;
    }
}

/* Si la pantalla es muy chica pero igual PC (por ejemplo 1024 de ancho),
   podrías darle un poco más de espacio al contenido principal si lo necesitas */
@media (min-width: 1024px) {
    .news-page {
        /* opcional: un poco más de margen para no chocar con el sidebar */
        margin-left: 6.5rem;
    }
}





@media (min-width: 1024px) {

    .news-actions-bar {
        padding: 1rem 2rem; /* MÁS espacio interior */
        gap: 2.5rem; /* más espacio entre grupos */
        border-radius: 40px; /* más bloque estilo “card” */
        background: rgba(148, 163, 184, 0.18);
        min-height: 65px; /* más alto (más “cacho”) */
    }

        .news-actions-bar .action-metric {
            gap: 0.6rem; /* espacio real entre ícono y número */
        }

        .news-actions-bar .action-btn {
            font-size: 1.7rem; /* emojis más grandes */
            width: 3rem;
            height: 3rem;
        }

        .news-actions-bar .action-count {
            font-size: 1rem; /* números más grandes */
            font-weight: 700;
        }
}
.actions-views {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 0.75rem;
}

.actions-views-number {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    color: #e5e7eb;
    text-shadow: 0 2px 6px rgba(15,23,42,0.9);
}

.actions-views-label {
    margin-top: 0.1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(226,232,240,0.9);
}

/* En móvil, que siga viéndose grande y claro */
@media (max-width: 640px) {
    .actions-views {
        margin-right: 0.5rem;
    }

    .actions-views-number {
        font-size: 1.3rem;
    }
}
:root {
    --bg-page: #f3f4f6;
    --text-main: #0f172a;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --card-shadow: 0 10px 25px rgba(15,23,42,0.06);
    --security-card-bg: linear-gradient(135deg, rgba(254, 242, 242, 0.98), rgba(255, 251, 235, 0.84) 58%, #ffffff 100%);
    --security-card-border: rgba(220, 38, 38, 0.46);
    --security-card-shadow: 0 16px 34px rgba(127, 29, 29, 0.12), 0 0 0 1px rgba(248, 113, 113, 0.16);
    --filter-bg: #f3f4f6;
    --filter-border: #e5e7eb;
    --actions-bg: rgba(15,23,42,0.9);
    --actions-border: rgba(148,163,184,0.45);
    --chip-bg-generic: #f9fafb;
    --chip-border-generic: rgba(148,163,184,0.8);
}

    /* Tema oscuro */
    :root[data-theme="dark"] {
        --bg-page: #020617;
        --text-main: #e5e7eb;
        --text-muted: #9ca3af;
        --card-bg: #020617;
        --card-border: #1f2937;
        --card-shadow: 0 18px 40px rgba(15,23,42,0.9);
        --security-card-bg: linear-gradient(135deg, rgba(127, 29, 29, 0.32), rgba(120, 53, 15, 0.22) 58%, rgba(2, 6, 23, 0.98) 100%);
        --security-card-border: rgba(248, 113, 113, 0.62);
        --security-card-shadow: 0 18px 42px rgba(127, 29, 29, 0.36), 0 0 0 1px rgba(248, 113, 113, 0.16);
        --filter-bg: #020617;
        --filter-border: #1f2937;
        --actions-bg: rgba(15,23,42,0.95);
        --actions-border: rgba(148,163,184,0.4);
        --chip-bg-generic: #020617;
        --chip-border-generic: #334155;
    }
.actions-views-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}

.actions-views-number {
    font-size: 1.5rem; /* número grande */
    font-weight: 800;
    line-height: 1;
    color: #fefce8; /* amarillito suave sobre fondo oscuro */
}

.actions-views-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #e5e7eb;
    opacity: 0.85;
}
@media (min-width: 1024px) {
    .actions-views-number {
        font-size: 1.8rem;
    }
}
/* Transiciones suaves para cambio de tema */
body,
.news-page,
.news-card,
.fuentes-filter,
.news-actions-bar,
.source-chip,
.news-summary,
.news-header-title,
.news-header-subtitle {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}


html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    background: var(--bg-page);
    color: var(--text-main);
}


.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ==========  ESTILOS CNN & ADN  (ESCRITORIO + TELÉFONO)  ========== */

/* CNN */
.news-card.cnn::before {
    background: #b91c1c;
}

.source-chip.cnn {
    border-color: #b91c1c;
    color: #7f1d1d;
    background: #fee2e2;
}

.news-legend-dot.cnn {
    background: #b91c1c;
}

/* ADN */
.news-card.adn::before {
    background: #1d4ed8;
}

.source-chip.adn {
    border-color: #1d4ed8;
    color: #1e3a8a;
    background: #dbeafe;
}

.news-legend-dot.adn {
    background: #1d4ed8;
}
.news-feedback-banner {
    margin-top: 0.5rem;
    margin-bottom: 0.8rem;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(37,99,235,0.10), rgba(56,189,248,0.10));
    border: 1px solid rgba(129,140,248,0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #0f172a;
}

:root[data-theme="dark"] .news-feedback-banner {
    background: linear-gradient(135deg, rgba(37,99,235,0.16), rgba(56,189,248,0.16));
    border-color: rgba(129,140,248,0.7);
    color: #e5e7eb;
}

.news-feedback-emoji {
    font-size: 1.2rem;
}

/* ====== CONTENEDOR ITEM (card + acciones) ====== */

/* Cada <li> será un "item" que contiene la tarjeta y la barra de acciones */
/* ====== CONTENEDOR ITEM (card + acciones) ====== */

/* Cada <li> será un "item" que contiene la tarjeta y la barra de acciones */
/* ====== CONTENEDOR ITEM (card + acciones) ====== */

/* Cada <li> es un item horizontal: tarjeta + barra de acciones */
.news-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    transition-delay: var(--appear-delay, 0s);
}

    .news-item.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* La tarjeta ocupa todo el espacio disponible */
    .news-item .news-card {
        flex: 1;
    }
#themeToggleBtn {
display:none !important ;
}
@keyframes pulse-like {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34,197,94,0.55);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 8px rgba(34,197,94,0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34,197,94,0);
    }
}

/* Aplica un par de pulsos cuando cargan */
.action-btn--like {
    animation: pulse-like 1.4s ease-out 2;
}

/* ====== Barra de acciones (fuera de la tarjeta) ====== */
/* Escritorio: columna a la derecha, fuera del cuadro */
.actions-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #e5e7eb;
    opacity: 0.85;
}

.actions-label-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.25);
}
.news-actions-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    margin-left: 0.4rem;
    margin-right: 0.2rem;
    align-self: center;
    min-width: 60px;
    padding: 0.5rem 0.45rem;
    border-radius: 16px;
    background: var(--actions-bg);
    box-shadow: 0 12px 30px rgba(15,23,42,0.55);
    border: 1px solid var(--actions-border);
    backdrop-filter: blur(14px);
}

.news-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.7);
    background: linear-gradient(135deg, #e5f0ff, #dbeafe);
    color: #1f2937;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(148,163,184,0.6);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

    .theme-toggle-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(148,163,184,0.7);
    }

    .theme-toggle-btn:active {
        transform: translateY(0);
        box-shadow: 0 4px 10px rgba(148,163,184,0.8);
    }

@media (max-width: 640px) {
    .news-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

.theme-toggle-icon {
    font-size: 1.1rem;
}
/* Cada métrica (icono + número) */
.action-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

/* El número al lado/bajo de cada icono */
.action-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e5e7eb;
    text-shadow: 0 1px 2px rgba(15,23,42,0.8);
}

/* Botones de acción, redondos y apretables */
.action-btn {
    background: #ffffff; /* ?? fondo blanco */
    border: 1px solid #cbd5f5;
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a; /* iconos/oscuros (emoji mantiene su color) */
    box-shadow: 0 8px 20px rgba(15,23,42,0.4);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

/* Variantes por tipo (solo cambiamos el borde para dar pista visual) */
.action-btn--like {
    border-color: #22c55e;
}

.action-btn--dislike {
    border-color: #f97316; /* ?? fondo blanco + borde naranjo */
}

.action-btn--copy {
    border-color: #3b82f6;
}

.action-btn--share {
    border-color: #a855f7;
}

.action-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 10px 24px rgba(15,23,42,0.65);
    background-color: #f9fafb;
}

.action-btn:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 4px 12px rgba(15,23,42,0.6);
    opacity: 0.9;
}


/* ====================  MOBILE (? 640px) ======================= */

@media (max-width: 640px) {

    /* En móvil el item se vuelve columna: tarjeta arriba, acciones abajo */
    .news-item {
        flex-direction: column;
        align-items: stretch;
    }

    .news-card {
        flex-direction: column;
        align-items: stretch;
        padding: 0.9rem 0.9rem 1rem;
    }

    /* MÓVIL: barra de acciones como pill horizontal debajo de la noticia */
    .news-actions-bar {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100%;
        margin: 0.6rem 0 0 0 !important;
        padding: 0.5rem 0.9rem !important;
        border-radius: 999px !important;
        background: linear-gradient(135deg, #020617, #0f172a) !important;
        box-shadow: 0 12px 30px rgba(15,23,42,0.85) !important;
        border: 1px solid rgba(30,64,175,0.8) !important;
    }

    .action-metric {
        flex-direction: column;
        align-items: center;
        gap: 0.05rem;
    }

    .action-btn {
        width: 38px;
        height: 38px;
        font-size: 1.3rem;
    }
}

h3 {
    font-size: 28px !important;
}

/* ================== ESTILOS EXISTENTES ================== */

.fuentes-filter {
    margin-top: 1.2rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: var(--filter-bg);
    border: 1px solid var(--filter-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}


.fuentes-filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-right: 0.5rem;
}

/* Chips usados como filtro */
.filter-chip {
    margin-right: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

    .filter-chip.is-active {
        box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(59, 130, 246, 0.7);
        transform: translateY(-1px);
    }

/* Generico por si falta mapping */
.tag-generica {
    background: #4b5563;
}

/* Estilos por página / fuente */
.tag-ciper {
    background: #1d4ed8;
}

.tag-ciudadano {
    background: #16a34a;
}

.tag-biobio {
    background: #0ea5e9;
}

.tag-desconcierto {
    background: #f97316;
}

.tag-24horas {
    background: #dc2626;
}

.tag-radio-uchile {
    background: #1d4ed8;
}

.tag-cnn {
    background: #b91c1c;
}

.tag-elpais {
    background: #0f172a;
}

.tag-interferencia {
    background: #7c3aed;
}

.tag-factos {
    background: #22c55e;
}

.tag-sismos {
    background: #059669;
}

.tag-senapred {
    background: #0369a1;
}

.tag-diariofinanciero {
    background: #f97316;
}

.tag-twitter {
    background: #1d9bf0;
}

.tag-t13 {
    background: #f97316;
}

.news-carousel-li {
    list-style: none;
}

.news-carousel {
    position: relative;
}

    .news-carousel .carousel-track {
        position: relative;
    }

.news-card.carousel-slide {
    display: none;
}

    .news-card.carousel-slide.is-active {
        display: flex;
    }

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 5;
}

    .carousel-arrow:hover {
        opacity: 1;
        transform: translateY(-50%) scale(1.05);
    }

.carousel-prev {
    left: 6px;
}

.carousel-next {
    right: 6px;
}

.news-page {
    max-width: 1100px;
    margin: 0 auto 3rem auto;
    padding: 0 1rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
}


.news-header-title {
    font-size: 2rem;
    font-weight: 800;
    color: #f9fafb; /* color final que quieres */
    text-shadow: 0 0 18px rgba(0,0,0,.7);
    margin-bottom: 0.3rem;
    text-align: left;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.news-header-subtitle {
    /*color: var(--text-muted);*/
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
    color: #e5e7eb;
}


.news-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.news-legend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid rgba(148,163,184,.6);
    background: #f9fafb;
    color: #111827;
}

.news-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

    .news-legend-dot.ciper {
        background: #fbbf24;
    }

    .news-legend-dot.ciudadano {
        background: #22c55e;
    }

    .news-legend-dot.biobio {
        background: #3b82f6;
    }

    .news-legend-dot.desconcierto {
        background: #f97316;
    }

    .news-legend-dot.latercera {
        background: #ec4899;
    }

    .news-legend-dot.radio-uchile {
        background: #6366f1;
    }

    .news-legend-dot.horas24 {
        background: #ef4444;
    }

    .news-legend-dot.sismos {
        background: #ea580c;
    }

    .news-legend-dot.twitter {
        background: #06b6d4;
    }

.news-grid {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

.news-card {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.25s ease;
    position: relative;
    overflow: hidden;
}

.news-card.news-card--security {
    background: var(--security-card-bg);
    border-color: var(--security-card-border);
    box-shadow: var(--security-card-shadow);
}

    .news-card.news-card--security::before {
        width: 7px;
        background: linear-gradient(180deg, #dc2626 0%, #f97316 58%, #f59e0b 100%) !important;
        box-shadow: 0 0 18px rgba(239, 68, 68, 0.38);
    }

    .news-card.news-card--security:hover {
        border-color: rgba(220, 38, 38, 0.68);
        box-shadow: 0 20px 42px rgba(127, 29, 29, 0.18), 0 0 0 1px rgba(248, 113, 113, 0.24);
    }

.badge-security {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.13), rgba(245, 158, 11, 0.14));
    border-left: 3px solid rgba(220, 38, 38, 0.72);
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.85rem;
    color: #dc2626;
}

:root[data-theme="dark"] .badge-security {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(245, 158, 11, 0.16));
    color: #fca5a5;
}


    .news-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: transparent;
    }

    .news-card.ciper::before {
        background: #fbbf24;
    }

    .news-card.ciudadano::before {
        background: #22c55e;
    }

    .news-card.biobio::before {
        background: #3b82f6;
    }

    .news-card.desconcierto::before {
        background: #f97316;
    }

    .news-card.latercera::before {
        background: #ec4899;
    }

    .news-card.radio-uchile::before {
        background: #6366f1;
    }

    .news-card.horas24::before {
        background: #ef4444;
    }

    .news-card.sismos::before {
        background: #ea580c;
    }

    .news-card.twitter::before {
        background: #06b6d4;
    }

    .news-card:hover {
        transform: translateY(-2px);
        border-color: #93c5fd;
        box-shadow: 0 18px 35px rgba(15,23,42,0.12);
    }

.news-image {
    flex: 0 0 230px;
    max-width: 260px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    align-self: center;
    background: #e5e7eb;
}

    .news-image img {
        width: 100%;
        height: 100%;
        max-height: 160px;
        object-fit: cover;
        display: block;
        transform: scale(1.01);
        transition: transform 0.25s ease, opacity 0.25s ease;
        opacity: 0.98;
    }

.news-card:hover .news-image img {
    transform: scale(1.03);
    opacity: 1;
}

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.news-title-row {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-bottom: 0.25rem;
}

.source-logo {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
    background: #0b1120;
    padding: 2px;
    box-shadow: 0 0 0 1px rgba(15,23,42,0.08);
}

.news-title-link {
    text-decoration: none;
    color: #111827;
    flex: 1;
}

    .news-title-link h3 {
        margin: 0;
        font-size: 1rem;
        line-height: 1.4;
        font-weight: 600;
    }

:root[data-theme="dark"] h3 {
    color: #f8fafc !important; /* blanco suave */
}

.news-title-link:hover h3 {
    color: #1d4ed8;
}

.news-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.source-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--chip-border-generic);
    background: var(--chip-bg-generic);
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}


    .source-chip:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 18px rgba(15,23,42,0.12);
    }

.filter-chip {
    cursor: pointer;
}

    .filter-chip.is-active {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        color: #f9fafb;
        border-color: transparent;
        box-shadow: 0 0 0 1px rgba(191,219,254,0.9), 0 10px 22px rgba(37,99,235,0.45);
        transform: translateY(-1px);
    }

    .filter-chip:not(.is-active):hover {
        background: #e5edff;
        border-color: #93c5fd;
    }

.source-chip.ciper {
    border-color: #fbbf24;
    color: #854d0e;
    background: #fef9c3;
}

.source-chip.ciudadano {
    border-color: #22c55e;
    color: #065f46;
    background: #dcfce7;
}

.source-chip.biobio {
    border-color: #3b82f6;
    color: #1d4ed8;
    background: #dbeafe;
}

.source-chip.desconcierto {
    border-color: #f97316;
    color: #9a3412;
    background: #ffedd5;
}

.source-chip.latercera {
    border-color: #ec4899;
    color: #9d174d;
    background: #fce7f3;
}

.source-chip.radio-uchile {
    border-color: #6366f1;
    color: #312e81;
    background: #e0e7ff;
}

.source-chip.horas24 {
    border-color: #ef4444;
    color: #7f1d1d;
    background: #fee2e2;
}

.source-chip.sismos {
    border-color: #ea580c;
    color: #7c2d12;
    background: #ffedd5;
}

.source-chip.twitter {
    border-color: #06b6d4;
    color: #0f172a;
    background: #cffafe;
}

.news-meta-dot {
    font-size: 0.8rem;
    opacity: 0.7;
}

.news-summary {
    margin-top: 0.55rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}


.badge-today {
    padding: 0.08rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

/* ====================  MOBILE (? 640px) ======================= */

@media (max-width: 640px) {

    .fuentes-filter {
        max-height: 90px; /* ajusta a gusto: 70, 80, 100… */
        overflow-y: auto; /* se puede hacer scroll dentro */
        position: relative;
    }

        /* Degradado abajo para que se note que hay más filtros */
        .fuentes-filter::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            height: 22px; /* cuánto “velo” quieres */
            pointer-events: none;
            /* si usas tema oscuro, ajusta colores según tu fondo real */
            /*background: linear-gradient( to bottom, rgba(12, 15, 20, 0), rgba(12, 15, 20, 1) );*/
            border-bottom-left-radius: 12px;
            border-bottom-right-radius: 12px;
        }
    .news-page {
        margin: 1.5rem auto 2rem;
        padding: 0 0.75rem;
    }

    /* En móvil el item se vuelve columna: tarjeta arriba, acciones abajo */
    .news-item {
        flex-direction: column;
        align-items: stretch;
    }

    .news-card {
        flex-direction: column;
        align-items: stretch;
        padding: 0.9rem 0.9rem 1rem;
    }

    .news-image {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
        margin-bottom: 0.7rem;
        border-radius: 10px;
        overflow: hidden;
    }

        .news-image img {
            width: 100%;
            height: auto;
            max-height: none;
        }

    .news-title-row {
        gap: 0.35rem;
    }

    .source-logo {
        width: 20px;
        height: 20px;
    }

    .news-title-link h3 {
        font-size: 1.15rem;
        line-height: 1.35;
        font-weight: 700;
    }

    .news-summary {
        font-size: 0.92rem;
        line-height: 1.45;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .news-meta-row {
        font-size: 0.75rem;
        gap: 0.3rem;
    }

    .source-chip {
        font-size: 0.7rem;
        padding: 0.12rem 0.55rem;
    }

    .badge-today {
        font-size: 0.65rem;
    }

    .news-carousel .carousel-arrow {
        top: auto;
        bottom: 10px;
        transform: none;
    }

    /* MÓVIL: barra de acciones como pill horizontal debajo de la noticia */


   
}
/* ============================
   BOTONES FLOTANTES DERECHA
   ============================ */
/* ============================
   BOTONES FLOTANTES DERECHA
   ============================ */
.floating-news-actions {
    position: fixed;
    right: 1.5rem;
    top: 45%;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    z-index: 999; /* por encima de las cards y header */
    pointer-events: none; /* truco: solo los botones reciben eventos */
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

    /* Estado oculto (scroll hacia abajo) */
    .floating-news-actions.is-hidden {
        opacity: 0;
        transform: translateX(90px); /* se va hacia la derecha */
        pointer-events: none;
    }

/* Versión base de los botones (mobile / tablet) */
.floating-btn {
    pointer-events: auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(148,163,184,0.8);
    background: #0f172a;
    color: #f9fafb;
    font-size: 1.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(15,23,42,0.85);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.16s ease;
}

/* Botón “principal” (aleatorio): azul degradado */
.floating-btn-main {
    /* 💚 Degradado verde más moderno */
    background: radial-gradient(circle at 30% 30%, #bbf7d0, #22c55e);
    border-color: #16a34a;
    /* ✨ Glow verde alrededor + sombra profunda */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.65), 0 0 28px rgba(34, 197, 94, 0.75);
    /* por si acaso, asegurar forma redonda (ya la tienes en .floating-btn) */
    border-radius: 50%;
}

    /* Hover un poco más llamativo en PC */
    .floating-btn-main:hover {
        background: radial-gradient(circle at 25% 20%, #dcfce7, #22c55e);
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 40px rgba(34, 197, 94, 0.9);
        transform: translateY(-3px) scale(1.06);
    }

    /* Click (active) */
    .floating-btn-main:active {
        transform: translateY(0) scale(0.97);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 24px rgba(34, 197, 94, 0.7);
    }

/* Botón “secundario” (actualizar): tono más neutro */
.floating-btn-secondary {
    background: radial-gradient(circle at 30% 30%, #f1f5f9, #94a3b8);
    color: #0f172a;
    border-color: #cbd5f5;
    box-shadow: 0 12px 30px rgba(15,23,42,0.55), 0 0 18px rgba(148,163,184,0.5);
}

.floating-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 18px 40px rgba(15,23,42,0.95);
}

.floating-btn:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 10px 24px rgba(15,23,42,0.9);
    opacity: 0.92;
}

/* Animación de entrada + latido inicial */
@keyframes floating-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Latido suave repetitivo (solo box-shadow para no pelear con hover) */
@keyframes floating-breath {
    0% {
        box-shadow: 0 15px 35px rgba(15,23,42,0.85), 0 0 25px rgba(37,99,235,0.25);
    }

    50% {
        box-shadow: 0 18px 45px rgba(15,23,42,0.95), 0 0 40px rgba(37,99,235,0.45);
    }

    100% {
        box-shadow: 0 15px 35px rgba(15,23,42,0.85), 0 0 25px rgba(37,99,235,0.25);
    }
}

/* Aplicamos animaciones al botón principal */
.floating-btn-main {
    animation: floating-pulse 0.9s ease-out 1, floating-breath 8s ease-in-out infinite 3s;
}

/* Responsive: en móvil las llevamos abajo a la derecha */
@media (max-width: 640px) {
    .floating-news-actions {
        top: auto;
        bottom: 1.5rem;
        right: 1.1rem;
        flex-direction: column-reverse; /* ⟳ abajo, 🔀 arriba */
        gap: 0.5rem;
    }

    .floating-btn {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
}
@media (max-width: 640px) {
    .floating-news-actions {
        bottom: 3.2rem; /* antes 1.5rem → lo subimos visualmente */
    }
}
/* ============================
   BOTONES FLOTANTES GRANDES (PC)
   ============================ */
@media (min-width: 1024px) {

    .floating-news-actions {
        right: 2.2rem;
        top: 40%;
        gap: 1.2rem;
    }

        /* cuando se “pegan” al header al scrollear harto */
        .floating-news-actions.docked-top {
            top: 96px; /* aprox. altura del header */
        }

    .floating-btn {
        width: 78px; /* MÁS GRANDE */
        height: 78px;
        font-size: 2.1rem; /* ÍCONO GRANDE */
        border-radius: 50%;
        box-shadow: 0 18px 55px rgba(0,0,0,0.45), 0 0 35px rgba(59,130,246,0.45); /* halo azul suave */
        transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.12s ease, background-color 0.2s ease;
    }

        /* EFECTO HOVER PC MUY PREMIUM */
        .floating-btn:hover {
            transform: translateY(-6px) scale(1.07);
            box-shadow: 0 25px 70px rgba(0,0,0,0.55), 0 0 55px rgba(59,130,246,0.55);
        }

        .floating-btn:active {
            transform: translateY(0px) scale(0.96);
            box-shadow: 0 15px 40px rgba(0,0,0,0.55), 0 0 35px rgba(59,130,246,0.5);
        }
}

.action-btn {
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
}
/* ===========================
   PANEL MÓVIL TOP DESTACADOS
   =========================== */

.top-mobile-panel {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none; /* se muestra con .is-open */
}

/* Fondo oscuro semitransparente */
.top-mobile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0);
    backdrop-filter: blur(0px);
    transition: background 0.35s ease, backdrop-filter 0.35s ease;
}

.top-mobile-panel.is-open .top-mobile-backdrop {
    background: rgba(15,23,42,0.75);
    backdrop-filter: blur(4px);
}


/* Tarjeta tipo bottom-sheet */
/* Card tipo bottom-sheet */
.top-mobile-card {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 75vh;
    padding: 0.9rem 1rem 1.1rem;
    border-radius: 18px 18px 0 0;
    background: #020617;
    color: #e5e7eb;
    box-shadow: 0 -20px 40px rgba(0,0,0,0.75);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    /* --- ANIMACIÓN --- */
    transform: translateY(100%); /* empieza fuera de pantalla */
    opacity: 0;
    transition: transform 0.38s cubic-bezier(.32, .72, 0, 1), opacity 0.38s ease;
}

/* Cuando el panel general está abierto */
.top-mobile-panel.is-open .top-mobile-card {
    transform: translateY(0); /* sube suavemente */
    opacity: 1;
}


/* Cabecera del panel */
.top-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.top-mobile-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.top-mobile-subtitle {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* Botón cerrar */
.top-mobile-close {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.7);
    background: #020617;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Lista interna */
.top-mobile-list {
    list-style: none;
    padding: 0;
    margin: 0.2rem 0 0 0;
    overflow-y: auto;
    max-height: 60vh;
}

/* Cada ítem del TOP en móvil */
.top-mobile-item + .top-mobile-item {
    margin-top: 0.4rem;
}

.top-mobile-link {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(75,85,99,0.9);
    background: rgba(15,23,42,0.9);
    padding: 0.55rem 0.75rem;
    display: flex;
    text-align: left;
    color: inherit;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

    .top-mobile-link:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(15,23,42,0.9);
        border-color: rgba(96,165,250,0.9);
    }

.top-mobile-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.top-mobile-text {
    font-size: 0.9rem;
    line-height: 1.35;
}

.top-mobile-meta {
    font-size: 0.75rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Mostrar panel cuando tenga la clase is-open */
/* Mostrar panel cuando tenga la clase is-open */
.top-mobile-panel.is-open {
    display: block; /* o display: flex, si quisieras, pero block va perfecto */
}


/* Solo tiene sentido en móviles / tablets chicos */
@media (min-width: 992px) {
    .top-mobile-panel {
        display: none !important;
    }
}

/* Botón TOP pequeño ajuste visual (opcional) */
.floating-btn-top {
    font-size: 1.4rem;
}

/* ============================
   LISTADO COMPACTO DE NOTICIAS
   ============================ */

.news-grid {
    gap: 0.85rem;
    margin-top: 1rem;
}

.news-item {
    gap: 0.75rem;
}

.news-card {
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
}

.news-image {
    flex: 0 0 170px;
    max-width: 170px;
    border-radius: 8px;
}

.news-image img {
    max-height: 110px;
}

.news-title-link h3,
:root[data-theme="dark"] .news-title-link h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 1.28rem !important;
    line-height: 1.22 !important;
    font-weight: 700;
}

.news-meta-row {
    gap: 0.28rem;
    margin-top: 0.15rem;
    font-size: 0.76rem;
}

.source-chip {
    padding: 0.12rem 0.55rem;
    font-size: 0.68rem;
}

.badge-security {
    padding: 1px 6px !important;
    font-size: 0.72rem !important;
}

.badge-today {
    padding: 0.05rem 0.42rem;
    font-size: 0.64rem;
}

.news-summary {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 0.42rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.82rem;
    line-height: 1.42;
}

.news-actions-bar {
    gap: 0.45rem;
    min-width: 232px;
    padding: 0.42rem 0.55rem;
    border-radius: 12px;
}

.actions-views-number {
    font-size: 1.2rem;
}

.actions-views-label {
    font-size: 0.62rem;
}

.action-btn {
    width: 30px;
    height: 30px;
    font-size: 1rem;
}

.action-count {
    font-size: 0.68rem;
}

@media (max-width: 640px) {
    .news-grid {
        gap: 1rem;
    }

    .news-card {
        padding: 0.75rem;
    }

    .news-image {
        max-width: 100%;
    }

    .news-image img {
        max-height: 170px;
    }

    .news-title-link h3,
    :root[data-theme="dark"] .news-title-link h3 {
        -webkit-line-clamp: 3;
        font-size: 1.08rem !important;
    }

    .news-summary {
        -webkit-line-clamp: 2;
        font-size: 0.82rem;
    }

    .news-actions-bar {
        min-width: 0;
        margin-top: 0.45rem !important;
        padding: 0.42rem 0.7rem !important;
    }

    .action-btn {
        width: 34px;
        height: 34px;
    }
}
