/* ==========================================================================
   anuncios.com.es — componentes del módulo de anuncios y retoques de identidad
   Versión: 1.0 (2026-10-14)
   Carga después de style.css y reutiliza sus variables (--ink, --paper, --accent, --sun…).
   Motivo gráfico: barras de color de la carta de ajuste de la televisión.
   ========================================================================== */

:root {
  --bar-1: #ff7a5c; --bar-2: #f6b81a; --bar-3: #2fc4a5; --bar-4: #8f7cf5; --bar-5: #4aa8ff; --bar-6: #e85d9b; --bar-7: #faf6ee;
  --shadow: 0 1px 2px rgba(27, 23, 64, .08), 0 8px 24px -12px rgba(27, 23, 64, .25);
}
@media (prefers-color-scheme: dark) { :root { --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -12px rgba(0, 0, 0, .6); } }

/* ---------- Cabecera ---------- */
.brand-mark { width: 44px; height: 40px; color: var(--ink); }
.brand-name { font: 700 1.05rem/1 var(--f-display); letter-spacing: -.02em; }
.brand-name b { font-weight: 800; color: var(--accent); }
.hdr-search { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink-2); margin-left: auto; }
.hdr-search:hover { background: var(--accent-soft); color: var(--accent); }
.nav-main { margin-left: .5rem; }
.nav-main + .hdr-search { margin-left: 0; }
.nav-main a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); }
.nav-mobile a[aria-current="page"] { color: var(--accent); }
.btn { background: var(--ink); border-color: var(--ink); }
.btn-test { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-test:hover { color: var(--accent); }
@media (max-width: 1119px) { .hdr-search { margin-left: auto; } .nav-mobile { margin-left: 0; } }
:focus-visible { outline-color: var(--accent); }

/* ---------- Portada ---------- */
.hero { position: relative; background: var(--ink); color: var(--paper); overflow: hidden; }
@media (prefers-color-scheme: dark) { .hero { background: #1c1941; color: #f4efe4; } }
.hero-grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); padding-top: clamp(2rem, 5vw, 4rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem); align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.hero .eyebrow { display: inline-flex; align-items: center; gap: .5em; font: 600 .85rem/1 var(--f-text); letter-spacing: .08em; text-transform: uppercase; color: var(--sun); margin: 0 0 1rem; }
.hero h1 { color: #fff; font-size: clamp(1.75rem, 4.6vw, 3rem); margin-bottom: .6em; }
.hero .lede { font-size: clamp(1.05rem, 1.8vw, 1.25rem); line-height: 1.55; color: #d9d5ef; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero .btn { background: var(--sun); border-color: var(--sun); color: #1b1740; }
.hero .btn:hover { background: transparent; color: var(--sun); }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.hero .btn-ghost:hover { background: #fff; color: #1b1740; border-color: #fff; }
.hero-stat { margin: 1.5rem 0 0; font-size: .98rem; color: #b8b3d6; }
.hero-stat strong { font: 700 1.6rem/1 var(--f-display); color: #fff; margin-right: .25em; }
.hero-video { min-width: 0; }
.hero-video-label { display: flex; align-items: center; gap: .5em; font: 700 .8rem/1 var(--f-text); letter-spacing: .08em; text-transform: uppercase; color: var(--sun); margin: 0 0 .6rem; }
.hero-video-title { margin: .8rem 0 0; font-weight: 700; line-height: 1.3; }
.hero-video-title a { color: #fff; text-decoration: none; }
.hero-video-title a:hover { text-decoration: underline; }
.hero-video-title span { display: block; font-weight: 500; font-size: .92rem; color: #b8b3d6; margin-top: .2rem; }
.color-bars { display: flex; height: 10px; }
.color-bars i { flex: 1; }
.color-bars i:nth-child(1) { background: var(--bar-7); } .color-bars i:nth-child(2) { background: var(--bar-2); } .color-bars i:nth-child(3) { background: var(--bar-3); }
.color-bars i:nth-child(4) { background: var(--bar-4); } .color-bars i:nth-child(5) { background: var(--bar-1); } .color-bars i:nth-child(6) { background: var(--bar-5); } .color-bars i:nth-child(7) { background: var(--bar-6); }

/* ---------- Secciones de la portada ---------- */
.band { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.band-alt { background: color-mix(in srgb, var(--surface) 70%, var(--paper)); border-block: 1px solid var(--line); }
.band-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .5rem 1.5rem; margin-bottom: 1.5rem; }
.band-head h2 { margin: 0; position: relative; padding-left: 1rem; }
.band-head h2::before { content: ""; position: absolute; left: 0; top: .1em; bottom: .1em; width: 5px; border-radius: 3px; background: linear-gradient(var(--bar-1), var(--bar-2) 50%, var(--bar-3)); }
.band-head a { font-weight: 700; display: inline-flex; align-items: center; gap: .35em; }

.decades { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .decades { grid-template-columns: repeat(4, 1fr); } }
.decades a { --c: var(--accent); display: flex; flex-direction: column; justify-content: flex-end; min-height: 8.5rem; padding: 1rem 1.1rem; border-radius: var(--r-m); text-decoration: none; color: #fff;
  background: linear-gradient(155deg, color-mix(in srgb, var(--c) 92%, #000) 0%, color-mix(in srgb, var(--c) 70%, #1b1740) 100%); box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .15s; }
.decades a::after { content: ""; position: absolute; right: -18px; top: -18px; width: 80px; height: 80px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.decades a:hover { transform: translateY(-3px); }
.decades b { font: 800 clamp(1.6rem, 3.2vw, 2.3rem)/1 var(--f-display); letter-spacing: -.03em; }
.decades span { font: 600 .85rem/1 var(--f-text); text-transform: uppercase; letter-spacing: .08em; opacity: .9; order: -1; margin-bottom: .2rem; }
.decades small { font-size: .9rem; opacity: .9; margin-top: .4rem; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); }
.tiles a { --c: var(--accent); display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); font-weight: 700; line-height: 1.2; transition: border-color .15s, transform .15s; }
.tiles a:hover { border-color: var(--c); transform: translateY(-2px); }
.tiles .icon { width: 2.1rem; height: 2.1rem; padding: .45rem; border-radius: 10px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); flex: none; }
.tiles small { margin-left: auto; font-weight: 600; color: var(--ink-3); }
.tiles-sm { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }

.brand-cloud { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.brand-cloud a, .brand-list a { display: inline-flex; align-items: baseline; gap: .45em; padding: .5em .95em; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.brand-cloud a:hover, .brand-list a:hover { border-color: var(--accent); color: var(--accent); }
.brand-cloud small, .brand-list small { color: var(--ink-3); font-weight: 600; font-size: .8em; }

.guides { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 760px) { .guides { grid-template-columns: repeat(3, 1fr); } }
.guides a { display: grid; gap: .35rem; height: 100%; padding: 1.2rem 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink-2); box-shadow: var(--shadow); }
.guides a:hover { border-color: var(--accent); }
.guides .icon { width: 1.6rem; height: 1.6rem; color: var(--accent); }
.guides b { font: 700 1.05rem/1.25 var(--f-display); color: var(--ink); }

/* ---------- Rejilla y tarjetas de anuncio ---------- */
.av-grid { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 1.25rem 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.av-grid-4 { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); margin-bottom: 0; }
@media (max-width: 480px) { .av-grid, .av-grid-4 { grid-template-columns: 1fr; } }
.av-card { margin: 0; min-width: 0; }
.av-link { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: var(--ink); height: 100%; }
.av-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r-m); overflow: hidden; background: linear-gradient(135deg, #2a2560, #1b1740); box-shadow: var(--shadow); }
.av-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.av-link:hover .av-thumb img { transform: scale(1.04); }
.av-play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .15s; background: rgba(27, 23, 64, .35); }
.av-play .icon { width: 3rem; height: 3rem; padding: .85rem; border-radius: 50%; background: var(--accent); color: #fff; }
.av-link:hover .av-play, .av-link:focus-visible .av-play { opacity: 1; }
.av-dur, .av-dec { position: absolute; bottom: .45rem; font: 700 .72rem/1 var(--f-text); padding: .3em .5em; border-radius: 6px; background: rgba(18, 16, 43, .85); color: #fff; letter-spacing: .02em; }
.av-dur { right: .45rem; } .av-dec { left: .45rem; background: var(--sun); color: #1b1740; }
.av-title { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.av-link:hover .av-title { color: var(--accent); }
.av-meta { font-size: .88rem; color: var(--ink-3); }

.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; align-items: center; margin: 0 0 1rem; }
.list-count { margin: 0; color: var(--ink-3); font-weight: 600; }
.sorts { margin: 0; display: flex; gap: .3rem; font-size: .92rem; }
.sorts a { padding: .35em .8em; border-radius: 999px; color: var(--ink-2); text-decoration: none; border: 1px solid transparent; }
.sorts a:hover { border-color: var(--line); }
.sorts a[aria-current] { background: var(--ink); color: var(--paper); }
.empty { padding: 2rem; border: 1px dashed var(--ink-3); border-radius: var(--r-l); background: var(--surface); max-width: 40rem; }

.searchbar { display: flex; gap: .6rem; margin: 0 0 1.25rem; max-width: 36rem; }
.searchbar input { flex: 1; min-width: 0; font: 500 1.05rem/1 var(--f-text); padding: .85em 1.1em; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); }
.searchbar input:focus { border-color: var(--accent); outline: none; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.chip { --c: var(--accent); display: inline-flex; align-items: center; gap: .45em; padding: .45em .95em; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.chip:hover { border-color: var(--c); color: var(--c); }
.chip .icon { color: var(--c); }
.chip small { color: var(--ink-3); font-weight: 600; }
.chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.is-on small { color: var(--paper); opacity: .75; }
.chips-topics { margin-top: -.25rem; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem; margin: 2rem 0 1rem; }
.pager ol { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.pager .pg { display: inline-flex; align-items: center; justify-content: center; gap: .3em; min-width: 2.5rem; height: 2.5rem; padding: 0 .8em; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; }
.pager a.pg:hover { border-color: var(--accent); color: var(--accent); }
.pager .pg.is-cur { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .gap { align-self: center; color: var(--ink-3); }
@media (max-width: 520px) { .pager .pg-prev span, .pager .pg-next span { display: none; } }

.more-links { margin: 2rem 0; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.more-links h2 { font-size: 1.1rem; }

.az { position: sticky; top: 76px; z-index: 5; padding: .5rem 0; background: var(--paper); }
.az-group { margin-bottom: 1.5rem; scroll-margin-top: 130px; }
.az-group h2 { font-size: 1.4rem; color: var(--accent); margin-bottom: .6rem; }
.brand-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }

.brand-box { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--sun); border-radius: var(--r-m); padding: 1rem 1.25rem; margin: 0 0 1.5rem; max-width: 52rem; }
.brand-box h2 { font-size: 1.1rem; }
.brand-box p { margin: 0 0 .5em; }
.brand-src { font-size: .9rem; color: var(--ink-3); }

/* ---------- Ficha del anuncio ---------- */
.av-page { display: grid; gap: 2rem; margin-bottom: 2rem; }
@media (min-width: 1000px) { .av-page { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; } }
.av-main { min-width: 0; }
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-l); overflow: hidden; background: #0d0b24; box-shadow: var(--shadow); }
.player-btn { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; display: block; }
.player-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 5rem; height: 5rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); transition: transform .15s; }
.player-play .icon { width: 2.2rem; height: 2.2rem; margin-left: .2rem; }
.player-btn:hover .player-play, .player-btn:focus-visible .player-play { transform: translate(-50%, -50%) scale(1.1); }
.player-btn:focus-visible { outline: 4px solid var(--sun); outline-offset: -4px; }
.player-note { position: absolute; left: 0; right: 0; bottom: 0; padding: .5rem .8rem; font-size: .78rem; color: #e8e5f7; background: linear-gradient(transparent, rgba(13, 11, 36, .85)); text-align: left; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-off { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .8rem; padding: 1.5rem; text-align: center; color: #fff; }
.player-off img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .25; filter: grayscale(1); }
.player-off p, .player-off a { position: relative; margin: 0; }
.player-off .btn { background: var(--sun); border-color: var(--sun); color: #1b1740; }

.tags { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { --c: var(--accent); display: inline-flex; align-items: center; gap: .4em; padding: .4em .85em; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line)); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; }
.tag:hover { border-color: var(--c); }
.tag .icon { color: var(--c); }
.tag-dec { --c: var(--sun); }

.av-desc, .av-note { margin-top: 1.75rem; max-width: var(--measure); }
.av-desc h2, .av-note h2 { font-size: 1.15rem; }
.av-desc p { white-space: pre-line; }
.note-lang { display: flex; align-items: center; gap: .5em; font-size: .9rem; color: var(--ink-3); }
.av-facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); }
.av-facts h2 { font-size: 1.05rem; margin-bottom: .75rem; }
.av-facts dl { margin: 0; }
.av-facts dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line); font-size: .98rem; }
.av-facts dt { color: var(--ink-3); }
.av-facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.rights { margin: 1rem 0 0; font-size: .85rem; color: var(--ink-3); }
.related-av { margin: 2.5rem 0; }
.related-av h2 { margin-bottom: 1rem; }

.defs dt { font-weight: 800; margin-top: 1rem; }
.defs dd { margin: .2rem 0 0; }

/* ---------- Cabeceras de página y varios ---------- */
.page-head h1 { max-width: 22ch; }
.t-article .page-head h1, .t-av .page-head h1 { max-width: 30ch; }
.page-head .lede { color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .decades a, .tiles a, .av-thumb img, .player-play { transition: none; } }

/* Móvil estrecho: nada debe ensanchar la página */
.tiles a, .tiles li { min-width: 0; }
.tiles span { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.chip { max-width: 100%; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); }
.tiles-sm { grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr)); }
.chip { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.chip { overflow: hidden; } .chip .icon { flex: none; }
.t-av .prose, .t-list .prose { max-width: none; }
.t-av .disclaimer, .t-list .disclaimer { max-width: var(--measure); }
.t-av .page-head h1 { max-width: 32ch; font-size: clamp(1.4rem, 3.2vw, 2.1rem); }
.t-av .page-head, .t-list .page-head { padding-bottom: 1.25rem; }
.t-av .prose ul, .t-list .prose ul, .t-list .prose ol { padding-left: 0; margin-top: 0; }
.t-av .prose li, .t-list .prose li { margin-bottom: 0; }
.t-av .tags { margin-top: 1rem; }
.t-av .av-desc p { margin-bottom: .8em; }

/* Etiquetas largas en móvil: el texto envuelve y el recuento no se sale del chip */
@media (max-width: 480px) {
  .chip { font-size: .84rem; padding: .4em .75em; gap: .35em; }
  .chip small { flex: none; }
}
.chips a.chip { white-space: normal; }
.chips a.chip small { flex: none; white-space: nowrap; }

/* Webs recomendadas */
.sites, .prose .sites { list-style: none; margin: 0 0 1.5rem; padding: 0 !important; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); }
.sites a { display: flex; flex-direction: column; gap: .3rem; height: 100%; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.sites a:hover { border-color: var(--accent); transform: translateY(-2px); }
.sites strong { font-size: 1.05rem; }
.sites .site-desc { color: var(--ink-2, var(--ink-3)); font-size: .93rem; line-height: 1.45; }
.sites .site-host { margin-top: auto; padding-top: .4rem; color: var(--accent); font-size: .85rem; font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; }
.sites .site-host .icon { width: .9em; height: .9em; }
.site-lang { color: var(--ink-3); font-style: normal; font-size: .85rem; font-weight: 500; }
