/* 
=========================================================
   ULTRA PREMIUM UI/UX THEME (Luxury OLED & Speed Optimized)
   Project: 9nung
========================================================= 
*/

/* ── Premium Logo ── */
.doo-logo-premium {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    text-decoration: none !important;
    user-select: none;
    position: relative;
}
/* Gold accent underline */
.doo-logo-premium::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: linear-gradient(90deg, #D4AF37 0%, #F5D77A 55%, transparent 100%);
    border-radius: 1px;
}
/* "9" — gold shimmer */
@keyframes gold-shine {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.doo-logo-num {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 44px;
    font-weight: 900;
    line-height: 44px;
    background: linear-gradient(90deg, #B8860B 0%, #D4AF37 25%, #F5D77A 50%, #D4AF37 75%, #B8860B 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    animation: gold-shine 4s ease infinite;
    filter: drop-shadow(0 0 10px rgba(212,175,55,0.35));
}
/* คอลัมน์ขวา: stack นายหนัง บน + nung ล่าง — ชิดกัน */
.doo-logo-right {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1;
}
/* "นายหนัง" — แนบชิดกับ nung */
.doo-logo-sup {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    display: block !important;
    letter-spacing: 0.1em;
    color: #D4AF37 !important;
    -webkit-text-fill-color: #D4AF37 !important;
    opacity: 0.9;
    white-space: nowrap;
    margin: 0 0 -9px 0 !important;
    padding: 0 !important;
}
/* "nung" — สีหมอก */
.doo-logo-text {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 33px;
    font-weight: 800;
    line-height: 33px;
    height: 33px;
    
    display: block !important;
    color: #b0b8c1 !important;
    -webkit-text-fill-color: #b0b8c1 !important;
    letter-spacing: -0.5px;
    margin: 0 !important;
    padding: 0 !important;
}
.logo a { text-decoration: none !important; }

:root {
    --up-bg-black: #050505;
    --up-bg-subtle: #141414;
    --up-bg-card: #181818;
    --up-text-main: #FFFFFF;
    --up-text-muted: #A3A3A3;
    --up-accent-gold: #D4AF37;
    --up-accent-hover: #F1C40F;
    --up-header-blur: rgba(5, 5, 5, 0.7);
    --up-border-radius: 12px;
    --up-transition: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 1. Base Typography & Background */
body, html {
    background-color: var(--up-bg-black) !important;
    color: var(--up-text-main) !important;
    font-family: 'Outfit', 'Inter', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}


/* 2. Glassmorphism Header */
#header {
    background: var(--up-header-blur) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 999;
}

/* .hbox: row layout — nav takes remaining space, headitems (search) never shrinks */
#header .hbox {
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;       /* clip ads that overflow nav height */
}
#header .head-main-nav {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;       /* prevent ad banners inside nav from overflowing */
    max-height: 64px !important;       /* cap nav row height — clips rogue ad images */
}
/* Custom HTML menu items (where ad banners are often injected) */
#header .head-main-nav .main-header li.menu-item-type-custom,
#header .head-main-nav .main-header li.menu-item-has-children {
    overflow: hidden !important;
    max-height: 64px !important;
}
/* headitems = search + user icon — never shrink, always on top */
#header .headitems {
    flex: 0 0 auto !important;
    position: relative !important;
    z-index: 1002 !important;
}

/* ── SEARCH — Design D: Gold Glow Border + Glassmorphism ── */

/* Form container: glass pill with gold border glow */
#header #searchform,
#header #advc-menu form {
    display: flex !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(16px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(160%) !important;
    border: 1px solid rgba(212, 175, 55, 0.45) !important;
    border-radius: 50px !important;
    box-shadow:
        0 0 10px rgba(212, 175, 55, 0.18),
        0 0 24px rgba(212, 175, 55, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* On focus-within: brighter glow */
#header #searchform:focus-within,
#header #advc-menu form:focus-within {
    border-color: rgba(212, 175, 55, 0.85) !important;
    box-shadow:
        0 0 16px rgba(212, 175, 55, 0.45),
        0 0 40px rgba(212, 175, 55, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Input: transparent inside the glass pill */
#header #advc-menu input,
#header #searchform input,
#header .search-wrapper input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: #fff !important;
    border-radius: 0 !important;
    padding: 9px 6px 9px 18px !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 13px !important;
    min-width: 160px !important;
    backdrop-filter: none !important;
}
#header #advc-menu input::placeholder,
#header #searchform input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Search button: gold circle with glow inside the pill */
#header .search-button,
#header #searchform .search-button {
    background: linear-gradient(135deg, #D4AF37 0%, #F5D77A 50%, #B8860B 100%) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    margin: 3px 3px 3px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #000 !important;
    font-size: 15px !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.45) !important;
    transition: box-shadow 0.25s ease, transform 0.2s ease !important;
    flex-shrink: 0 !important;
}
#header .search-button:hover,
#header #searchform .search-button:hover {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.75), 0 0 40px rgba(212, 175, 55, 0.3) !important;
    transform: scale(1.08) !important;
}

/* 3. Movie Posters & Cards (Luxury Curves & Speed) */
/*
 * DooPlay original: padding-top:140% + height:100% + img{margin-top:-140%; height:auto; position:absolute}
 * ปัญหาที่เกิด: margin-top:-140% ที่เราไม่ได้ reset → img ถูก push ขึ้นไป -140% → เห็นแค่แถบล่าง
 * ปัญหาที่สอง: DooPlay selector specificity = 4 classes (.module .content .items .item .poster)
 *              ของเราแค่ 2 classes → ต้อง match full selector ให้ชนะ
 *
 * FIX: ใช้ padding-top:150% (2:3 ratio) + reset margin-top:0 + position absolute + inset:0
 */
.module .content .items .item .poster,
.item .poster {
    border-radius: var(--up-border-radius) !important;
    overflow: hidden !important;
    transform: translateZ(0);
    transition: transform var(--up-transition), box-shadow var(--up-transition);
    border: 1px solid transparent !important;
    background: var(--up-bg-card);
    position: relative !important;
    display: block !important;
    width: 100% !important;
    padding-top: 150% !important;    /* 2:3 ratio */
    padding-bottom: 0 !important;
    height: 0 !important;            /* override DooPlay height:100% */
    aspect-ratio: unset !important;
}

/* Smooth Scale Hover */
.module .content .items .item:hover .poster,
.item:hover .poster {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.15), 0 5px 15px rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
}

.module .content .items .item .poster img,
.item .poster img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    margin-top: 0 !important;        /* ← reset DooPlay margin-top:-140% — นี่คือ root cause */
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
    border-radius: var(--up-border-radius) !important;
}

/* <a> overlay ให้ span เต็ม poster */
.module .content .items .item .poster > a,
.item .poster > a {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    z-index: 1 !important;
    background: transparent !important;
}

/* Hide Dooplay's clunky gradients and badges, modernize them */
.item .poster .mepo, 
.item .poster .quality,
.item .poster .year {
    border-radius: 4px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

.item .poster .quality {
    background: var(--up-accent-gold) !important;
    color: #000 !important;
    padding: 3px 8px;
}

.item .poster .rating {
    background: rgba(0,0,0,0.7) !important;
    color: #FFD700 !important;
    border-radius: 12px;
    padding: 4px 10px;
    backdrop-filter: blur(5px);
}

/* Titles */
.item .data h3 {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    margin-top: 10px !important;
    color: var(--up-text-main) !important;
}
.item .data span {
    color: var(--up-text-muted) !important;
    font-size: 13px !important;
}

/* 4. Single Pages & Breadcrumbs */
#single .sbox, .sbox {
    background: var(--up-bg-subtle) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: var(--up-border-radius) !important;
    box-shadow: none !important;
    padding: 20px;
}

.breadcrumb {
    background: transparent !important;
    border: none !important;
    color: var(--up-text-muted) !important;
    font-family: 'Outfit', sans-serif;
}

.breadcrumb a {
    color: var(--up-text-main) !important;
    font-weight: 500;
}
.breadcrumb a:hover {
    color: var(--up-accent-gold) !important;
}

/* 5. Buttons & Badges */
.btn, .button, input[type="submit"], button {
    background: rgba(45, 45, 45, 0.92) !important;
    color: #d0d0d0 !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 50px !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 7px 18px !important;
    transition: background var(--up-transition), transform var(--up-transition), box-shadow var(--up-transition) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

.btn:hover, .button:hover, input[type="submit"]:hover, button:hover {
    background: rgba(70, 70, 70, 0.95) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
}

/* Slider nav arrows — small silver */
.btn.prevf, .btn.nextf, .btn.prev4, .btn.next4 {
    padding: 5px 11px !important;
    font-size: 13px !important;
    min-width: 0 !important;
    width: auto !important;
    background: rgba(50, 50, 50, 0.88) !important;
    color: #c8c8c8 !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.4) !important;
    border: 1px solid rgba(255,255,255,0.07) !important;
}
.btn.prevf:hover, .btn.nextf:hover, .btn.prev4:hover, .btn.next4:hover {
    background: rgba(80, 80, 80, 0.95) !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}
.btn.prevf i, .btn.nextf i, .btn.prev4 i, .btn.next4 i {
    color: #c8c8c8 !important;
    -webkit-text-fill-color: #c8c8c8 !important;
}

/* Keep gold only for important action buttons */
input[type="submit"],
.doo-jump-btn,
.btn-play-movie,
.wp-block-button__link {
    background: var(--up-accent-gold) !important;
    color: #000 !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4) !important;
    border: none !important;
}
input[type="submit"]:hover,
.doo-jump-btn:hover,
.btn-play-movie:hover {
    background: var(--up-accent-hover) !important;
    color: #000 !important;
}

/* Mobile nav icon buttons — fix icon visibility */
.nav_items_module a.btn {
    background: transparent !important;
    color: #d0d0d0 !important;
    -webkit-text-fill-color: #d0d0d0 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 6px 8px !important;
    font-size: 22px !important;
}
.nav_items_module a.btn:hover {
    background: rgba(255,255,255,0.08) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    transform: none !important;
}

/* ── Mobile header buttons (button.aresp) — icomoon icons ── */
/* Override .btn gold background on these buttons */
header.responsive button.aresp,
header button.aresp {
    background: transparent !important;
    color: #c8c8c8 !important;
    -webkit-text-fill-color: #c8c8c8 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 8px 12px !important;
    font-size: 0 !important; /* hide any text fallback */
    line-height: 1 !important;
    cursor: pointer !important;
}
header.responsive button.aresp:hover,
header button.aresp:hover {
    background: rgba(255,255,255,0.08) !important;
    color: #fff !important;
}
/* Inject icomoon icons via ::before */
header.responsive button.aresp::before,
header button.aresp::before {
    font-family: icomoon !important;
    font-size: 24px !important;
    line-height: 1;
    color: #c8c8c8 !important;
    -webkit-text-fill-color: #c8c8c8 !important;
    display: block !important;
    font-weight: 400;
    font-style: normal;
    font-variant: normal;
    text-transform: none;
    speak: none;
    -webkit-font-smoothing: antialiased;
}
header.responsive button.aresp.nav-resp::before,
header button.aresp.nav-resp::before {
    content: "\e5d2" !important; /* hamburger/menu icon */
}
header.responsive button.aresp.search-resp::before,
header button.aresp.search-resp::before {
    content: "\e927" !important; /* search icon */
}
header.responsive button.aresp:hover::before,
header button.aresp:hover::before {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

/* 6. Tabs & Taxonomies */
.sgeneros a {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: var(--up-text-main) !important;
    border-radius: 50px !important;
    padding: 5px 15px !important;
    transition: all var(--up-transition);
}

.sgeneros a:hover {
    background: var(--up-accent-gold) !important;
    border-color: var(--up-accent-gold) !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4) !important;
}

/* 7. Footer */
#footer {
    background: var(--up-bg-black) !important;
    border-top: 1px solid rgba(255,255,255,0.05) !important;
    color: var(--up-text-muted) !important;
}

/* General Layout Fixes to remove legacy Dooplay white components */
#archive-content, .module {
    background: transparent !important;
    border: none !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
}

/* 8. Structural Layout: Hero Banner */
.premium-hero {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    border-radius: 0 0 var(--up-border-radius) var(--up-border-radius);
    overflow: hidden;
    margin-bottom: -150px;
    z-index: 1;
}

.premium-hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, var(--up-bg-black) 0%, rgba(5,5,5,0.85) 40%, rgba(5,5,5,0.3) 100%);
    display: flex;
    align-items: flex-end;
    padding: 50px;
}

.premium-hero-content {
    max-width: 800px;
    padding-bottom: 50px;
}

.premium-title {
    font-size: 3.5rem !important;
    line-height: 1.1;
    margin-bottom: 15px !important;
    text-shadow: 2px 4px 15px rgba(0,0,0,0.8);
}

.premium-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.meta-badge {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}

.meta-badge.rated {
    background: #FFF;
    color: #000;
}

.premium-genres a {
    color: var(--up-accent-gold) !important;
    margin-right: 15px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
}

.premium-synopsis-short {
    font-size: 16px;
    line-height: 1.6;
    color: #ddd;
    margin-bottom: 30px;
    text-shadow: 1px 2px 10px rgba(0,0,0,0.8);
}

.btn-play-movie {
    background: var(--up-accent-gold) !important;
    color: #000 !important;
    font-weight: 700;
    font-size: 16px;
    padding: 15px 40px !important;
    border-radius: 50px;
    display: inline-block;
    transition: all var(--up-transition);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
    text-shadow: none;
    text-transform: uppercase;
}
.btn-play-movie:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.6);
    color: #000 !important;
}
.btn-play-movie i {
    margin-right: 8px;
}

/* 9. Premium Player Placement */
.premium-player-section {
    position: relative;
    z-index: 10;
    max-width: 95%;
    margin: 0 auto 50px auto;
    border-radius: var(--up-border-radius);
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    overflow: hidden;
}

/* 10. Information Grid */
.premium-details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    padding: 0 20px 50px 20px;
}

.premium-sbox {
    margin-bottom: 0 !important;
    background: var(--up-bg-card) !important;
}

.premium-poster-thumb {
    width: 100%;
    border-radius: var(--up-border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    margin-bottom: 20px;
}

.premium-crew h5 {
    color: var(--up-accent-gold) !important;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.premium-crew .persons a {
    color: #fff !important;
    font-weight: 500;
    transition: color 0.3s;
}

.premium-crew .persons a:hover {
    color: var(--up-accent-gold) !important;
}

.mt-10 {
    margin-top: 20px;
}

/* Specific to Mobile Hero */
@media screen and (max-width: 768px) {
    .premium-hero {
        height: 60vh;
        min-height: 400px;
    }
    .premium-hero-overlay {
        padding: 30px 20px;
    }
    .premium-title {
        font-size: 2rem !important;
    }
    .premium-synopsis-short {
        display: none; /* Hide synopsis on mobile hero to save space */
    }
    .premium-details-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE IMAGES — ทุก banner/ad/รูป
   ย่อขยายตามหน้าจออัตโนมัติ
═══════════════════════════════════════ */

/* Global: ทุก img ไม่ล้น viewport */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* Banner / Ad areas */
.module_single_ads img,
.module_ads img,
.banner img,
[class*="banner"] img,
[class*="-ad"] img,
[class*="ad-"] img,
[id*="banner"] img,
[id*="-ad"] img,
.textwidget img,
.widget_text img,
.widget_custom_html img,
#header_ad img,
#footer_ad img,
.header-ad img,
.top-ad img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 8px;
}

/* iframe ads (เช่น Google AdSense) */
iframe {
    max-width: 100% !important;
}

/* ป้องกัน container ล้น */
.module_single_ads,
.module_ads,
[class*="banner"],
[id*="banner"] {
    max-width: 100% !important;
    overflow: hidden !important;
}

/* ═══════════════════════════════════════════════
   GLOBAL LUXURY DARK — Homepage + Archive + Genre
   ให้ทุกหน้าไปทางเดียวกับ single page
═══════════════════════════════════════════════ */

/* 1. Kill blue-grey backgrounds */
#dt_contenedor {
    background: #0d0d0d !important;
}
header.subhead {
    background: #0d0d0d !important;
    border-bottom: 1px solid rgba(212,175,55,.12) !important;
}

/* 2. Link colors: blue → gold */
a {
    color: #D4AF37 !important;
    transition: color .22s ease !important;
}
a:hover {
    color: #F5D77A !important;
}

/* 3. Module background — pure dark */
.module {
    background: #111111 !important;
    border-top: 1px solid rgba(255,255,255,.05) !important;
    border-bottom: 1px solid rgba(255,255,255,.05) !important;
}
.module:first-child { border-top: none !important; }

/* 4. Module section header titles — gold gradient */
.module .content header {
    padding: 18px 10px 12px !important;
    position: relative;
}
.module .content header h1,
.module .content header h2 {
    background: linear-gradient(135deg,#D4AF37 0%,#F5D77A 50%,#B8860B 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: .5px !important;
    text-transform: none !important;
    padding-left: 14px !important;
    position: relative;
}
/* gold left bar */
.module .content header h1::before,
.module .content header h2::before {
    content: '';
    position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px;
    background: linear-gradient(180deg,#D4AF37,#B8860B);
    border-radius: 2px;
}
/* "See all" count link */
.module .content header span {
    color: #848484 !important;
    font-size: 12px !important;
}
.module .content header span a.see-all {
    color: #D4AF37 !important;
    background: rgba(212,175,55,.1) !important;
    border: 1px solid rgba(212,175,55,.2) !important;
    border-radius: 20px !important;
    padding: 3px 12px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    transition: all .22s ease !important;
}
.module .content header span a.see-all:hover {
    background: rgba(212,175,55,.2) !important;
    color: #F5D77A !important;
}

/* 5. Item cards hover: blue → gold */
.module .content .items .item .data h3 a { color: #e0e0e0 !important; }
.module .content .items .item .data h3 a:hover { color: #D4AF37 !important; }
.module .content .items .item .data span { color: #777 !important; }

/* 6. Item border section */
.module .content .items {
    border-color: rgba(255,255,255,.05) !important;
    padding-bottom: 20px !important;
}

/* 7. Archive/Genre page header */
.archive_title,
.archive-title,
.module .content .archive_title h1,
.module .content .archive_title h2 {
    background: linear-gradient(135deg,#D4AF37 0%,#F5D77A 50%,#B8860B 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-size: 20px !important;
    font-weight: 700 !important;
}

/* 8. Sidebar on archive/genre pages — match single page */
.module .sidebar {
    background: transparent !important;
    padding: 20px 16px !important;
}
.sidemenu {
    background: #141414 !important;
    border: 1px solid rgba(212,175,55,.15) !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    margin-bottom: 16px !important;
}
.sidemenu h2 {
    background: linear-gradient(135deg,#D4AF37 0%,#F5D77A 50%,#B8860B 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    padding: 13px 16px 11px !important;
    border-bottom: 1px solid rgba(212,175,55,.12) !important;
    color: transparent !important;
}
.sidemenu ul.genres { margin: 0 !important; padding: 0 !important; }
.sidemenu ul.genres li {
    border-bottom: 1px solid rgba(255,255,255,.04) !important;
    margin: 0 !important;
}
.sidemenu ul.genres li:last-child { border-bottom: none !important; }
.sidemenu ul.genres li a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
    color: #ccc !important;
    font-weight: 500 !important;
    transition: color .22s, background .22s, padding-left .22s !important;
}
.sidemenu ul.genres li a::before {
    content: '›' !important;
    color: #D4AF37 !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
    -webkit-text-fill-color: #D4AF37 !important;
}
.sidemenu ul.genres li a:hover,
.sidemenu ul.genres li.current-cat a {
    color: #D4AF37 !important;
    background: rgba(212,175,55,.06) !important;
    padding-left: 20px !important;
    -webkit-text-fill-color: #D4AF37 !important;
}

/* 9. Pagination */

/* Container — flex row, wraps cleanly if needed */
.module .content .pagination,
.pagination {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 5px !important;
    float: left !important;
    width: auto !important;
    max-width: calc(100% - 240px) !important;
    padding: 6px 0 !important;
}

/* Hide "Page X" label — current button already shows position */
.pagination > span:not(.current):not(.arrow_pag) {
    display: none !important;
}

/* Buttons */
.pagination a,
.nav-links a {
    background: #1a1a1a !important;
    border: 1px solid rgba(212,175,55,.2) !important;
    color: #ccc !important;
    border-radius: 8px !important;
    transition: all .22s !important;
    min-width: 38px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 10px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}
.pagination a:hover,
.pagination .current,
.nav-links a:hover {
    background: rgba(212,175,55,.15) !important;
    border-color: #D4AF37 !important;
    color: #D4AF37 !important;
    -webkit-text-fill-color: #D4AF37 !important;
}
/* Current page — gold border + bg */
.pagination .current {
    min-width: 38px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    border: 1px solid #D4AF37 !important;
    background: rgba(212,175,55,.15) !important;
    color: #D4AF37 !important;
    -webkit-text-fill-color: #D4AF37 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 0 10px !important;
}

/* 10. Footer */
footer.main {
    background: #0a0a0a !important;
    border-top: 1px solid rgba(212,175,55,.12) !important;
}
footer.main a { color: #aaa !important; }
footer.main a:hover { color: #D4AF37 !important; }

/* 11. Search results */
.search-page .module .content header h1 { padding-left: 14px !important; }

/* 12. Navigation menu links — gold on hover (not blue) */
header.main .hbox nav ul li a:hover,
header.main .hbox nav ul li.current-menu-item a {
    color: #D4AF37 !important;
}

/*
 * isolation: isolate บน .items กักด stacking context ของ poster cards (transform:translateZ(0))
 * ไว้ข้างใน — ป้องกัน cards ลอยทับ pagination / jump widget ที่อยู่นอก .items
 */
.module .content .items,
.items {
    isolation: isolate !important;
}

/* ── PAGINATION + JUMP TO PAGE — same row ── */

.doo-jump-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    margin: 8px 0 !important;
    flex-wrap: nowrap !important;
    position: relative !important;
    z-index: 10 !important;
    isolation: isolate !important;
    float: right !important;
    clear: none !important;   /* อยู่แถวเดียวกับ pagination */
    width: auto !important;
}

/* clearfix หลัง jump wrap เพื่อปิด float */
.doo-jump-wrap::after {
    content: '' !important;
    display: table !important;
    clear: both !important;
}
.doo-jump-label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    white-space: nowrap;
}
.doo-jump-input {
    width: 80px !important;
    height: 38px !important;
    background: #1a1a1a !important;
    border: 1px solid rgba(212,175,55,.3) !important;
    border-radius: 8px !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center !important;
    padding: 0 10px !important;
    outline: none !important;
    -moz-appearance: textfield !important;
    transition: border-color .22s, box-shadow .22s !important;
    box-shadow: none !important;
}
.doo-jump-input::-webkit-outer-spin-button,
.doo-jump-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.doo-jump-input:focus {
    border-color: #D4AF37 !important;
    box-shadow: 0 0 0 2px rgba(212,175,55,.15) !important;
}
.doo-jump-btn {
    height: 38px !important;
    padding: 0 18px !important;
    background: linear-gradient(135deg,#D4AF37,#F5D77A,#B8860B) !important;
    border: none !important;
    border-radius: 8px !important;
    color: #000 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    letter-spacing: .5px !important;
    transition: opacity .2s, transform .2s !important;
    box-shadow: 0 4px 14px rgba(212,175,55,.3) !important;
    text-transform: none !important;
    -webkit-text-fill-color: #000 !important;
}
.doo-jump-btn:hover {
    opacity: .88 !important;
    transform: translateY(-1px) !important;
}

/* 13. Breadcrumb */
#breadcrumb, .breadcrumb_archive {
    background: transparent !important;
    color: #666 !important;
    padding: 10px 0 !important;
}
#breadcrumb a, .breadcrumb_archive a { color: #aaa !important; }
#breadcrumb a:hover, .breadcrumb_archive a:hover { color: #D4AF37 !important; }

/* ═══════════════════════════════════════════════
   SINGLE PAGE — CAST / GALLERY FIX
   gallery images may use float:left → crew row wraps alongside them
   clear:both forces crew below the gallery, not next to it
═══════════════════════════════════════════════ */

/* Gallery container — cap width, never overflow the column */
#dt_galery,
.nx-story-text .gallery,
.nx-story-text [id*="galery"],
.nx-story-text [class*="gallery"] {
    max-width: 100% !important;
    overflow: hidden !important;
    display: block !important;
    float: none !important;
}
#dt_galery .g-item img {
    width: 100% !important;
    height: auto !important;
    float: none !important;
    display: block !important;
}

/* Divider + crew — always start below any floats */
.nx-divider,
.nx-crew-row,
.nx-tags {
    clear: both !important;
}

/* col-main: use overflow:clip instead of overflow:hidden
   clip = visually crops without creating a scroll container,
   so absolutely-positioned children (e.g. dropdowns) aren't affected */
.nx-col-main {
    overflow-x: clip !important;
}

/* ═══════════════════════════════════════════════
   RELATED POSTS GRID — movies + tvshows (global)
   (previously only in peliculas.php inline style)
═══════════════════════════════════════════════ */
.nx-related-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    overflow: visible !important;
}
@media (max-width: 940px) {
    .nx-related-grid { grid-template-columns: repeat(4, 1fr) !important; }
}
@media (max-width: 600px) {
    .nx-related-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ─── Accessibility: หยุด animation สำหรับ prefers-reduced-motion ─── */
@media (prefers-reduced-motion: reduce) {
    .doo-logo-num {
        animation: none;
        background: #D4AF37;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

/* ─── Accessibility: Screen-reader only text ─── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─── Accessibility: Touch targets — minimum 44px (WCAG 2.5.5) ─── */
.arrow_pag {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.resppages a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* Movie card poster links — ensure tap area covers the image */
.articles article .poster,
.items article .poster {
    display: block;
    min-height: 44px;
}

/* ─── TMDB Deferred Loading — placeholder + fade-in ─── */
img.tmdb-lazy {
    /* ใช้พื้นที่ตามขนาด HTML แต่ไม่แสดงรูป */
    background: #111827;
    opacity: 0.4;
}
img.tmdb-loaded {
    opacity: 1;
    animation: tmdbFadeIn 0.35s ease-in;
}
@keyframes tmdbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    img.tmdb-loaded { animation: none; }
}
