/*
Theme Name: Cine Horizon
Description: Catálogo responsivo de filmes e séries com destaques e downloads autorizados.
Version: 1.0.22
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: cine-horizon
*/

/* 01 — Base e cores */

:root {
    --bg: #020814;
    --panel: #0e1b29;
    --panel2: #142637;
    --line: #243548;
    --text: #edf2f6;
    --muted: #a6b5c4;
    --green: #008b00;
    --accent: #57cf85;
    --radius: 9px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: linear-gradient(140deg,#020814,#041929) fixed;
    color: var(--text);
    font: 15px/1.55 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

button,input,select {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
}

button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.wrap {
    width: min(1420px,calc(100% - 48px));
    margin: auto;
}

.ico {
    width: 19px;
    height: 19px;
    display: inline-block;
    vertical-align: middle;
    flex: none;
}

.muted {
    color: var(--muted);
}

.screen-reader-text {
    position: absolute;
    clip: rect(1px,1px,1px,1px);
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--green);
    color: white;
    border: 1px solid transparent;
    border-radius: 7px;
    font-weight: 650;
}

.button:hover {
    background: #057405;
    color: #fff;
}

.button.secondary {
    background: #ffffff12;
    border-color: #ffffff30;
}

.button.secondary:hover {
    background: #ffffff25;
}

/* 02 — Menu superior */

.site-header {
    background: #08121de8;
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 5;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 30px;
    min-height: 78px;
    flex-wrap: wrap;
    padding: 12px 0;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.03;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.5px;
    color: var(--accent);
    min-width: 152px;
}

.brand small {
    font-size: 15px;
    letter-spacing: 2.5px;
}

.custom-logo {
    max-width: 190px;
    max-height: 62px;
    object-fit: contain;
}

.nav {
    display: flex;
    gap: 22px;
    align-items: center;
    flex-wrap: wrap;
}

.nav a,.nav summary {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-weight: 550;
    font-size: 14px;
}

.nav a:hover,.nav summary:hover {
    color: var(--accent);
}

.nav details {
    position: relative;
}

.nav summary {
    list-style: none;
    cursor: pointer;
}

.nav summary::-webkit-details-marker {
    display: none;
}

.genres {
    position: absolute;
    top: 100%;
    left: 0;
    width: 340px;
    max-width: calc(100vw - 28px);
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 4px;
    background: #101d2b;
    border: 1px solid var(--line);
    padding: 12px;
    border-radius: 9px;
    box-shadow: 0 10px 30px #0008;
}

.genre-menu:not([open])>.genres {
    display: none;
}

.genres a {
    padding: 8px 9px;
    min-width: 0;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.25;
}

.genres a:hover,.genres a:focus-visible {
    background: #203547;
    color: var(--accent);
}

.genres a .ico {
    color: var(--accent);
    width: 18px;
    height: 18px;
}

.genres a span {
    overflow-wrap: anywhere;
}

.genre-menu[open]>summary {
    color: var(--accent);
}

.genre-menu[open]>summary>.ico:last-child {
    transform: rotate(180deg);
}

.genres>.muted {
    grid-column: 1/-1;
}

.site-header .search {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #162434;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 5px 10px;
    max-width: 100%;
    flex: 0 1 280px;
}

.site-header .search input {
    background: none;
    border: 0;
    min-width: 0;
    width: 100%;
    color: var(--text);
    outline: none;
}

.site-header .search button {
    background: none;
    border: 0;
    color: var(--muted);
    padding: 4px;
}

/* 03 — Controles do carrossel */

.arrow {
    background: #132333e8;
    color: #fff;
    border: 1px solid #50647a;
    border-radius: 7px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
}

.arrow[hidden] {
    display: none;
}

.arrow:hover {
    background: var(--green);
}

/* 04 — Catálogo e carrossel 7 colunas */

.section {
    margin: 30px 0 38px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.section-head h1,.section-head h2 {
    margin: 0;
    font-size: clamp(19px,2vw,25px);
    line-height: 1.2;
    border-left: 4px solid var(--green);
    padding-left: 12px;
    letter-spacing: -.5px;
}

.section-head a {
    color: var(--accent);
    font-size: 13px;
}

.featured-section {
    margin-top: 24px;
}

.section-head .view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid #356449;
    border-radius: 7px;
    background: linear-gradient(125deg,#153b2c,#102030);
    color: #c9f5d5;
    font-weight: 650;
    white-space: nowrap;
    transition: background .2s,border-color .2s;
}

.section-head .view-all .ico {
    width: 15px;
    height: 15px;
}

.section-head .view-all:hover {
    background: var(--green);
    border-color: var(--accent);
    color: white;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(7,minmax(0,1fr));
    gap: 17px;
}

.rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 6 * 17px)/7);
    gap: 17px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 0;
}

.rail .tile {
    scroll-snap-align: start;
}

.tile {
    min-width: 0;
}

.poster {
    position: relative;
    display: block;
    aspect-ratio: 2/3;
    background: #162638;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #ffffff15;
}

.poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s;
}

.tile:hover .poster img {
    transform: scale(1.045);
}

.placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: linear-gradient(145deg,#1c364c,#101d2b);
}

.placeholder .ico {
    width: 42px;
    height: 42px;
}

.quality {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    background: #08151ee8;
    border: 1px solid #ffffff30;
    border-radius: 4px;
    padding: 3px 7px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile h3 {
    font-size: 14px;
    line-height: 1.35;
    margin: 9px 0 3px;
    font-weight: 650;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile h3 a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--muted);
}

.rating {
    color: #f1c96b;
}

.tile-trailer {
    margin-top: 7px;
    width: 100%;
    min-height: 34px;
    border: 1px solid #2d4a3d;
    background: linear-gradient(120deg,#142c2a,#102030);
    color: #dceee2;
    padding: 6px 4px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 650;
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
}

.tile-trailer .ico {
    color: var(--accent);
}

.tile-trailer.trailer-unavailable {
    color: var(--muted);
    border-color: var(--line);
    background: var(--panel);
    opacity: .65;
    font-weight: 400;
}

.tile-trailer.trailer-unavailable .ico {
    color: inherit;
}

.tile-trailer:hover {
    color: var(--accent);
    border-color: var(--green);
}

.tile-trailer .ico {
    width: 14px;
    height: 14px;
}

.pagination,.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 28px 0;
}

.page-numbers {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
}

.page-numbers.current {
    background: var(--green);
    color: white;
}

/* 05 — Post e relacionados */

.single-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 340px;
    gap: 32px;
    align-items: start;
    margin-top: 28px;
}

.article {
    min-width: 0;
}

.article h1 {
    font-size: clamp(23px,3vw,36px);
    line-height: 1.2;
    margin: 0 0 18px;
}

.detail-top {
    display: grid;
    grid-template-columns: minmax(130px,210px) minmax(0,1fr);
    gap: 23px;
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.detail-top .poster {
    height: auto;
}

.detail-top h2,.entry h2,.sidebar h2 {
    font-size: 20px;
    margin: 0 0 12px;
    color: var(--accent);
}

.facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 14px;
    margin: 0 0 17px;
}

.facts div {
    border-bottom: 1px solid var(--line);
    padding-bottom: 7px;
    min-width: 0;
}

.facts dt {
    font-size: 12px;
    color: var(--muted);
}

.facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.entry {
    margin-top: 23px;
    overflow-wrap: anywhere;
}

.entry a {
    color: var(--accent);
}

.entry iframe {
    max-width: 100%;
}

.entry img {
    height: auto;
}

.entry strong {
    color: #e1eaf0;
}

.sidebar {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 15px;
}

.sidebar .catalog-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 14px;
}

.sidebar .tile h3 {
    font-size: 13px;
}

.sidebar .tile-trailer {
    display: none;
}

.download-link {
    display: flex!important;
    align-items: center;
    gap: 12px;
    justify-content: center;
    background: linear-gradient(110deg,#007b15,#08662c);
    border: 1px solid #36a85b;
    border-radius: 8px;
    color: white!important;
    font-weight: 700;
    padding: 13px 16px;
    margin: 9px 0;
    text-align: center;
    line-height: 1.35;
    max-width: 100%;
    white-space: normal;
    box-shadow: 0 5px 18px #0003;
}

.download-link:hover {
    filter: brightness(1.14);
}

.download-link .ico {
    width: 22px;
    height: 22px;
}

.download-link .download-label {
    min-width: 0;
}

.subtitle-link {
    margin-top: 20px;
}

.entry .legacy-cover {
    display: none;
}

.entry .alignleft {
    float: left;
    margin: 0 16px 12px 0;
}

.entry .alignright {
    float: right;
    margin: 0 0 12px 16px;
}

.entry:after {
    content: "";
    display: block;
    clear: both;
}

/* 06 — Trailer e rodapé */

.trailer-modal {
    border: 1px solid var(--line);
    background: #07111c;
    color: #fff;
    border-radius: 12px;
    padding: 12px;
    width: min(920px,94vw);
    max-width: 94vw;
}

.trailer-modal::backdrop {
    background: #000c;
}

.trailer-close {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 9px;
}

.trailer-frame {
    aspect-ratio: 16/9;
    width: 100%;
    border: 0;
    display: block;
}

.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 45px;
    padding: 24px 0;
    color: var(--muted);
    font-size: 13px;
}

.comment-list {
    padding-left: 22px;
}

.comment-form input,.comment-form textarea {
    max-width: 100%;
    background: var(--panel2);
    color: var(--text);
    border: 1px solid var(--line);
    padding: 10px;
    border-radius: 5px;
}

.comment-form textarea {
    width: 100%;
}

/* 07 — Responsividade */

@media(max-width:1000px) {
    .header-inner {
        gap: 16px;
    }
    .nav {
        gap: 14px;
    }
    .catalog-grid {
        grid-template-columns: repeat(7,minmax(0,1fr));
    }
    .rail {
        grid-auto-columns: calc((100% - 6 * 17px)/7);
    }
    .single-layout {
        grid-template-columns: minmax(0,1fr) 285px;
        gap: 20px;
    }
}

@media(max-width:900px) {
    .catalog-grid {
        grid-template-columns: repeat(4,minmax(0,1fr));
    }
    .rail {
        grid-auto-columns: calc((100% - 3 * 17px)/4);
    }
    .single-layout {
        grid-template-columns: 1fr;
    }
    .sidebar .catalog-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        max-width: 460px;
    }
    .header-inner .search {
        flex-basis: 100%;
        margin: 0;
    }
    .wrap {
        width: calc(100% - 28px);
    }
}

@media(max-width:540px) {
    .catalog-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 12px;
    }
    .rail {
        grid-auto-columns: calc((100% - 12px)/2);
        gap: 12px;
    }
    .detail-top {
        grid-template-columns: 1fr;
        padding: 14px;
    }
    .detail-top>.poster {
        max-width: 175px;
    }
    .facts {
        grid-template-columns: 1fr 1fr;
    }
    .nav {
        gap: 12px;
    }
    .nav a,.nav summary {
        font-size: 12px;
    }
    .nav .ico {
        width: 15px;
        height: 15px;
    }
    .nav {
        position: relative;
    }
    .nav .genre-menu {
        position: static;
    }
    .genres {
        left: 0;
        right: auto;
        width: min(340px,calc(100vw - 28px));
    }
    .brand {
        min-width: 0;
    }
    .section-head h2 {
        font-size: 18px;
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        scroll-behavior: auto!important;
        transition: none!important;
    }
}

/* 08 — Carrossel infinito e controles superiores */

.rail::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.rail {
    overscroll-behavior-x: contain;
    overflow-anchor: none;
}

.rail.is-rotating {
    scroll-snap-type: none;
    scroll-behavior: auto;
}

.rail-controls {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.rail-controls[hidden],.rail-controls [hidden] {
    display: none!important;
}

.rail-control {
    display: grid;
    place-items: center;
    width: 38px;
    height: 36px;
    padding: 0;
    border: 1px solid #385368;
    border-radius: 9px;
    background: linear-gradient(150deg,#1d3041,#0b1724);
    color: #dce9f0;
    box-shadow: 0 3px 9px #0003,inset 0 1px 0 #ffffff0b;
    transition: background .2s,border-color .2s,color .2s,transform .2s;
}

.rail-control .ico {
    width: 19px;
    height: 19px;
    stroke-width: 1.9;
}

.rail-control:hover,.rail-control:focus-visible {
    background: linear-gradient(150deg,#176a3c,#0b4529);
    border-color: #57cf85;
    color: #fff;
}

.rail-control:active {
    transform: scale(.94);
}

.rail-toggle {
    color: #8ee3a8;
    border-color: #39634f;
    background: linear-gradient(150deg,#193c32,#102520);
}

.rail-toggle[aria-pressed="true"] {
    background: #0d4b2c;
    color: #fff;
    border-color: #57cf85;
}

@media(max-width:540px) {
    .rail-controls {
        gap: 5px;
    }
    .rail-control {
        width: 34px;
        height: 34px;
        border-radius: 7px;
    }
}

/* 09 — Selos das capas: qualidade à esquerda, versão no canto inferior direito */

.audio-badges {
    position: absolute;
    bottom: 6px;
    right: 6px;
    max-width: calc(100% - 12px);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    z-index: 1;
    pointer-events: none;
}
.audio-badge {
    max-width: 100%;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #086a39ed;
    border: 1px solid #61bc80a0;
    color: #fff;
    box-shadow: 0 2px 8px #0006;
}

/* 10 — Navegação e lupa */

.header-inner {
    gap: 20px;
}

.nav {
    gap: 14px;
}

.nav a,.nav summary {
    white-space: nowrap;
}

.nav a[aria-current=page] {
    color: var(--accent);
}

.header-inner .search {
    flex: 1 1 225px;
    max-width: 300px;
    padding: 4px 4px 4px 12px;
    gap: 7px;
    border-radius: 10px;
    background: #0c1b29;
    transition: border-color .2s,box-shadow .2s;
}

.site-header .search:focus-within {
    border-color: #32965d;
    box-shadow: 0 0 0 3px #2fa06422;
}

.site-header .search .search-submit {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #398454;
    border-radius: 7px;
    background: linear-gradient(145deg,#14783d,#075025);
    color: #fff;
    box-shadow: 0 2px 8px #0004;
    transition: background .2s,transform .2s;
}

.site-header .search .search-submit:hover {
    background: linear-gradient(145deg,#23a657,#087739);
    transform: translateY(-1px);
}

.site-header .search .search-submit .ico {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

@media(max-width:900px) {
    .header-inner .search {
        flex: 1 1 100%;
        max-width: none;
    }
    .header-inner {
        gap: 14px;
    }
    .nav {
        gap: 12px;
    }
}

/* 11 — Página interna: sinopse, downloads e relacionados */

.single-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) calc((100% - 102px)*2/7 + 17px);
    gap: 17px;
    align-items: start;
}

.detail-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--accent);
}

.detail-heading .ico {
    width: 23px;
    height: 23px;
    color: var(--accent);
}

.poster-trailer {
    margin-top: 10px;
}

.poster-trailer .button {
    width: 100%;
}

.synopsis-box,.content-panel {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}

.synopsis-box h2 {
    margin: 0 0 12px;
    font-size: 20px;
}

.synopsis-box p {
    margin: 0;
    line-height: 1.75;
}

.content-panel>p:first-child {
    margin-top: 0;
}

.content-panel>p:last-child {
    margin-bottom: 0;
}

.download-copy {
    margin: 22px 0 18px;
    text-align: center;
    font-weight: 750;
    font-size: 15px;
    color: var(--text);
}

/* 12 — Quadro de downloads: versão, qualidade, formato, tamanho e botão */

.downloads-box {
    border: 1px solid #2a4150;
    border-radius: 12px;
    overflow: hidden;
    background: #0e1b26;
}

.downloads-head {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    background: linear-gradient(110deg,#153c34,#0b603d,#116b51);
    color: #fff;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
}

.downloads-head::-webkit-details-marker {
    display: none;
}

.downloads-head>.ico {
    width: 20px;
    height: 20px;
    transition: transform .2s;
}

.downloads-box:not([open]) .downloads-head>.ico {
    transform: rotate(-90deg);
}

.downloads-count {
    margin-left: auto;
    background: #062b27a6;
    border-radius: 20px;
    font-size: 11px;
    letter-spacing: 0;
    padding: 4px 11px;
    text-transform: none;
    white-space: nowrap;
}

.downloads-body {
    padding: 14px 18px 18px;
}

.download-group+.download-group {
    margin-top: 18px;
}

.download-group h3 {
    font-size: 14px;
    text-transform: uppercase;
    border-left: 4px solid var(--accent);
    padding: 3px 9px;
    margin: 0 0 10px;
    line-height: 1.4;
}

.download-columns,.download-row {
    display: grid;
    grid-template-columns: minmax(76px,.85fr) minmax(0,1.75fr) minmax(65px,.85fr) minmax(132px,1.1fr);
    align-items: center;
    gap: 12px;
}

.download-columns {
    padding: 0 13px 8px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .6px;
    font-weight: 750;
    text-transform: uppercase;
}

.download-row {
    padding: 10px 12px;
    border: 1px solid #2a4052;
    border-left: 4px solid #2fba72;
    border-radius: 9px;
    background: #152331;
    margin-bottom: 6px;
    min-height: 62px;
    font-size: 13px;
}

.download-row:last-child {
    margin-bottom: 0;
}

.download-quality {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
}

.resolution-pill {
    display: inline-flex;
    padding: 5px 10px;
    background: #164b40;
    color: #a8e7c0;
    font-size: 11px;
    font-weight: 850;
    border-radius: 18px;
    white-space: nowrap;
}

.download-episode {
    font-size: 10px;
    color: var(--muted);
    font-weight: 650;
}

.download-format {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #cad6e1;
}

.download-size {
    font-weight: 800;
    color: var(--text);
}

.magnet-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(140deg,#138447,#076638);
    border: 1px solid #3ba969;
    border-radius: 8px;
    color: #fff;
    font-weight: 750;
    min-height: 40px;
    padding: 8px 10px;
    white-space: nowrap;
    font-size: 13px;
    transition: background .2s,border-color .2s;
}

.magnet-button:hover {
    background: #0e9750;
    color: #fff;
    border-color: var(--accent);
}

.magnet-icon {
    width: 20px;
    height: 20px;
    flex: none;
}

/* 13 — Relacionados: duas colunas na direita, cards iguais aos da index */

.sidebar.single-related {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
}

.single-related .section-head {
    margin-bottom: 15px;
}

.single-related .section-head h2 {
    font-size: 18px;
    border-left: 0;
    padding: 0;
    margin: 0;
    line-height: 1.35;
}

.sidebar .related-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 17px;
    max-width: none;
}

.sidebar .tile h3 {
    font-size: 14px;
}

.sidebar .tile-trailer {
    display: flex;
}

@media(max-width:900px) {
    .single-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .sidebar .related-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        max-width: none;
    }
}

@media(max-width:540px) {
    .synopsis-box,.content-panel {
        padding: 14px;
    }
    .downloads-body {
        padding: 12px;
    }
    .download-columns {
        display: none;
    }
    .download-row {
        grid-template-columns: minmax(60px,1fr) minmax(0,1.6fr) minmax(50px,1fr);
        gap: 8px;
        padding: 10px;
    }
    .magnet-button {
        grid-column: 1/-1;
    }
    .sidebar .related-grid {
        gap: 12px;
    }
}

/* 14 — Ficha compacta: rótulo e valor na mesma linha, alinhada à capa */

.detail-top {
    grid-template-columns: minmax(130px,210px) minmax(0,1fr);
    align-items: start;
    gap: 22px;
    padding: 20px;
}

.detail-cover {
    min-width: 0;
    width: 100%;
    max-width: 210px;
}

.detail-info {
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}

.detail-info .detail-heading {
    margin: 0 0 10px;
    line-height: 1.3;
}

.detail-info .facts {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    align-content: stretch;
    gap: 0 16px;
    margin: 0;
}

.detail-info .facts>div {
    display: block;
    align-content: center;
    padding: 5px 0;
    line-height: 1.45;
    font-size: 13px;
    overflow-wrap: anywhere;
    min-width: 0;
}

.detail-info .facts dt {
    display: inline;
    font-size: inherit;
    font-weight: 700;
    color: var(--text);
}

.detail-info .facts dd {
    display: inline;
    margin: 0;
    font-size: inherit;
    color: var(--muted);
}

@media(max-width:1050px) and (min-width:901px) {
    .detail-top {
        grid-template-columns: minmax(125px,170px) minmax(0,1fr);
        gap: 15px;
        padding: 15px;
    }
    .detail-info .facts {
        gap: 0 12px;
    }
}

@media(max-width:540px) {
    .detail-top {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 15px;
    }
    .detail-cover {
        max-width: 190px;
        margin: 0 auto;
    }
    .detail-info .facts {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .detail-info .facts>div {
        padding: 7px 0;
        font-size: 14px;
    }
}

/* 15 — Conteúdo interno padronizado: sem HTML residual do editor */

.catalog-section {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    overflow-wrap: anywhere;
}

.catalog-section h2 {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.4;
}

.catalog-section p {
    margin: 0;
    line-height: 1.75;
}

.single-trailer-action {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.single-trailer-action .button {
    min-width: 180px;
    border-color: var(--line);
    color: var(--accent);
}

.additional-links .button {
    margin: 4px 8px 4px 0;
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
    text-align: left;
}

@media(max-width:540px) {
    .catalog-section {
        padding: 14px;
    }
    .single-trailer-action .button {
        width: 100%;
    }
}

/* 16 — Faixa dupla: esboço aprovado */

.feature-band {
    margin: 22px 0 0;
    container-type: inline-size;
}

.feature-band-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    overflow: hidden;
    border: 1px solid #3bab77;
    border-radius: 14px;
    background: radial-gradient(ellipse at 0 0,#12634a 0,transparent 48%),radial-gradient(ellipse at 100% 100%,#12634a 0,transparent 48%),linear-gradient(125deg,#0b2629,#091a25 48%,#0d2a2a);
    box-shadow: 0 0 16px #33c77a16;
}

.feature-band-grid.is-single {
    grid-template-columns: 1fr;
}

.feature-band .feature-band-card {
    appearance: none;
    position: relative;
    display: grid;
    grid-template-columns: clamp(44px,8cqw,88px) minmax(0,1fr) 20px;
    align-items: center;
    gap: clamp(8px,2cqw,24px);
    min-width: 0;
    min-height: 142px;
    padding: 20px clamp(12px,3cqw,32px);
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #edf2f6;
    text-align: left;
    cursor: pointer;
    transition: background .2s;
}

.feature-band-card+.feature-band-card:before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    bottom: 10%;
    width: 1px;
    background: #39976b;
}

.feature-band .feature-band-card:hover,.feature-band .feature-band-card:focus-visible {
    background: #4cdd8a14;
    outline: 2px solid #67e69a;
    outline-offset: -3px;
}

.feature-band-icon {
    display: grid;
    place-items: center;
    color: #59ec91;
    min-width: 0;
}

.feature-band-icon .ico {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    stroke-width: 1.75;
    filter: drop-shadow(0 3px 9px #26de7240);
}

.feature-band-copy {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.feature-band-copy strong {
    font-size: clamp(15px,3.1cqw,34px);
    line-height: 1.1;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: -.5px;
    color: #f2f7fb;
}

.feature-band-copy small {
    font-size: clamp(11px,1.5cqw,15px);
    line-height: 1.35;
    color: #c1ccd4;
}

.feature-band-arrow {
    color: #62ef98;
    display: grid;
    place-items: center;
}

.feature-band-arrow .ico {
    width: 23px;
    height: 23px;
    stroke-width: 2;
}

/* 17 — Elenco em carrossel, no pop-up */

.cast-modal {
    width: min(1100px,calc(100vw - 24px));
    max-width: none;
    max-height: 90vh;
    overflow: auto;
    border: 1px solid #344a59;
    border-radius: 15px;
    background: #0e1b29;
    color: #edf2f6;
    padding: 18px;
    box-shadow: 0 30px 90px #0008;
}

.cast-modal::backdrop {
    background: #02060ddd;
}

.cast-modal-head h2 {
    margin: 0 0 5px;
}

.cast-modal-head p {
    margin: 0 0 18px;
    color: var(--muted);
}

.cast-carousel {
    display: grid;
    grid-template-columns: 36px minmax(0,1fr) 36px;
    align-items: center;
    gap: 10px;
}

.cast-popup-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 5 * 12px)/6);
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #3b8465 #142637;
    padding-bottom: 10px;
}

.cast-card {
    min-width: 0;
    scroll-snap-align: start;
    border: 1px solid #2d4356;
    border-radius: 8px;
    overflow: hidden;
    background: #14212f;
}

.cast-photo {
    aspect-ratio: 4/5;
    background: #152c3d;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.cast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cast-photo-placeholder .ico {
    width: 44px;
    height: 44px;
    color: #66e997;
}

.cast-card-body {
    padding: 9px;
}

.cast-card-body h3 {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cast-card-body p {
    margin: 0;
    color: #d3dce5;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.cast-status {
    margin: 10px 0 0;
    color: var(--muted);
}

.cast-status:empty {
    display: none;
}

.cast-carousel .arrow:disabled {
    opacity: .35;
    cursor: default;
}

@media(max-width:800px) {
    .cast-popup-grid {
        grid-auto-columns: calc((100% - 3 * 12px)/4);
    }
}

@container (max-width:560px) {
    .feature-band .feature-band-card {
        min-height: 100px;
        grid-template-columns: 34px minmax(0,1fr);
        padding: 12px 9px;
        gap: 8px;
    }
    .feature-band-copy strong {
        font-size: clamp(13px,3.7cqw,20px);
    }
    .feature-band-copy small,.feature-band-arrow {
        display: none;
    }
}

@media(max-width:540px) {
    .cast-modal {
        padding: 12px;
    }
    .cast-carousel {
        grid-template-columns: 28px minmax(0,1fr) 28px;
        gap: 6px;
    }
    .cast-carousel .arrow {
        width: 28px;
    }
    .cast-popup-grid {
        grid-auto-columns: calc((100% - 10px)/2);
        gap: 10px;
    }
}

/* 18 — Downloads de episódios: nome, resolução e qualidade na mesma linha */

.download-episode-heading,.download-episode-line {
    grid-column: span 2;
    min-width: 0;
}

.download-episode-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.episode-name {
    font-size: 14px;
    font-weight: 750;
    color: var(--text);
}

.download-episode-line .resolution-pill {
    font-size: 12px;
}

.download-episode-line .download-format {
    font-weight: 650;
}

@media(max-width:540px) {
    .download-row-episode {
        grid-template-columns: minmax(0,1fr);
        gap: 9px;
    }
    .download-row-episode .download-episode-line {
        grid-column: 1/-1;
        gap: 6px 10px;
    }
    .download-row-episode .download-size-unknown {
        display: none;
    }
    .download-row-episode .download-size:not(.download-size-unknown):before {
        content: 'Tamanho: ';
        color: var(--muted);
        font-weight: 500;
    }
    .episode-name {
        font-size: 13px;
    }
}

/* 19 — Paginação centralizada: index, gêneros, buscas e arquivos */

.navigation.pagination {
    display: block;
    width: 100%;
    margin: 34px auto 20px;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 auto;
}

.pagination .page-numbers {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 42px;
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid #304657;
    border-radius: 9px;
    background: linear-gradient(145deg,#162737,#0b1824);
    color: #d7e4ec;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
    transition: background .18s,border-color .18s,color .18s;
}

.pagination a.page-numbers:hover,.pagination a.page-numbers:focus-visible {
    border-color: var(--accent);
    background: #164c38;
    color: #fff;
}

.pagination .page-numbers.current {
    border-color: #49b77a;
    background: linear-gradient(145deg,#15864b,#096039);
    color: #fff;
    box-shadow: 0 3px 12px #16a34a24;
    font-weight: 800;
}

.pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    min-width: 26px;
    padding: 8px 3px;
    color: var(--muted);
}

.pagination .prev,.pagination .next {
    gap: 6px;
    padding-inline: 13px;
}

.pagination .prev .ico,.pagination .next .ico {
    width: 15px;
    height: 15px;
    color: var(--accent);
}

@media(max-width:540px) {
    .navigation.pagination {
        margin-top: 26px;
    }
    .pagination .nav-links {
        gap: 5px;
    }
    .pagination .page-numbers {
        min-width: 35px;
        min-height: 38px;
        padding: 7px 9px;
        font-size: 12px;
    }
    .pagination .page-numbers.dots {
        min-width: 20px;
    }
}

/* 20 — Cabeçalho fixo durante a rolagem, compacto e responsivo */

:root {
    --header-offset: 80px;
    scroll-padding-top: var(--header-offset);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #08121d;
    box-shadow: 0 4px 16px #0004;
}

body.admin-bar .site-header {
    top: 32px;
}

html:has(body.admin-bar) {
    --header-offset: 112px;
}

.header-inner {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, 210px);
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 7px 0;
}

.header-brand, .header-brand .custom-logo-link {
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-brand .custom-logo {
    display: block;
    width: auto;
    max-width: 185px;
    max-height: 46px;
    object-fit: contain;
}

.header-brand .brand {
    font-size: 17px;
    min-width: 0;
}

.header-brand .brand small {
    font-size: 12px;
}

.header-inner .nav {
    justify-content: center;
    gap: 9px 13px;
    min-width: 0;
}

.header-inner .nav > a, .header-inner .nav > details > summary {
    font-size: 13px;
    gap: 5px;
    min-height: 30px;
}

.header-inner .nav > a > .ico, .header-inner .nav > details > summary > .ico {
    width: 17px;
    height: 17px;
    color: var(--accent);
}

/* Formulário somente dentro do header: não afeta body.search. */

header .search {
    margin: 0 auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    align-content: center;
    background-image: url(img/pattern.png);
    padding: 10px;
}

/* Densidade compacta: mantém o pattern e reduz a área do campo. */

.site-header .header-inner .search {
    margin: 0 auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    align-content: center;
    width: 100%;
    max-width: 210px;
    min-width: 0;
    padding: 3px 4px 3px 9px;
    gap: 5px;
    border-radius: 8px;
    background-color: #0c1b29;
    background-image: url(img/pattern.png);
}

.site-header .search input {
    font-size: 12px;
    padding: 3px 0;
}

.site-header .search .search-submit {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
}

.site-header .search .search-submit .ico {
    width: 17px;
    height: 17px;
}

.site-header .genres {
    max-height: min(60vh, 480px);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 2;
}

.screen-reader-text:focus {
    clip: auto;
    width: auto;
    height: auto;
    padding: 10px;
    background: var(--panel);
    color: var(--text);
    z-index: 101;
}

@media (max-width: 1100px) {
    :root {
        --header-offset: 130px;
    }
    html:has(body.admin-bar) {
        --header-offset: 162px;
    }
    .header-inner {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 5px 12px;
    }
    .header-inner .nav {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .header-inner .search {
        grid-row: 1;
        grid-column: 2;
        justify-self: center;
    }
}

@media (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
    html:has(body.admin-bar) {
        --header-offset: 176px;
    }
}

@media (max-width: 600px) {
    body.admin-bar .site-header {
        top: 0;
    }
    html:has(body.admin-bar) {
        --header-offset: 145px;
    }
    :root {
        --header-offset: 145px;
    }
    .header-inner {
        gap: 4px 8px;
        padding: 6px 0;
    }
    .header-brand .custom-logo {
        max-width: 100%;
        max-height: 37px;
    }
    .header-brand .brand {
        font-size: 15px;
    }
    .header-inner .nav {
        gap: 2px 10px;
    }
    .header-inner .nav > a, .header-inner .nav > details > summary {
        font-size: 11px;
        gap: 4px;
        min-height: 27px;
    }
    .header-inner .nav > a > .ico, .header-inner .nav > details > summary > .ico {
        width: 15px;
        height: 15px;
    }
    .header-inner .nav {
        position: relative;
    }
    .header-inner .genre-menu {
        position: static;
    }
    .header-inner .genres {
        left: 0;
        right: auto;
        width: min(340px, 100%);
    }
}

/* 21 — Ícones dos títulos: filmes, séries, destaques, buscas e gêneros */

.section-head h1, .section-head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    border-left: 0;
    padding-left: 0;
    overflow-wrap: anywhere;
}

.section-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 1px solid #397a57;
    border-radius: 10px;
    color: #72e99f;
    background: linear-gradient(145deg, #194a36, #0d222c);
    box-shadow: inset 0 1px 0 #ffffff12, 0 3px 9px #0003;
}

.section-icon > .ico {
    width: 25px;
    height: 25px;
    stroke-width: 1.75;
    color: inherit;
}

.featured-section .section-icon {
    color: #b2f6bc;
    background: linear-gradient(145deg, #206a43, #12312d);
}

.single-related .section-icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
}

.single-related .section-icon > .ico {
    width: 21px;
    height: 21px;
}

@media (max-width: 540px) {
    .section-icon {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    .section-icon > .ico {
        width: 21px;
        height: 21px;
    }
    .section-head h1, .section-head h2 {
        gap: 7px;
    }
}

/* 22 — Aviso reutilizável: cores, ícone e botão de fechar. */
.ch-notice {
    --notice-bg: #2b2313;
    --notice-border: #685027;
    --notice-text: #ffe2a0;
    --notice-accent: #f5bc56;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    min-width: 0;
    margin: 18px 0;
    padding: 17px 20px;
    background: var(--notice-bg);
    border: 1px solid var(--notice-border);
    border-radius: 14px;
    color: var(--notice-text);
    font-size: 14px;
    line-height: 1.55;
    box-sizing: border-box;
}
.ch-notice[hidden] { display: none !important; }
.ch-notice--green { --notice-bg: #102d23; --notice-border: #356c4c; --notice-text: #c3f4d3; --notice-accent: #62dc96; }
.ch-notice--blue { --notice-bg: #13283b; --notice-border: #345776; --notice-text: #d2eaff; --notice-accent: #83caff; }
.ch-notice--red { --notice-bg: #351d25; --notice-border: #80424c; --notice-text: #ffd8dc; --notice-accent: #ff969c; }
.ch-notice .ch-notice-icon { flex: 0 0 23px; width: 23px; height: 23px; margin-top: 1px; color: var(--notice-accent); }
.ch-notice-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ch-notice-title { color: var(--notice-accent); font-weight: 800; }
.ch-notice .ch-notice-text a { color: var(--notice-text); text-decoration: underline; font-weight: 700; text-underline-offset: 3px; }
.ch-notice .ch-notice-close { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; color: var(--notice-accent); background: transparent; cursor: pointer; }
.ch-notice-close .ico { width: 19px; height: 19px; }
.ch-notice-close:hover, .ch-notice-close:focus-visible { background: #ffffff12; outline: 1px solid var(--notice-accent); }
.ch-notice-global .ch-notice { margin-bottom: 0; }
@media (max-width: 540px) { .ch-notice { gap: 10px; padding: 13px 12px; font-size: 13px; border-radius: 10px; } }
