/**
 * Yurivisión Portal — Design System (docs/07_DESIGN_SYSTEM.md)
 */

:root {
    --yv-primary: #0755A5;
    --yv-primary-dark: #063B73;
    --yv-primary-light: #0A6FD4;
    --yv-accent-yellow: #FFD200;
    --yv-accent-red: #E11D2E;
    --yv-news-red: #D91E2E;
    --yv-burgundy: #8B1A24;
    --yv-amazon-green: #1F6B4E;
    --yv-amazon-green-dark: #145239;
    --yv-amazon-teal: #0D9488;
    --yv-ink: #111827;
    --yv-muted: #6B7280;
    --yv-border: #E5E7EB;
    --yv-surface: #FFFFFF;
    --yv-surface-soft: #F7F8FA;
    --yv-success: #15803D;

    --font-display: 'Montserrat', 'Arial Narrow', 'Helvetica Neue', sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Escala tipográfica — empresa de comunicaciones / radial */
    --text-display: clamp(2.25rem, 5vw, 3.75rem);
    --text-h1: clamp(1.875rem, 3.5vw, 3rem);
    --text-h2: clamp(1.5rem, 2.8vw, 2.25rem);
    --text-h3: clamp(1.25rem, 2.2vw, 1.75rem);
    --text-h4: clamp(1.0625rem, 1.8vw, 1.375rem);
    --text-body-lg: 1.125rem;
    --text-body: 1rem;
    --text-subtitle: 0.9375rem;
    --text-small: 0.875rem;
    --text-ui: 0.8125rem;
    --text-caption: 0.75rem;
    --text-overline: 0.6875rem;
    --text-micro: 0.625rem;

    --leading-tight: 1.12;
    --leading-snug: 1.35;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    --tracking-tight: -0.015em;
    --tracking-normal: 0;
    --tracking-wide: 0.04em;
    --tracking-wider: 0.08em;
    --tracking-broadcast: 0.12em;

    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;

    --measure-body: 68ch;
    --measure-headline: 24ch;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    --topbar-height: 36px;
    --header-height: 68px;
    --header-offset: calc(var(--topbar-height) + var(--header-height));
    --container-max: 1200px;
    --portal-gutter-x: 16px;
    --portal-block-gap: 20px;
    --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06);
    --shadow-md: 0 4px 16px rgba(17, 24, 39, 0.08);
    --shadow-lg: 0 12px 40px rgba(17, 24, 39, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.portal-premium {
    font-family: var(--font-body);
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--yv-ink);
    background: var(--yv-surface-soft);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding-top: var(--header-offset);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ── Sistema tipográfico Yurivisión (comunicaciones / radial) ── */
.portal-premium main h1,
.portal-premium main h2,
.portal-premium main h3,
.portal-premium main h4,
.portal-premium main h5,
.portal-premium main h6 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--yv-ink);
    margin-top: 0;
}

.portal-premium main h1 { font-size: var(--text-h1); letter-spacing: var(--tracking-tight); }
.portal-premium main h2 { font-size: var(--text-h2); }
.portal-premium main h3 { font-size: var(--text-h3); line-height: var(--leading-snug); }
.portal-premium main h4 { font-size: var(--text-h4); line-height: var(--leading-snug); }
.portal-premium main h5 { font-size: var(--text-small); line-height: var(--leading-snug); }
.portal-premium main h6 { font-size: var(--text-caption); line-height: var(--leading-snug); }

.portal-premium main p {
    margin-top: 0;
    margin-bottom: var(--space-3);
}

.yv-overline,
.yv-text-overline {
    display: inline-block;
    font-family: var(--font-display);
    font-size: var(--text-overline);
    font-weight: var(--weight-extrabold);
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.yv-display,
.yv-text-display {
    font-family: var(--font-display);
    font-size: var(--text-display);
    font-weight: var(--weight-extrabold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

.yv-headline,
.yv-text-headline {
    font-family: var(--font-display);
    font-size: var(--text-h2);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
}

.yv-subhead,
.yv-text-subhead {
    font-family: var(--font-display);
    font-size: var(--text-h3);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-snug);
}

.yv-lead,
.yv-text-lead {
    font-size: var(--text-body-lg);
    font-weight: var(--weight-regular);
    line-height: var(--leading-relaxed);
    color: var(--yv-muted);
}

.yv-body,
.yv-text-body {
    font-size: var(--text-body);
    line-height: var(--leading-normal);
}

.yv-body-sm,
.yv-text-small {
    font-size: var(--text-small);
    line-height: var(--leading-normal);
}

.yv-text-subtitle {
    font-size: var(--text-subtitle);
    line-height: var(--leading-normal);
}

.yv-text-ui {
    font-size: var(--text-ui);
    line-height: var(--leading-snug);
}

.yv-caption,
.yv-text-caption {
    font-size: var(--text-caption);
    line-height: var(--leading-snug);
    color: var(--yv-muted);
}

.yv-ticker,
.yv-text-ticker {
    font-family: var(--font-display);
    font-size: var(--text-caption);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-broadcast);
    text-transform: uppercase;
}

.yv-label,
.yv-text-label {
    font-family: var(--font-display);
    font-size: var(--text-overline);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.yv-prose {
    max-width: var(--measure-body);
    font-size: var(--text-body);
    line-height: var(--leading-relaxed);
}

.yv-prose p:last-child {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    :root {
        --portal-gutter-x: 20px;
        --portal-block-gap: 24px;
    }
}

@media (min-width: 1200px) {
    :root {
        --portal-gutter-x: 24px;
        --portal-block-gap: 32px;
    }
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.container,
.container-fluid {
    --bs-gutter-x: calc(var(--portal-gutter-x) * 2);
    max-width: var(--container-max);
}

body.portal-premium .container {
    --bs-gutter-x: calc(var(--portal-gutter-x) * 2);
}

body.portal-premium main.flex-grow-1 {
    width: 100%;
    overflow-x: clip;
}

.portal-page {
    padding: var(--portal-block-gap) 0 var(--space-7);
}

@media (min-width: 768px) {
    .portal-page { padding: var(--space-6) 0 var(--space-8); }
}

/* ── Tipografía de sección ── */
.section-eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-size: var(--text-overline);
    font-weight: var(--weight-extrabold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    line-height: var(--leading-snug);
    color: var(--yv-primary);
    margin-bottom: var(--space-2);
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--text-h2);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--yv-ink);
    margin: 0 0 var(--space-2);
}

.section-desc {
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-relaxed);
    color: var(--yv-muted);
    margin: 0;
    max-width: 560px;
}

.portal-section {
    margin-bottom: var(--portal-block-gap);
}

@media (min-width: 768px) {
    .portal-section {
        margin-bottom: var(--space-7);
    }
}

.portal-section-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

@media (min-width: 768px) {
    .portal-section-header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.section-eyebrow--amazon { color: var(--yv-amazon-green); }
.section-eyebrow--live { color: var(--yv-news-red); }

.section-title--sm {
    font-size: var(--text-h3);
}

/* ── Barra de vista previa (CMS) ── */
.portal-preview-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    height: var(--preview-bar-height, 40px);
    background: linear-gradient(90deg, #5b21b6, #7c3aed);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(91, 33, 182, 0.35);
}

.portal-preview-bar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: var(--text-ui);
    font-weight: 600;
}

.portal-preview-bar-inner i {
    margin-right: 6px;
}

.portal-preview-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: var(--text-caption);
    white-space: nowrap;
}

.portal-preview-back:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.portal-preview-mode {
    --preview-bar-height: 40px;
    --header-offset: calc(var(--topbar-height) + var(--header-height) + var(--preview-bar-height));
}

.portal-preview-mode .portal-corp-bar {
    top: var(--preview-bar-height);
}

.portal-preview-mode .portal-header {
    top: calc(var(--topbar-height) + var(--preview-bar-height));
}

/* ── Barra corporativa (estilo medio informativo) ── */
.portal-corp-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    height: var(--topbar-height);
    background: var(--yv-ink);
    color: rgba(255, 255, 255, 0.92);
    font-size: var(--text-ui);
    border-bottom: 3px solid var(--yv-news-red);
}

.portal-corp-bar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.portal-corp-bar-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: var(--text-overline);
    font-weight: var(--weight-extrabold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--yv-accent-yellow);
    flex-shrink: 0;
}

.portal-corp-bar-ticker {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}

.portal-corp-bar-ticker-track {
    display: inline-flex;
    align-items: center;
    gap: 0;
    width: max-content;
    white-space: nowrap;
    animation: portal-corp-ticker 28s linear infinite;
    will-change: transform;
}

.portal-corp-bar-ticker-item {
    font-size: var(--text-caption);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-normal);
    color: rgba(255, 255, 255, 0.88);
    padding: 0 0.15rem;
}

.portal-corp-bar-ticker-sep {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    color: rgba(250, 204, 21, 0.85);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.portal-corp-bar:hover .portal-corp-bar-ticker-track {
    animation-play-state: paused;
}

@keyframes portal-corp-ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .portal-corp-bar-ticker-track {
        animation: none;
        transform: none;
    }

    .portal-corp-bar-ticker {
        mask-image: none;
        -webkit-mask-image: none;
    }

    .portal-corp-bar-ticker-track .portal-corp-bar-ticker-item:nth-child(n+3),
    .portal-corp-bar-ticker-track .portal-corp-bar-ticker-sep:nth-child(n+4) {
        display: none;
    }

    .portal-corp-bar-ticker-item {
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

.portal-corp-bar .live-badge.is-on {
    background: var(--yv-news-red);
    color: #fff;
    border-color: var(--yv-news-red);
}

.portal-corp-bar .live-badge.is-off {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.15);
}

@media (max-width: 575px) {
    .portal-corp-bar-label {
        display: none;
    }

    .portal-corp-bar-ticker-track {
        animation-duration: 22s;
    }
}

/* ── Header ── */
.portal-header {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    z-index: 1030;
    height: var(--header-height);
    background: var(--yv-surface);
    border-bottom: 1px solid var(--yv-border);
    box-shadow: var(--shadow-sm);
}

.portal-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
    min-width: 0;
}

.portal-brand-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.portal-brand-text {
    display: none;
    flex-direction: column;
    line-height: 1.15;
}

.portal-brand-name {
    font-family: var(--font-display);
    font-size: var(--text-small);
    font-weight: var(--weight-extrabold);
    letter-spacing: var(--tracking-wide);
    color: var(--yv-primary-dark);
}

.portal-brand-tagline {
    font-size: var(--text-overline);
    font-weight: var(--weight-medium);
    color: var(--yv-muted);
    letter-spacing: var(--tracking-wide);
}

@media (min-width: 480px) {
    .portal-brand-text { display: flex; }
    .portal-brand-logo { height: 40px; }
}

.portal-nav-toggle {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--yv-border);
    border-radius: var(--radius-sm);
    padding: 0;
    background: var(--yv-surface-soft);
    color: var(--yv-ink);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.portal-nav-toggle:hover,
.portal-nav-toggle:focus-visible {
    background: var(--yv-ink);
    border-color: var(--yv-ink);
    color: #fff;
    outline: none;
}

.portal-nav-toggle-icon {
    font-size: 1.65rem;
    line-height: 1;
}

@media (min-width: 992px) {
    .portal-nav-toggle { display: none; }
}

.portal-nav {
    position: fixed;
    top: var(--header-offset);
    left: 0;
    right: 0;
    background: var(--yv-surface);
    border-bottom: 1px solid var(--yv-border);
    box-shadow: var(--shadow-md);
    padding: var(--space-4);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
}

.portal-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

@media (min-width: 992px) {
    .portal-nav {
        position: static;
        display: flex;
        align-items: center;
        transform: none;
        opacity: 1;
        visibility: visible;
        border: 0;
        box-shadow: none;
        padding: 0;
        margin-left: auto;
        background: transparent;
    }
}

.portal-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

@media (min-width: 992px) {
    .portal-nav-list {
        flex-direction: row;
        align-items: center;
        gap: var(--space-1);
    }
}

.portal-nav-link {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--text-small);
    font-weight: var(--weight-medium);
    color: var(--yv-muted);
    transition: color 0.15s ease, background 0.15s ease;
}

.portal-nav-link:hover,
.portal-nav-link.is-active {
    color: var(--yv-primary-dark);
    background: var(--yv-surface-soft);
}

@media (min-width: 992px) {
    .portal-nav-link {
        border-radius: 0;
        border-bottom: 2px solid transparent;
        padding: 10px 12px;
    }

    .portal-nav-link:hover {
        background: transparent;
        color: var(--yv-ink);
    }

    .portal-nav-link.is-active {
        color: var(--yv-news-red);
        background: transparent;
        border-bottom-color: var(--yv-news-red);
    }
}

@media (max-width: 991px) {
    .portal-nav-link.is-active {
        color: var(--yv-news-red);
        background: rgba(217, 30, 46, 0.06);
    }
}

.portal-nav-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--yv-border);
}

@media (min-width: 992px) {
    .portal-nav-actions {
        flex-direction: row;
        align-items: center;
        gap: var(--space-2);
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
        margin-left: var(--space-3);
    }
}

.portal-location {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: var(--text-caption);
    font-weight: var(--weight-medium);
    color: var(--yv-muted);
}

.portal-location i { color: var(--yv-primary); }

@media (min-width: 1200px) {
    .portal-location { display: inline-flex; }
}

/* ── Live badge ── */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: var(--text-overline);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    white-space: nowrap;
    text-decoration: none;
}

a.live-badge:hover {
    text-decoration: none;
    filter: brightness(0.97);
}

.live-badge--lg {
    padding: 8px 14px;
    font-size: var(--text-caption);
}

.live-badge.is-on {
    background: rgba(217, 30, 46, 0.08);
    color: var(--yv-news-red);
    border: 1px solid rgba(217, 30, 46, 0.22);
}

.live-badge.is-off {
    background: var(--yv-surface-soft);
    color: var(--yv-muted);
    border: 1px solid var(--yv-border);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--yv-accent-red);
    flex-shrink: 0;
}

.live-badge.is-on .live-dot {
    animation: live-pulse 1.4s ease-in-out infinite;
}

/* Corazón latiente — transmisión en vivo */
.live-heart-icon {
    color: var(--yv-news-red);
    font-size: 0.9em;
    line-height: 1;
    transform-origin: center;
    animation: heartbeat 1.15s ease-in-out infinite;
}

.live-badge--pulse.is-on {
    box-shadow: 0 0 0 0 rgba(217, 30, 46, 0.45);
    animation: heartbeat-glow 1.15s ease-in-out infinite;
}

.portal-corp-bar .live-heart-icon,
.portal-corp-bar .live-badge--pulse.is-on {
    animation: heartbeat 1.15s ease-in-out infinite;
}

.portal-corp-bar .live-badge--pulse.is-on {
    animation: heartbeat-glow 1.15s ease-in-out infinite;
}

.portal-corp-bar .live-heart-icon {
    color: #fff;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.28); }
    28% { transform: scale(1); }
    42% { transform: scale(1.18); }
    70% { transform: scale(1); }
}

@keyframes heartbeat-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 30, 46, 0.35); }
    14% { box-shadow: 0 0 0 8px rgba(217, 30, 46, 0); }
    28% { box-shadow: 0 0 0 0 rgba(217, 30, 46, 0.2); }
    42% { box-shadow: 0 0 0 6px rgba(217, 30, 46, 0); }
    70% { box-shadow: 0 0 0 0 rgba(217, 30, 46, 0); }
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ── Botones ── */
.btn-yv {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: var(--text-small);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.btn-yv-sm {
    padding: 8px 14px;
    font-size: var(--text-caption);
    letter-spacing: var(--tracking-wide);
}

.btn-yv-live {
    background: var(--yv-news-red);
    color: #fff;
    border-color: var(--yv-news-red);
}

.btn-yv-live:hover {
    background: #B91C1C;
    border-color: #B91C1C;
    color: #fff;
}

.btn-yv-light {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(4px);
}

.btn-yv-light:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-yv-primary {
    background: var(--yv-primary);
    color: #fff;
    border-color: var(--yv-primary);
}

.btn-yv-primary:hover {
    background: var(--yv-primary-dark);
    border-color: var(--yv-primary-dark);
    color: #fff;
}

.btn-yv-outline {
    background: var(--yv-surface);
    color: var(--yv-primary-dark);
    border-color: var(--yv-border);
}

.btn-yv-outline:hover {
    border-color: var(--yv-primary);
    color: var(--yv-primary);
    background: var(--yv-surface-soft);
}

.btn-yv-ghost {
    background: transparent;
    color: var(--yv-primary-dark);
    border-color: transparent;
    padding-inline: 12px;
}

.btn-yv-ghost:hover {
    background: var(--yv-surface-soft);
}

/* ── Tarjetas base ── */
.yv-card {
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
    border-radius: var(--radius-md);
}

/* ── Footer ── */
.portal-footer {
    margin-top: auto;
    background: var(--yv-surface);
    border-top: 1px solid var(--yv-border);
}

.portal-footer-accent {
    height: 4px;
    background: linear-gradient(90deg, var(--yv-news-red), var(--yv-primary), var(--yv-amazon-green));
}

.portal-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding: var(--space-7) 0 var(--space-5);
}

@media (min-width: 576px) {
    .portal-footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
    .portal-footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

.portal-footer-logo {
    height: 40px;
    width: auto;
    margin-bottom: var(--space-4);
}

.portal-footer-desc {
    font-size: var(--text-small);
    color: var(--yv-muted);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
    max-width: 300px;
}

.portal-footer-heading {
    font-family: var(--font-display);
    font-size: var(--text-caption);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--yv-ink);
    margin-bottom: var(--space-3);
}

.portal-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portal-footer-links a {
    font-size: var(--text-small);
    color: var(--yv-muted);
    transition: color 0.15s ease;
}

.portal-footer-links a:hover { color: var(--yv-primary); }

.portal-footer-contact {
    display: flex;
    gap: 10px;
    font-size: var(--text-small);
    color: var(--yv-muted);
    margin-bottom: 10px;
}

.portal-footer-contact i {
    color: var(--yv-primary);
    margin-top: 3px;
    flex-shrink: 0;
}

.portal-footer-social {
    display: flex;
    gap: var(--space-2);
}

.portal-footer-social a {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--yv-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--yv-muted);
    transition: all 0.15s ease;
}

.portal-footer-social a:hover {
    background: var(--yv-primary);
    border-color: var(--yv-primary);
    color: #fff;
}

.portal-footer-bottom {
    border-top: 1px solid var(--yv-border);
    padding: var(--space-4) 0 var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--text-ui);
    color: var(--yv-muted);
    text-align: center;
}

@media (min-width: 768px) {
    .portal-footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* ── Shell móvil tipo app ── */
:root {
    --app-tabbar-height: 56px;
}

.portal-header-live {
    display: none;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.portal-app-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    min-height: var(--app-tabbar-height);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--yv-border);
    box-shadow: 0 -6px 28px rgba(17, 24, 39, 0.1);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.portal-app-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 1px 7px;
    border: none;
    background: transparent;
    color: var(--yv-muted);
    font-family: var(--font-body);
    font-size: clamp(0.62rem, 2.7vw, 0.72rem);
    font-weight: var(--weight-semibold);
    letter-spacing: 0;
    text-decoration: none;
    cursor: pointer;
    min-width: 0;
    min-height: 52px;
    overflow: visible;
    transition: color 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.portal-app-tab i {
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
}

.portal-app-tab span {
    line-height: 1.1;
    white-space: nowrap;
    overflow: visible;
    max-width: 100%;
}

.portal-app-tab.is-active {
    color: var(--yv-news-red);
}

.portal-app-tab.is-active i {
    transform: translateY(-1px);
}

.portal-app-tab[data-nav="yuri"].is-active {
    color: var(--yv-primary);
}

@media (max-width: 991px) {
    :root {
        --topbar-height: 0px;
        --header-height: 54px;
        --header-offset: var(--header-height);
        --app-tabbar-height: calc(56px + env(safe-area-inset-bottom, 0px));
        --portal-gutter-x: 20px;
        --portal-block-gap: 18px;
    }

    .portal-preview-mode {
        --header-offset: calc(var(--header-height) + var(--preview-bar-height));
    }

    .portal-preview-mode .portal-header {
        top: var(--preview-bar-height);
    }

    body.portal-premium .container,
    body.portal-premium .container-fluid {
        --bs-gutter-x: calc(var(--portal-gutter-x) * 2);
        padding-left: max(calc(var(--bs-gutter-x) * 0.5), env(safe-area-inset-left, 0px));
        padding-right: max(calc(var(--bs-gutter-x) * 0.5), env(safe-area-inset-right, 0px));
    }

    .portal-app-tabbar {
        padding-left: max(0px, env(safe-area-inset-left, 0px));
        padding-right: max(0px, env(safe-area-inset-right, 0px));
    }

    .portal-corp-bar {
        display: none;
    }

    body.portal-premium {
        padding-bottom: 0;
    }

    body.portal-premium main.flex-grow-1 {
        padding-bottom: var(--app-tabbar-height);
    }

    .portal-header .container {
        gap: var(--space-3);
    }

    .portal-brand-logo {
        height: 32px;
    }

    .portal-header-live {
        display: inline-flex;
    }

    .portal-header-live .live-badge {
        padding: 4px 8px;
        font-size: 0.58rem;
    }

    .portal-nav {
        display: none !important;
    }

    .portal-nav-toggle {
        display: none !important;
    }

    .portal-footer {
        margin-bottom: 0;
        padding-bottom: calc(var(--space-4) + var(--app-tabbar-height));
    }

    body.player-immersive-active .portal-app-tabbar,
    body.chat-panel-open .portal-app-tabbar {
        display: none;
    }

    body.player-immersive-active main.flex-grow-1,
    body.chat-panel-open main.flex-grow-1 {
        padding-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.portal-ad-beacon {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ── Botón flotante de WhatsApp ── */
.portal-whatsapp-float {
    position: fixed;
    bottom: 22px;
    left: 20px;
    z-index: 1049;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px 12px 14px;
    border-radius: 999px;
    background: #25d366;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.portal-whatsapp-float:hover,
.portal-whatsapp-float:focus {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5);
}

.portal-whatsapp-float i {
    font-size: 1.5rem;
    line-height: 1;
}

@media (max-width: 991px) {
    .portal-whatsapp-float {
        bottom: calc(var(--app-tabbar-height, 56px) + env(safe-area-inset-bottom, 0px) + 14px);
        left: 14px;
        padding: 12px;
    }

    .portal-whatsapp-float-label {
        display: none;
    }

    body.player-immersive-active .portal-whatsapp-float,
    body.chat-panel-open .portal-whatsapp-float {
        display: none;
    }
}
