/*
Theme Name: nusastream
Theme URI: https://steamx.site
Author: steamX
Description: Tema video gelap untuk steamX dengan pemutar Doodstream. Kompatibel dengan Elementor (Header, Footer, Single, Archive lewat Theme Builder).
Version: 2.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: nusastream
*/

/* ---------- Token ---------- */
:root {
    --bg: #0b101b;
    --bg-card: #121a2a;
    --bg-raise: #182238;
    --line: #1f2a40;
    --text: #f2f5fb;
    --muted: #8b97ad;
    --red: #ff1f3d;
    --red-deep: #c4102b;
    --radius: 10px;
    --cols: 5;
    --font-display: 'Outfit', system-ui, sans-serif;
    --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 .5em;
    letter-spacing: -.01em;
}

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }

.screen-reader-text, .skip-link:not(:focus) {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
.skip-link:focus {
    position: fixed; top: 10px; left: 10px; z-index: 999;
    background: var(--red); color: #fff; padding: 10px 16px; border-radius: 6px;
}

.page-main { padding-top: 28px; padding-bottom: 56px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 16, 27, .88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.header-flex {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 68px;
}

.site-logo, .custom-logo-link { display: inline-flex; flex-shrink: 0; }
.site-logo img, .custom-logo { height: 44px; width: auto; }

.site-nav { flex: 1; }
.nav-list { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.nav-list a {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 500;
    font-size: 15px;
    transition: color .15s, background .15s;
}
.nav-list a:hover, .nav-list .current-menu-item > a { color: var(--text); background: var(--bg-raise); }

.search-box { margin-left: auto; }
.search-box input[type="search"] {
    width: 260px;
    max-width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--line);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    padding: 10px 16px 10px 40px;
    border-radius: 999px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b97ad' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 18px;
    transition: border-color .15s, width .2s;
    -webkit-appearance: none;
}
.search-box input[type="search"]::placeholder { color: var(--muted); }
.search-box input[type="search"]:focus { outline: none; border-color: var(--red); width: 320px; }

/* ---------- Hero ---------- */
.hero { margin-bottom: 28px; }
.hero-link {
    position: relative;
    display: block;
    aspect-ratio: 21 / 9;
    min-height: 260px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.hero-link:hover .hero-img { transform: scale(1.03); }
.hero-shade {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(11,16,27,.92) 0%, rgba(11,16,27,.55) 45%, rgba(11,16,27,0) 75%),
                linear-gradient(0deg, rgba(11,16,27,.8) 0%, rgba(11,16,27,0) 45%);
}
.hero-body {
    position: absolute; left: 0; bottom: 0;
    padding: clamp(20px, 4vw, 44px);
    max-width: 640px;
    display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.hero-cat { color: var(--muted); font-size: 14px; font-weight: 500; }
.hero-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(26px, 4.2vw, 48px);
    line-height: 1.08;
    letter-spacing: -.02em;
    text-wrap: balance;
}
.hero-cta, .btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--red);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    padding: 11px 20px;
    border-radius: 999px;
    box-shadow: 0 6px 28px rgba(255, 31, 61, .4);
    transition: background .15s, transform .15s;
}
.hero-link:hover .hero-cta, .btn:hover { background: #ff3b56; }

/* ---------- Genre ---------- */
.genre-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 26px;
    scrollbar-width: none;
}
.genre-bar::-webkit-scrollbar { display: none; }

.chip {
    flex-shrink: 0;
    display: inline-block;
    background: var(--bg-card);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 9px 16px;
    border-radius: 999px;
    transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--text); border-color: #33415f; }
.chip.is-active { background: var(--red); border-color: var(--red); color: #fff; }

.section-title { font-size: clamp(22px, 2.4vw, 28px); margin-bottom: 18px; }

/* ---------- Grid & kartu ---------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: 22px 16px;
}

.post-card { min-width: 0; }
.post-card-link { display: block; }

.post-card-thumb {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}
.post-card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s ease, filter .35s ease;
}

/* Tombol play: satu-satunya elemen yang menyala merah */
.post-card-thumb::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 52px; height: 52px;
    transform: translate(-50%, -50%) scale(.7);
    background-color: var(--red);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 55% center;
    background-size: 26px;
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 0 6px rgba(255, 31, 61, .2), 0 8px 30px rgba(255, 31, 61, .55);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.post-card:hover .post-card-thumb::after,
.post-card-link:focus-visible .post-card-thumb::after { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.post-card:hover .post-card-thumb img { transform: scale(1.04); filter: brightness(.7); }

.post-card .title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 10px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
}
.post-card-meta { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- Halaman tonton ---------- */
.watch-article { max-width: 1040px; margin: 0 auto; }

.player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.player-overlay {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    padding: 0; border: 0;
    background: #000;
    cursor: pointer;
    display: block;
}
.player-thumb { width: 100%; height: 100%; object-fit: cover; opacity: .75; transition: opacity .25s, transform .5s; }
.player-overlay:hover .player-thumb { opacity: .55; transform: scale(1.02); }

.play-btn {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 84px; height: 84px;
    display: grid; place-items: center;
    background: var(--red);
    border-radius: 50%;
    box-shadow: 0 0 0 10px rgba(255, 31, 61, .2), 0 12px 48px rgba(255, 31, 61, .6);
    transition: transform .2s;
}
.play-btn svg { margin-left: 4px; }
.player-overlay:hover .play-btn { transform: translate(-50%, -50%) scale(1.08); }

.player-frame { position: absolute; inset: 0; }
.player-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.player.is-playing .player-overlay { display: none; }

.watch-head { margin: 22px 0 6px; }
.watch-head h1 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 12px; }
.watch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.watch-meta time { margin-right: 6px; }

.entry-content { color: #c6cedd; margin-top: 18px; max-width: 72ch; }
.entry-content p { margin: 0 0 1em; }
.entry-content a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

.related { margin-top: 56px; }

/* ---------- Pagination & kosong ---------- */
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
    min-width: 42px; text-align: center;
    background: var(--bg-card); border: 1px solid var(--line);
    padding: 9px 14px; border-radius: 8px; font-size: 14px; color: var(--muted);
}
.pagination a.page-numbers:hover { color: var(--text); border-color: #33415f; }
.pagination .page-numbers.current { background: var(--red); border-color: var(--red); color: #fff; }

.empty { text-align: center; padding: 70px 20px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); padding: 32px 0; }
.footer-flex { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.footer-logo img { height: 32px; width: auto; }
.footer-nav { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; }
.footer-nav a { color: var(--muted); font-size: 14px; }
.footer-nav a:hover { color: var(--text); }
.copyright { margin: 0 0 0 auto; color: var(--muted); font-size: 13px; }

/* ---------- Elementor ---------- */
.elementor-page .page-main,
.elementor-page .page-article { padding-top: 0; padding-bottom: 0; max-width: none; padding-left: 0; padding-right: 0; }
.elementor-page .entry-content { max-width: none; margin-top: 0; color: inherit; }
.elementor-editor-active .site-header { position: relative; }
.elementor-widget-shortcode .post-grid { width: 100%; }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) { .post-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) {
    .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .site-nav { display: none; }
    .search-box { flex: 1; }
    .search-box input[type="search"], .search-box input[type="search"]:focus { width: 100%; }
    .header-flex { gap: 16px; }
    .copyright { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
    .container { padding: 0 14px; }
    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
    .site-logo img, .custom-logo { height: 36px; }
    .hero-link { aspect-ratio: 4 / 3; }
    .play-btn { width: 68px; height: 68px; }
    .post-card .title { font-size: 14px; }
}

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