/* PELISLIBRE — estilos de la página. Los colores, fuentes y botones base vienen de modernist.css */

body { margin: 0; background: var(--color-bg); }
a { color: var(--color-accent); }
a:hover { color: var(--color-accent-600); }
button { font-family: inherit; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; padding: 8px 12px; background: var(--color-text); color: var(--color-bg); z-index: 10; }
.skip:focus { top: 8px; }

/* Botón sin estilo (tarjetas clicables) */
.plain { all: unset; cursor: pointer; box-sizing: border-box; }
.plain:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

/* ── Cabecera ── */
.site-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 24px; border-bottom: 2px solid var(--color-divider); }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-weight: 800; font-size: 22px; letter-spacing: -.02em; color: var(--color-text); text-decoration: none; }
.logo:hover { color: var(--color-text); }
.logo-mark { width: 14px; height: 14px; background: var(--color-accent); display: block; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-right: auto; }
.site-nav a { display: flex; align-items: center; min-height: 44px; padding: 0; font-size: 14px; font-weight: 600; color: var(--color-text); text-decoration: none; border-bottom: 2px solid transparent; }
.site-nav a[aria-current="page"] { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.header-tools { display: flex; gap: 8px; align-items: center; flex: 1 1 220px; max-width: 340px; }
.header-tools .input { min-height: 40px; }
.lang { flex: none; }
.lang button { border: 0; padding: 0 12px; min-height: 40px; cursor: pointer; font-size: 13px; font-weight: 600; background: transparent; color: var(--color-text); }
.lang button[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); }

.main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 32px; box-sizing: border-box; }
.main:focus { outline: none; }
.site-footer { border-top: 2px solid var(--color-divider); padding: 20px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--color-neutral-700); }
.site-footer strong { color: var(--color-text); }
.site-footer span { max-width: 60ch; }

/* ── Encabezados de sección ── */
.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--color-divider); padding-bottom: 8px; }
.section-head h1 { margin: 0; font-size: clamp(32px, 4vw, 48px); }
.section-head h3 { margin: 0; }
.muted { font-size: 13px; color: var(--color-neutral-700); }
.eyebrow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--color-accent-700); }

/* ── Portada (hero a pantalla completa) ── */
.hero { position: relative; overflow: hidden; background: #201e1d; color: #f3f2f2; min-height: 560px; display: flex; align-items: flex-end; margin: -24px -24px 0; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,18,17,.88) 0%, rgba(20,18,17,.6) 45%, rgba(20,18,17,.1) 80%), linear-gradient(0deg, rgba(20,18,17,.75) 0%, rgba(20,18,17,0) 50%); }
.hero-body { position: relative; padding: 56px 24px 40px; display: flex; flex-direction: column; gap: 20px; max-width: 720px; }
.hero h1 { margin: 0; font-size: clamp(48px, 8vw, 112px); line-height: .88; letter-spacing: -.045em; text-wrap: balance; }
.hero p { margin: 0; max-width: 46ch; font-size: 16px; text-wrap: pretty; }
.hero-meta { font-size: 14px; font-weight: 600; }
.hero-credit { position: absolute; right: 16px; bottom: 16px; padding: 4px 8px; background: rgba(20,18,17,.8); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.badge { align-self: flex-start; padding: 4px 10px; background: var(--color-accent); color: #fff; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-lg { min-height: 44px; padding: 0 20px; }
.btn-red { background: var(--color-accent); color: #fff; border: 0; }
.btn-red:hover { background: var(--color-accent-600); }
.btn-outline-light { background: transparent; border: 2px solid #f3f2f2; color: #f3f2f2; }
.btn-outline-light[aria-pressed="true"] { background: #f3f2f2; color: #201e1d; }

/* ── Filas y rejillas de pósters ── */
.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(140px, 180px); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.grid-posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 16px; }
.card { display: flex; flex-direction: column; gap: 6px; }
.card:hover { color: var(--color-accent); }
.poster { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--color-neutral-300); }
.card-title { font-weight: 800; font-size: 15px; line-height: 1.2; }
.card-meta { font-size: 12px; color: var(--color-neutral-700); }

/* ── Publicidad (sustituir por el código del proveedor de anuncios) ── */
.ad { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.ad-label { width: 100%; max-width: 728px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--color-neutral-600); }
.ad-slot { width: 100%; max-width: 728px; height: 90px; background: repeating-linear-gradient(45deg, var(--color-surface) 0 10px, var(--color-neutral-200) 10px 20px); border: 1px solid var(--color-neutral-300); display: flex; align-items: center; padding: 0 16px; font-family: ui-monospace, monospace; font-size: 12px; color: var(--color-neutral-700); box-sizing: border-box; }
.ad-mpu { align-items: flex-start; }
.ad-mpu .ad-label, .ad-mpu .ad-slot { max-width: 300px; }
.ad-mpu .ad-slot { height: 250px; align-items: flex-end; padding: 12px; }

/* ── Catálogo ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--color-neutral-500); background: transparent; color: var(--color-text); padding: 0 14px; min-height: 40px; cursor: pointer; font-size: 13px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }

/* ── Ficha ── */
.detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 32px; align-items: start; }
.detail .poster { max-width: 420px; }
.detail-body { display: flex; flex-direction: column; gap: 20px; }
.detail-body h1 { margin: 0; font-size: clamp(40px, 5vw, 64px); line-height: .95; letter-spacing: -.03em; }
.detail-body p { margin: 0; font-size: 17px; max-width: 56ch; text-wrap: pretty; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid var(--color-divider); margin: 0; }
.facts div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--color-divider); display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-700); }
.facts dd { margin: 0; font-weight: 600; }

/* ── Reproductor (películas y tráilers) ── */
.player { display: flex; flex-direction: column; background: var(--color-text); color: var(--color-bg); }
.screen { position: relative; aspect-ratio: 16/9; background: #201e1d center/cover no-repeat; display: flex; flex-direction: column; justify-content: space-between; padding: 16px; width: 100%; }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.screen-label { align-self: flex-start; padding: 4px 8px; background: var(--color-text); font-size: 12px; font-weight: 600; color: var(--color-bg); position: relative; }
.big-play { align-self: flex-start; width: 72px; height: 72px; background: var(--color-accent); display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff; position: relative; }
.controls { display: flex; align-items: center; gap: 16px; padding: 12px 16px; flex-wrap: wrap; }
.controls button { background: none; border: 0; color: var(--color-bg); cursor: pointer; font-size: 18px; min-width: 44px; min-height: 44px; }
.time { font-family: ui-monospace, monospace; font-size: 12px; }
.bar { flex: 1 1 200px; height: 6px; background: var(--color-neutral-800); cursor: pointer; position: relative; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--color-accent); }
.player-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 32px; align-items: start; }
.player-layout > .player { grid-column: 1 / -1; }
.list-rows { display: flex; flex-direction: column; }
.list-rows h4 { margin: 0; padding-bottom: 8px; border-bottom: 2px solid var(--color-divider); }
.next-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-divider); }
.next-item:hover { color: var(--color-accent); }

/* ── Estrenos ── */
.trailer-hero { display: flex; flex-wrap: wrap; background: #201e1d; color: #f3f2f2; }
.trailer-hero .player { flex: 2 1 480px; min-width: 0; background: #201e1d; }
.trailer-info { flex: 1 1 300px; min-width: 0; padding: 32px 24px; display: flex; flex-direction: column; gap: 16px; justify-content: flex-end; }
.trailer-info h2 { margin: 0; font-size: clamp(32px, 4vw, 52px); line-height: .92; letter-spacing: -.035em; color: #f3f2f2; }
.trailer-info p { margin: 0; font-size: 15px; text-wrap: pretty; }
.release { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: #ff8a73; }
.countdown { font-family: var(--font-heading); font-weight: 800; font-size: 22px; }
.grid-trailers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 24px 16px; }
.thumb { position: relative; aspect-ratio: 16/9; background: var(--color-neutral-300) center/cover no-repeat; }
.thumb[data-current="true"] { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.thumb-play { position: absolute; left: 8px; bottom: 8px; width: 36px; height: 36px; background: var(--color-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.thumb-dur { position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; background: rgba(20,18,17,.85); color: #f3f2f2; font-family: ui-monospace, monospace; font-size: 11px; }

/* ── Mi lista ── */
.my-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--color-divider); }
.my-row .actions { justify-content: flex-end; }
.empty { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 40px 0; }
.empty h3, .empty p { margin: 0; }

/* ── Fase A: piezas nuevas del sitio con servidor ── */
.h3 { font-size: 22px; margin: 0; }
.h4 { font-size: 16px; margin: 0; padding-bottom: 8px; border-bottom: 2px solid var(--color-divider); }
.align-start { align-self: flex-start; }
.back-link { align-self: flex-start; }
.on-dark { color: #c9c5c5; }
.watch-title { margin: 0; font-size: clamp(28px, 3vw, 40px); line-height: 1; }

/* Buscador con sugerencias */
.search-form { position: relative; }
.suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; background: var(--color-bg); border: 2px solid var(--color-text); max-height: 420px; overflow-y: auto; }
.suggest-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; color: var(--color-text); text-decoration: none; border-bottom: 1px solid var(--color-divider); }
.suggest-item img { width: 32px; height: 48px; object-fit: cover; background: var(--color-neutral-300); flex: none; }
.suggest-item span { display: flex; flex-direction: column; }
.suggest-item:hover, .suggest-item[aria-selected="true"] { background: var(--color-surface); color: var(--color-accent); }

/* Géneros como enlaces */
a.chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.chip[aria-current="page"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.chip-count { font-weight: 400; opacity: .7; }
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.genre-tile { display: flex; flex-direction: column; gap: 4px; padding: 20px 16px; border: 2px solid var(--color-divider); }
.genre-tile strong { font-size: 18px; }
.genre-tile:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* Filtros del catálogo */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; }
.filters select { min-height: 40px; min-width: 160px; }

/* Paginación */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.pg-item { min-width: 44px; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--color-neutral-500); color: var(--color-text); text-decoration: none; font-weight: 600; font-size: 14px; box-sizing: border-box; }
.pg-item:hover { border-color: var(--color-accent); color: var(--color-accent); }
.pg-item[aria-current="page"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.pg-gap { padding: 0 4px; color: var(--color-neutral-700); }

/* Lo más visto */
.top-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 0 24px; }
.top-item { display: flex; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--color-divider); width: 100%; }
.top-item span { display: flex; flex-direction: column; }
.top-rank { font-family: var(--font-heading); font-weight: 800; font-size: 32px; color: var(--color-accent); min-width: 40px; }
.top-item:hover strong { color: var(--color-accent); }

/* Reproductor */
.screen-note { align-self: flex-start; position: relative; padding: 6px 10px; background: rgba(20,18,17,.85); color: #f3f2f2; font-size: 14px; font-weight: 600; }
.screen-embed { padding: 0; background: #000; }
.screen-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-facade { cursor: pointer; }

/* Ficha */
.review { display: flex; flex-direction: column; gap: 12px; }
.review h2 { margin: 0; font-size: 22px; }
.tags a.tag { text-decoration: none; }

/* -- Multi-servidor (estilo Cuevana: pesta�as de idioma + selector de servidor) -- */
.servers { display: grid; gap: 16px; grid-column: 1 / -1; }
.srv-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.srv-tab { border: 1px solid var(--color-neutral-500); background: transparent; color: var(--color-text); border-radius: 999px; padding: 0 18px; min-height: 44px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.srv-tab:hover { background: var(--color-surface); }
.srv-tab.is-active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.srv-panel { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.srv-field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--color-neutral-700); min-width: 220px; flex: 0 1 280px; }
.srv-field .input { min-height: 48px; font-size: 15px; }

/* Anuncios (Hito E, Adsterra 30-nov): interruptor de la cabecera y caja del banner 300x250. */
.ads-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--color-neutral-600); cursor: pointer; user-select: none; white-space: nowrap; }
.ads-toggle:hover { color: var(--color-text); }
.ads-toggle input { accent-color: var(--color-accent); cursor: pointer; margin: 0; }
html.ads-off .ad { display: none; }
.ad-mpu .ad-slot { padding: 0; overflow: hidden; }
.ad-mpu .ad-slot iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ── Páginas legales + contacto (DAN-130) ── */
.legal-doc { max-width: 70ch; margin: 0 auto; width: 100%; line-height: 1.7; font-size: 15.5px; }
.legal-doc h1 { margin: 0 0 .6em; }
.legal-doc h2 { font-size: 1.15rem; margin: 1.5em 0 .4em; color: var(--color-text); }
.legal-doc p { margin: .6em 0; color: var(--color-neutral-500); }
.legal-doc ul { margin: .6em 0; padding-left: 1.3em; color: var(--color-neutral-500); }
.legal-doc li { margin: .3em 0; }
.legal-doc strong { color: var(--color-text); }
.legal-doc .doc-date { margin-top: 2em; padding-top: 1em; border-top: 1px solid var(--color-divider); font-size: 13px; color: var(--color-neutral-600); }

.contact-form { display: grid; gap: 14px; margin: 1.2em 0; }
.contact-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--color-text); }
.contact-form .input { min-height: 46px; font-size: 15px; width: 100%; box-sizing: border-box; }
.contact-form textarea.input { min-height: 130px; resize: vertical; line-height: 1.5; }
.contact-form .hp { position: absolute; left: -9999px; }
.form-error { color: #e57373; font-size: 14px; margin: 0; }

.footer-id { display: grid; gap: 2px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-nav a { color: var(--color-neutral-700); text-decoration: none; }
.footer-nav a:hover { color: var(--color-accent); }
