/* rb-yt — estilos propios sobre Bootstrap 5.3 (base de rb-telefonico / rb-fl5). Se usa sobre todo en el celular:
   ahí la letra base es 16px (la del sistema) y se agranda con el zoom del teléfono; en la computadora es 18px ajustable
   (A−/A+). Atkinson Hyperlegible, contrastes AA o mejores en claro y oscuro y foco siempre visible. */

@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/vendor/fonts/atkinson-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/vendor/fonts/atkinson-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/vendor/fonts/atkinson-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/vendor/fonts/atkinson-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* --- Escala de letra (la elige el usuario, queda en localStorage) --- */
html[data-escala="0"] { font-size: 100%; }    /* 16px */
html[data-escala="1"] { font-size: 112.5%; }  /* 18px, por defecto */
html[data-escala="2"] { font-size: 125%; }    /* 20px */
html[data-escala="3"] { font-size: 137.5%; }  /* 22px */
/* Celular: letra del sistema, sin escala propia (el A−/A+ no se muestra). */
@media (max-width: 767.98px) { html[data-escala] { font-size: 100%; } }

:root {
  --bs-body-font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-line-height: 1.55;
  --foco: #0b57d0;
  --marca: #0f766e;               /* verde azulado: nada que ver con el rojo de YouTube */
}
[data-bs-theme="light"] {
  --bs-body-color: #16181b;               /* casi negro: contraste ~17:1 */
  --bs-body-bg: #f3f5f9;                  /* lienzo gris azulado: las tarjetas blancas resaltan */
  --bs-secondary-color: #4a5058;          /* texto secundario ≥ 7:1 (AAA) */
  --bs-link-color: #0a4fb8; --bs-link-color-rgb: 10, 79, 184;
  --bs-link-hover-color: #073a88; --bs-link-hover-color-rgb: 7, 58, 136;
  --fondo-tarjeta: #ffffff;
}
[data-bs-theme="dark"] {
  --bs-body-bg: #121417;
  --bs-body-color: #eceff3;
  --bs-secondary-color: #bcc3cc;          /* ≥ 9:1 sobre el fondo oscuro */
  --bs-tertiary-bg: #1b1f24;
  --bs-link-color: #8ab4ff; --bs-link-color-rgb: 138, 180, 255;
  --bs-link-hover-color: #b3ceff; --bs-link-hover-color-rgb: 179, 206, 255;
  --foco: #8ab4ff;
  --fondo-tarjeta: #1b1f24;
}

/* Foco bien visible para quien navega con teclado */
:focus-visible { outline: 3px solid var(--foco) !important; outline-offset: 2px; box-shadow: none !important; }
.btn, .form-control, .form-select { --bs-border-width: 1.5px; }
.form-control::placeholder { color: var(--bs-secondary-color); opacity: .85; }
[hidden] { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }
.card { --bs-card-bg: var(--fondo-tarjeta); }

/* --- Nav --- */
.navbar .nav-link, .dropdown-item { font-size: 1rem; }
.navbar .nav-link.active, .navbar .dropdown-toggle.active { font-weight: 700; text-decoration: underline; text-underline-offset: .35em; }
.dropdown-menu { max-height: calc(100vh - 6rem); max-height: calc(100dvh - 6rem); overflow-y: auto; }
.logo { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: .5rem;
  background: var(--marca); color: #fff; font-weight: 700; }
[data-bs-theme="light"] .tema-claro, [data-bs-theme="dark"] .tema-oscuro { display: none; }
.menu-usuario .dropdown-menu { min-width: 16rem; }
/* Celular (menú plegado): los desplegables bajan dentro del menú ocupando el ancho, así no quedan fuera de la pantalla. */
@media (max-width: 767.98px) {
  .navbar-collapse > .d-flex { flex-wrap: wrap; align-items: flex-start !important; }
  .menu-usuario { flex: 1 1 auto; }
  .menu-usuario .dropdown-menu { position: static; width: 100%; min-width: 0; margin-top: .5rem; }
}

.login-card { border-radius: 1rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* La confirmación puede abrirse sobre otro modal: va por encima. */
#confirmModal { z-index: 1070; }

/* --- Lista "Para ver": miniatura a la izquierda (celular) o arriba (pantallas anchas, en grilla). --- */
.contenido { max-width: 72rem; }
.videos { display: grid; gap: .75rem; margin: 0; }
.video { display: grid; grid-template-columns: 9.5rem 1fr auto; gap: .75rem; align-items: start; padding: .5rem;
  background: var(--fondo-tarjeta); border: 1px solid var(--bs-border-color); border-radius: .75rem; }
.miniatura { position: relative; display: block; border-radius: .5rem; overflow: hidden; aspect-ratio: 16 / 9; background: #000; }
.miniatura img { display: block; width: 100%; height: 100%; object-fit: cover; }
.duracion { position: absolute; right: .25rem; bottom: .3rem; padding: 0 .3rem; border-radius: .25rem; font-size: .8rem;
  font-weight: 700; color: #fff; background: rgb(0 0 0 / .8); }
.avance { position: absolute; left: 0; bottom: 0; height: .25rem; background: var(--marca); }
.video .datos { min-width: 0; }
.video .titulo { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-weight: 700;
  line-height: 1.3; color: var(--bs-body-color); text-decoration: none; overflow-wrap: anywhere; }
.video .titulo:hover { text-decoration: underline; }
.video .canal { font-size: .9rem; color: var(--bs-secondary-color); margin-top: .2rem; }
@media (min-width: 768px) {
  .videos { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
  .video { grid-template-columns: 1fr auto; }
  .video .miniatura { grid-column: 1 / -1; }
}
.vacio { padding: 2rem 1rem; text-align: center; background: var(--fondo-tarjeta); border: 1px dashed var(--bs-border-color); border-radius: .75rem; }

/* --- Agregar / compartir --- */
.resultados { display: grid; gap: .5rem; }
.resultado { display: flex; gap: .5rem; align-items: baseline; padding: .5rem .75rem; border-radius: .5rem;
  background: var(--fondo-tarjeta); border: 1px solid var(--bs-border-color); overflow-wrap: anywhere; }
.resultado-guardado > .bi { color: var(--bs-success-text-emphasis); }
.resultado-no_es_link > .bi, .resultado-no_existe > .bi, .resultado-short > .bi { color: var(--bs-danger-text-emphasis); }
.miniatura-grande { display: block; width: 100%; max-width: 32rem; height: auto; border-radius: .75rem; }
.miniatura-chica { flex: none; width: 7.5rem; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .4rem; }
.min-w-0 { min-width: 0; }

/* --- Vistos --- */
.vistos { display: grid; gap: .75rem; max-width: 48rem; }
.visto { padding: .75rem; background: var(--fondo-tarjeta); border: 1px solid var(--bs-border-color); border-radius: .75rem; }

/* --- Reproductor: 16:9 a lo ancho, sin pasarse del alto de la pantalla. --- */
.ver { max-width: 72rem; }
.escenario { position: relative; width: 100%; max-height: calc(100dvh - 7rem); aspect-ratio: 16 / 9; margin: 0 auto;
  background: #000; border-radius: .5rem; overflow: hidden; }
.escenario iframe, #reproductor { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Franja arriba sin clics: ahí YouTube pone el título y el canal, que llevan a su app. */
.tapa-arriba { position: absolute; inset: 0 0 auto 0; height: 18%; }
/* Pausa: tapa la mitad de abajo (los "más videos") y deja ver la de arriba (para leer la pantalla). */
.pausa { position: absolute; inset: 50% 0 0 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(transparent, rgb(0 0 0 / .92) 25%); }
.escenario:fullscreen { max-height: none; border-radius: 0; aspect-ratio: auto; }
.terminado { padding: 1rem; background: var(--fondo-tarjeta); border: 1px solid var(--bs-border-color); border-radius: .75rem; max-width: 48rem; }
.nota textarea { max-width: 48rem; }
