/* Cẩm Nang Baccarat — plain CSS, system fonts, no framework. */

:root {
  --felt: #0f3d2e;
  --felt-2: #17533f;
  --red: #9b1c31;
  --gold: #b8862b;
  --gold-soft: #f3e7cc;
  --bg: #faf7f0;
  --surface: #ffffff;
  --text: #1f2421;
  --muted: #5a625d;
  --line: #e3ddd0;
  --radius: 10px;
  --max: 1120px;
  --prose: 760px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Noto Serif", Cambria, "Times New Roman", serif; /* Georgia lacks full Vietnamese diacritics on Windows */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.7 var(--font);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--felt-2); text-underline-offset: 2px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.25; color: var(--felt); }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 1.8em 0 .6em; scroll-margin-top: 80px; }
h3 { font-size: 1.2rem; margin: 1.4em 0 .4em; scroll-margin-top: 80px; }
p, ul, ol, table { margin: 0 0 1.1em; }

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

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Header */
.site-header { background: var(--felt); color: #fff; position: sticky; top: 0; z-index: 50; }
/* Desktop: logo | centered menu | auth buttons */
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; min-height: 64px; }
.header-inner > .logo { justify-self: start; }
.site-nav { justify-self: center; }
.header-auth { justify-self: end; display: flex; gap: 8px; }
.logo { display: flex; align-items: center; line-height: 0; }
.logo img { display: block; height: 44px; width: auto; }
.footer-brand .logo img { height: 60px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a { color: #fff; text-decoration: none; padding: 8px 10px; border-radius: 6px; display: block; font-size: .95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--felt-2); color: var(--gold-soft); }
.site-nav ul { align-items: center; justify-content: center; }
.nav-btn { display: block; text-align: center; white-space: nowrap; text-decoration: none; font-weight: 600; font-size: .95rem; padding: 7px 14px; border-radius: 6px; }
.nav-btn-login { color: #fff; border: 1px solid rgba(255,255,255,.6); }
.nav-btn-login:hover { background: var(--felt-2); color: var(--gold-soft); }
.nav-btn-signup { background: var(--gold); color: #1f2421; border: 1px solid var(--gold); }
.nav-btn-signup:hover { background: var(--gold-soft); color: var(--felt); }
.nav-toggle { display: none; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer; }

@media (max-width: 860px) {
  .js .nav-toggle { display: block; }
  .js .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--felt); border-top: 1px solid var(--felt-2); }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; padding: 8px 16px 16px; }
  .header-inner { display: flex; flex-wrap: wrap; justify-content: space-between; }
  /* Mobile: login / sign-up pinned to the bottom of the screen */
  .header-auth { position: fixed; left: 0; right: 0; bottom: 0; justify-self: stretch; z-index: 60; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--felt); border-top: 1px solid var(--felt-2); box-shadow: 0 -4px 12px rgba(0,0,0,.18); }
  .nav-btn { padding: 11px 14px; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
}

/* Page banner (generated SVG per page) */
.page-banner { margin: 4px 0 24px; }
.page-banner img { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: 0 8px 24px rgba(15,61,46,.18); background: var(--felt); }

/* Breadcrumb */
.breadcrumb { font-size: .9rem; color: var(--muted); margin: 20px 0 8px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--gold); }

/* Article */
.article { max-width: var(--prose); margin: 0 auto 48px; }
.lead { font-size: 1.1rem; color: var(--muted); }
.meta { font-size: .88rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.toc { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 14px 18px; margin: 20px 0; }
.toc-title { font-weight: 700; margin: 0 0 6px; }
.toc ol { margin: 0; padding-left: 20px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: .35em; }

.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
table { border-collapse: collapse; width: 100%; background: var(--surface); font-size: .95rem; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--gold-soft); color: var(--felt); }
caption { text-align: left; font-size: .88rem; color: var(--muted); padding-bottom: 6px; }

.note { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--felt-2); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 1.2em; }
.note.warn { border-left-color: var(--red); }
.note p:last-child { margin-bottom: 0; }

.faq h3 { color: var(--text); font-family: var(--font); font-size: 1.05rem; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 16px 0 24px; padding: 0; list-style: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card h3 a { text-decoration: none; color: var(--felt); }
.card h3 a:hover { color: var(--red); }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

.related { border-top: 1px solid var(--line); margin-top: 32px; }
.responsible { background: var(--gold-soft); border-radius: var(--radius); padding: 14px 18px; font-size: .95rem; margin-top: 28px; }

/* Home */
.hero { background: linear-gradient(135deg, var(--felt), var(--felt-2)); color: #fff; padding: 56px 0 48px; }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.hero h1 { color: #fff; }
.hero p { font-size: 1.1rem; color: #e8efe9; }
.hero-art { width: 100%; max-width: 440px; height: auto; justify-self: center; filter: drop-shadow(0 10px 24px rgba(0,0,0,.35)); }
.btn { display: inline-block; background: var(--gold); color: #1f2421; padding: 10px 18px; border-radius: 8px; text-decoration: none; font-weight: 600; margin: 4px 8px 4px 0; }
.btn:hover { background: var(--gold-soft); color: var(--felt); }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); }
.btn.ghost:hover { background: var(--felt); color: var(--gold-soft); }
.section { padding: 40px 0 8px; }
.section > .container > h2:first-child { margin-top: 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; margin-bottom: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--felt); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }

@media (max-width: 760px) {
  .hero { padding: 36px 0 32px; }
  .hero-inner, .two-col { grid-template-columns: 1fr; }
  .hero-art { max-width: 300px; order: -1; margin: 0 auto 4px; }
}

/* Footer */
.site-footer { background: #0b2d22; color: #cfdad3; padding: 40px 0 24px; font-size: .93rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--gold-soft); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 24px; }
.footer-grid h2 { color: var(--gold-soft); font: 700 1rem/1.3 var(--font); margin: 0 0 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-brand p { margin: 8px 0 0; }
.footer-bottom { border-top: 1px solid #23493b; margin-top: 28px; padding-top: 16px; font-size: .85rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* HTML sitemap / 404 */
.sitemap-list { columns: 2 260px; padding-left: 20px; }
.notfound { text-align: center; padding: 48px 0; }
