/**
 * =============================================================================
 * css/home.css — Estilos propios de la home
 * =============================================================================
 * Estaba embebido en index.html. Al vivir en un archivo aparte, nginx lo sirve
 * con `Cache-Control: immutable` por un año, en vez de volver a descargarlo en
 * cada navegación junto con el HTML.
 *
 * OJO AL EDITARLO: con `immutable`, el navegador NO revalida durante un año.
 * Si se cambia algo acá hay que renombrar el archivo (o agregarle un sufijo de
 * versión) para que los lectores que ya lo tienen cacheado vean el cambio.
 *
 * Va enlazado ANTES de assets/tailwind.css, igual que cuando era un <style>:
 * el CDN inyectaba su hoja al final, así que las utilidades de Tailwind ganan
 * los empates de especificidad contra estas clases.
 * =============================================================================
 */

  /* ---------------------------------------------------------------------
     Foco de teclado, global. Se usa :focus-visible y no :focus para que el
     anillo aparezca al tabular pero NO al hacer clic con el mouse.
     Sin `border-radius`: el outline ya sigue el radio propio de cada
     elemento, y forzar 4px cuadraría las píldoras y los botones circulares.
     --------------------------------------------------------------------- */
  :focus-visible {
    outline: 2px solid #a855f7;
    outline-offset: 2px;
  }

  /* Enlace de salto: fuera de pantalla hasta recibir foco de teclado. */
  .saltar-contenido {
    position: absolute; left: -9999px;
    background: #a855f7; color: #fff; padding: .75rem 1.25rem;
    border-radius: 0 0 8px 0; z-index: 100; font-weight: 600;
  }
  .saltar-contenido:focus { left: 0; top: 0; }

  /* ---------------------------------------------------------------------
     Área táctil mínima de 44x44 px (WCAG 2.5.5) sin tocar el tamaño visible.
     El pseudo-elemento se centra sobre el control y crece SOLO hasta el
     mínimo: así sirve igual en un botón de 32 px que en uno de 16 px.
     (Un `inset: -8px` fijo suma 16 px y deja los controles chicos por debajo.)
     --------------------------------------------------------------------- */
  .toque-44 { position: relative; }
  .toque-44::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    min-width: 44px;
    min-height: 44px;
  }

  body { font-family: 'Inter', sans-serif; font-size: 14px; }
  .font-display { font-family: 'Sora', sans-serif; }
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: #190f2b; }
  ::-webkit-scrollbar-thumb { background: #3a2a5c; border-radius: 8px; }
  .card-hover { transition: transform .2s ease, box-shadow .2s ease; }
  .card-hover:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -8px rgba(168,85,247,0.35); }


  /* type="search" hace que WebKit dibuje su propio botón de borrar dentro del
     campo. El preflight de Tailwind no lo quita y aparecería al escribir. */
  input[type="search"]::-webkit-search-cancel-button,
  input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
  }
  /* ---- Chips de género: pastillas glass ---- */
  .chip-glass {
    border-radius: 9999px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 55%, rgba(0, 0, 0, 0.10) 100%),
      rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-top-color: rgba(255, 255, 255, 0.28);
    box-shadow:
      inset 0 1px 1px 0 rgba(255, 255, 255, 0.28),
      inset 0 -3px 8px 0 rgba(0, 0, 0, 0.12);
    color: #cbd5e1;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .chip-glass:hover {
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.30);
    border-top-color: rgba(255, 255, 255, 0.5);
    box-shadow:
      inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.45),
      inset 0 -3px 8px 0 rgba(0, 0, 0, 0.12),
      0 4px 12px rgba(168, 85, 247, 0.22);
  }
  .genre-chip.active {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(0, 0, 0, 0.10) 100%),
      #a855f7;
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.30);
    border-top-color: rgba(255, 255, 255, 0.6);
    box-shadow:
      inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.7),
      inset 0 -2px 5px 0 rgba(0, 0, 0, 0.18),
      0 4px 14px rgba(168, 85, 247, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  }
  .modal-enter { animation: modalIn .2s ease forwards; }
  @keyframes modalIn { from { opacity:0; transform: scale(0.97); } to { opacity:1; transform: scale(1); } }
  .backdrop-enter { animation: fadeIn .2s ease forwards; }
  @keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
  .reader-page { max-width: 760px; }
  .hero-slide { transition: opacity .7s ease; }
  .scrollbar-hide::-webkit-scrollbar { display: none; }
  .scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
  .cover-tilt { transform: rotate(4deg); transition: transform .4s ease; }
  .cover-tilt:hover { transform: rotate(0deg) scale(1.02); }
  @keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
  .marquee-track { animation: marquee 40s linear infinite; }
  .marquee-track:hover { animation-play-state: paused; }
  /* ---- Design tokens: badges glossy glass ---- */
  :root {
    --color-text-on-action: #FFFFFF;
    --size-icon-base: 24px;
    --size-icon-button: 40px;
  }
  /* Acabado glass reutilizable: brillo superior + bisel interior + halo de color */
  .icon-glass {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(0, 0, 0, 0.08) 100%),
      var(--badge-color);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow:
      inset 0 1px 1.5px rgba(255, 255, 255, 0.7),
      inset 0 -2px 4px rgba(0, 0, 0, 0.15),
      0 4px 12px var(--badge-glow);
  }
  .badge-glass-pink   { --badge-color: #FF3377; --badge-glow: rgba(255, 51, 119, 0.35); }
  .badge-glass-blue   { --badge-color: #0066FF; --badge-glow: rgba(0, 102, 255, 0.35); }
  .badge-glass-green  { --badge-color: #00E676; --badge-glow: rgba(0, 230, 118, 0.35); }
  .badge-glass-violet { --badge-color: #7C3AED; --badge-glow: rgba(124, 58, 237, 0.35); }
  /* Azul índigo tomado de la ilustración Biblioteca-catálogo */
  .badge-glass-indigo { --badge-color: #3A3AF0; --badge-glow: rgba(58, 58, 240, 0.35); }
  .icon-badge {
    width: var(--size-icon-button);
    height: var(--size-icon-button);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .icon-badge__icon {
    width: var(--size-icon-base);
    height: var(--size-icon-base);
    fill: #FFFFFF;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  }
  .badge-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--size-icon-button);
    padding: 0 12px;
    border-radius: 9999px;
    color: var(--color-text-on-action);
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  }
  /* ---- Cápsulas de género: Dual-point Gradient Glass ---- */
  .capsule-glass {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    width: 100%;
    border-radius: 9999px;
    padding: 0 16px 0 44px;
    cursor: pointer;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 40%),
      radial-gradient(circle at 85% 100%, var(--color-point-2) 0%, transparent 65%),
      radial-gradient(circle at 15% 0%, var(--color-point-1) 0%, transparent 65%),
      rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(255, 255, 255, 0.35);
    border-left-color: rgba(255, 255, 255, 0.25);
    box-shadow:
      inset 0 1px 1px 0 rgba(255, 255, 255, 0.4),
      inset 0 -8px 24px 0 rgba(255, 255, 255, 0.08),
      0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .capsule-glass:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: rgba(255, 255, 255, 0.6);
    border-left-color: rgba(255, 255, 255, 0.45);
    box-shadow:
      inset 0 1px 2px 0 rgba(255, 255, 255, 0.6),
      inset 0 -8px 24px 0 rgba(255, 255, 255, 0.12),
      0 12px 36px 0 rgba(0, 0, 0, 0.35);
  }
  .capsule-mascot {
    position: absolute;
    left: 8px;
    height: 36px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
    pointer-events: none;
    z-index: 10;
  }
  .capsule-text {
    color: #FFFFFF;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    user-select: none;
    white-space: nowrap;
  }
  /* ============================================================
     Medallas del ranking — resplandor morado neón
     El glow va por CSS y no dentro del SVG: drop-shadow sigue la silueta
     real de la medalla (círculo + cinta), no su caja rectangular.
     Nota: drop-shadow() acepta UNA sombra; para dos capas se encadenan.
     ============================================================ */
  .medalla-ranking {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1);
  }
  .medalla-ranking:hover { transform: scale(1.10); }

  .medalla-ranking--1 {
    filter: drop-shadow(0 0 16px rgba(189, 0, 255, .85))
            drop-shadow(0 0 30px rgba(157, 78, 221, .45));
  }
  .medalla-ranking--2 {
    filter: drop-shadow(0 0 14px rgba(189, 0, 255, .70))
            drop-shadow(0 0 24px rgba(157, 78, 221, .35));
  }
  .medalla-ranking--3 {
    filter: drop-shadow(0 0 12px rgba(189, 0, 255, .60))
            drop-shadow(0 0 20px rgba(157, 78, 221, .30));
  }

  @media (prefers-reduced-motion: reduce) {
    .medalla-ranking { transition: none; }
    .medalla-ranking:hover { transform: none; }
  }
