/* ===========================================================
   KetQuaXSMN — Global Stylesheet
   Mobile-first, red/gold Vietnamese lottery brand palette
   =========================================================== */

:root {
  --red-700: #b5121b;
  --red-600: #d4181f;
  --red-500: #e6262d;
  --gold-500: #f2b705;
  --gold-600: #d99e00;
  --ink-900: #1a1210;
  --ink-700: #3d2e2b;
  --ink-500: #6b5a56;
  --paper-0: #ffffff;
  --paper-50: #fff8f0;
  --paper-100: #fdeee0;
  --line-200: #f0ddd0;
  --green-600: #1c8a4b;
  --shadow-sm: 0 1px 3px rgba(26, 18, 16, 0.08);
  --shadow-md: 0 6px 20px rgba(181, 18, 27, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink-900);
  background: var(--paper-50);
  line-height: 1.55;
  padding-bottom: 64px; /* space for mobile sticky CTA */
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--gold-500); color: var(--ink-900);
  padding: 10px 16px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--red-700), var(--red-600));
  color: #fff;
  box-shadow: var(--shadow-md);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.05rem; text-decoration: none; color: #fff;
  letter-spacing: .2px;
}
.brand .brand-logo {
  height: 34px;
  width: auto;
  display: block;
}
@media (min-width: 480px) {
  .brand .brand-logo { height: 40px; }
}
.nav-toggle {
  display: inline-flex; background: none; border: 0; color: #fff;
  padding: 8px; cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; }

.main-nav {
  position: fixed; inset: 56px 0 0 0;
  background: var(--red-700);
  transform: translateX(100%);
  transition: transform .25s ease;
  overflow-y: auto;
  z-index: 49;
}
.main-nav.open { transform: translateX(0); }
.main-nav ul {
  list-style: none; margin: 0; padding: 12px 16px;
  display: flex; flex-direction: column;
}
.main-nav a {
  display: block; padding: 14px 8px; color: #fff; text-decoration: none;
  font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.12);
}
.main-nav a:hover { color: var(--gold-500); }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .main-nav {
    position: static; transform: none; background: none; inset: auto;
    overflow: visible;
  }
  .main-nav ul { flex-direction: row; padding: 0; gap: 4px; }
  .main-nav a { border-bottom: 0; padding: 10px 12px; border-radius: 8px; }
  .main-nav a:hover { background: rgba(255,255,255,.12); }
}

/* ---------- Live badge ---------- */
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15); color: #fff;
  padding: 5px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  letter-spacing: .4px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
  70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--red-600), var(--red-700) 70%);
  color: #fff; padding: 24px 0 32px;
}
.hero-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.hero h1 {
  font-size: 1.5rem; font-weight: 800; margin: 0 0 6px;
}
.hero .hero-date {
  color: var(--gold-500); font-weight: 700; font-size: .95rem;
}
.hero p.lede { color: rgba(255,255,255,.9); max-width: 60ch; }

.countdown {
  display: flex; gap: 8px; margin: 16px 0;
}
.countdown .cd-box {
  background: rgba(255,255,255,.12); border-radius: var(--radius-sm);
  padding: 8px 10px; text-align: center; min-width: 56px;
}
.countdown .cd-num { font-size: 1.25rem; font-weight: 800; display: block; }
.countdown .cd-label { font-size: .68rem; text-transform: uppercase; opacity: .85; }

.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; border-radius: 999px; font-weight: 700; text-decoration: none;
  border: 2px solid transparent; font-size: .95rem; cursor: pointer;
  min-height: 44px;
}
.btn-gold { background: var(--gold-500); color: var(--ink-900); }
.btn-gold:hover { background: var(--gold-600); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.6); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-primary { background: var(--red-600); color: #fff; }
.btn-primary:hover { background: var(--red-700); }
.btn-block { width: 100%; }

/* ---------- Sections ---------- */
section { padding: 32px 0; }
.section-title {
  font-size: 1.3rem; font-weight: 800; color: var(--red-700);
  margin-bottom: 4px;
}
.section-sub { color: var(--ink-500); margin-bottom: 18px; font-size: .95rem; }

/* ---------- Results card ---------- */
.results-card {
  background: var(--paper-0); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 16px; margin-top: -18px; position: relative; z-index: 2;
}
.results-card-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.province-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}
.province-tabs::-webkit-scrollbar { height: 4px; }
.province-tab {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-200);
  background: var(--paper-50); font-weight: 700; font-size: .85rem; cursor: pointer;
  white-space: nowrap; color: var(--ink-700);
}
.province-tab[aria-selected="true"] {
  background: var(--red-600); border-color: var(--red-600); color: #fff;
}

table.results-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.results-table th, .results-table td {
  padding: 9px 8px; text-align: center; border-bottom: 1px solid var(--line-200);
}
.results-table th { color: var(--ink-500); font-weight: 700; font-size: .78rem; text-transform: uppercase; }
.results-table td.prize-special { font-weight: 800; color: var(--red-600); font-size: 1.05rem; }
.results-table tr:last-child td { border-bottom: 0; }
.results-note {
  font-size: .78rem; color: var(--ink-500); font-style: italic; margin-top: 10px;
}

/* ---------- Checker tool ---------- */
.checker-card {
  background: var(--paper-100); border: 1px dashed var(--gold-600);
  border-radius: var(--radius-md); padding: 16px; margin-top: 18px;
}
.checker-form { display: grid; gap: 10px; grid-template-columns: 1fr; }
.checker-form label { font-weight: 700; font-size: .82rem; color: var(--ink-700); display: block; margin-bottom: 4px; }
.checker-form input, .checker-form select {
  width: 100%; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-200);
  font-size: 1rem; background: #fff;
}
.checker-result { margin-top: 10px; padding: 12px; border-radius: var(--radius-sm); font-weight: 700; display: none; }
.checker-result.show { display: block; }
.checker-result.win { background: #e8f8ef; color: var(--green-600); }
.checker-result.lose { background: #fdeceb; color: var(--red-700); }

@media (min-width: 560px) {
  .checker-form { grid-template-columns: 1fr 1fr auto; align-items: end; }
}

/* ---------- Schedule table ---------- */
.schedule-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.schedule-table th, .schedule-table td {
  padding: 10px 8px; border-bottom: 1px solid var(--line-200); text-align: left;
}
.schedule-table th { background: var(--paper-100); color: var(--red-700); }
.schedule-table td.day-cell { font-weight: 700; white-space: nowrap; }

/* ---------- Prize structure ---------- */
.prize-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .prize-grid { grid-template-columns: repeat(4, 1fr); } }
.prize-item {
  background: #fff; border-radius: var(--radius-sm); padding: 12px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.prize-item .prize-name { font-size: .78rem; color: var(--ink-500); font-weight: 700; }
.prize-item .prize-count { font-size: 1.1rem; font-weight: 800; color: var(--red-600); }

/* ---------- Cards / Blog ---------- */
.card-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  background: #fff; border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; border: 1px solid var(--line-200);
}
.post-card:hover { box-shadow: var(--shadow-md); }
.post-thumb {
  height: 120px; background: linear-gradient(135deg, var(--gold-500), var(--red-500));
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
.post-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.post-tag {
  font-size: .7rem; font-weight: 800; text-transform: uppercase; color: var(--red-600);
  letter-spacing: .4px; margin-bottom: 6px;
}
.post-title { font-size: 1.02rem; font-weight: 800; margin-bottom: 6px; }
.post-excerpt { font-size: .88rem; color: var(--ink-500); flex: 1; }
.post-meta { font-size: .76rem; color: var(--ink-500); margin-top: 10px; }

/* ---------- FAQ ---------- */
.faq-item {
  background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--line-200);
  margin-bottom: 10px; overflow: hidden;
}
.faq-q {
  width: 100%; text-align: left; background: none; border: 0; padding: 14px 16px;
  font-weight: 700; font-size: .95rem; cursor: pointer; display: flex;
  justify-content: space-between; align-items: center; gap: 10px; color: var(--ink-900);
}
.faq-q .chevron { transition: transform .2s ease; flex-shrink: 0; }
.faq-item[open] .faq-q .chevron { transform: rotate(180deg); }
.faq-a { padding: 0 16px 16px; color: var(--ink-700); font-size: .9rem; }

/* ---------- Disclaimer / trust ---------- */
.trust-strip {
  display: grid; gap: 12px; grid-template-columns: 1fr;
}
@media (min-width: 640px) { .trust-strip { grid-template-columns: repeat(3, 1fr); } }
.trust-item {
  background: #fff; border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow-sm);
  font-size: .85rem;
}
.trust-item strong { display: block; color: var(--red-700); margin-bottom: 4px; }

.notice-box {
  background: #fff7e0; border-left: 4px solid var(--gold-600);
  padding: 14px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .85rem; color: var(--ink-700);
}

/* ---------- Newsletter / lead hook ---------- */
.newsletter {
  background: linear-gradient(135deg, var(--red-700), var(--ink-900));
  color: #fff; border-radius: var(--radius-lg); padding: 22px;
  text-align: center;
}
.newsletter h2 { color: var(--gold-500); }
.newsletter-form { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.newsletter-form input {
  flex: 1 1 220px; padding: 12px 14px; border-radius: 999px; border: 0; font-size: 1rem;
}
.newsletter-form button { flex: 0 0 auto; }

/* ---------- Internal links block ---------- */
.link-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.link-cloud a {
  background: #fff; border: 1px solid var(--line-200); border-radius: 999px;
  padding: 7px 14px; font-size: .82rem; text-decoration: none; color: var(--ink-700);
}
.link-cloud a:hover { border-color: var(--red-500); color: var(--red-600); }

.breadcrumbs { font-size: .8rem; color: var(--ink-500); margin-bottom: 14px; }
.breadcrumbs a { color: var(--red-600); text-decoration: none; }

/* ---------- Article (blog post) ---------- */
.article-header { padding: 20px 0 6px; }
.article-header h1 { font-size: 1.5rem; color: var(--red-700); }
.article-meta { font-size: .82rem; color: var(--ink-500); }
.article-body { font-size: 1rem; }
.article-body h2 { font-size: 1.2rem; color: var(--red-700); margin-top: 1.6em; }
.article-body h3 { font-size: 1.05rem; margin-top: 1.3em; }
.article-body ul, .article-body ol { padding-left: 1.2em; }
.article-body li { margin-bottom: .4em; }
.article-body a { color: var(--red-600); font-weight: 600; }
.toc {
  background: var(--paper-100); border-radius: var(--radius-sm); padding: 14px 16px; font-size: .88rem;
}
.toc a { display: block; padding: 3px 0; color: var(--ink-700); text-decoration: none; }
.toc a:hover { color: var(--red-600); }
.author-box {
  display: flex; gap: 12px; align-items: center; background: #fff; border-radius: var(--radius-sm);
  padding: 14px; box-shadow: var(--shadow-sm); margin-top: 24px;
}
.author-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: var(--gold-500);
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--ink-900);
  flex-shrink: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink-900); color: rgba(255,255,255,.75); padding: 32px 0 90px; margin-top: 24px;
  font-size: .85rem;
}
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-col h3 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 .5em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { text-decoration: none; color: rgba(255,255,255,.75); }
.footer-col a:hover { color: var(--gold-500); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 24px; padding-top: 16px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
}
.age-gate {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.08);
  padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: .75rem;
}

/* ---------- Mobile sticky CTA ---------- */
.mobile-sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #fff; border-top: 1px solid var(--line-200);
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  padding: 8px 12px; display: flex; gap: 8px;
}
.mobile-sticky-cta .btn { flex: 1; }
@media (min-width: 860px) { .mobile-sticky-cta { display: none; } }

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