:root {
  --bg: #07080c;
  --panel: #12141a;
  --ink: #f6f3ea;
  --muted: #b8b3a4;
  --yellow: #f2eb16;
  --yellow-deep: #d4c80a;
  --gold: #ffc107;
  --red: #dc3545;
  --line: rgba(242, 235, 22, 0.16);
  --pad: clamp(0.9rem, 3.6vw, 2rem);
  --max: 1180px;
  --radius: 0.75rem;
  --nav-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Noto Sans Thai", "Sukhumvit Set", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  background:
    linear-gradient(180deg, rgba(7, 8, 12, 0.72), rgba(7, 8, 12, 0.92)),
    url("/assets/bg.jpg") center / cover fixed no-repeat,
    #000;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: #000;
  color: #fff;
  padding: 0.55rem 0.8rem;
}
.skip:focus { left: 0.6rem; top: calc(0.6rem + var(--safe-top)); }

.topbar {
  background: #1a1d20 url("/assets/header-bg.jpg") center / cover no-repeat;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.7rem var(--pad);
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  min-height: 48px;
}
.brand__logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff3cd;
  border-radius: 0.45rem;
  padding: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: #fff;
}
.brand__name span { color: var(--yellow); }
.brand__tag {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 700;
}

.search {
  flex: 1;
  max-width: 420px;
}
.search__row { display: flex; gap: 0; }
.search input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  border: 0;
  border-radius: 0.5rem 0 0 0.5rem;
  padding: 0 0.95rem;
  font: inherit;
  background: #fff;
  color: #111;
}
.search button {
  min-width: 52px;
  min-height: 46px;
  border: 0;
  border-radius: 0 0.5rem 0.5rem 0;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--yellow);
  min-height: var(--nav-h);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}
.nav__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  text-decoration: none;
  color: #111;
  font-weight: 800;
  font-size: 0.92rem;
  border-radius: 0.4rem;
}
.nav__links a:hover,
.nav__links a.is-active { background: #111; color: var(--yellow); }
.nav__links img { width: 22px; height: 22px; }
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: #111;
  color: var(--yellow);
  border-radius: 0.4rem;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  margin: 0 auto;
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(7, 8, 12, 0.92) 0%, rgba(7, 8, 12, 0.55) 55%, rgba(7, 8, 12, 0.3) 100%),
    url("/assets/header-bg.jpg") center / cover no-repeat;
}
.hero__inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 3rem) var(--pad);
}
.kicker {
  margin: 0 0 0.35rem;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5.4vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.hero h1 span { color: var(--yellow); }
.hero__lead {
  margin: 0.7rem 0 0;
  max-width: 38rem;
  color: #e8e4d8;
  font-size: clamp(1rem, 2vw, 1.08rem);
}
.hero__actions {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.hero__note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.hero__note a { color: var(--gold); }
.hero__poster {
  justify-self: end;
  width: min(280px, 100%);
  border-radius: 0.85rem;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(242, 235, 22, 0.35);
}
.hero__poster img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  transition: transform 0.16s ease, background 0.16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--yellow);
  color: #111;
  box-shadow: 0 8px 22px rgba(242, 235, 22, 0.28);
}
.btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.4rem, 3.6vw, 2.4rem) var(--pad);
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.section-head h2,
.page-title {
  margin: 0;
  font-size: clamp(1.35rem, 3.4vw, 1.85rem);
  letter-spacing: -0.02em;
}
.section-head a {
  color: var(--gold);
  font-weight: 800;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.heading-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 0 0 1rem;
  background: var(--yellow);
  color: #111;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  border-radius: 0.5rem 0.5rem 0 0;
}

.grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.movie {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: rgba(18, 20, 26, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.65rem;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.movie:hover {
  transform: translateY(-3px);
  border-color: rgba(242, 235, 22, 0.45);
}
.movie__poster {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #111;
}
.movie__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.movie__badge,
.movie__rate {
  position: absolute;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.18rem 0.4rem;
  border-radius: 0.28rem;
}
.movie__badge {
  top: 0.4rem;
  right: 0.4rem;
  background: var(--yellow);
  color: #111;
}
.movie__rate {
  top: 0.4rem;
  left: 0.4rem;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
}
.movie__rate img { width: 10px; height: 10px; }
.movie__meta {
  padding: 0.55rem 0.6rem 0.75rem;
}
.movie__audio {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 700;
}
.movie__title {
  margin: 0.15rem 0 0;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cats {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cat {
  min-height: 108px;
  padding: 0.95rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(160deg, #2a2410, #12110c);
  border: 1px solid rgba(242, 235, 22, 0.12);
}
.cat:hover { border-color: var(--yellow); }
.cat strong { font-size: 1.02rem; }
.cat span { color: var(--muted); font-size: 0.8rem; }
.cat--cyan { background: linear-gradient(160deg, #16343a, #0c1618); }
.cat--rose { background: linear-gradient(160deg, #3a1830, #140c16); }
.cat--blue { background: linear-gradient(160deg, #14284a, #0b1524); }
.cat--green { background: linear-gradient(160deg, #163528, #0b1a14); }
.cat--purple { background: linear-gradient(160deg, #2a1a44, #120c22); }
.cat--orange { background: linear-gradient(160deg, #3a2412, #16100a); }
.cat--slate { background: linear-gradient(160deg, #243040, #10161c); }

.about, .prose { max-width: 760px; }
.about h2, .prose h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.3rem, 3.4vw, 1.8rem);
}
.about p, .prose p {
  margin: 0 0 0.9rem;
  color: var(--muted);
}
.about a, .prose a, .faq a, .hero__note a {
  color: var(--gold);
  text-underline-offset: 3px;
}
.about strong, .prose strong { color: var(--ink); }
.plain-list { margin: 0 0 1rem; padding-left: 1.15rem; color: var(--muted); }
.plain-list li { margin: 0.3rem 0; }

.cards {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.post-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  padding: 1.05rem 1.1rem;
  background: rgba(18, 20, 26, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.post-card:hover { border-color: var(--yellow); }
.post-card h2, .post-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  line-height: 1.3;
}
.post-card p { margin: 0; color: var(--muted); font-size: 0.92rem; flex: 1; }
.post-card__more { margin-top: 0.75rem; color: var(--yellow); font-weight: 800; font-size: 0.86rem; }

.faq { display: grid; gap: 0.7rem; }
.faq article {
  background: rgba(18, 20, 26, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
}
.faq h3 { margin: 0 0 0.35rem; font-size: 1.02rem; }
.faq p { margin: 0; color: var(--muted); }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
}
.crumbs a { color: var(--gold); text-decoration: none; }
.page-lead { color: var(--muted); margin: 0.5rem 0 1.1rem; }
.article-meta { color: var(--muted); font-size: 0.82rem; margin: 0 0 0.4rem; }
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.4rem;
}
.related { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.related h2 { margin: 0 0 0.6rem; font-size: 1.15rem; }
.related ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.45rem; }
.related a {
  display: block;
  text-decoration: none;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 20, 26, 0.75);
}
.related a:hover { border-color: var(--yellow); }

.foot {
  margin-top: 1rem;
  background: #0b0c10;
  border-top: 4px solid var(--yellow);
  padding: 1.4rem var(--pad) calc(1.2rem + var(--safe-bottom));
}
.foot__inner { max-width: var(--max); margin: 0 auto; }
.foot__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.5fr 1fr 1fr;
}
.foot h2 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yellow);
}
.foot p, .foot a { color: var(--muted); text-decoration: none; }
.foot a { display: inline-block; min-height: 1.7rem; }
.foot a:hover { color: #fff; }
.foot__copy {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.86rem;
}
.foot__copy a { color: var(--gold); display: inline; }

.panel {
  background: rgba(12, 13, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.85rem;
  padding: 1rem;
}

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .cats, .cards, .foot__grid { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search { max-width: 280px; }
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav__links {
    display: none;
    position: absolute;
    left: var(--pad);
    right: var(--pad);
    top: calc(var(--nav-h) + 4px);
    flex-direction: column;
    align-items: stretch;
    background: #111;
    padding: 0.5rem;
    border-radius: 0.6rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  }
  .nav.is-open .nav__links { display: flex; }
  .nav__links a { color: var(--yellow); }
  .nav__links a:hover, .nav__links a.is-active { background: var(--yellow); color: #111; }
  .topbar__inner { flex-wrap: wrap; }
  .search { max-width: none; width: 100%; order: 3; }
  .grid, .cats, .cards, .foot__grid { grid-template-columns: 1fr 1fr; }
  .brand__logo { width: 52px; height: 52px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .movie:hover { transform: none; }
}
