/* ==========================================================================
   READ VPN Learning — Base (reset, typography, layout primitives, utilities)
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  color: var(--ink-primary);
  background: var(--surface-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
svg { flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--border-default); margin: var(--s-24) 0; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
::selection { background: rgba(0, 194, 214, .22); }

/* Thai: tracking 0 (kit recommendation), roomier line-height */
:lang(th) { letter-spacing: 0; }

/* ---- Headings (BeDoctor scale adapted for Thai, see implementation-decisions.md) ---- */
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; color: var(--ink-primary); font-weight: var(--fw-bold); }
h1, .h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
h2, .h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
h3, .h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
h4, .h4 { font-size: var(--fs-h4); line-height: var(--lh-h4); }
h5, .h5 { font-size: var(--fs-h5); line-height: var(--lh-h5); font-weight: var(--fw-semibold); }
h6, .h6 { font-size: var(--fs-h6); line-height: var(--lh-h6); }
.lead { font-size: 24.5px; line-height: 1.45; color: var(--ink-primary); }
@media (max-width: 767px) { .lead { font-size: 22.5px; } }
.text-muted { color: var(--ink-secondary); }
.text-sm { font-size: var(--fs-sm); line-height: 1.35; }
.text-xs { font-size: var(--fs-xs); line-height: 1.3; }
.text-center { text-align: center; }
.accent { color: var(--brand-primary-dark); }
.accent-grad {
  background: linear-gradient(120deg, var(--brand-primary-deep) 0%, var(--brand-primary-active) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--brand-primary-dark);
}
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Eyebrow = BeDoctor H6 eyebrow */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-h6); line-height: 1.2; font-weight: var(--fw-bold);
  color: var(--brand-primary-dark); text-transform: uppercase; letter-spacing: .06em;
  margin: 0 0 var(--s-16);
}
.eyebrow--cyan { color: var(--brand-primary-dark); }
.eyebrow--light { color: #BFE9F1; }

/* ---- Layout primitives ---- */
.container { width: 100%; max-width: calc(var(--container) + var(--page-pad) * 2); margin-inline: auto; padding-inline: var(--page-pad); }
.container--narrow { max-width: calc(880px + var(--page-pad) * 2); }
.container--mid { max-width: calc(1100px + var(--page-pad) * 2); }

/* BeDoctor coloured outer panel: margin 24 / radius 24 */
.panel { margin-inline: var(--outer); border-radius: var(--r-section); overflow: clip; position: relative; }
.panel--subtle { background: var(--surface-subtle); }
.panel--soft { background: var(--grad-soft); }
.panel--dark { background: var(--grad-panel); color: #fff; }
.panel--dark h1, .panel--dark h2, .panel--dark h3, .panel--dark h4, .panel--dark h5 { color: #fff; }

.section { padding-block: var(--section-top) var(--section-bottom); }
.section--tight { padding-block: calc(var(--section-top) * .56) calc(var(--section-bottom) * .5); }
.section--flush-top { padding-top: 0; }
.stack > * + * { margin-top: var(--stack, var(--s-16)); }

.grid { display: grid; gap: var(--gutter); }
.grid-2 { display: grid; gap: var(--gutter); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: var(--gutter); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: var(--gutter); grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1239px) { .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 959px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.w-full { width: 100%; }

/* Section heading (BeDoctor: eyebrow → H2 → description max 660, centred) */
.section-head { text-align: center; max-width: 760px; margin: 0 auto var(--s-48); }
.section-head h2 { margin-bottom: var(--s-16); }
.section-head p { max-width: 660px; margin-inline: auto; color: var(--ink-primary); }
.section-head--left { text-align: left; margin-inline: 0; }
.section-head--left p { margin-inline: 0; }

/* ---- Accessibility ---- */
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 200; padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--ink-primary); color: #fff; font-weight: 600; transition: top .2s;
}
.skip-link:focus { top: 16px; }

/* Reduced motion (kit: no long slides / fixed backgrounds) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Reveal animations (BeDoctor hero fadeIn / fadeInRight — shorter offset) */
@keyframes rv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rv-fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes rv-fade-right { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes rv-spin { to { transform: rotate(360deg); } }
@keyframes rv-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.reveal { animation: rv-fade-in 1s both; }
.reveal-up { animation: rv-fade-up .7s var(--ease-out) both; }
.reveal-right { animation: rv-fade-right 1s var(--ease-out) both; }

/* Print baseline (certificate page overrides) */
@media print {
  .no-print, .site-header, .site-footer, .proto-switcher, .toast-region { display: none !important; }
  body { background: #fff; }
}
