/* ===== Tokens ===== */
:root {
  --bg: #f6f6f8;
  --surface: #ffffff;
  --surface-2: #eeeef2;
  --text: #16161d;
  --muted: #62626f;
  --border: #e2e2e8;
  --accent: #e11d48;
  --accent-ink: #ffffff;
  --accent-soft: #ffe4ea;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .06);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f14; --surface: #191920; --surface-2: #24242d; --text: #ececf1; --muted: #9d9daa;
    --border: #2c2c36; --accent: #fb3d63; --accent-soft: #3a1520; --shadow: 0 1px 2px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f14; --surface: #191920; --surface-2: #24242d; --text: #ececf1; --muted: #9d9daa;
  --border: #2c2c36; --accent: #fb3d63; --accent-soft: #3a1520; --shadow: 0 1px 2px rgb(0 0 0 / .4);
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
body.has-player { padding-bottom: 84px; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mt { margin-top: 2.5rem; }
.wrap { max-width: 1260px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== Cabecera ===== */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.search { flex: 1; display: flex; max-width: 520px; margin-left: auto; background: var(--surface-2); border-radius: 999px; border: 1px solid transparent; }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 16px; font: inherit; color: inherit; outline: none; }
.search button { border: 0; background: transparent; color: var(--muted); padding: 0 14px; cursor: pointer; }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; font-size: 1rem; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.main-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: .9rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current] { color: var(--accent); background: var(--accent-soft); }
.nav-mood { opacity: .9; }
@media (max-width: 640px) {
  .logo-text { display: none; }
  .header-inner { gap: 8px; }
}

/* ===== Maquetación ===== */
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 20px; padding-bottom: 40px; }
.sidebar { display: none; }
@media (min-width: 1100px) {
  .page:has(.ad-sidebar) { grid-template-columns: minmax(0, 1fr) 300px; }
  .sidebar:has(.ad) { display: block; }
  .sidebar .sticky { position: sticky; top: 130px; }
}
main section { margin-bottom: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }

/* ===== Portada ===== */
.hero { padding: 20px 0 8px; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0 0 6px; }
.hero h1 span { color: var(--accent); }
.hero p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 32px; }
.chip { text-decoration: none; background: var(--surface); border: 1px solid var(--border); padding: 7px 14px; border-radius: 999px; font-size: .9rem; font-weight: 500; white-space: nowrap; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chips-sm { margin: 10px 0 0; }
.chips-sm .chip { padding: 4px 11px; font-size: .82rem; }
.strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.strip .card { flex: 0 0 150px; }

/* ===== Tarjetas ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-link { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px 12px 14px; text-decoration: none; height: 100%; }
.card-name { font-weight: 650; font-size: .95rem; margin-top: 10px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { color: var(--muted); font-size: .78rem; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card-play { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; opacity: 0; transform: scale(.85); transition: .15s; box-shadow: 0 4px 12px rgb(225 29 72 / .35); }
.card:hover .card-play, .card-play:focus-visible, .card-play.is-playing { opacity: 1; transform: none; }
@media (hover: none) { .card-play { opacity: 1; transform: none; width: 32px; height: 32px; } }
.grid-ad { grid-column: 1 / -1; }

/* Logos */
.logo-img { position: relative; display: grid; place-items: center; flex-shrink: 0; border-radius: 12px; overflow: hidden; background: hsl(var(--h) 65% 46%); color: #fff; }
.logo-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo-img:has(img) { background: #fff; }
.logo-img:has(img) .logo-fallback { visibility: hidden; }
.logo-dark img, .logo-dark:has(img) { background: #1d1d24; }
.logo-fallback { font-weight: 800; letter-spacing: -.02em; }
.logo-md { width: 96px; height: 96px; font-size: 1.6rem; }
.logo-xl { width: 160px; height: 160px; font-size: 2.6rem; border-radius: 22px; box-shadow: var(--shadow); }
.logo-sm { width: 44px; height: 44px; font-size: .9rem; border-radius: 9px; }
@media (max-width: 480px) { .logo-md { width: 76px; height: 76px; } }

/* Iconos play/pausa dibujados con CSS */
.i-play { width: 0; height: 0; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent currentColor; margin-left: 3px; }
.is-playing .i-play, .is-loading .i-play { width: 12px; height: 14px; border: 0; margin: 0; border-left: 4px solid currentColor; border-right: 4px solid currentColor; }
.is-loading .i-play { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
/* Cuando el navegador bloquea la reproducción automática: invita a pulsar */
.needs-tap { animation: ring 1.6s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgb(225 29 72 / .55); } 70% { box-shadow: 0 0 0 16px rgb(225 29 72 / 0); } 100% { box-shadow: 0 0 0 0 rgb(225 29 72 / 0); } }

/* ===== Cabeceras de listados ===== */
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
.page-head p { margin: 0; color: var(--muted); max-width: 70ch; }
.page-icon { font-size: 2rem; width: 60px; height: 60px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; flex-shrink: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 14px; }
.tile { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-decoration: none; }
.tile:hover { border-color: var(--accent); }
.tile-icon { font-size: 1.5rem; margin-bottom: 6px; }
.tile small { color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 28px; }
.pagination a, .pagination span { min-width: 40px; padding: 8px 12px; border-radius: 10px; text-align: center; text-decoration: none; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }
.pagination a:hover { border-color: var(--accent); }
.pagination span[aria-current] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.search-big { max-width: 640px; margin: 0 0 28px; }
.search-big button { background: var(--accent); color: var(--accent-ink); border-radius: 999px; margin: 4px; padding: 0 20px; font-weight: 600; }

/* ===== Ficha de emisora ===== */
.station-head { display: flex; gap: 28px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px; margin-bottom: 24px; }
.station-info { min-width: 0; }
.station-info h1 { margin: 0; font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
.station-info h1 span { color: var(--muted); font-weight: 500; font-size: .6em; display: block; margin-top: 4px; }
.station-sub { margin: 8px 0 0; color: var(--muted); }
.station-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; }
.btn-play { display: inline-flex; align-items: center; gap: 12px; border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; font-size: 1.05rem; padding: 14px 28px 14px 22px; border-radius: 999px; cursor: pointer; box-shadow: 0 6px 20px rgb(225 29 72 / .35); transition: transform .1s; }
.btn-play:active { transform: scale(.97); }
.btn-play .i-play { border-width: 9px 0 9px 15px; }
.btn-play.is-playing .i-play, .btn-play.is-loading .i-play { width: 15px; height: 18px; border-left-width: 5px; border-right-width: 5px; }
.btn-round { width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.btn-round:hover { color: var(--accent); border-color: var(--accent); }
.fav-btn svg path { fill: none; stroke: currentColor; stroke-width: 2; }
.fav-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.fav-btn[aria-pressed="true"] svg path { fill: currentColor; }
.note { margin: 14px 0 0; font-size: .85rem; color: var(--muted); }
.station-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; margin: 24px 0 36px; }
.prose, .facts { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.prose h2, .facts h2 { margin-bottom: 12px; }
.prose p { margin: 0 0 12px; }
.prose a { color: var(--accent); }
.facts dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts a { color: var(--accent); }
.share-links { font-size: .9rem; }
@media (max-width: 760px) {
  .station-head { flex-direction: column; text-align: center; padding: 24px 16px; gap: 18px; }
  .station-head .chips-sm, .station-actions { justify-content: center; }
  .logo-xl { width: 128px; height: 128px; }
  .station-body { grid-template-columns: 1fr; }
}
.seo-text { margin-top: 12px; }
.legal { max-width: 820px; }
.legal h1 { margin-top: 0; }
.legal h2 { margin: 24px 0 8px; font-size: 1.1rem; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink) !important; padding: 10px 20px; border-radius: 999px; text-decoration: none; font-weight: 600; }
.notfound { text-align: center; padding: 40px 0; }
.notfound .big { font-size: 5rem; font-weight: 900; color: var(--accent); margin: 0; line-height: 1; }
.notfound .search-big { margin: 20px auto; }

/* ===== Anuncios ===== */
.ad { margin: 16px auto; text-align: center; min-height: 90px; }
.ad-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.ad-player { margin: 0 0 24px; min-height: 250px; }
.ad-sidebar { min-height: 600px; margin: 0; }
.ad-placeholder { display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, transparent 10px, transparent 20px); border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: .8rem; }
.grid-ad .ad { margin: 4px 0; }

/* ===== Pie ===== */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 0 24px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 24px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
.footer-brand { font-weight: 800; font-size: 1.05rem; margin: 0 0 6px; }
.footer-title { font-weight: 700; margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.site-footer ul a { text-decoration: none; color: var(--muted); }
.site-footer ul a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 16px; font-size: .8rem; }

/* ===== Reproductor fijo ===== */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 24px rgb(0 0 0 / .08); }
.player-inner { display: flex; align-items: center; gap: 16px; height: 72px; }
.player-station { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; text-decoration: none; }
.player-logo { display: contents; }
.player-text { display: flex; flex-direction: column; min-width: 0; }
.player-text strong, .player-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-text small { color: var(--muted); }
.player-controls { display: flex; align-items: center; gap: 10px; }
.play-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; }
#player-volume { width: 110px; accent-color: var(--accent); }
@media (max-width: 560px) { #player-volume { display: none; } }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; margin-right: 6px; }
.eq i { width: 3px; background: var(--accent); animation: eq .9s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 10px; } }
@media (prefers-reduced-motion: reduce) { .eq i, .is-loading .i-play { animation: none; } .card { transition: none; } }
