/*
Theme Name: TramaCorta
Description: Tema de streaming para dramas cortos y series subtituladas en español. Compatible con DramaVía Catálogo y VIP.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: dramavia
License: GNU General Public License v2 or later
*/

@font-face {
    font-family: "Inter";
    src: url("assets/inter-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --base: #0c0d11;
    --panel: #15171e;
    --raised: #1d2029;
    --line: #2d303a;
    --text: #f7f6f4;
    --muted: #aeb0bc;
    --accent: #ff775f;
    --accent-hover: #ff947f;
    --gold: #ffdb8f;
    --page: 1260px;
    --gutter: clamp(16px, 4vw, 52px);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 25px; }
body { margin: 0; background: var(--base); color: var(--text); font: 16px/1.55 "Inter", system-ui, sans-serif; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -.036em; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
img { max-width: 100%; height: auto; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.shell { width: min(calc(100% - var(--gutter) * 2), var(--page)); margin-inline: auto; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 99; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.screen-reader-text { clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; width: 1px; overflow: hidden; position: absolute; white-space: nowrap; }
.topbar { background: #101116; border-bottom: 1px solid #24262e; }
.topbar-inner { min-height: 72px; display: flex; align-items: center; gap: clamp(16px, 3vw, 42px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 850; letter-spacing: -.055em; flex-shrink: 0; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #190c08; background: var(--accent); }
.brand-mark::after, .play-mark::after { content: ""; width: 0; height: 0; border: 6px solid transparent; border-right: 0; border-left: 9px solid currentColor; margin-left: 2px; }
.custom-logo { width: auto; max-width: 180px; max-height: 42px; object-fit: contain; }
.main-nav { flex: 1; }
.main-nav ul { display: flex; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; list-style: none; }
.main-nav a { display: inline-block; color: var(--muted); font-size: 14px; font-weight: 650; padding-block: 8px; }
.main-nav a:hover, .main-nav a[aria-current], .main-nav .current-menu-item > a { color: var(--text); }
.main-nav .sub-menu { padding-left: 10px; }
.searchform { display: flex; align-items: stretch; border: 1px solid var(--line); background: var(--panel); border-radius: 9px; min-width: 0; }
.searchform input { width: clamp(110px, 13vw, 190px); min-width: 0; padding: 8px 11px; color: var(--text); background: transparent; border: 0; font-size: 13px; }
.searchform input::placeholder { color: var(--muted); }
.searchform button { display: grid; place-items: center; width: 38px; border: 0; color: var(--muted); background: transparent; }
.searchform button:hover { color: var(--accent); }
.search-mark { position: relative; display: block; width: 13px; height: 13px; border: 1.7px solid currentColor; border-radius: 50%; }
.search-mark::after { position: absolute; content: ""; width: 6px; height: 1.7px; background: currentColor; transform: rotate(45deg); right: -4px; bottom: -2px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 42px; border: 1px solid transparent; padding: 10px 16px; border-radius: 9px; font-size: 14px; font-weight: 750; text-align: center; line-height: 1.3; }
.button-primary { background: var(--accent); color: #190c08; }
.button-primary:hover { background: var(--accent-hover); }
.button-quiet { color: var(--text); background: #171922; border-color: #383b48; }
.button-quiet:hover { border-color: var(--muted); }
.button-vip { color: var(--gold); background: #29221b; border-color: #50402c; }
.button-vip:hover { border-color: var(--gold); }
.play-mark { display: inline-grid; place-items: center; }

.catalog { padding-block: 24px 68px; }
.browse { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding-block: 0 20px; }
.browse a { padding: 6px 13px; border-radius: 7px; color: var(--muted); font-weight: 650; font-size: 13px; white-space: nowrap; }
.browse a:hover { background: var(--raised); color: var(--text); }
.browse .selected { background: #2c1c1c; color: #ff9b87; }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: clamp(400px, 37vw, 510px); display: flex; align-items: end; border-radius: 18px; border: 1px solid #282c3a; background: linear-gradient(130deg, #191e2c, #111218 70%); }
.hero-img { position: absolute; z-index: -2; top: 0; right: 0; width: 76%; height: 100%; object-fit: cover; object-position: center 27%; }
.hero::before { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(90deg, #0f1119 4%, #0f1119f5 29%, #0f11198c 51%, transparent 76%), linear-gradient(0deg, #0d1019b0, transparent 64%); }
.hero-copy { padding: clamp(24px, 4.3vw, 62px); width: min(640px, 64%); }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #ffab9a; font-weight: 800; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.hero h1 { margin: 14px 0; font-size: clamp(36px, 5vw, 70px); line-height: .99; font-weight: 850; letter-spacing: -.062em; text-wrap: balance; }
.hero p { color: #d1d1db; margin-block: 12px 23px; max-width: 435px; }
.chips, .hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { font-size: 12px; font-weight: 650; color: #dbdce5; background: #161923d9; border: 1px solid #ffffff24; border-radius: 6px; padding: 3px 8px; }
.chip a:hover { color: var(--accent); }
.section-head { margin-block: 36px 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 15px; }
.section-head h2, .episodes h2 { font-size: clamp(25px, 3vw, 34px); }
.section-head a, .text-link { color: #ff9b87; font-size: 14px; font-weight: 700; }
.section-head a:hover, .text-link:hover { text-decoration: underline; }
.card-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(12px, 1.75vw, 23px); }
.card { min-width: 0; }
.card-art { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: linear-gradient(140deg, #2f293d, #131923); border: 1px solid var(--line); border-radius: 12px; }
.card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.card a:hover .card-art img { transform: scale(1.035); }
.card a:hover .card-title { color: #ff9b87; }
.card-art::after { position: absolute; content: ""; inset: 55% 0 0; background: linear-gradient(transparent, #0007); pointer-events: none; }
.art-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #b6adbf; }
.card-title { margin-block: 10px 5px; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.2; }
.card-meta { color: var(--muted); font-size: 12px; }

.page-head { margin-block: 10px 26px; }
.page-head h1, .detail h1, .watch h1, .standard h1 { font-size: clamp(32px, 5vw, 59px); }
.page-head p, .muted { color: var(--muted); }
.page-head p { margin-top: 8px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-block: 0 21px; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.detail { display: grid; grid-template-columns: minmax(125px, 255px) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; margin-bottom: 35px; }
.detail .card-art { max-width: 255px; }
.detail .hero-actions, .detail .chips { margin-top: 15px; }
.detail .muted { margin-top: 6px; }
.prose { max-width: 760px; color: #d9dae2; overflow-wrap: anywhere; }
.prose > * { margin-block: 12px; }
.prose a { color: #ff9b87; text-decoration: underline; }
.prose iframe, .prose video { max-width: 100%; }
.episode-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0; margin-block: 16px 0; list-style: none; }
.episode-item { height: 100%; display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; }
.episode-item:hover, .episode-item[aria-current] { border-color: #aa695d; }
.episode-num { min-width: 38px; align-self: stretch; display: grid; place-items: center; padding-inline: 5px; background: var(--raised); border-radius: 6px; font-weight: 750; }
.episode-name { flex: 1; min-width: 0; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.badge { color: #d6d7e1; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; font-weight: 750; padding: 2px 7px; white-space: nowrap; }
.badge-vip { color: var(--gold); background: #2b241a; border-color: #52432d; }
.watch h1 { margin-bottom: 16px; }
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, .65fr); align-items: start; gap: 24px; }
.watch-layout .episode-list { grid-template-columns: 1fr; }
.watch-layout .episodes { background: #12141a; border-radius: 14px; padding: 18px; border: 1px solid var(--line); }
.watch-layout .episodes h2 { font-size: 22px; }
.player { overflow: hidden; display: grid; place-items: center; border-radius: 14px; border: 1px solid #292c37; background: #08090d; }
.player video { display: block; width: 100%; height: clamp(360px, 66vh, 690px); background: #050608; }
.locked { min-height: 360px; padding: 24px; background: radial-gradient(ellipse at top, #322426, #11131b 68%); text-align: center; }
.locked h2 { margin-top: 14px; font-size: clamp(24px, 4vw, 37px); }
.locked p { margin-block: 10px 19px; color: var(--muted); max-width: 450px; }
.locked .hero-actions { justify-content: center; }
.playback-nav { margin-block: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.signout { margin-top: 12px; }
.signout button { color: var(--muted); background: transparent; border: 0; padding: 6px 0; font-size: 13px; text-decoration: underline; }
.topbar-inner > .account-link + .button { margin-left: -25px; }
.account-wrap { display: grid; place-items: start center; padding-block: clamp(20px, 6vw, 68px); }
.account-panel { width: min(100%, 490px); background: var(--panel); border: 1px solid var(--line); border-radius: 17px; padding: clamp(22px, 5vw, 39px); }
.account-heading { margin-bottom: 24px; }
.account-heading h1 { font-size: clamp(29px, 4vw, 40px); }
.account-heading p { margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; }
.account-form { display: grid; gap: 8px; }
.account-form label { font-weight: 700; font-size: 14px; }
.account-form > input:not([type=hidden]) { min-width: 0; min-height: 45px; background: var(--base); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; color: var(--text); }
.account-form > label:not(:first-of-type) { margin-top: 8px; }
.account-form small, .account-remember { color: var(--muted); }
.account-remember { display: flex; gap: 8px; align-items: center; }
.account-remember input { accent-color: var(--accent); }
.account-form button { margin-top: 12px; }
.account-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 20px; }
.account-notice { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; color: var(--text); margin-bottom: 18px; padding: 10px 13px; font-size: 14px; }
.account-membership { border-top: 1px solid var(--line); margin-bottom: 19px; padding-top: 18px; }
.account-membership h2 { font-size: 23px; }
.account-membership p { margin-block: 8px 14px; color: var(--muted); }
.empty { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--muted); }
.pagination { margin-top: 24px; }
.page-numbers { display: inline-flex; padding: 6px 10px; margin: 1px; border-radius: 6px; background: var(--raised); }
.page-numbers.current { background: var(--accent); color: #190c08; }
.standard article + article { margin-top: 24px; }
.standard .searchform { width: max-content; max-width: 100%; margin-top: 18px; }
.footer { padding-block: 24px; border-top: 1px solid #24262e; }
.footer-inner { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.footer a:hover { color: var(--text); }

@media (max-width: 920px) {
    .topbar-inner { gap: 16px; }
    .topbar-inner > .account-link + .button { margin-left: 0; }
    .main-nav ul { gap: 12px; }
    .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .topbar-inner { min-height: 62px; flex-wrap: wrap; padding-block: 11px 4px; gap: 5px 12px; justify-content: space-between; }
    .main-nav { flex-basis: 100%; order: 3; }
    .main-nav ul { gap: 18px; }
    .topbar-inner > .button { order: 4; min-height: 34px; padding: 6px 9px; }
    .topbar-inner > .account-link { order: 2; }
    .topbar-inner > .searchform { order: 1; }
    .topbar-inner:has(> .button-vip) .main-nav { flex-basis: auto; }
    .searchform input { width: 120px; }
    .hero { min-height: 475px; }
    .hero-img { width: 100%; height: 76%; object-position: center 36%; }
    .hero::before { background: linear-gradient(0deg, #0f1119 22%, #0f1119d9 44%, transparent 83%); }
    .hero-copy { width: 100%; }
    .watch-layout { grid-template-columns: 1fr; }
    .detail { grid-template-columns: minmax(100px, 130px) 1fr; align-items: start; }
    .detail .prose { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .brand { font-size: 20px; }
    .brand-mark { width: 27px; height: 27px; }
    .topbar-inner { gap: 5px 7px; }
    .topbar-inner > .searchform input { width: clamp(58px, 23vw, 105px); padding-inline: 6px; }
    .topbar-inner > .searchform button { width: 29px; }
    .topbar-inner > .account-link { font-size: 12px; }
    .browse { gap: 4px; }
    .browse a { padding: 6px 8px; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .episode-list { grid-template-columns: 1fr; }
    .detail { grid-template-columns: 100px minmax(0, 1fr); gap: 12px 16px; }
    .detail h1 { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
    .card-art img { transition: none; }
}
