/*
Theme Name: MegaBox Cinema
Author: MegaBox Cinema
Description: Theme tin tức giải trí nền tối kiểu điện ảnh: hero lớn, dải bài cuộn ngang, cột phải.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: megabox-cinema
*/

:root {
  --red: #cc1f2d;
  --red-dk: #a8151f;
  --ink: #1b1b1f;
  --text: #2d2d33;
  --soft: #6b6b75;
  --line: #e4e4e8;
  --wash: #f5f5f7;
  --white: #fff;
  --f-head: 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif;
  --f-body: 'Noto Sans', 'Segoe UI', Arial, sans-serif;
  --wrap: 1200px;
  --gut: 16px;
  --side: 320px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--text); font: 400 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, video, iframe { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 700; line-height: 1.32; margin: 0; color: var(--ink); }
p { margin: 0 0 .9em; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 999; background: var(--red); color: #fff; padding: 10px 16px; }
.wrap { width: min(100% - var(--gut) * 2, var(--wrap)); margin-inline: auto; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Top bar ---------- */
.topbar { background: var(--wash); border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--soft); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 34px; gap: 12px; }
.topbar ul { display: flex; gap: 16px; }
.topbar a { display: inline-flex; align-items: center; min-height: 34px; }
.topbar #dot, .topbar .ping { display: none; }
.topbar span[style] { margin: 0 !important; }

/* ---------- Header ---------- */
.head { padding: 14px 0; }
.head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; flex-direction: column; line-height: 1; }
.brand__name { font: 800 clamp(1.7rem, 4vw, 2.2rem)/1 var(--f-head); letter-spacing: -.02em; color: var(--ink); }
.brand__name b { color: var(--red); font-weight: 800; }
.brand__tag { margin-top: 5px; font: 500 11.5px var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--soft); }
.searchform { display: flex; width: min(100%, 360px); }
.searchform input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-right: 0; background: var(--wash); font: inherit; font-size: 14px; color: var(--ink); border-radius: 3px 0 0 3px; }
.searchform input:focus { outline: none; border-color: var(--red); background: #fff; }
.searchform button { display: grid; place-items: center; width: 46px; height: 40px; border: 0; background: var(--red); color: #fff; cursor: pointer; border-radius: 0 3px 3px 0; }
.searchform button:hover { background: var(--red-dk); }

/* ---------- Nav ---------- */
.navbar { position: sticky; top: 0; z-index: 50; background: var(--white); border-top: 1px solid var(--line); border-bottom: 3px solid var(--red); box-shadow: 0 2px 6px rgba(0, 0, 0, .05); }
.navbar .wrap { overflow-x: auto; scrollbar-width: none; }
.navbar .wrap::-webkit-scrollbar { display: none; }
.navbar ul { display: flex; white-space: nowrap; }
.navbar li { position: relative; }
.navbar a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; font: 700 13.5px var(--f-head); text-transform: uppercase; letter-spacing: .02em; color: var(--ink); }
.navbar a:hover, .navbar .current-cat > a, .navbar .current-menu-item > a { color: var(--red); }
.navbar .home a { padding: 0 12px 0 0; }
.navbar ul ul { display: none; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 28px; padding: 20px 0 8px; align-items: start; }
.main { min-width: 0; }
.side { min-width: 0; }
.box { margin-bottom: 24px; }
.box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.box__head h2, .box__head h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .02em; padding-left: 10px; border-left: 4px solid var(--red); line-height: 1.1; }
.box__head a { font-size: 12.5px; color: var(--soft); white-space: nowrap; }
.box__head a:hover { color: var(--red); }

/* ---------- Pieces ---------- */
.thumb { position: relative; display: block; overflow: hidden; background: var(--wash); aspect-ratio: 3 / 2; border-radius: 2px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; font: 800 36px var(--f-head); color: #c9c9d1; background: var(--wash); }
.cat { font: 700 11.5px/1 var(--f-head); text-transform: uppercase; letter-spacing: .04em; color: var(--red); }
.cat:hover { color: var(--red-dk); }
.meta { font-size: 12.5px; color: var(--soft); }
.meta span + span::before { content: '·'; margin: 0 6px; }
.t a:hover { color: var(--red); }

/* Lead block */
.top { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.lead .thumb { aspect-ratio: 16 / 10; }
.lead__title { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin: 10px 0 6px; }
.lead__sapo { color: var(--soft); font-size: 14.5px; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.stack { display: flex; flex-direction: column; }
.item { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stack .item:first-child { padding-top: 0; }
.stack .item:last-child { border-bottom: 0; padding-bottom: 0; }
.item__title { font-size: 14.5px; line-height: 1.38; margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item .thumb { align-self: start; }

/* 4-up cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 18px 0 4px; }
.card__title { font-size: 14.5px; line-height: 1.38; margin: 8px 0 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Category block */
.blk { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.blk .lead__title { font-size: 1.15rem; margin: 8px 0 4px; }
.blk .lead .thumb { aspect-ratio: 3 / 2; }
.blk .stack .item { grid-template-columns: 1fr 88px; }
.blk .stack .item .thumb { order: 2; }
.blk .stack .item:first-child { padding-top: 0; }

/* List rows */
.row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:first-child { padding-top: 0; }
.row__title { font-size: 1.1rem; margin: 5px 0 5px; }
.row__sapo { margin: 0 0 6px; color: var(--soft); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Sidebar */
.rank li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); counter-increment: r; }
.rank { counter-reset: r; }
.rank li::before { content: counter(r); font: 800 22px/1 var(--f-head); color: #c9c9d1; }
.rank li:nth-child(-n+3)::before { color: var(--red); }
.rank li:last-child { border-bottom: 0; }
.rank a { font: 600 14px/1.4 var(--f-head); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rank a:hover { color: var(--red); }
.rank .meta { display: block; margin-top: 2px; }
.mini .item { grid-template-columns: 88px 1fr; gap: 10px; padding: 9px 0; }
.mini .item__title { font-size: 14px; margin: 0 0 3px; -webkit-line-clamp: 3; }
.mini .item:first-child { padding-top: 0; }
.cats li { border-bottom: 1px solid var(--line); }
.cats li:last-child { border-bottom: 0; }
.cats a { display: flex; justify-content: space-between; align-items: center; min-height: 40px; font: 600 14px var(--f-head); color: var(--ink); }
.cats a:hover { color: var(--red); }
.cats small { color: var(--soft); font: 500 12px var(--f-body); }
.cats ul { padding-left: 14px; }
.sticky { position: sticky; top: 62px; }

/* Pagination / page head */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; }
.pagination .page-numbers { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); font: 600 14px var(--f-head); border-radius: 3px; }
.pagination a.page-numbers:hover { border-color: var(--red); color: var(--red); }
.pagination .current { background: var(--red); border-color: var(--red); color: #fff; }
.page-head { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.page-head h1 { font-size: 1.5rem; padding-left: 12px; border-left: 5px solid var(--red); }
.page-head p { margin: 8px 0 0; color: var(--soft); }
.empty { padding: 40px 0; text-align: center; }
.empty .big { font: 800 5rem/1 var(--f-head); color: var(--red); }
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 22px; background: var(--red); color: #fff; font: 700 14px var(--f-head); border-radius: 3px; border: 0; cursor: pointer; }
.btn:hover { background: var(--red-dk); color: #fff; }

/* ---------- Article ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12.5px; color: var(--soft); margin-bottom: 10px; }
.crumbs a:hover { color: var(--red); }
.article__title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.28; margin-bottom: 10px; }
.article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0; margin-bottom: 14px; border-block: 1px solid var(--line); font-size: 13px; color: var(--soft); }
.article__cover { margin: 0 0 16px; }
.article__cover img { width: 100%; border-radius: 2px; }
.entry { font-size: 17px; line-height: 1.75; overflow-wrap: anywhere; color: #26262b; }
.entry > * { margin-top: 0; margin-bottom: 1em; }
.entry h2 { font-size: 1.45rem; margin: 1.5em 0 .6em; padding-left: 10px; border-left: 4px solid var(--red); line-height: 1.3; scroll-margin-top: 64px; }
.entry h3 { font-size: 1.2rem; margin: 1.3em 0 .5em; scroll-margin-top: 64px; }
.entry a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.entry a:hover { color: var(--red-dk); }
.entry img { margin: 1em auto; height: auto; max-width: 100%; }
.entry .wp-caption, .entry figure, .entry div, .entry p, .entry table { max-width: 100% !important; }
.entry .wp-caption, .entry figure { width: auto !important; margin: 1em 0; }
.entry .wp-caption img { width: 100%; }
.entry figcaption, .entry .wp-caption-text { font-size: 13px; color: var(--soft); text-align: center; margin-top: 4px; font-style: italic; }
.entry blockquote { margin: 1.2em 0; padding: 10px 16px; background: var(--wash); border-left: 4px solid var(--red); }
.entry blockquote p:last-child { margin: 0; }
.entry ul { list-style: disc; padding-left: 1.4em; }
.entry ol { padding-left: 1.4em; }
.entry li { margin-bottom: .35em; }
.entry li::marker { color: var(--red); }
.entry table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.entry th, .entry td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.entry th { background: var(--wash); }
.entry code, .entry pre { background: var(--wash); font: .88em ui-monospace, Menlo, monospace; }
.entry code { padding: 1px 5px; }
.entry pre { padding: 12px; overflow-x: auto; }
.entry iframe { width: 100%; }
.toc { margin: 0 0 18px; border: 1px solid var(--line); border-left: 4px solid var(--red); background: var(--wash); font-family: var(--f-head); }
.toc summary { cursor: pointer; padding: 10px 14px; min-height: 44px; font-weight: 700; font-size: 14px; text-transform: uppercase; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: '+'; font-size: 18px; color: var(--red); }
.toc[open] summary::after { content: '–'; }
.toc ol { margin: 0; padding: 0 14px 12px 34px; font-size: 14.5px; line-height: 1.45; }
.toc li { padding: 3px 0; }
.toc li.sub { margin-left: 14px; list-style: circle; }
.toc a { color: var(--ink); font-weight: 500; }
.toc a:hover { color: var(--red); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tags a { padding: 4px 10px; border: 1px solid var(--line); font-size: 13px; border-radius: 3px; }
.tags a:hover { border-color: var(--red); color: var(--red); }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--red); z-index: 100; }

/* Comments */
.comments { margin-top: 28px; }
.comments h2, .comment-reply-title { font-size: 1.1rem; margin-bottom: 14px; text-transform: uppercase; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 20px; }
.comment-body { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment-author .avatar { float: left; margin-right: 10px; border-radius: 50%; }
.comment-metadata { font-size: 12px; color: var(--soft); }
.comment-form label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: var(--wash); font: inherit; border-radius: 3px; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--red); background: #fff; }
.comment-form .submit { min-height: 42px; padding: 0 22px; background: var(--red); color: #fff; border: 0; border-radius: 3px; font: 700 14px var(--f-head); cursor: pointer; }
.comment-form .submit:hover { background: var(--red-dk); }

/* ---------- Footer ---------- */
.foot { margin-top: 28px; background: #1a1a1e; color: #b9b9c2; font-size: 14px; }
.foot__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; padding: 28px 0 20px; }
.foot .brand__name { color: #fff; font-size: 1.7rem; }
.foot .brand__tag { color: #8b8b95; }
.foot p { margin: 12px 0 0; max-width: 46ch; color: #9a9aa4; }
.foot h3 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.foot li a { display: inline-flex; align-items: center; min-height: 32px; color: #9a9aa4; }
.foot li a:hover { color: #fff; }
.foot__copy { border-top: 1px solid #2c2c33; padding: 12px 0 16px; font-size: 12.5px; color: #7d7d88; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__grid > :first-child { grid-column: span 2; }
}
@media (max-width: 680px) {
  body { font-size: 15px; }
  .topbar ul { display: none; }
  .head .wrap { flex-direction: column; align-items: stretch; gap: 10px; }
  .searchform { width: 100%; }
  .top, .blk { grid-template-columns: 1fr; }
  .top .stack { padding-top: 6px; }
  .item { grid-template-columns: 104px 1fr; }
  .row { grid-template-columns: 112px 1fr; gap: 12px; }
  .row__title { font-size: 1rem; margin: 3px 0; }
  .row__sapo { display: none; }
  .blk .stack .item { grid-template-columns: 1fr 88px; }
  .entry { font-size: 16.5px; }
  .foot__grid { grid-template-columns: 1fr; }
  .foot__grid > :first-child { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.toc ol { list-style: none; padding-left: 14px; counter-reset: t; }
.toc li:not(.sub) { counter-increment: t; }
.toc li:not(.sub)::before { content: counter(t) '. '; color: var(--red); font-weight: 700; }
.toc li.sub { list-style: none; padding-left: 18px; }
.toc li.sub::before { content: '– '; color: var(--red); }
.entry .toc a { text-decoration: none; color: var(--ink); }
.entry .toc a:hover { color: var(--red); }

:root{--red:#e11d2e;--red-dk:#ff5a66;--ink:#f6f6f9;--text:#d6d6df;--soft:#9d9daa;--line:#2a2a34;--wash:#17171f;--white:#0c0c11}

body{background:var(--white)}
.topbar{background:#08080c;color:#8f8f9c;border-color:var(--line)}
.head{background:#0c0c11}
.brand__name{font-weight:900;letter-spacing:.02em}
.brand__name b{background:var(--red);color:#fff;padding:0 .22em;margin-left:.1em;border-radius:3px}
.brand__tag{color:#8f8f9c}
.searchform input{background:var(--wash);color:var(--ink);border-color:var(--line)}
.searchform input:focus,.comment-form input:focus,.comment-form textarea:focus{background:var(--wash);border-color:var(--red)}
.navbar{background:#0c0c11;border-top-color:var(--line);box-shadow:none}
.navbar a{color:#e8e8ee}
.navbar a:hover,.navbar .current-cat>a{color:var(--red-dk)}
.box__head{border-bottom:2px solid var(--line)}
.ph{background:var(--wash);color:#3a3a48}
.rank li::before{color:#3a3a48}
.entry{color:#d6d6df}
.entry a{color:#ff6b76}
.entry a:hover{color:#fff}
.entry blockquote,.toc{background:var(--wash)}
.toc a,.entry .toc a{color:var(--ink)}
.comment-form input[type=text],.comment-form input[type=email],.comment-form input[type=url],.comment-form textarea{background:var(--wash);color:var(--ink);border-color:var(--line)}
.pagination .page-numbers{border-color:var(--line)}
.foot{background:#08080c}
.btn:hover{color:#fff}
.chip{display:inline-block;background:var(--red);color:#fff;font:700 12px/1 var(--f-head);text-transform:uppercase;letter-spacing:.06em;padding:6px 10px;border-radius:3px}
.mhero{position:relative;display:flex;align-items:flex-end;min-height:clamp(340px,50vw,560px);margin-top:18px;border-radius:6px;overflow:hidden;background:var(--wash)}
.mhero__img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.mhero::after{content:'';position:absolute;inset:0;background:linear-gradient(to top,rgba(8,8,12,.96) 0%,rgba(8,8,12,.55) 45%,rgba(8,8,12,.05) 80%)}
.mhero__body{position:relative;z-index:2;padding:clamp(18px,4vw,44px);max-width:840px}
.mhero__title{font-size:clamp(1.7rem,4.4vw,3rem);margin:12px 0 10px;color:#fff}
.mhero__title a::after{content:'';position:absolute;inset:0;z-index:3}
.mhero__sapo{color:#cfcfd8;max-width:62ch;margin:0 0 14px}
.mhero .btn{position:relative;z-index:4}
.rail{display:flex;gap:14px;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:10px;scrollbar-width:thin}
.rail .card{flex:0 0 min(78vw,270px);scroll-snap-align:start}
.rail-wrap{margin-top:26px}
.box__head{flex-wrap:wrap}
.box__head h2,.box__head h3{min-width:0;overflow-wrap:anywhere}
