/* ==========================================================================
   Sitio "Creación" — hoja de estilos común
   Dirección de diseño A: "Papel y tinta" (cálida y editorial)
   ========================================================================== */

/* --- Tipografías autoalojadas -------------------------------------------- */
@font-face {
    font-family: 'EB Garamond';
    src: url('../fonts/ebgaramond.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/opensans.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* --- Tokens del sistema de diseño ---------------------------------------- */
:root {
    --paper: #faf7f2;
    --paper-deep: #f3eee5;
    --surface: #ffffff;

    --ink: #1c1a17;
    --ink-soft: #6e675c;
    --muted: #a79e8f;

    --line: #e7e1d7;
    --line-strong: #d9d0c1;

    --accent: #9a5b33;
    --accent-ink: #7c4826;
    --accent-soft: #f2e8dc;

    --font-serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
    --font-sans: 'Open Sans', ui-sans-serif, system-ui, -apple-system,
        'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --maxw: 1080px;
    --radius: 8px;
    --radius-sm: 6px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 16px 38px rgba(63, 46, 28, 0.1);
    --shadow-sm: 0 8px 20px rgba(63, 46, 28, 0.08);
}

/* --- Reset y base --------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
video,
audio {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}

::selection {
    background: var(--accent-soft);
}

/* --- Barra superior común ------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 13px clamp(18px, 5vw, 46px);
    background: rgba(250, 247, 242, 0.88);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--line);
}

.topbar .brand {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    white-space: nowrap;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(14px, 2.4vw, 30px);
}

.topbar nav a {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-soft);
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    transition:
        color 0.2s var(--ease),
        border-color 0.2s var(--ease);
}

.topbar nav a:hover {
    color: var(--ink);
    border-bottom-color: var(--line-strong);
}

.topbar nav a.is-active {
    color: var(--accent-ink);
    border-bottom-color: var(--accent);
}

/* --- Contenedor principal ------------------------------------------------- */
.page {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(40px, 6vw, 72px) clamp(18px, 5vw, 46px) 120px;
}

.page--narrow {
    max-width: 760px;
}

/* --- Cabecera de página --------------------------------------------------- */
.page-header {
    margin-bottom: clamp(34px, 6vw, 60px);
}

.eyebrow {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 14px;
}

.page-header h1 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(2.1rem, 5vw, 3rem);
    line-height: 1.1;
    letter-spacing: 0.01em;
    color: var(--ink);
}

.page-header h1::after {
    content: '';
    display: block;
    width: 54px;
    height: 2px;
    margin-top: 20px;
    background: var(--accent);
}

/* --- Enlace "volver" ------------------------------------------------------ */
.back {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
    margin-bottom: 26px;
    transition: color 0.2s var(--ease);
}

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

/* --- Secciones plegables (acordeón) -------------------------------------- */
.section {
    border-top: 1px solid var(--line);
}

.section:last-child {
    border-bottom: 1px solid var(--line);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 26px 4px;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 2.4vw, 1.6rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--ink);
    transition: color 0.2s var(--ease);
}

.section-header:hover {
    color: var(--accent-ink);
}

.section-header .arrow {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 0.65rem;
    line-height: 1;
    transition:
        transform 0.35s var(--ease),
        background 0.25s var(--ease),
        border-color 0.25s var(--ease),
        color 0.25s var(--ease);
}

.section.open .section-header .arrow {
    transform: rotate(90deg);
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Animación sin JavaScript de alturas: rejilla 0fr -> 1fr */
.section-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s var(--ease);
}

.section.open .section-body {
    grid-template-rows: 1fr;
}

.section-body-inner {
    overflow: hidden;
    min-height: 0;
}

/* El espaciado se hace con pseudoelementos: de este modo el contenedor puede
   plegarse a 0 px (un relleno propio impediría el colapso). */
.section-body-inner::before,
.section-body-inner::after {
    content: '';
    display: block;
}

.section-body-inner::before {
    height: 8px;
}

.section-body-inner::after {
    height: 40px;
}

/* --- Pistas de audio ------------------------------------------------------ */
.track {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    transition: background 0.2s var(--ease);
}

.track:hover {
    background: var(--accent-soft);
}

.track-number {
    min-width: 26px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.track-name {
    flex: 1;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--ink);
}

/* El elemento <audio> original se conserva en el DOM (es el que suena), pero
   se oculta: la interfaz la construye site.js con estas clases. */
.track > audio {
    display: none;
}

.player {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 340px;
    max-width: 340px;
}

.player-toggle {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--ink-soft);
    cursor: pointer;
    transition:
        background 0.2s var(--ease),
        border-color 0.2s var(--ease),
        color 0.2s var(--ease);
}

.player-toggle svg {
    display: block;
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.player-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.track.is-playing .player-toggle {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.player-bar {
    position: relative;
    flex: 1;
    min-width: 60px;
    height: 18px;
    cursor: pointer;
    touch-action: none;
}

.player-bar::before {
    content: '';
    position: absolute;
    inset: 50% 0 auto 0;
    height: 3px;
    border-radius: 999px;
    background: var(--line-strong);
    transform: translateY(-50%);
}

.player-fill {
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
    transform: translateY(-50%);
}

.player-fill::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--accent);
    opacity: 0;
    transform: translate(50%, -50%) scale(0.4);
    transition:
        opacity 0.2s var(--ease),
        transform 0.2s var(--ease);
}

.track:hover .player-fill::after,
.track.is-playing .player-fill::after,
.player-bar:focus-visible .player-fill::after {
    opacity: 1;
    transform: translate(50%, -50%) scale(1);
}

/* El anillo de foco, en forma de píldora, abraza el carril en vez de encajonarlo */
.player-bar:focus-visible {
    outline-offset: 3px;
    border-radius: 999px;
}

.player-time {
    flex-shrink: 0;
    min-width: 72px;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.player-sep {
    margin: 0 4px;
    opacity: 0.6;
}

.track.is-playing .player-time {
    color: var(--ink-soft);
}

/* Separador ornamental */
.divider {
    height: 1px;
    margin: 26px 16px;
    background: linear-gradient(
        to right,
        transparent,
        var(--line-strong),
        transparent
    );
}

/* --- Rejilla de vídeo ----------------------------------------------------- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}

.video-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition:
        transform 0.3s var(--ease),
        box-shadow 0.3s var(--ease),
        border-color 0.3s var(--ease);
}

.video-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

/* La miniatura es un botón: al pulsarlo el vídeo se abre en una ventana. */
.video-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    background: var(--ink);
    border: 0;
    border-radius: 0;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
}

.video-thumb img,
.video-thumb video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}

.video-card:hover .video-thumb img,
.video-card:hover .video-thumb video {
    transform: scale(1.03);
}

.video-card-info {
    padding: 15px 17px 17px;
}

.video-card-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.35;
    color: var(--ink);
}

.video-card-subtitle {
    margin-top: 5px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: var(--muted);
}

/* Sobreimpresión de reproducción (ocupa solo la zona de la miniatura) */
.video-thumb-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(
        180deg,
        rgba(28, 26, 23, 0) 55%,
        rgba(28, 26, 23, 0.22)
    );
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.video-card:hover .video-thumb-overlay,
.video-thumb:focus-visible .video-thumb-overlay {
    opacity: 1;
}

.video-thumb-overlay::after {
    content: '';
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background-color: rgba(250, 247, 242, 0.94);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%231c1a17'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 55% 50%;
    background-size: 22px 22px;
    box-shadow: 0 6px 18px rgba(28, 26, 23, 0.25);
}

/* Sin puntero (pantallas táctiles) el icono debe verse siempre. */
@media (hover: none) {
    .video-thumb-overlay {
        opacity: 1;
    }
}

.video-card.wide {
    grid-column: 1 / -1;
    max-width: 600px;
}

/* --- Embed de vídeo (YouTube) ---------------------------------------------- */
/* El embed sustituye al <video> local: muestra la miniatura local y, al pulsar,
   carga el reproductor incrustado (iframe de YouTube) en el mismo hueco. */
.video-embed {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--ink);
    cursor: pointer;
    overflow: hidden;
}

.video-embed img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}

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

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-embed.is-playing {
    cursor: default;
}

/* Sobreimpresión de reproducción sobre la miniatura del embed */
.video-embed .play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(
        180deg,
        rgba(28, 26, 23, 0) 55%,
        rgba(28, 26, 23, 0.22)
    );
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.video-card:hover .play-overlay,
.video-embed:focus-visible .play-overlay {
    opacity: 1;
}

.video-embed .play-overlay::after {
    content: '';
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background-color: rgba(250, 247, 242, 0.94);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%231c1a17'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 55% 50%;
    background-size: 22px 22px;
    box-shadow: 0 6px 18px rgba(28, 26, 23, 0.25);
}

@media (hover: none) {
    .video-embed .play-overlay {
        opacity: 1;
    }
}

/* --- Ventana de vídeo ----------------------------------------------------- */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: clamp(14px, 3vw, 40px);
    background: rgba(24, 21, 18, 0.94);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.28s var(--ease),
        visibility 0.28s var(--ease);
}

.video-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.video-modal-frame {
    position: relative;
    width: min(100%, 1080px);
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - 150px);
    background: #000;
    border-radius: var(--radius);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.97);
    transition: transform 0.28s var(--ease);
}

.video-modal.is-open .video-modal-frame {
    transform: scale(1);
}

.video-modal-player,
.video-modal-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.video-modal-caption {
    max-width: min(100%, 1080px);
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2vw, 1.2rem);
    text-align: center;
    color: rgba(250, 247, 242, 0.86);
}

.video-modal-close {
    position: absolute;
    top: clamp(12px, 2.5vw, 26px);
    right: clamp(12px, 2.5vw, 26px);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(250, 247, 242, 0.08);
    border: 1px solid rgba(250, 247, 242, 0.3);
    border-radius: 999px;
    color: var(--paper);
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.2s var(--ease),
        border-color 0.2s var(--ease);
}

.video-modal-close:hover {
    background: rgba(250, 247, 242, 0.18);
    border-color: rgba(250, 247, 242, 0.55);
}

body.has-modal {
    overflow: hidden;
}

/* --- Rejilla de libros ---------------------------------------------------- */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 32px 26px;
}

.book-card {
    display: flex;
    flex-direction: column;
}

.book-card img {
    width: 100%;
    aspect-ratio: 857 / 935; /* proporción común de las portadas */
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper-deep);
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.3s var(--ease),
        box-shadow 0.3s var(--ease);
}

.book-card:hover img {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.book-card-info {
    margin-top: 14px;
}

.book-card-title {
    font-size: 1.1rem;
    line-height: 1.35;
    color: var(--ink);
}

.book-card-desc {
    margin-top: 5px;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.book-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.book-card-links a {
    font-family: var(--font-sans);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--accent-ink);
    padding: 5px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    transition:
        background 0.2s var(--ease),
        color 0.2s var(--ease),
        border-color 0.2s var(--ease);
}

.book-card-links a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* --- Portada (home) ------------------------------------------------------- */
.home {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: clamp(40px, 8vw, 96px) clamp(18px, 5vw, 46px);
}

.home-wrap {
    width: 100%;
    max-width: 780px;
}

.home-hero {
    margin-bottom: clamp(30px, 6vw, 52px);
}

.home-hero h1 {
    font-size: clamp(2.4rem, 7vw, 3.6rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: 0.01em;
}

.home-hero h1::after {
    content: '';
    display: block;
    width: 64px;
    height: 2px;
    margin-top: 24px;
    background: var(--accent);
}

.home-nav {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
}

.home-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
    padding: 26px 6px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition:
        background 0.25s var(--ease),
        padding-left 0.25s var(--ease);
}

.home-link:hover {
    background: var(--accent-soft);
    padding-left: 18px;
}

.home-link-index {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    color: var(--accent-ink);
}

.home-link-title {
    display: block;
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--ink);
    line-height: 1.2;
}

.home-link-desc {
    display: block;
    margin-top: 3px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: var(--ink-soft);
}

.home-link-arrow {
    font-size: 1.2rem;
    color: var(--muted);
    transition:
        transform 0.25s var(--ease),
        color 0.25s var(--ease);
}

.home-link:hover .home-link-arrow {
    transform: translateX(5px);
    color: var(--accent-ink);
}

/* --- Galería de fotos y lightbox ----------------------------------------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(18px, 4vw, 46px) 90px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--paper-deep);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition:
        transform 0.6s var(--ease),
        filter 0.3s var(--ease);
}

.gallery-item:hover img {
    transform: scale(1.045);
    filter: brightness(0.88);
}

.gallery-item .caption {
    display: none;
}

.loading {
    grid-column: 1 / -1;
    padding: 60px;
    text-align: center;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--muted);
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(22, 19, 16, 0.96);
    animation: fadeIn 0.3s var(--ease);
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-content {
    max-width: 90%;
    max-height: 88%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 32px;
    font-size: 36px;
    line-height: 1;
    color: rgba(250, 247, 242, 0.85);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s var(--ease);
}

.lightbox-close:hover {
    color: #fff;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 44px;
    line-height: 1;
    color: rgba(250, 247, 242, 0.85);
    background: none;
    border: none;
    padding: 16px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s var(--ease);
}

.lightbox-nav:hover {
    color: #fff;
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: rgba(250, 247, 242, 0.85);
    text-align: center;
}

/* --- Adaptación a pantallas pequeñas ------------------------------------- */
@media (max-width: 720px) {
    .topbar {
        flex-direction: column;
        gap: 10px;
        padding: 12px 18px;
    }

    .topbar nav {
        justify-content: center;
        gap: 16px;
    }

    .page {
        padding-top: 36px;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .video-card-info {
        padding: 11px 12px 13px;
    }

    .video-card-title {
        font-size: 1rem;
    }

    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px 16px;
    }

    .track {
        flex-wrap: wrap;
        gap: 8px 12px;
        padding: 10px 8px;
    }

    .track-name {
        flex: 1 1 100%;
    }

    .player {
        flex: 1 1 100%;
        max-width: none;
    }

    .track-number {
        display: none;
    }

    .video-thumb-overlay::after {
        width: 44px;
        height: 44px;
        background-size: 18px 18px;
    }

    .video-modal-frame {
        max-height: calc(100vh - 118px);
    }
}

@media (max-width: 440px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Accesibilidad: movimiento reducido ---------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}




/* Enlace a transcripción bajo una pista ---------------------------------- */
.track-link {
    margin-top: 14px;
    font-family: var(--font-serif);
}
