/* ==========================================================================
   layout.css — page shell: header, navigation, footer, grids
   ========================================================================== */

.page-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main { flex: 1 0 auto; }

/* --------------------------------------------------------------------------
   Header — top bar
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-red-deep);
  box-shadow: var(--shadow-sm);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--header-h);
  padding-block: var(--sp-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.brand__logo {
  width: auto;
  height: 46px;
  object-fit: contain;
}

.brand__name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* --------------------------------------------------------------------------
   Header — main navigation
   -------------------------------------------------------------------------- */
.nav-bar {
  background: var(--c-nav);
  border-top: 1px solid var(--c-border);
}

.nav-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* single row — never wrap; scroll horizontally if the viewport is tight */
.nav-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
}

.nav-list::-webkit-scrollbar { display: none; }

.nav-list > li { flex: 0 0 auto; }

.nav-list__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 11px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
  color: var(--c-text);
  transition: color var(--transition), background-color var(--transition);
}

/* underline drawn as a pseudo-element so it hugs the label, not the padding */
.nav-list__link::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background-color var(--transition);
}

.nav-list__link:hover,
.nav-list__link:focus-visible {
  color: var(--c-gold);
  background: rgba(255, 255, 255, .04);
}

.nav-list__link:hover::after,
.nav-list__link:focus-visible::after { background: var(--c-gold); }

.nav-list__link[aria-current="page"] {
  color: var(--c-gold);
  background: rgba(211, 33, 33, .12);
}

.nav-list__link[aria-current="page"]::after { background: var(--c-red); }

.nav-list__icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

/* a hair tighter where the row is closest to overflowing */
@media (max-width: 1240px) {
  .nav-list__link { padding-inline: 9px; gap: 5px; }
  .nav-list__link::after { left: 9px; right: 9px; }
}

/* --------------------------------------------------------------------------
   Header — mobile toggle
   -------------------------------------------------------------------------- */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border-strong);
  color: #fff;
}

.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle__bar { position: relative; }
.nav-toggle__bar::before,
.nav-toggle__bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bar::before { top: -6px; }
.nav-toggle__bar::after  { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 992px) {
  .nav-toggle { display: inline-flex; }

  .nav-bar__inner { display: block; }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    padding-block: var(--sp-2);
  }

  .nav-list.is-open { display: flex; }

  .nav-list__link {
    width: 100%;
    padding: var(--sp-3) var(--sp-2);
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--c-border);
  }

  .nav-list__link::after { display: none; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--sp-8);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(71, 0, 0, .55) 0%, transparent 60%),
    var(--c-surface);
  border-top: 1px solid var(--c-border-strong);
}

/* thin brand rule across the very top */
.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--c-red), var(--c-gold), var(--c-red));
}

/* Three columns: brand | game & guide lists | cẩm nang & legal */
.footer-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-7) var(--sp-6);
  padding-block: var(--sp-8) var(--sp-7);
}

@media (max-width: 980px) {
  .footer-widgets { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
  .footer-col--brand { grid-column: span 2; }
}

@media (max-width: 700px) {
  .footer-widgets { grid-template-columns: 1fr; text-align: center; }
  .footer-col--brand { grid-column: auto; }
}

/* ---- brand column ---- */
.footer-logo {
  width: 150px;
  max-width: 100%;
  height: auto;
  margin-bottom: var(--sp-4);
}

@media (max-width: 700px) { .footer-logo { margin-inline: auto; } }

.footer-about {
  max-width: 42ch;
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--c-text-muted);
}

@media (max-width: 700px) { .footer-about { margin-inline: auto; } }

.footer-about a { color: var(--c-gold); }
.footer-about a:hover { color: var(--c-gold-light); }

.footer-tags {
  margin-top: var(--sp-4);
  font-size: var(--fs-xs);
  letter-spacing: .02em;
  color: var(--c-text-dim);
  word-spacing: .35em;
}

/* ---- section headings ---- */
.footer-col__title {
  position: relative;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--c-gold);
  border-bottom: 1px solid var(--c-border);
}

/* short accent sitting on the hairline */
.footer-col__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 36px;
  height: 2px;
  background: var(--c-red);
}

@media (max-width: 700px) {
  .footer-col__title::after { left: 50%; transform: translateX(-50%); }
}

.footer-col__title--stacked { margin-top: var(--sp-7); }

/* ---- link lists ---- */
.footer-links,
.footer-contact {
  display: grid;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}

.footer-links--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--sp-5);
}

@media (max-width: 400px) { .footer-links--two { grid-template-columns: 1fr; } }

.footer-links a {
  position: relative;
  display: inline-block;
  color: var(--c-text-muted);
  line-height: 1.5;
  transition: color var(--transition), padding-left var(--transition);
}

/* a small marker slides in on hover instead of shifting the whole row */
.footer-links a::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 0;
  height: 1px;
  background: var(--c-gold);
  transition: width var(--transition);
}

.footer-links a:hover {
  color: var(--c-gold);
  padding-left: 14px;
}

.footer-links a:hover::before { width: 8px; }

@media (max-width: 700px) {
  .footer-links a:hover { padding-left: 0; }
  .footer-links a:hover::before { width: 0; }
}

/* ---- contact rows ---- */
.footer-contact { margin-top: var(--sp-5); gap: var(--sp-3); }

.footer-contact li {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: var(--sp-2);
  align-items: baseline;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .footer-contact li { grid-template-columns: 1fr; gap: 2px; justify-items: center; }
}

.footer-contact__k {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-text-dim);
}

.footer-contact a { color: var(--c-text); }
.footer-contact a:hover { color: var(--c-gold); }

/* ---- provider strip ---- */
.footer-provider {
  padding-block: var(--sp-5);
  border-top: 1px solid var(--c-border);
  text-align: center;
}

.footer-provider img {
  width: 100%;
  max-width: 900px;
  height: auto;
  margin-inline: auto;
  opacity: .75;
  transition: opacity var(--transition);
}

.footer-provider img:hover { opacity: 1; }

/* ---- bottom bar ---- */
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-5);
  padding-block: var(--sp-5);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-sm);
  color: var(--c-text-dim);
}

.footer-copy strong { color: var(--c-text-muted); }

.footer-age {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-dim);
}

.footer-age .age-badge {
  width: 32px;
  height: 32px;
  font-size: var(--fs-xs);
}

@media (max-width: 700px) {
  .footer-bottom { justify-content: center; text-align: center; }
  .footer-age { justify-content: center; }
}
