/* RIAV — Shared base & components
 * Imported AFTER tokens.css.
 */

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--neutral-700);
  background: var(--neutral-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--brand-primary); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--brand-accent-700); }

h1, h2, h3, h4 { color: var(--neutral-900); font-weight: 700; line-height: var(--lh-tight); margin: 0; text-wrap: balance; }
h1 { font-size: var(--fs-h1); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.005em; }
h3 { font-size: var(--fs-h3); }
p  { margin: 0; text-wrap: pretty; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.section { padding-block: 64px; }
@media (min-width: 768px) { .section { padding-block: 96px; } }
.section--tight { padding-block: 48px; }
@media (min-width: 768px) { .section--tight { padding-block: 64px; } }
.section--alt { background: var(--neutral-100); }
.section--ink { background: var(--brand-primary); color: var(--neutral-100); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-caption); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--brand-accent-700);
}
.eyebrow::before {
  content: ""; width: 24px; height: 2px; background: var(--brand-accent);
}
.section--ink .eyebrow { color: var(--brand-accent); }
.section--ink .eyebrow::before { background: var(--brand-accent); }

.section-head { margin-bottom: 48px; max-width: 720px; }
.section-head h2 { margin-top: 12px; }
.section-head p { margin-top: 12px; font-size: var(--fs-body-lg); color: var(--neutral-700); }
.section--ink .section-head p { color: var(--neutral-200); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: white; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 12px; top: -40px;
  background: var(--brand-primary); color: #fff;
  padding: 8px 14px; border-radius: var(--radius-sm);
  z-index: 200; transition: top var(--t);
  font-weight: 600; font-size: var(--fs-caption);
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Header ---------- */
/* The wrapper div from partials.js must drop out of layout so position:sticky
   on .site-header pins to the body, not the (short) wrapper. */
#site-header { display: contents; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--neutral-100);
  transition: background var(--t-slow), border-color var(--t-slow), box-shadow var(--t-slow);
}
.site-header--scrolled {
  box-shadow: 0 4px 16px rgba(11,27,59,0.08);
}
/* Transparent mode (used on top of dark hero) — body opt-in */
body[data-header="transparent"] .site-header:not(.site-header--scrolled) {
  background: transparent;
  backdrop-filter: none;
  border-bottom-color: transparent;
}
body[data-header="transparent"] .site-header:not(.site-header--scrolled) .brand,
body[data-header="transparent"] .site-header:not(.site-header--scrolled) .brand__name { color: white; }
body[data-header="transparent"] .site-header:not(.site-header--scrolled) .brand__sub { color: rgba(255,255,255,0.65); }
body[data-header="transparent"] .site-header:not(.site-header--scrolled) .nav a { color: rgba(255,255,255,0.88); }
body[data-header="transparent"] .site-header:not(.site-header--scrolled) .nav a:hover { color: white; background: rgba(255,255,255,0.1); }
body[data-header="transparent"] .site-header:not(.site-header--scrolled) .nav a[aria-current="page"] { color: white; }
body[data-header="transparent"] .site-header:not(.site-header--scrolled) .lang-switch a { color: rgba(255,255,255,0.7); }
body[data-header="transparent"] .site-header:not(.site-header--scrolled) .lang-switch a.is-active { color: white; }
body[data-header="transparent"] .site-header:not(.site-header--scrolled) .lang-switch span { color: rgba(255,255,255,0.3); }
body[data-header="transparent"] .site-header:not(.site-header--scrolled) .menu-toggle { color: white; border-color: rgba(255,255,255,0.3); }
body[data-header="transparent"] .site-header:not(.site-header--scrolled) .brand__logo {
  background: rgba(255,255,255,0.95); border-radius: 8px; padding: 4px;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 72px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--neutral-900); font-weight: 700;
}
.brand:hover { color: var(--neutral-900); }
.brand__mark {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--brand-primary); color: var(--brand-accent);
  display: grid; place-items: center; font-weight: 800; letter-spacing: 0.04em;
  font-size: 14px;
}
.brand__logo {
  width: 48px; height: 48px; flex: 0 0 auto; display: block;
  object-fit: contain;
}
@media (max-width: 640px) {
  .brand__logo { width: 40px; height: 40px; }
  .brand__name { font-size: 14px; }
}
.brand__name { font-size: 15px; letter-spacing: 0.02em; }
.brand__sub { font-size: 11px; font-weight: 500; color: var(--neutral-500); letter-spacing: 0.04em; text-transform: uppercase; display: block; margin-top: 2px; }

.nav { display: none; gap: 4px; align-items: center; list-style: none; margin: 0; padding: 0; }
@media (min-width: 1024px) { .nav { display: flex; } }
.nav li { display: flex; align-items: center; }
.nav a {
  color: var(--neutral-700); font-weight: 500; font-size: 15px;
  padding: 8px 14px; border-radius: var(--radius-sm); position: relative;
  transition: color var(--t), background var(--t);
}
.nav a:hover { color: var(--brand-primary); background: var(--neutral-100); }
.nav a[aria-current="page"] { color: var(--brand-primary); font-weight: 600; }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px;
  height: 2px; background: var(--brand-accent);
}

.lang-switch {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-caption); color: var(--neutral-500); font-weight: 500;
}
.lang-switch a { color: var(--neutral-500); padding: 4px 2px; }
.lang-switch a.is-active { color: var(--brand-primary); font-weight: 600; border-bottom: 2px solid var(--brand-accent); }
.lang-switch span { color: var(--neutral-300); }

/* Below desktop: hide brand subtitle and lang switcher (lang is in mobile menu).
   Keeps the header to one row: logo + brand name + hamburger.
   Placed AFTER .brand__sub / .lang-switch base rules so display:none wins the cascade. */
@media (max-width: 1023px) {
  .brand__sub { display: none; }
  .lang-switch { display: none; }
}

.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--neutral-200);
  color: var(--neutral-900); cursor: pointer;
}
@media (min-width: 1024px) { .menu-toggle { display: none; } }

.mobile-menu {
  display: none; border-top: 1px solid var(--neutral-100);
  background: white; padding: 12px var(--container-pad);
}
.mobile-menu.is-open { display: block; }
.mobile-menu a {
  display: block; padding: 14px 8px; font-weight: 500; color: var(--neutral-900);
  border-bottom: 1px solid var(--neutral-100);
}
.mobile-menu a[aria-current="page"] { color: var(--brand-primary); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 12px 24px; min-height: 44px;
  border-radius: var(--radius); border: 1.5px solid transparent;
  cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t), transform var(--t);
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(255,255,255,0.9); }
.btn--primary { background: var(--brand-accent); color: var(--brand-primary); }
.btn--primary:hover { background: var(--brand-accent-700); color: white; }
.btn--secondary { border-color: var(--brand-primary); color: var(--brand-primary); background: transparent; }
.btn--secondary:hover { background: var(--brand-primary); color: white; }
.btn--ghost { color: var(--brand-accent-700); padding-inline: 8px; }
.btn--ghost:hover { color: var(--brand-primary); text-decoration: underline; }
.btn--inverse { background: white; color: var(--brand-primary); }
.btn--inverse:hover { background: var(--brand-accent); }
.btn--sm { padding: 8px 14px; font-size: 14px; min-height: 36px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn .ico { width: 18px; height: 18px; }

/* ---------- Cards ---------- */
.card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 24px;
  border: 1px solid var(--neutral-100);
  transition: box-shadow var(--t), transform var(--t);
}
.card--linked:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-full);
  background: var(--brand-accent-soft); color: var(--brand-primary);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.badge--ink { background: var(--brand-primary); color: white; }
.badge--gold { background: var(--brand-accent); color: var(--brand-primary); }
.badge--soft { background: var(--neutral-100); color: var(--neutral-700); }

/* ---------- Inputs ---------- */
.input, .select {
  width: 100%; font: inherit; color: var(--neutral-900);
  background: white; border: 1px solid var(--neutral-200);
  border-radius: 8px; padding: 10px 14px; min-height: 44px;
  transition: border-color var(--t), box-shadow var(--t);
}
.input::placeholder { color: var(--neutral-500); }
.input:focus, .select:focus {
  outline: none; border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(201,162,75,0.25);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-caption); font-weight: 600; color: var(--neutral-700); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233A4357' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  padding-right: 40px;
}

.search-input {
  position: relative;
}
.search-input .input { padding-left: 44px; font-size: var(--fs-body-lg); }
.search-input svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--neutral-500);
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--neutral-100); border-radius: var(--radius); background: white; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 15px;
}
table.data caption { caption-side: top; text-align: left; padding: 16px 20px; font-weight: 600; color: var(--neutral-900); background: white; border-bottom: 1px solid var(--neutral-100); }
table.data th, table.data td { padding: 14px 16px; text-align: left; vertical-align: middle; }
table.data thead th { background: var(--neutral-100); color: var(--neutral-900); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--neutral-200); }
table.data tbody tr { border-top: 1px solid var(--neutral-100); transition: background var(--t); }
table.data tbody tr:hover { background: var(--brand-accent-softer); }
table.data tbody tr:nth-child(even) { background: rgba(238,241,246,0.4); }
table.data tbody tr:nth-child(even):hover { background: var(--brand-accent-softer); }
table.data td.num { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; color: var(--neutral-900); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--neutral-200); overflow-x: auto; }
.tabs button {
  background: none; border: none; padding: 14px 18px; font: inherit; font-weight: 500;
  color: var(--neutral-500); cursor: pointer; position: relative; white-space: nowrap;
  transition: color var(--t);
}
.tabs button:hover { color: var(--brand-accent-700); }
.tabs button[aria-selected="true"] { color: var(--brand-primary); font-weight: 600; }
.tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px; background: var(--brand-primary);
}

/* ---------- Breadcrumb ---------- */
.crumbs { display: flex; gap: 8px; font-size: var(--fs-caption); color: var(--neutral-500); flex-wrap: wrap; }
.crumbs a { color: var(--neutral-500); }
.crumbs a:hover { color: var(--brand-primary); }
.crumbs span { color: var(--neutral-300); }
.crumbs [aria-current="page"] { color: var(--neutral-700); font-weight: 500; }

/* ---------- Page header ---------- */
.page-header {
  background: linear-gradient(180deg, #0B1B3B 0%, #16285A 100%);
  color: white; padding-block: 56px;
  position: relative; overflow: hidden;
}
.page-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand-accent), transparent);
}
.page-header h1 { color: white; font-size: clamp(2rem, 4vw, 2.75rem); margin-top: 16px; }
.page-header p { color: var(--neutral-200); max-width: 720px; margin-top: 12px; font-size: var(--fs-body-lg); }
.page-header .crumbs, .page-header .crumbs a { color: rgba(255,255,255,0.7); }
.page-header .crumbs a:hover { color: var(--brand-accent); }
.page-header .crumbs span { color: rgba(255,255,255,0.3); }
.page-header .crumbs [aria-current="page"] { color: white; }

/* Decorative soundwave in page header */
.page-header .wave {
  position: absolute; right: -40px; bottom: -10px; opacity: 0.08; pointer-events: none;
  width: 480px; height: 200px;
}
@media (max-width: 767px) { .page-header .wave { display: none; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brand-primary); color: var(--neutral-200);
  padding-block: 64px 24px;
  border-top: 4px solid var(--brand-accent);
}
.site-footer h4 { color: white; font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; font-weight: 600; }
.footer-grid { display: grid; gap: 40px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 64px; } }
.site-footer a { color: var(--neutral-200); }
.site-footer a:hover { color: var(--brand-accent); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.footer-bottom {
  margin-top: 48px; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
  font-size: var(--fs-caption); color: var(--neutral-300);
}
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-brand .brand__mark { background: white; color: var(--brand-primary); }
.brand__logo--footer {
  width: 56px; height: 56px; padding: 8px;
  background: white; border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.footer-brand-text { color: var(--neutral-200); font-size: 14px; line-height: 1.6; }
.footer-brand-text strong { color: white; display: block; font-size: 15px; margin-bottom: 6px; }

/* ---------- Image placeholders (no stock photo) ---------- */
.imgph {
  background:
    repeating-linear-gradient(135deg, rgba(11,27,59,0.06) 0 1px, transparent 1px 14px),
    var(--neutral-100);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  display: grid; place-items: center; color: var(--neutral-500);
  font-family: var(--font-mono); font-size: 12px;
  text-align: center; padding: 16px;
  position: relative; overflow: hidden;
}
.imgph::before {
  content: ""; position: absolute; inset: 16px; border: 1px dashed var(--neutral-300); border-radius: 6px; pointer-events: none;
}
.imgph span { position: relative; z-index: 1; }
.imgph--dark {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 14px),
    #16285A;
  border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.55);
}
.imgph--dark::before { border-color: rgba(255,255,255,0.18); }

.aspect-21x9 { aspect-ratio: 21 / 9; }
.aspect-16x9 { aspect-ratio: 16 / 9; }
.aspect-4x3  { aspect-ratio: 4 / 3; }
.aspect-1x1  { aspect-ratio: 1 / 1; }
.aspect-3x4  { aspect-ratio: 3 / 4; }

/* ---------- Logo strip placeholders ---------- */
.logo-tile {
  height: 64px; border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm); background: white;
  display: grid; place-items: center;
  color: var(--neutral-500); font-weight: 600; font-size: 14px;
  letter-spacing: 0.02em;
  filter: grayscale(1); opacity: 0.75;
  transition: filter var(--t), opacity var(--t), color var(--t), border-color var(--t);
  padding-inline: 12px; text-align: center;
}
.logo-tile:hover { filter: none; opacity: 1; color: var(--brand-primary); border-color: var(--brand-accent); }

/* ---------- Reusable iconography ---------- */
.ico { width: 24px; height: 24px; stroke-width: 1.5; }
.ico-circle {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--brand-accent-soft); color: var(--brand-primary);
  display: grid; place-items: center; flex: 0 0 auto;
}
.ico-circle .ico { width: 24px; height: 24px; color: inherit; }

/* ---------- Pagination ---------- */
.pagination { display: inline-flex; gap: 6px; }
.pagination a, .pagination button, .pagination span {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border-radius: var(--radius-sm); border: 1px solid var(--neutral-200);
  background: white; color: var(--neutral-700); font-weight: 500; font-size: 14px;
  cursor: pointer; user-select: none;
}
.pagination a:hover, .pagination button:hover { background: var(--brand-accent-soft); color: var(--brand-primary); border-color: var(--brand-accent); }
.pagination [aria-current="page"] { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }
.pagination .ellipsis { border: none; background: none; cursor: default; }

/* ---------- Misc utilities ---------- */
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--neutral-500); }
.divider-gold { height: 3px; width: 56px; background: var(--brand-accent); border-radius: 2px; }
.center { text-align: center; }
.hide-mobile { display: none; }
@media (min-width: 768px) { .hide-mobile { display: initial; } .hide-desktop { display: none; } }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Print stylesheet (Gioi-thieu + Bieu-gia) ---------- */
@media print {
  .site-header, .site-footer, .mobile-menu, .skip-link, .btn, .page-header .wave { display: none !important; }
  body { background: white; color: black; font-size: 12pt; }
  .page-header { background: white !important; color: black !important; padding-block: 12pt; border-bottom: 2pt solid black; }
  .page-header h1, .page-header p, .page-header .crumbs { color: black !important; }
  .section { padding-block: 16pt; }
  .card { box-shadow: none; border: 1pt solid #999; break-inside: avoid; }
  table.data { font-size: 10pt; }
  table.data thead th { background: white; border-bottom: 1.5pt solid black; }
}
