/*
Theme Name: Moban 8-2-7
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 tạp chí Tết lấy cảm hứng tranh dân gian Đông Hồ, nền giấy dó, tối ưu SEO.
Version: 1.0
Author: Moban82
Text Domain: moban82
*/

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

/* ============================================================
   1. Design tokens — giấy dó Đông Hồ
   ============================================================ */
:root {
  --paper: #f4e8cf;
  --paper-deep: #eadcb9;
  --paper-bright: #fbf4e2;
  --ink: #2a1a12;
  --ink-soft: #55402f;
  --ink-red: #9d1d1d;
  --ink-red-deep: #6f1114;
  --gold: #b07d2b;
  --gold-soft: #d8b56a;
  --line: rgba(42, 26, 18, 0.28);
  --line-soft: rgba(42, 26, 18, 0.14);
  --radius: 3px;
  --radius-sm: 2px;
  --shadow-print: 7px 7px 0 rgba(42, 26, 18, 0.1);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Be Vietnam Pro', 'Segoe UI', sans-serif;
  --wrap: 1160px;
}

/* ============================================================
   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.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(42, 26, 18, 0.022) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(176, 125, 43, 0.03) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(251, 244, 226, 0.9), transparent 70%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(157, 29, 29, 0.05), transparent 65%);
  background-attachment: fixed;
  overflow-x: hidden;
}

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

a {
  color: var(--ink-red);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: var(--ink-red-deep);
}

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

h1 { font-size: clamp(1.9rem, 5vw, 3.1rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 3.5vw, 2.15rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }

p {
  margin: 0 0 1.2em;
}

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

.section {
  padding: 3.2rem 0;
}

.section-kicker {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--paper-bright);
  background: var(--ink-red);
  padding: 0.3rem 0.9rem;
  margin-bottom: 0.9rem;
  border-radius: var(--radius-sm);
}

.section-title {
  position: relative;
  padding-bottom: 0.8rem;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  max-width: 120px;
  height: 5px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

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

/* ============================================================
   3. Masthead header — báo xuân xưa
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(244, 232, 207, 0.96);
  border-bottom: 3px double var(--ink);
  backdrop-filter: blur(6px);
}

.site-header__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0 0.35rem;
  position: relative;
}

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

.site-brand__logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--ink-red);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--ink);
}

.site-brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink-red);
  line-height: 1.05;
  text-align: left;
}

.site-brand__tag {
  display: block;
  font-family: var(--font-body);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-nav {
  display: none;
  width: 100%;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 0.4rem;
  margin: 0;
  padding: 0.35rem 0 0.5rem;
  list-style: none;
  border-top: 1px solid var(--line);
}

.site-nav__link {
  display: block;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  border-bottom: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.site-nav__link:hover,
.site-nav__link:focus {
  color: var(--ink-red);
  border-bottom-color: var(--ink-red);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 12px;
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0.5rem;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  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;
  width: 100%;
  border-top: 1px solid var(--line);
}

.site-nav.is-open .site-nav__list {
  flex-direction: column;
  align-items: stretch;
}

.site-nav.is-open .site-nav__link {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
}

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

  .nav-toggle {
    display: none;
  }
}

/* ============================================================
   4. Front page — bản tin đặc biệt xuân
   ============================================================ */
.fp-masthead {
  text-align: center;
  padding: 1.1rem 0 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.fp-masthead strong {
  color: var(--ink-red);
}

.fp-feature {
  display: grid;
  gap: 2.4rem;
  padding: 2.8rem 0 3rem;
  border-bottom: 3px double var(--ink);
}

@media (min-width: 980px) {
  .fp-feature {
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
  }
}

.fp-feature__kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-red);
  margin-bottom: 0.8rem;
}

.fp-feature__title {
  margin-bottom: 0.5em;
}

.fp-feature__standfirst {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 1.12rem;
  color: var(--ink-soft);
  border-left: 3px solid var(--gold);
  padding-left: 1rem;
}

.fp-feature__figure {
  margin: 0;
  border: 6px double var(--ink);
  background: var(--paper-bright);
  padding: 10px;
  box-shadow: var(--shadow-print);
  transform: rotate(-0.6deg);
}

.fp-feature__figure img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: sepia(0.14) saturate(1.08);
}

.fp-feature__caption {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
}

/* Two-column stories */
.fp-stories {
  padding: 3rem 0;
}

.fp-stories__grid {
  display: grid;
  gap: 2.2rem;
  margin-top: 1.8rem;
}

@media (min-width: 900px) {
  .fp-stories__grid {
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }

  .fp-story + .fp-story {
    border-left: 1px solid var(--line);
    padding-left: 2.2rem;
  }

  .fp-story:first-child {
    padding-right: 2.2rem;
  }
}

.fp-story__media {
  display: block;
  margin-bottom: 1rem;
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-print);
}

.fp-story__media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.fp-story__title {
  margin-bottom: 0.35em;
}

.fp-story__title a {
  color: var(--ink);
}

.fp-story__title a:hover {
  color: var(--ink-red);
}

.fp-story__text {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* Rules — bảng niêm yết mực tàu */
.fp-rules__table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0 0;
  background: var(--paper-bright);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-print);
}

.fp-rules__table th,
.fp-rules__table td {
  padding: 0.9rem 1rem;
  text-align: left;
  border: 1px solid var(--line);
  font-size: 0.94rem;
}

.fp-rules__table th {
  background: var(--ink-red);
  color: var(--paper-bright);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.fp-rules__table tbody tr:nth-child(even) {
  background: rgba(176, 125, 43, 0.07);
}

.table-scroll {
  overflow-x: auto;
}

/* Symbols strip — dãy linh vật */
.fp-symbols {
  display: grid;
  gap: 0;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  border: 2px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: var(--shadow-print);
  grid-template-columns: repeat(2, 1fr);
}

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

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

.fp-symbol {
  text-align: center;
  padding: 1.3rem 0.8rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease;
}

.fp-symbol:hover {
  background: rgba(157, 29, 29, 0.06);
}

.fp-symbol img {
  width: 86px;
  height: 86px;
  margin: 0 auto 0.7rem;
  border-radius: 50%;
  border: 3px double var(--ink-red);
}

.fp-symbol__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink-red);
}

/* Pull quote — thơ dân gian */
.fp-pullquote {
  margin: 0;
  padding: 3rem 8%;
  text-align: center;
  background: var(--ink-red);
  color: var(--paper-bright);
  position: relative;
}

.fp-pullquote::before {
  content: '“';
  display: block;
  font-family: var(--font-display);
  font-size: 4.4rem;
  line-height: 0.6;
  color: var(--gold-soft);
  margin-bottom: 1rem;
}

.fp-pullquote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  max-width: 30ch;
  margin: 0 auto 0.8em;
}

.fp-pullquote footer {
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

/* Customs — phong vị Tết */
.fp-customs-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: 1fr;
  margin-top: 1.8rem;
}

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

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

.fp-custom {
  background: var(--paper-bright);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  box-shadow: var(--shadow-print);
}

.fp-custom__no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--ink-red);
  color: var(--ink-red);
  font-family: var(--font-display);
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.fp-custom__title {
  font-size: 1.08rem;
}

.fp-custom__text {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0;
}

/* Letters to the editor — thư bạn đọc */
.fp-letters-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: 1fr;
  margin-top: 1.8rem;
}

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

.fp-letter {
  margin: 0;
  background: var(--paper-bright);
  border: 1px dashed var(--ink-soft);
  border-radius: var(--radius);
  padding: 1.5rem 1.3rem;
  position: relative;
}

.fp-letter::after {
  content: 'TEM';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--paper-bright);
  background: var(--gold);
  border: 1px solid var(--ink);
  padding: 0.35rem 0.45rem;
  transform: rotate(4deg);
}

.fp-letter__text {
  font-style: italic;
  font-size: 0.94rem;
}

.fp-letter__author {
  margin: 0.9rem 0 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-red);
}

/* ============================================================
   5. CTA button — ô quảng cáo báo xưa
   ============================================================ */
.cta-btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: var(--paper-bright);
  background: var(--ink-red);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.9rem 2.4rem;
  box-shadow: 5px 5px 0 rgba(42, 26, 18, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.cta-btn:hover,
.cta-btn:focus {
  color: var(--paper-bright);
  background: var(--ink-red-deep);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(42, 26, 18, 0.28);
}

.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: 5px double var(--ink);
  background: var(--paper-bright);
  box-shadow: var(--shadow-print);
}

/* ============================================================
   6. 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-soft);
}

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

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

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

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

/* ============================================================
   7. Archive — trang báo hai cột
   ============================================================ */
.page-head {
  padding: 2.2rem 0 0.6rem;
}

.post-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  padding: 1.8rem 0 3rem;
}

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

  .post-card:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    border-bottom: 3px double var(--ink);
    padding-bottom: 1.6rem;
  }

  .post-card:first-child .post-card__media img {
    aspect-ratio: 4 / 3;
  }
}

.post-card {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.4rem;
}

.post-card__media {
  display: block;
  margin-bottom: 0.9rem;
}

.post-card__media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--ink);
  filter: sepia(0.12);
  transition: filter 0.3s ease;
}

.post-card:hover .post-card__media img {
  filter: sepia(0);
}

.post-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

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

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

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

.post-card__meta {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.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: 0.5rem 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(--ink);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
  background: var(--paper-bright);
}

.page-numbers.current {
  background: var(--ink-red);
  color: var(--paper-bright);
  border-color: var(--ink-red);
}

.page-numbers:hover {
  border-color: var(--ink-red);
  color: var(--ink-red);
}

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

/* ============================================================
   8. Single post — bài phóng sự
   ============================================================ */
.single-head {
  padding: 2rem 0 1rem;
  border-bottom: 3px double var(--ink);
}

.single-head h1 {
  max-width: 24ch;
}

.single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}

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

.entry-content > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3.4em;
  float: left;
  line-height: 0.82;
  padding-right: 0.12em;
  color: var(--ink-red);
}

.entry-content img {
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-print);
}

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

.entry-content blockquote {
  margin: 1.8em 0;
  padding: 1.2rem 1.6rem;
  border: 1px solid var(--ink);
  border-left: 5px solid var(--ink-red);
  background: var(--paper-bright);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.06rem;
  box-shadow: var(--shadow-print);
}

.related-block {
  padding: 2.5rem 0 3rem;
  border-top: 3px double var(--ink);
}

/* ============================================================
   9. Footer — mực tàu trên giấy
   ============================================================ */
.site-footer {
  border-top: 6px double var(--ink);
  background: var(--ink);
  color: var(--paper-deep);
  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: var(--paper-deep);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

.site-footer__nav a:hover {
  color: var(--gold-soft);
}

.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(234, 220, 185, 0.75);
}

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

.site-footer__copy {
  margin-top: 1.4rem;
  font-size: 0.78rem;
  color: rgba(234, 220, 185, 0.5);
}

/* ============================================================
   10. Motion & a11y
   ============================================================ */
@keyframes fp-reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fp-feature__copy,
.fp-feature__figure {
  animation: fp-reveal 0.8s ease both;
}

.fp-feature__figure {
  animation-delay: 0.15s;
}

@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(--ink-red);
  outline-offset: 3px;
}
