/*
Theme Name: Moban 8-2-30
Description: Chủ đề WordPress tùy chỉnh cho cổng thông tin game Bầu Cua Tôm Cá (Hoo Hey How) – phong cách ký sự đọc chậm: nền giấy sepia, chương đánh số, chữ hoa đầu và menu chỉ mục có số thứ tự.
Version: 1.0
Author: Moban82
Text Domain: moban82
*/

/* Google Fonts (Source Serif 4 + Be Vietnam Pro) are enqueued in functions.php — no @import here. */

/* ============================================================
   1. Design tokens — sepia long-read journal
   ============================================================ */
:root {
  --paper: #ede3cd;
  --paper-deep: #e3d4b4;
  --paper-tint: #f5edd9;
  --ink: #3b2f23;
  --ink-soft: #6b5c48;
  --ink-faint: #9c8c72;
  --sienna: #8a4b23;
  --sienna-deep: #5f3216;
  --line: #c8b58e;
  --line-strong: #3b2f23;
  --radius: 4px;
  --shadow: 0 12px 30px rgba(59, 47, 35, 0.16);
  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body: 'Be Vietnam Pro', 'Segoe UI', sans-serif;
  --wrap: 1140px;
}

/* ============================================================
   2. Reset & base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 60% 34% at 12% -4%, rgba(138, 75, 35, 0.1), transparent 62%),
    radial-gradient(ellipse 56% 36% at 92% 0%, rgba(200, 181, 142, 0.35), transparent 60%),
    repeating-linear-gradient(45deg, rgba(59, 47, 35, 0.014) 0 3px, transparent 3px 7px);
  overflow-x: hidden;
}

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

a {
  color: var(--sienna);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--sienna-deep);
  text-decoration: underline;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.22;
  color: var(--ink);
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.8rem, 4.6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.4vw, 2.1rem); }
h3 { font-size: clamp(1.08rem, 2.4vw, 1.3rem); }

p {
  margin: 0 0 1.25em;
}

.wrap {
  width: min(var(--wrap), 92%);
  margin-inline: auto;
}

.section {
  padding: 3rem 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============================================================
   3. Header & numbered index navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(237, 227, 205, 0.95);
  border-bottom: 1px solid var(--line-strong);
  backdrop-filter: blur(6px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.site-brand__logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--sienna);
  padding: 3px;
  background: var(--paper-tint);
}

.site-brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 1.1;
}

.site-brand__tag {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sienna);
}

.site-nav {
  display: none;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: navindex;
}

.site-nav__link {
  display: block;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease;
}

.site-nav__link::before {
  counter-increment: navindex;
  content: counter(navindex, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--sienna);
  margin-right: 0.4rem;
  vertical-align: 0.35em;
}

.site-nav__link:hover,
.site-nav__link:focus {
  background: var(--paper-deep);
  color: var(--sienna-deep);
  text-decoration: none;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--sienna);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav.is-open {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--paper-tint);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.site-nav.is-open .site-nav__list {
  flex-direction: column;
  padding: 0.7rem 4%;
}

.site-nav.is-open .site-nav__link {
  border-bottom: 1px dotted var(--line);
  border-radius: 0;
}

@media (min-width: 960px) {
  .site-nav {
    display: block;
  }

  .nav-toggle {
    display: none;
  }
}

/* ============================================================
   4. Long-read intro
   ============================================================ */
.longread {
  padding: 3rem 0 1rem;
}

.longread__kicker {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sienna);
  border-bottom: 1px solid var(--sienna);
  padding-bottom: 0.3rem;
  margin-bottom: 1.2rem;
}

.longread__kicker--head {
  font-size: 0.85rem;
}

.longread__title {
  max-width: 30ch;
  font-weight: 700;
}

.longread__standfirst {
  max-width: 68ch;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.longread__byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0;
  margin: 1.4rem 0 1.8rem;
}

.longread__figure {
  margin: 0 0 2rem;
}

.longread__figure img {
  width: 100%;
  aspect-ratio: 1920 / 810;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.longread__figure figcaption {
  font-size: 0.8rem;
  color: var(--ink-faint);
  padding-top: 0.6rem;
  text-align: right;
  font-style: italic;
}

/* ============================================================
   5. Chapters with ghost numerals
   ============================================================ */
.chapter {
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}

.chapter--tint {
  background: var(--paper-deep);
}

.chapter__grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .chapter__grid {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 2.6rem;
  }
}

.chapter__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 9vw, 7rem);
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 2px var(--sienna);
  user-select: none;
}

@supports not (-webkit-text-stroke: 1px black) {
  .chapter__num {
    color: var(--sienna);
  }
}

.chapter__title {
  font-size: clamp(1.4rem, 3.2vw, 2rem);
}

.chapter__body > p {
  max-width: 72ch;
}

/* Steps (chapter 01) */
.steps {
  margin: 1.6rem 0 0;
  border-top: 1px solid var(--line-strong);
}

.steps__row {
  display: grid;
  gap: 0.2rem 1.6rem;
  grid-template-columns: 1fr;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 720px) {
  .steps__row {
    grid-template-columns: 240px 1fr;
  }
}

.steps__row dt {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--sienna);
}

.steps__row dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Chapter icons (chapter 02) */
.chapter-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .chapter-icons {
    grid-template-columns: repeat(6, 1fr);
  }
}

.chapter-icons__item {
  text-align: center;
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 0.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chapter-icons__item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.chapter-icons__item img {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.55rem;
  border-radius: 50%;
  border: 2px solid var(--sienna);
}

.chapter-icons__item span {
  font-family: var(--font-display);
  font-weight: 700;
}

/* Odds list (chapter 03) */
.odds-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.odds-list li {
  padding: 0.8rem 0 0.8rem 1.4rem;
  border-left: 3px solid var(--sienna);
  margin-bottom: 0.7rem;
  background: var(--paper-tint);
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.odds-list strong {
  color: var(--sienna-deep);
}

/* Habits (chapter 04) */
.habits {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: habit;
}

.habits li {
  counter-increment: habit;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px dotted var(--line);
  color: var(--ink-soft);
}

.habits li::before {
  content: counter(habit, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--sienna);
}

/* ============================================================
   6. Pull quote
   ============================================================ */
.pull-quote {
  padding: 3.2rem 0;
  text-align: center;
  border-top: 3px double var(--line-strong);
  border-bottom: 3px double var(--line-strong);
  background: var(--paper-tint);
}

.pull-quote blockquote {
  margin: 0 auto;
  max-width: 38ch;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.5;
  color: var(--sienna-deep);
}

.pull-quote__source {
  margin: 1.1rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ============================================================
   7. Field notes
   ============================================================ */
.field-notes__stack {
  display: grid;
  gap: 1.4rem;
  max-width: 760px;
  margin-top: 1.4rem;
}

.field-note {
  margin: 0;
  padding: 1.2rem 1.5rem;
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sienna);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.field-note p {
  font-family: var(--font-display);
  font-style: italic;
  margin-bottom: 0.5em;
}

.field-note footer {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--sienna);
}

/* ============================================================
   8. CTA
   ============================================================ */
.cta-btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--paper-tint);
  background: linear-gradient(160deg, var(--sienna), var(--sienna-deep));
  border-radius: 999px;
  padding: 0.9rem 2.4rem;
  box-shadow: 0 12px 26px rgba(138, 75, 35, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cta-btn:hover,
.cta-btn:focus {
  color: var(--paper-tint);
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(138, 75, 35, 0.5);
  text-decoration: none;
}

.cta-btn--block {
  display: block;
  width: max-content;
  margin-inline: auto;
}

.cta-strip {
  text-align: center;
  padding: 2.6rem 1rem;
  margin: 2rem 0 3rem;
  border: 3px double var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-tint);
}

.cta-strip p {
  color: var(--ink-soft);
}

/* ============================================================
   9. Breadcrumbs
   ============================================================ */
.breadcrumbs {
  padding: 1rem 0 0;
  font-size: 0.85rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-faint);
}

.breadcrumbs li + li::before {
  content: '·';
  margin-right: 0.4rem;
  color: var(--sienna);
}

.breadcrumbs a {
  color: var(--ink-soft);
}

.breadcrumbs a:hover {
  color: var(--sienna);
}

.breadcrumbs [aria-current="page"] {
  color: var(--sienna);
}

/* ============================================================
   10. Archive — numbered journal index
   ============================================================ */
.page-head {
  padding: 2.2rem 0 0.6rem;
}

.archive-index {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: entry;
}

.archive-entry {
  counter-increment: entry;
  display: grid;
  gap: 0.3rem 2rem;
  grid-template-columns: 1fr;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 760px) {
  .archive-entry {
    grid-template-columns: 90px minmax(0, 1fr);
  }
}

.archive-entry::before {
  content: counter(entry, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--sienna);
}

@supports not (-webkit-text-stroke: 1px black) {
  .archive-entry::before {
    color: var(--sienna);
  }
}

.archive-entry__title {
  font-size: 1.2rem;
  margin: 0 0 0.25em;
}

.archive-entry__title a {
  color: var(--ink);
}

.archive-entry__title a:hover {
  color: var(--sienna);
  text-decoration: none;
}

.archive-entry__excerpt {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 0.3em;
}

.archive-entry__meta {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Generic post grid (index.php fallback) */
.post-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  padding: 1.2rem 0 2.4rem;
}

@media (min-width: 640px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.post-card__media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.post-card__body {
  padding: 1rem 1.1rem 1.3rem;
}

.post-card__title {
  font-size: 1.05rem;
  margin-bottom: 0.4em;
}

.post-card__title a {
  color: var(--ink);
}

.post-card__title a:hover {
  color: var(--sienna);
}

.post-card__excerpt {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 0.6em;
}

.post-card__meta {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--ink-soft);
}

/* Pagination */
.pagination,
.nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1rem 0 3rem;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 600;
  background: var(--paper-tint);
}

.page-numbers.current {
  background: var(--sienna);
  color: var(--paper-tint);
  border-color: var(--sienna-deep);
}

.page-numbers:hover {
  color: var(--sienna);
}

.page-numbers.current:hover {
  color: var(--paper-tint);
}

/* ============================================================
   11. Single post — journal entry with drop cap
   ============================================================ */
.single-head {
  padding: 2.4rem 0 1rem;
}

.single-chapter-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sienna);
}

.single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0;
  margin: 1.2rem 0 0;
}

.single-meta a {
  color: var(--sienna);
}

.entry-content {
  max-width: 740px;
}

.entry-content > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.6em;
  float: left;
  line-height: 0.82;
  padding: 0.08em 0.14em 0 0;
  color: var(--sienna);
}

.entry-content h2,
.entry-content h3 {
  margin-top: 1.9em;
}

.entry-content img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.entry-content blockquote {
  margin: 1.8em 0;
  padding: 0.4rem 1.6rem;
  border-left: 4px solid var(--sienna);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--sienna-deep);
}

.related-block {
  padding: 2.2rem 0 2.6rem;
}

/* ============================================================
   12. Footer
   ============================================================ */
.site-footer {
  border-top: 3px double var(--line-strong);
  background: var(--sienna-deep);
  color: var(--paper);
  padding: 2.8rem 0 1.6rem;
  text-align: center;
}

.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.6rem;
  margin: 0 0 1.6rem;
  padding: 0;
  list-style: none;
}

.site-footer__nav a {
  color: rgba(237, 227, 205, 0.85);
  font-size: 0.92rem;
  font-weight: 600;
}

.site-footer__nav a:hover {
  color: var(--paper-tint);
}

.site-footer__badge {
  margin: 1.4rem 0;
}

.site-footer__disclaimer {
  max-width: 720px;
  margin: 1.2rem auto 0;
  font-size: 0.82rem;
  line-height: 1.8;
  color: rgba(237, 227, 205, 0.7);
}

.site-footer__disclaimer p {
  margin: 0.3em 0;
}

.site-footer__copy {
  margin-top: 1.4rem;
  font-size: 0.78rem;
  color: rgba(237, 227, 205, 0.5);
}

/* ============================================================
   13. Motion & a11y
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

:focus-visible {
  outline: 2px solid var(--sienna);
  outline-offset: 3px;
}
