/*
Theme Name: Moban 8-2-49
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 App Shell di động nền sáng: thanh tab dưới cùng, ô tìm kiếm, hàng thẻ vuốt ngang và bo góc lớn.
Version: 1.0
Author: Moban82
Text Domain: moban82
*/

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

/* ============================================================
   1. Design tokens — light app shell
   ============================================================ */
:root {
  --bg: #f1f3f7;
  --card: #ffffff;
  --ink: #171c26;
  --muted: #6b7280;
  --line: #e3e7ee;
  --accent: #ff5a3c;
  --accent-soft: #ffe9e4;
  --accent-deep: #d63d22;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 10px 30px rgba(23, 28, 38, 0.08);
  --shadow-lg: 0 18px 44px rgba(23, 28, 38, 0.14);
  --font-display: 'Be Vietnam Pro', -apple-system, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Be Vietnam Pro', sans-serif;
  --tab-h: 70px;
  --wrap: 1080px;
}

/* ============================================================
   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.6;
  color: var(--ink);
  background: var(--bg);
  /* Reserve room for the fixed bottom tab bar + device safe area. */
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 16px);
}

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

a {
  color: var(--accent-deep);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

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

h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.08rem; }

p {
  margin: 0 0 1.1em;
}

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

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

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

body.sheet-open {
  overflow: hidden;
}

/* ============================================================
   3. App bar + menu sheet
   ============================================================ */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(241, 243, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.app-bar__inner {
  width: min(var(--wrap), 94%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
}

.app-bar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
}

.app-bar__logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.app-bar__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.15;
}

.app-bar__tag {
  display: block;
  font-weight: 500;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-bar__menu-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4.5px;
  width: 46px;
  height: 46px;
  padding: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.app-bar__menu-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

/* Sheet */
.app-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.app-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(23, 28, 38, 0.45);
  cursor: pointer;
}

.app-sheet__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86%);
  background: var(--card);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow-lg);
  animation: sheet-in 0.28s ease;
}

@keyframes sheet-in {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.app-sheet__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.8rem;
}

.app-sheet__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-sheet__list a {
  display: block;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--ink);
}

.app-sheet__list a:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

/* ============================================================
   4. Bottom tab bar
   ============================================================ */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -8px 24px rgba(23, 28, 38, 0.08);
}

.tab-bar__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 620px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.tab-bar__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px calc(10px);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: var(--radius-md);
  transition: color 0.2s ease, transform 0.2s ease;
}

.tab-bar__tab svg {
  transition: transform 0.2s ease;
}

.tab-bar__tab:hover {
  color: var(--accent-deep);
}

.tab-bar__tab.is-active {
  color: var(--accent-deep);
}

.tab-bar__tab.is-active svg {
  transform: translateY(-2px) scale(1.08);
}

.tab-bar__tab.is-active span::after {
  content: '';
  display: block;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin: 3px auto 0;
}

/* ============================================================
   5. Greeting + search
   ============================================================ */
.app-greet {
  padding: 1.8rem 0 0.6rem;
}

.app-greet__title {
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  margin-bottom: 1rem;
}

.app-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.4rem 0.4rem 1rem;
  box-shadow: var(--shadow);
}

.app-search__icon {
  color: var(--muted);
  flex: none;
}

.app-search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 0.5rem 0;
}

.app-search__input:focus {
  outline: none;
}

.app-search__btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.app-search__btn:hover {
  background: var(--accent-deep);
}

.app-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.app-chip {
  display: inline-block;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.app-chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ============================================================
   6. Blocks & swipeable row
   ============================================================ */
.app-block {
  padding: 1.6rem 0 0.4rem;
}

.app-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.app-block__head h2 {
  margin: 0;
}

.app-block__hint {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.app-swipe {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 340px);
  gap: 0.9rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.2rem 0.2rem 1rem;
  scrollbar-width: none;
}

.app-swipe::-webkit-scrollbar {
  display: none;
}

.app-swipe__card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--ink);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.app-swipe__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}

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

.app-swipe__body {
  display: block;
  padding: 0.9rem 1.1rem 1.1rem;
}

.app-swipe__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.app-swipe__text {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ============================================================
   7. Explore tiles & icon grid
   ============================================================ */
.app-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

@media (min-width: 900px) {
  .app-tiles { grid-template-columns: repeat(4, 1fr); }
}

.app-tile {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.app-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}

.app-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.app-tile__body {
  display: block;
  padding: 0.85rem 1rem 1rem;
}

.app-tile__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.app-tile__text {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.app-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin: 0;
  padding: 0.9rem 1rem 1.1rem;
  list-style: none;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

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

.app-icons__item {
  text-align: center;
}

.app-icons__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 22%;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.app-icons__item:hover img {
  transform: scale(1.06) rotate(-2deg);
}

.app-icons__item span {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

/* ============================================================
   8. Feed
   ============================================================ */
.app-feed {
  display: grid;
  gap: 0.9rem;
}

.app-feed__card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 0.8rem;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.app-feed__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}

.app-feed__card > img {
  width: 116px;
  height: 116px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.app-feed__body {
  display: block;
  min-width: 0;
}

.app-feed__tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.4rem;
}

.app-feed__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.app-feed__title a {
  color: var(--ink);
}

.app-feed__title a:hover {
  color: var(--accent-deep);
}

.app-feed__text {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.app-feed__meta {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Archive feed variant: big thumb on top */
.app-feed--archive .app-feed__item {
  background: var(--card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.app-feed--archive .app-feed__item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

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

.app-feed--archive .app-feed__body {
  padding: 1rem 1.2rem 1.25rem;
}

.app-feed--archive .app-feed__title {
  font-size: 1.15rem;
}

@media (min-width: 900px) {
  .app-feed--archive {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   9. CTA panel & button
   ============================================================ */
.cta-btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-radius: 999px;
  padding: 0.9rem 2.4rem;
  box-shadow: 0 12px 26px rgba(255, 90, 60, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-btn:hover,
.cta-btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(255, 90, 60, 0.45);
  color: #fff;
}

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

.app-cta {
  margin: 1.8rem 0 1rem;
  text-align: center;
  background: linear-gradient(150deg, #fff, var(--accent-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 2.2rem 1.2rem;
  box-shadow: var(--shadow);
}

.app-cta h2 {
  margin-bottom: 0.3rem;
}

.app-cta p {
  color: var(--muted);
  max-width: 44ch;
  margin-inline: auto;
}

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

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0.5rem 0.9rem;
  list-style: none;
  color: var(--muted);
  background: var(--card);
  border-radius: 999px;
  width: max-content;
  max-width: 100%;
  box-shadow: var(--shadow);
}

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

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

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

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

/* ============================================================
   11. Archive header & single article
   ============================================================ */
.app-archive-head {
  padding: 1.6rem 0 0.8rem;
}

.app-archive-head__kicker {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  margin: 0 0 0.7rem;
}

.app-archive-head__title {
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  margin: 0;
}

.app-archive-head__desc {
  max-width: 62ch;
  color: var(--muted);
  margin: 0.7rem 0 0;
}

.app-article {
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.4rem 2rem;
  margin-top: 1.2rem;
}

@media (min-width: 900px) {
  .app-article { padding: 2.4rem 3rem 2.6rem; }
}

.app-article__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  margin-bottom: 0.8rem;
}

.app-article__title {
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  margin-bottom: 0.5rem;
}

.app-article__meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.app-article__figure {
  margin: 0 0 1.4rem;
}

.app-article__figure img {
  width: 100%;
  border-radius: var(--radius-lg);
}

.app-article__content {
  font-size: 1.02rem;
}

.app-article__content img {
  border-radius: var(--radius-md);
}

.app-article__content h2,
.app-article__content h3 {
  margin-top: 1.7em;
}

.app-article__content blockquote {
  margin: 1.6em 0;
  padding: 1rem 1.3rem;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-md);
  font-style: italic;
}

/* ============================================================
   12. Fallback grid (index.php), pagination, empty state
   ============================================================ */
.page-head {
  padding: 1.8rem 0 0.6rem;
}

.section-title {
  margin: 0;
}

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

@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(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

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

.post-card__title {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.post-card__excerpt {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.post-card__meta {
  font-size: 0.74rem;
  color: var(--accent-deep);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 3.5rem 1.2rem;
  margin: 1.4rem 0 2rem;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  color: var(--muted);
}

.empty-state h2 {
  color: var(--ink);
}

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

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 0.8rem;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 700;
}

.page-numbers.current {
  background: var(--accent);
  color: #fff;
}

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

.page-numbers.current:hover {
  color: #fff;
}

/* ============================================================
   13. Footer
   ============================================================ */
.site-footer {
  margin-top: 1.6rem;
  background: var(--card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 2.4rem 1rem 1.6rem;
  text-align: center;
}

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

.site-footer__nav a {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.site-footer__nav a:hover {
  color: var(--accent-deep);
}

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

.site-footer__disclaimer {
  max-width: 720px;
  margin: 1rem auto 0;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--muted);
}

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

.site-footer__copy {
  margin-top: 1.2rem;
  font-size: 0.76rem;
  color: var(--muted);
}

/* ============================================================
   14. 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: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
