/* Radio ATP — estructura compartida de los temas Vice.
   Cada tema define sus tokens (--hoja-*, --foco, fuentes) y su propio aspecto;
   aquí vive solo lo que hace que la página funcione igual que index.html:
   hojas modales, página fija en el teléfono, volumen solo con mouse, etc. */

/* Fuente de las lyrics cards e historias que dibuja compartir.js en canvas */
@font-face {
  font-family: "alte_haas_groteskbold";
  src: url("../fonts/AlteHaasGroteskBold.woff2") format("woff2"), url("../fonts/AlteHaasGroteskBold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--borde-abajo, #000); }
body { min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
button, a, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
img { display: block; }
.hidden { display: none !important; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fade-out { opacity: 0 !important; }
:focus-visible { outline: 3px solid var(--foco, #fff); outline-offset: 3px; }

/* --- Play: indicador de carga mientras conecta ----------------------------- */
.play { cursor: pointer; }
.play[disabled] { opacity: 0.35; cursor: not-allowed; }
.play.cargando { cursor: progress; }
.play.cargando svg { display: none; }
.play.cargando::after {
  content: "";
  width: 40%; aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, currentColor 28%, transparent);
  border-top-color: currentColor;
  animation: girar 0.8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* --- Volumen: solo con mouse (en el teléfono manda el volumen del equipo) --- */
.volumen { display: none; }
@media (hover: hover) and (pointer: fine) { .volumen { display: flex; } }

/* --- Links: en escritorio la lista; en el teléfono un botón que abre una hoja */
.botones-detalle .boton-enlaces { display: none; }

/* --- Hojas modales ---------------------------------------------------------- */
.hoja {
  border: 0;
  padding: 0;
  margin: auto auto 0;
  width: 100%;
  max-width: 560px;
  height: 92dvh;
  max-height: 92dvh;
  border-radius: var(--hoja-radio, 24px) var(--hoja-radio, 24px) 0 0;
  color: var(--hoja-texto, #fff);
  background: var(--hoja-fondo, rgba(20, 20, 24, 0.9));
  -webkit-backdrop-filter: blur(40px) saturate(160%);
          backdrop-filter: blur(40px) saturate(160%);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.hoja[open] { display: flex; flex-direction: column; animation: subir 0.35s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes subir { from { transform: translateY(48px); opacity: 0; } }
.hoja::backdrop { background: rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hoja-cabecera { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 18px; border-bottom: 1px solid var(--hoja-linea, rgba(255, 255, 255, 0.1)); flex: none; }
.hoja-portada { width: 48px; height: 48px; border-radius: var(--hoja-portada-radio, 8px); object-fit: cover; flex: none; background: rgba(255, 255, 255, 0.1); }
.hoja-texto { min-width: 0; }
.hoja-titulo { font-family: var(--fuente-titulo, inherit); font-weight: 700; font-size: 1.0625rem; line-height: 1.2; overflow-wrap: anywhere; }
.hoja-artista { font-size: 0.875rem; color: var(--hoja-texto-2, rgba(255, 255, 255, 0.65)); }
.hoja-cerrar {
  margin-left: auto;
  width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.hoja-cerrar:hover { background: rgba(255, 255, 255, 0.2); }
.hoja-cerrar:active { transform: scale(0.92); }
.hoja-cerrar svg { width: 15px; height: 15px; fill: currentColor; }
.hoja-letra {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  padding: 24px 24px 48px;
  white-space: pre-line;
  font-family: var(--fuente-letra, inherit);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--hoja-texto, #fff);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.hoja-dato { font-size: 1.1875rem; font-weight: 600; }
.hoja.hoja-enlaces { height: auto; max-height: min(76dvh, 620px); }
.hoja-enlaces-lista {
  min-height: 0;
  display: grid;
  gap: 9px;
  padding: 18px 18px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.hoja-enlaces-lista .enlace { justify-content: flex-start; min-height: 50px; padding-inline: 16px; }
.hoja :focus-visible { outline-color: #fff; }
body:has(.hoja[open]) { overflow: hidden; }
@media (min-width: 700px) {
  .hoja { margin: auto; height: min(82dvh, 760px); border-radius: var(--hoja-radio, 24px); }
}

/* --- Teléfono: la página no se desplaza; lo largo vive en hojas ------------- */
@media (max-width: 600px) {
  html.pagina-fija { scrollbar-width: none; }
  html.pagina-fija::-webkit-scrollbar { display: none; }
  html.pagina-fija, html.pagina-fija body { overscroll-behavior-y: none; }
  html.pagina-fija body { touch-action: pan-x pinch-zoom; }
  html.pagina-fija body:has(.hoja[open]) { touch-action: pan-y pinch-zoom; }
  .botones-detalle { display: none; }
  html.con-extras .botones-detalle { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  html.con-extras .botones-detalle .boton-enlaces:not(.hidden) { display: flex; }
  .enlaces { display: none !important; }
}

/* --- Safari 26 rellena la barra de estado con el color de un fixed arriba --- */
.safari-borde {
  position: fixed; right: 0; left: 0; top: 0;
  z-index: 2147483647;
  height: 0;
  pointer-events: none;
  background-color: var(--borde-arriba, #000);
  background-clip: text; -webkit-background-clip: text;
}
@supports (-webkit-touch-callout: none) {
  @media (max-width: 600px) and (hover: none) and (pointer: coarse) {
    .safari-borde { height: 11px; }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .play.cargando::after { animation-duration: 2s !important; animation-iteration-count: infinite !important; }
}
