/* ═══════════════════════════════════════════════════════════
   cducatolica multimedia — Archivo Audiovisual Universidad Católica
   Estilo: portal claro, identidad azul cducatolica.com (#1e73be)
   ═══════════════════════════════════════════════════════════ */

:root {
    --royal:      #1e73be;   /* azul portal (acento principal) */
    --royal-dark: #155a97;   /* azul hover/activo */
    --navy:       #0d3d6b;   /* azul oscuro (títulos, header alt) */
    --navy-deep:  #0a2d50;   /* para hero overlay */
    --crimson:    #c8102e;

    --white:      #ffffff;
    --ink:        #0d3d6b;   /* texto principal (azul muy oscuro) */
    --gray:       #64748b;   /* texto secundario */
    --gray-soft:  #94a3b8;   /* texto terciario */
    --line:       #e2e8f0;   /* bordes */

    /* Fondos claros */
    --bg:         #f5f7fa;   /* página */
    --bg-card:    #ffffff;   /* tarjetas */
    --bg-hover:   #eef2f7;
    --bg-surface: #eef2f7;   /* footer / superficies */

    /* Resultado */
    --res-win:  #16a34a;
    --res-draw: #64748b;     /* empate = gris neutro */
    --res-loss: #dc2626;

    /* Tipografía */
    --font-display: 'Bebas Neue', sans-serif;
    --font-cond:    'Barlow Condensed', sans-serif;
    --font-body:    'Barlow', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }

/* ══════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════ */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: var(--royal);
    border-bottom: 1px solid rgba(0,0,0,.08);
    transition: background .3s, box-shadow .3s;
}
.site-header.scrolled {
    background: var(--royal-dark);
    box-shadow: 0 2px 12px rgba(13,61,107,.18);
}

.header-inner {
    max-width: 1400px; margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex; align-items: center; gap: 32px;
}

/* Logo */
.header-logo {
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
}
.logo-badge {
    width: 36px; height: 36px;
    background: var(--white);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 16px; letter-spacing: 1px;
    color: var(--royal);
    border: 2px solid rgba(255,255,255,.6);
}
.logo-badge.small { width: 28px; height: 28px; font-size: 12px; }
.logo-name {
    font-family: var(--font-display);
    font-size: 22px; letter-spacing: 3px;
    color: #fff; line-height: 1;
}
.logo-sub {
    display: block;
    font-size: 9px; letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,.7);
    line-height: 1;
    margin-top: 2px;
}

/* Nav */
.header-nav {
    display: flex; align-items: center; gap: 4px;
    flex: 1;
}
.nav-link {
    padding: 8px 14px;
    font-family: var(--font-cond);
    font-size: 14px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase;
    color: rgba(255,255,255,.8);
    border-radius: 6px;
    transition: color .15s, background .15s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.15); }
.nav-link.active { color: #fff; background: rgba(255,255,255,.2); }

/* Header right */
.header-right { display: flex; align-items: center; gap: 8px; }
.search-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    color: rgba(255,255,255,.85);
    display: flex; align-items: center; justify-content: center;
    transition: color .15s, background .15s;
}
.search-btn:hover { color: #fff; background: rgba(255,255,255,.15); }

/* Search bar */
.search-bar {
    display: none;
    padding: 12px 24px;
    border-top: 1px solid rgba(255,255,255,.15);
    background: var(--royal-dark);
}
.search-bar.open { display: block; }
.search-bar-inner {
    max-width: 600px; margin: 0 auto;
    display: flex; gap: 10px; align-items: center;
}
.search-bar-inner input {
    flex: 1;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 8px;
    padding: 10px 16px;
    color: #fff; font-size: 15px;
    outline: none;
}
.search-bar-inner input::placeholder { color: rgba(255,255,255,.6); }
.search-bar-inner button { color: rgba(255,255,255,.75); font-size: 18px; padding: 4px 8px; }

/* Mobile */
.mobile-menu-btn {
    display: none;
    flex-direction: column; gap: 5px;
    padding: 8px; width: 38px; height: 38px;
    justify-content: center; align-items: center;
}
.mobile-menu-btn span {
    display: block; width: 20px; height: 2px;
    background: rgba(255,255,255,.85); border-radius: 2px;
    transition: all .2s;
}
.mobile-menu { display: none; padding: 12px 24px 16px; border-top: 1px solid rgba(255,255,255,.15); background: var(--royal); }
.mobile-menu.open { display: block; }
.mobile-nav-link {
    display: block; padding: 12px 0;
    font-family: var(--font-cond); font-size: 16px;
    font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
    color: rgba(255,255,255,.85);
    border-bottom: 1px solid rgba(255,255,255,.12);
}

/* ══════════════════════════════════════════════════════════
   HERO / FEATURED — mantiene efecto cine (overlay oscuro)
══════════════════════════════════════════════════════════ */
.hero {
    position: relative;
    height: 85vh; min-height: 520px; max-height: 800px;
    display: flex; align-items: flex-end;
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 50%, #06203a 100%);
}
.hero-bg img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: .45;
}
.hero-gradient {
    position: absolute; inset: 0;
    background: linear-gradient(
        to top,
        var(--bg) 0%,
        rgba(10,45,80,.55) 40%,
        rgba(10,45,80,.1) 100%
    );
}
.hero-gradient-left {
    position: absolute; inset: 0;
    background: linear-gradient(
        to right,
        rgba(10,45,80,.9) 0%,
        rgba(10,45,80,.35) 60%,
        transparent 100%
    );
}
.hero-content {
    position: relative; z-index: 2;
    max-width: 1400px; margin: 0 auto; width: 100%;
    padding: 0 24px 64px;
}
.hero-tag {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-cond); font-size: 12px;
    font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
    color: rgba(255,255,255,.9);
    margin-bottom: 14px;
}
.hero-tag-dot { width: 6px; height: 6px; border-radius: 50%; background: #5ba3e8; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }

.hero-titulo {
    font-family: var(--font-display);
    font-size: clamp(36px, 6vw, 72px);
    letter-spacing: 2px; line-height: .95;
    color: #fff;
    margin-bottom: 14px;
    text-shadow: 0 2px 20px rgba(0,0,0,.5);
}
.hero-meta {
    font-size: 13px; color: rgba(255,255,255,.75);
    margin-bottom: 24px;
    display: flex; align-items: center; gap: 12px;
}
.hero-meta-sep { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.5); }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-play {
    display: inline-flex; align-items: center; gap: 10px;
    text-decoration: none;
    padding: 14px 28px;
    background: var(--royal); color: #fff;
    border-radius: 8px;
    font-family: var(--font-cond); font-size: 16px;
    font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    transition: all .2s;
}
.btn-play:hover { background: var(--royal-dark); transform: scale(1.03); }
.btn-play svg { flex-shrink: 0; }

.btn-info {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 28px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff; border-radius: 8px;
    font-family: var(--font-cond); font-size: 16px;
    font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    backdrop-filter: blur(8px);
    transition: all .2s;
}
.btn-info:hover { background: rgba(255,255,255,.25); }

/* ══════════════════════════════════════════════════════════
   SECCIONES DE FILAS
══════════════════════════════════════════════════════════ */
.sections-wrap {
    max-width: 1400px; margin: 0 auto;
    padding: 40px 24px 80px;
}

.section-row {
    margin-bottom: 48px;
}
.section-row-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.section-row-title {
    font-family: var(--font-cond);
    font-size: 20px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--navy);
}
.section-row-title span {
    color: var(--royal); margin-right: 8px;
}
.section-row-link {
    font-size: 12px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--gray);
    transition: color .15s;
    display: flex; align-items: center; gap: 4px;
}
.section-row-link:hover { color: var(--royal); }

/* ── Grid mosaico (modo año específico) ── */
.vid-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.vid-grid .vid-card {
    flex: none;
    min-width: 0;
    width: 100%;
}
@media (max-width: 1100px) { .vid-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .vid-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px)  { .vid-grid { grid-template-columns: 1fr; } }

/* Slider horizontal */
.row-slider {
    display: flex; gap: 12px;
    overflow-x: auto; scroll-behavior: smooth;
    scrollbar-width: none; padding-bottom: 8px;
    position: relative;
}
.row-slider::-webkit-scrollbar { display: none; }

/* ── Tarjeta de video ── */
.vid-card {
    display: block;                 /* ahora es <a> */
    text-decoration: none;
    color: inherit;
    flex: 0 0 240px; min-width: 240px;
    border-radius: 10px; overflow: hidden;
    background: var(--bg-card);
    cursor: pointer;
    transition: transform .25s, box-shadow .25s;
    position: relative;
    border: 1px solid var(--line);
    box-shadow: 0 1px 4px rgba(13,61,107,.06);
}
.vid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(13,61,107,.18);
    z-index: 10;
    border-color: var(--royal);
}

/* Thumbnail */
.vid-thumb {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    background: var(--navy);
    overflow: hidden;
}
.vid-thumb img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.vid-card:hover .vid-thumb img { transform: scale(1.08); }

.vid-thumb-overlay {
    position: absolute; inset: 0;
    background: rgba(13,61,107,.25);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s;
}
.vid-card:hover .vid-thumb-overlay { opacity: 1; }
.vid-play-circle {
    width: 52px; height: 52px;
    background: var(--royal);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(13,61,107,.45);
    border: 2px solid rgba(255,255,255,.9);
}
.vid-play-circle svg { margin-left: 3px; }
.vid-play-circle svg polygon { fill: #fff !important; }

/* Badge resultado (esquina thumb) */
.vid-badge {
    position: absolute; bottom: 8px; left: 8px;
    font-family: var(--font-cond);
    font-size: 11px; font-weight: 700;
    padding: 3px 8px; border-radius: 4px;
    letter-spacing: .5px;
}
.vid-badge.win  { background: rgba(22,163,74,.15);  color: var(--res-win); }
.vid-badge.draw { background: rgba(100,116,139,.15); color: var(--res-draw); }
.vid-badge.loss { background: rgba(220,38,38,.15);   color: var(--res-loss); }

/* Punto de resultado (esquina superior) */
.vid-res-dot {
    position: absolute; top: 10px; right: 10px;
    width: 10px; height: 10px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.9);
}
.vid-res-win  { background: var(--res-win); }
.vid-res-draw { background: var(--res-draw); }
.vid-res-loss { background: var(--res-loss); }

/* Info de la tarjeta */
.vid-info {
    padding: 12px;
}
.vid-fecha {
    font-size: 10px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--gray-soft); margin-bottom: 4px;
}
.vid-thumb.sin-thumb { background: linear-gradient(135deg, var(--royal), var(--navy)); }
.vid-pen {
    font-family: var(--font-cond); font-weight: 700; font-size: 12px;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--gray); margin-top: 2px; white-space: nowrap;
}
.vid-partido {
    font-family: var(--font-cond);
    font-size: 15px; font-weight: 700;
    color: var(--navy); line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vid-comp {
    font-size: 11px; color: var(--gray-soft);
    margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Tarjeta grande (destacado) */
.vid-card.large {
    flex: 0 0 340px; min-width: 340px;
}

/* ── Flechas del slider ── */
.row-arrows { display: flex; gap: 6px; }
.row-arrow {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--white);
    color: var(--royal);
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.row-arrow:hover:not(:disabled) { background: var(--royal); color: #fff; border-color: var(--royal); }
.row-arrow:disabled { opacity: .3; cursor: default; }

/* ══════════════════════════════════════════════════════════
   GRID DE DÉCADAS
══════════════════════════════════════════════════════════ */
.decades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.decade-card {
    position: relative;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: var(--navy);
    transition: transform .2s, box-shadow .2s;
}
.decade-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(13,61,107,.25); }
.decade-card-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--royal), var(--navy));
}
.decade-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(10,45,80,.7) 0%, transparent 60%);
}
.decade-card-label {
    position: absolute; bottom: 14px; left: 16px;
    font-family: var(--font-display);
    font-size: 38px; letter-spacing: 3px;
    color: #fff; line-height: 1;
}
.decade-card-count {
    position: absolute; top: 12px; right: 12px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    color: rgba(255,255,255,.85);
    background: rgba(0,0,0,.3);
    padding: 3px 8px; border-radius: 999px;
}

/* ══════════════════════════════════════════════════════════
   MODAL DE VIDEO — se mantiene oscuro (reproductor = cine)
══════════════════════════════════════════════════════════ */
.video-modal {
    display: none;
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(10,45,80,.85);
    align-items: center; justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.video-modal.open { display: flex; animation: fade-in .2s; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.video-modal-box {
    background: #0d1b2e;
    border-radius: 12px;
    width: 100%;
    max-height: 92vh;
    position: relative;
    animation: pop-in .22s cubic-bezier(.34,1.56,.64,1);
    max-width: 960px;
    overflow: hidden;
}
.video-modal-box.has-sidebar { max-width: 1200px; }

@keyframes pop-in {
    from { opacity:0; transform:scale(.92); }
    to   { opacity:1; transform:scale(1); }
}

.video-modal-layout {
    display: flex;
    align-items: stretch;
    max-height: 92vh;
}
.video-modal-main {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.video-modal-sidebar {
    width: 260px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-radius: 0 12px 12px 0;
}
.modal-sidebar-label {
    font-size: 10px; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
    color: rgba(255,255,255,.4);
    padding: 16px 14px 10px;
    flex-shrink: 0;
}
#modal-galeria-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 10px 14px;
}

.video-modal-close {
    position: fixed; top: 16px; right: 16px;
    width: 36px; height: 36px;
    background: rgba(30,30,40,.85); border-radius: 50%;
    color: rgba(255,255,255,.85); font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    z-index: 2100; cursor: pointer;
    border: 1.5px solid rgba(255,255,255,.2);
    transition: background .15s, color .15s, transform .15s;
    backdrop-filter: blur(4px);
}
.video-modal-close:hover { background: rgba(255,255,255,.25); color: #fff; transform: scale(1.1); }

.video-modal-player {
    position: relative; padding-bottom: 56.25%; height: 0;
    border-radius: 12px 12px 0 0; overflow: hidden;
    flex-shrink: 0;
}
.has-sidebar .video-modal-player { border-radius: 12px 0 0 0; }
.video-modal-player iframe,
.video-modal-player img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; border: none;
}
.video-modal-player img { object-fit: contain; background: #000; }

.video-modal-info { padding: 16px 20px 20px; flex-shrink: 0; }
.video-modal-titulo {
    font-family: var(--font-cond);
    font-size: 22px; font-weight: 700;
    color: #fff; margin-bottom: 4px;
}
.video-modal-meta { font-size: 13px; color: rgba(255,255,255,.55); }

@media (max-width: 700px) {
    .video-modal-layout { flex-direction: column; overflow-y: auto; max-height: 92vh; }
    .video-modal-box.has-sidebar { max-width: 960px; }
    .video-modal-sidebar {
        width: 100%; border-left: none;
        border-top: 1px solid rgba(255,255,255,.08);
        border-radius: 0 0 12px 12px;
        max-height: 180px; overflow-y: auto;
    }
    #modal-galeria-grid { flex-direction: row; flex-wrap: wrap; }
    .has-sidebar .video-modal-player { border-radius: 12px 12px 0 0; }
}

/* ══════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════ */
.site-footer {
    background: var(--navy);
    border-top: 1px solid rgba(0,0,0,.08);
    padding: 32px 24px;
}
.footer-inner {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-logo { display: flex; align-items: center; gap: 10px; }
.footer-name {
    font-family: var(--font-display);
    font-size: 18px; letter-spacing: 2px; color: #fff;
}
.footer-sub { font-size: 11px; color: rgba(255,255,255,.5); letter-spacing: .5px; }
.footer-copy { font-size: 12px; color: rgba(255,255,255,.4); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    html, body { overflow-x: hidden; }
    .header-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    /* sin el nav, el botón se pegaba al logo: esto lo manda al borde derecho */
    .header-right { margin-left: auto; }
    .hero { height: 70vh; }
    .vid-card { flex: 0 0 180px; min-width: 180px; }
    .vid-card.large { flex: 0 0 240px; min-width: 240px; }
    .sections-wrap { padding: 24px 16px 60px; }
    .hero-content { padding: 0 16px 48px; }
    .decades-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .vid-card { flex: 0 0 150px; min-width: 150px; }
    .hero-titulo { font-size: 32px; }
    .btn-play, .btn-info { padding: 11px 20px; font-size: 14px; }
}

/* ── Galería en modal (sidebar vertical) ── */
.gal-item {
    width: 100%; aspect-ratio: 16/9;
    border-radius: 6px; overflow: hidden;
    cursor: pointer; flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.1);
    transition: border-color .15s, transform .15s;
    position: relative;
    background: #0a1524;
}
.gal-item:hover { border-color: rgba(255,255,255,.4); transform: scale(1.02); }
.gal-item.active { border-color: #5ba3e8; box-shadow: 0 0 0 1px #5ba3e8; }
.gal-item img { width:100%; height:100%; object-fit:cover; display:block; }
.gal-item-play {
    position:absolute; inset:0;
    display:flex; align-items:center; justify-content:center;
    background:rgba(0,0,0,.3);
}
.gal-item-play svg { filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }

@media (max-width: 700px) {
    .gal-item { width: 110px; aspect-ratio: 16/9; flex-shrink: 0; }
}

/* ── Score badge en tarjeta ── */
.vid-partido {
    font-family: var(--font-cond);
    font-size: 15px; font-weight: 700;
    color: var(--navy); line-height: 1.3;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.vid-score {
    display: inline-block;
    font-size: 13px; font-weight: 800;
    padding: 2px 8px; border-radius: 4px;
    letter-spacing: .5px; flex-shrink: 0;
}
.vid-score-win  { background: rgba(22,163,74,.15);  color: var(--res-win); }
.vid-score-draw { background: rgba(100,116,139,.15); color: var(--res-draw); }
.vid-score-loss { background: rgba(220,38,38,.15);   color: var(--res-loss); }
