/* =========================================================
   Koidoo — Friendly first-timer HIV education
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-soft: #eef4f8;
  --surface: #ffffff;
  --ink: #152a3a;
  --ink-muted: #5a6b78;
  --nav-bg: #152a3a;
  --nav-text: #f5fafc;
  --accent: #e8915a;
  --accent-hot: #d66b3a;
  --accent-soft: #fff1e8;
  --teal: var(--accent);
  --teal-hot: var(--accent-hot);
  --teal-soft: var(--accent-soft);
  --chip: #e8915a;
  --line: #d7e2ea;
  --focus: #e8915a;
  --shadow: 0 10px 28px rgba(21, 42, 58, 0.1);
  --shadow-soft: 0 6px 18px rgba(21, 42, 58, 0.06);
  --radius: 14px;
  --radius-lg: 22px;
  --font-display: "Nunito", "Noto Sans Thai", sans-serif;
  --font: "Nunito", "Noto Sans Thai", sans-serif;
  --max: 1160px;
  --header-h: 70px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
}

body.page-home {
  background: var(--bg-soft);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hot);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.visually-hidden {
  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: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
}

.skip-link:focus {
  top: 1rem;
}

.wrap,
.leaflet {
  width: min(var(--max), calc(100% - 3rem));
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.65rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn-sm {
  min-height: 2.25rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.88rem;
}

.btn-ico {
  flex-shrink: 0;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hot);
  color: #fff;
}

.btn-teal {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.btn-teal:hover {
  background: var(--teal-hot);
  border-color: var(--teal-hot);
  color: #fff;
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-text {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  padding-inline: 0.65rem;
}

.btn-text:hover {
  color: var(--accent-hot);
  background: var(--accent-soft);
}

.btn-outline {
  background: #fff;
  border: 1.5px solid var(--teal);
  color: var(--teal);
}

.btn-outline:hover {
  background: var(--teal-soft);
  border-color: var(--teal-hot);
  color: var(--teal-hot);
}

.btn-ghost-light {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
}

.btn-ghost-light:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.text-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
}

.cat-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  line-height: 1;
}

.cat-badge-sm {
  font-size: 0.62rem;
  padding: 0.22rem 0.45rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  color: var(--nav-text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.header-bar {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}

.brand-mark {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
}

.nav-desktop {
  display: none;
  align-items: stretch;
  min-width: 0;
  margin-left: auto;
  gap: 0.15rem;
}

.nav-desktop > a,
.nav-drop-trigger {
  appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  padding: 0 0.8rem;
  min-height: var(--header-h);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  border-radius: 0;
}

.nav-desktop > a:hover,
.nav-drop-trigger:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-desktop > a[aria-current="page"],
.nav-drop.is-open .nav-drop-trigger {
  color: #fff;
  background: transparent;
}

.nav-desktop > a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.9rem;
  height: 3px;
  background: var(--teal);
  border-radius: 2px;
}

.nav-drop {
  position: relative;
  display: flex;
}

.nav-caret {
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.15s var(--ease);
}

.nav-drop.is-open .nav-caret {
  transform: rotate(225deg) translateY(-1px);
}

.nav-drop-panel {
  display: none;
  position: absolute;
  top: calc(100% - 0.35rem);
  left: 0;
  min-width: 15rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 80;
  overflow: hidden;
}

.nav-drop.is-open .nav-drop-panel {
  display: grid;
  animation: dropIn 0.16s var(--ease);
}

.nav-drop-panel a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.7rem 0.95rem;
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--line);
}

.nav-drop-panel a:last-child {
  border-bottom: 0;
}

.nav-drop-panel a:hover,
.nav-drop-panel a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-hot);
}

.nav-tools {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 0.35rem;
  flex-shrink: 0;
}

.header-cta {
  display: none;
  min-height: 2.35rem;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 8px;
}

.nav-toggle {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  position: relative;
}

.nav-toggle-bars::before {
  position: absolute;
  top: -5px;
}

.nav-toggle-bars::after {
  position: absolute;
  top: 5px;
}

.mobile-drawer {
  background: #111;
  border-top: 1px solid #333;
  padding: 0.65rem 0 1.1rem;
}

.mobile-drawer[hidden] {
  display: none !important;
}

.mobile-drawer a,
.mobile-topics summary {
  display: block;
  padding: 0.7rem 0.15rem;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.mobile-topics summary {
  cursor: pointer;
  list-style: none;
}

.mobile-topics summary::-webkit-details-marker {
  display: none;
}

.mobile-topics-list {
  padding: 0 0 0.35rem 0.85rem;
}

.mobile-topics-list a {
  color: #bbb;
  font-weight: 500;
}

@media (min-width: 960px) {
  .nav-desktop {
    display: flex;
  }

  .nav-tools {
    margin-left: 0.35rem;
  }

  .nav-toggle,
  .mobile-drawer {
    display: none !important;
  }

  .header-cta {
    display: inline-flex;
  }
}

@media (max-width: 420px) {
  .brand-text {
    font-size: 0.88rem;
  }
}

/* ---------- Home portal ---------- */
.btn-link-teal,
.btn-link-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.btn-link-teal:hover,
.btn-link-accent:hover {
  color: var(--accent-hot);
}
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 0.4rem 0.2rem;
}

.btn-link-teal:hover {
  color: var(--teal-hot);
}

.portal-hero {
  display: grid;
  gap: 2rem;
  padding: 3.25rem 0 2.5rem;
  align-items: center;
}

.portal-hero-copy {
  max-width: 30rem;
}

.portal-hero-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.22;
  color: var(--nav-bg);
}

.portal-hero-lead {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 27rem;
}

.portal-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.1rem;
}

.portal-hero-actions .btn-teal {
  min-height: 2.9rem;
  padding: 0.7rem 1.3rem;
  border-radius: 12px;
  font-weight: 700;
}

.portal-featured {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.portal-feat-main,
.portal-feat-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: #fff;
  background: #0f2744;
  box-shadow: var(--shadow-soft);
  isolation: isolate;
}

.portal-feat-main {
  min-height: 22rem;
  aspect-ratio: 3 / 4;
}

.portal-feat-card {
  min-height: 10.5rem;
  aspect-ratio: 16 / 10;
}

.portal-feat-main img,
.portal-feat-card img,
.portal-feat-main .thumb-fallback,
.portal-feat-card .thumb-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 22%;
  z-index: 0;
  transition: transform 0.55s var(--ease);
}

.portal-feat-main:hover img,
.portal-feat-card:hover img {
  transform: scale(1.04);
}

.portal-feat-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8, 20, 36, 0.02) 20%, rgba(8, 20, 36, 0.35) 55%, rgba(8, 20, 36, 0.82) 100%);
  pointer-events: none;
}

.portal-feat-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  gap: 0.4rem;
  padding: 1.15rem 1.1rem 1.05rem;
}

.portal-chip {
  display: inline-flex;
  align-self: start;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--chip);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.portal-cat {
  display: inline-block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-feat-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.9vw, 1.4rem);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portal-feat-title-sm {
  font-size: 1rem;
  -webkit-line-clamp: 2;
}

.portal-feat-side {
  display: grid;
  gap: 0.85rem;
}

.portal-body {
  display: grid;
  gap: 2rem;
  padding: 0.5rem 0 2.5rem;
  align-items: start;
}

.portal-main {
  display: grid;
  gap: 2.5rem;
  min-width: 0;
}

.portal-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.portal-section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.1vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--nav-bg);
}

.portal-section-head-line h2 {
  position: relative;
  padding-bottom: 0.45rem;
}

.portal-section-head-line h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.6rem;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.portal-more {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.portal-more:hover {
  color: var(--accent-hot);
}

.portal-topic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.portal-topic-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 1.05rem 1rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.portal-topic-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.portal-topic-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tone-rose .portal-topic-icon { background: #fde8ea; color: #e84855; }
.tone-violet .portal-topic-icon { background: #ede8f7; color: #7b5ea7; }
.tone-coral .portal-topic-icon { background: #fff0e8; color: #e87048; }
.tone-plum .portal-topic-icon { background: #f0ebf5; color: #2d2640; }
.tone-teal .portal-topic-icon { background: #e8f5f4; color: #2a9d8f; }
.tone-blue .portal-topic-icon { background: #e8eef7; color: #4a6fa5; }
.tone-green .portal-topic-icon { background: #e8f7ee; color: #2d8a6e; }
.tone-amber .portal-topic-icon { background: #fef6e8; color: #c4860a; }

.portal-hero-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.portal-feat-main.tone-rose { background: linear-gradient(145deg, #e84855 0%, #7b5ea7 100%); }
.portal-feat-card.tone-violet { background: linear-gradient(145deg, #7b5ea7 0%, #2d2640 100%); }
.portal-feat-card.tone-coral { background: linear-gradient(145deg, #e87048 0%, #e84855 100%); }

.portal-feat-main:not(:has(img)) .portal-feat-shade,
.portal-feat-card:not(:has(img)) .portal-feat-shade {
  background: linear-gradient(180deg, rgba(45, 38, 64, 0.05) 20%, rgba(45, 38, 64, 0.45) 55%, rgba(45, 38, 64, 0.85) 100%);
}

.portal-topic-body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.portal-topic-body strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-topic-body span {
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portal-topic-arrow {
  color: #a0adbb;
  font-size: 1.45rem;
  line-height: 1;
}

.portal-digest {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.2rem 1.35rem;
  box-shadow: var(--shadow-soft);
}

.portal-latest-lead {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.portal-latest-lead-media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
}

.portal-latest-lead-media img,
.portal-latest-lead-media .thumb-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.portal-latest-lead-body h3 {
  margin: 0.4rem 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
}

.portal-latest-lead-body h3 a,
.portal-latest-row-body h3 a {
  color: var(--ink);
  text-decoration: none;
}

.portal-latest-lead-body h3 a:hover,
.portal-latest-row-body h3 a:hover {
  color: var(--accent);
}

.portal-meta {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.portal-latest-grid {
  display: grid;
  gap: 1rem;
}

.portal-latest-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.85rem;
  align-items: start;
}

.portal-latest-row-media {
  position: relative;
  display: block;
  width: 88px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg-soft);
}

.portal-latest-row-media img,
.portal-latest-row-media .thumb-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.portal-latest-row-body h3 {
  margin: 0.25rem 0 0.3rem;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portal-side {
  display: grid;
  gap: 1.1rem;
  align-content: start;
}

.portal-uu {
  position: relative;
  display: grid;
  gap: 0.55rem;
  justify-items: start;
  padding: 1.4rem 1.25rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 88% 18%, rgba(25, 144, 152, 0.16) 0 18%, transparent 19%),
    radial-gradient(circle at 78% 42%, rgba(25, 144, 152, 0.1) 0 10%, transparent 11%),
    linear-gradient(160deg, #e8f8f8 0%, #dff4f4 55%, #e6f6f7 100%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.portal-uu-kicker {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--teal);
}

.portal-uu-mark {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.portal-uu-title {
  margin: 0.2rem 0 0;
  max-width: 14rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--teal-hot);
}

.portal-uu-text {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--teal);
}

.portal-uu-note {
  margin: 0 0 0.55rem;
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.portal-service {
  padding: 1.35rem 1.25rem;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid #dceaf8;
  display: grid;
  gap: 0.55rem;
}

.portal-service-ico {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  background: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-service-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.portal-service h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--nav-bg);
}

.portal-service p {
  margin: 0 0 0.35rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.portal-trust {
  padding: 0 0 3rem;
}

.portal-trust-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.25rem;
  padding: 1.35rem 1.25rem;
  background: #eef4fa;
  border-radius: var(--radius-lg);
}

.portal-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.portal-trust-item strong {
  display: block;
  color: var(--nav-bg);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.portal-trust-item small {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.portal-trust-ico {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
}

.thumb-fallback {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background:
    linear-gradient(135deg, #e8eef5, #d5dee8),
    repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(25, 144, 152, 0.05) 8px, rgba(25, 144, 152, 0.05) 16px);
}

@media (min-width: 720px) {
  .portal-topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portal-latest-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portal-latest-lead {
    grid-template-columns: 1.05fr 1.2fr;
    align-items: center;
  }

  .portal-trust-inner {
    grid-template-columns: repeat(4, 1fr);
    padding: 1.5rem 1.5rem;
  }
}

@media (min-width: 980px) {
  .portal-hero {
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.22fr);
    gap: 2.5rem;
    padding: 3.5rem 0 3rem;
  }

  .portal-featured {
    grid-template-columns: 1.25fr 1fr;
    gap: 0.85rem;
    min-height: 30rem;
  }

  .portal-feat-main {
    min-height: 30rem;
    height: 100%;
    aspect-ratio: auto;
  }

  .portal-feat-side {
    height: 100%;
    grid-template-rows: 1fr 1fr;
  }

  .portal-feat-card {
    min-height: 0;
    height: 100%;
    aspect-ratio: auto;
  }

  .portal-body {
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.72fr);
    gap: 1.5rem;
  }

  .portal-topic-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .portal-side {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }
}

/* ---------- Shared cards / pages ---------- */
.section {
  padding: 2.5rem 0;
}

.section-soft {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.page-intro {
  padding: 2rem 0 1rem;
}

.page-intro h1,
.section-head h2,
.author-card h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-lead {
  margin: 0;
  color: var(--ink-muted);
  max-width: 40rem;
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.mag-card {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.mag-card-media {
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
}

.mag-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.mag-card:hover .mag-card-media img {
  transform: scale(1.04);
}

.mag-card-fallback {
  width: 100%;
  height: 100%;
  min-height: 10rem;
  background: linear-gradient(135deg, #eee, #ddd);
}

.mag-card-body {
  padding: 0.9rem 1rem 1.1rem;
  display: grid;
  gap: 0.3rem;
}

.mag-card-kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.mag-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
}

.mag-card-title a {
  color: inherit;
  text-decoration: none;
}

.mag-card-title a:hover {
  color: var(--accent);
}

.mag-card-excerpt,
.mag-card-meta {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.mag-grid-rest {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .mag-grid-rest {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  .mag-grid-rest {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cta-band {
  margin: 2rem 0 0;
  padding: 2.5rem 0;
  background: var(--nav-bg);
  color: #fff;
}

.cta-band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.cta-band h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.cta-band p {
  margin: 0;
  opacity: 0.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* Articles */
.articles-layout {
  display: grid;
  gap: 2rem;
}

.filter-rail {
  display: grid;
  gap: 1.25rem;
  align-content: start;
}

.search-form {
  display: grid;
  gap: 0.55rem;
}

.search-form input {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  background: var(--surface);
}

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.chip:hover,
.chip.is-active,
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
}

@media (min-width: 900px) {
  .articles-layout {
    grid-template-columns: 220px 1fr;
  }
}

/* Article detail */
.breadcrumbs {
  padding: 1rem 0 0;
  font-size: 0.88rem;
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--ink-muted);
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  opacity: 0.5;
}

.breadcrumbs a {
  text-decoration: none;
  color: var(--ink-muted);
}

.article-layout {
  display: grid;
  gap: 2rem;
  padding-bottom: 2rem;
}

.article-header h1 {
  margin: 0.55rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

/* Author byline — avatar + "Name ใน Category" / date (NHTD-style) */
.byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  min-width: 0;
}

.byline-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line);
}

.byline-avatar-fallback,
.article-author-avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
}

.byline-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.byline-line {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--ink-muted);
}

.byline-name,
.byline-cat {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

a.byline-name:hover,
a.byline-cat:hover {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.byline-in {
  color: var(--ink-muted);
  font-weight: 400;
}

.byline-date {
  font-size: 0.84rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

.article-header > .byline {
  margin: 0 0 1.15rem;
}

.article-header > .byline .byline-avatar {
  width: 52px;
  height: 52px;
}

.article-header > .byline .byline-line {
  font-size: 1rem;
}

.article-header > .byline .byline-name {
  font-weight: 800;
}

.mag-card-body .byline,
.byline.byline-compact {
  margin: 0.35rem 0 0;
}

.mag-card-body .byline-avatar,
.byline.byline-compact .byline-avatar {
  width: 34px;
  height: 34px;
  box-shadow: 0 0 0 1px var(--line);
}

.mag-card-body .byline-line,
.byline.byline-compact .byline-line {
  font-size: 0.84rem;
}

.mag-card-body .byline-date,
.byline.byline-compact .byline-date {
  font-size: 0.78rem;
}

.article-author-box {
  display: grid;
  gap: 1.15rem;
  margin: 2.25rem 0 1.5rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%);
  box-shadow: var(--shadow);
}

.article-author-avatar-link {
  display: inline-block;
  width: fit-content;
  border-radius: 50%;
  line-height: 0;
}

.article-author-avatar {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent-soft), 0 8px 20px rgba(0, 0, 0, 0.08);
}

.article-author-avatar-fallback {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  font-size: 1.6rem;
}

.article-author-label {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.article-author-name {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.article-author-name a {
  color: inherit;
  text-decoration: none;
}

.article-author-name a:hover {
  color: var(--accent);
}

.article-author-bio {
  margin: 0 0 0.85rem;
  color: var(--ink-muted);
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 40rem;
}

@media (min-width: 560px) {
  .article-author-box {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
}

.article-meta,
.eeat-byline,
.eeat-trust-notice {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.eeat-trust-notice {
  padding: 0.7rem 0.85rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}

.article-detail {
  overflow: visible;
}

.article-main {
  min-width: 0;
  max-width: 100%;
}

.article-hero-img {
  margin: 0 0 1.25rem;
  overflow: hidden;
}

.article-hero-img img {
  width: 100%;
  height: auto;
  display: block;
}

.prose,
.article-body {
  font-size: 1.05rem;
  overflow: visible;
  max-width: 100%;
}

.prose h2,
.article-body h2,
.topic-prose h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2rem;
}

.prose .wp-block-image,
.article-body .wp-block-image,
.prose figure,
.article-body figure {
  margin: 1.25rem 0;
  max-width: 100%;
}

.prose img,
.article-body img {
  border-radius: var(--radius);
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.prose .aligncenter,
.article-body .aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.table-scroll,
.knowledge-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.prose table,
.knowledge-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose th,
.prose td,
.knowledge-table-wrap th,
.knowledge-table-wrap td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  text-align: left;
}

.prose th,
.knowledge-table-wrap th {
  background: var(--bg-soft);
}

.article-toc {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 1rem 1.15rem;
  margin: 1.2rem 0;
}

.article-ad {
  margin: 1.5rem 0;
  padding: 0.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  text-align: center;
}

.article-ad-top {
  margin: 0 0 1.5rem;
}

.article-ad a,
.aside-promo {
  display: block;
  text-decoration: none;
}

.article-ad img,
.aside-promo img {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
  object-fit: contain;
}

.aside-promo-wrap {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  padding: 0.85rem;
  border: 1px solid var(--line);
  background: var(--bg);
}

.article-disclaimer {
  margin-top: 2.4rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.article-aside {
  display: grid;
  gap: 1.2rem;
  align-content: start;
}

.aside-block {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.aside-list {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.aside-list a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.related-block {
  margin-top: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.related-block h2 {
  font-family: var(--font-display);
  margin: 0 0 1.15rem;
  font-weight: 800;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

/* Author / About / FAQ / Contact / Knowledge */
.author-card {
  display: grid;
  gap: 1.15rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
}

.author-avatar {
  width: 5.75rem;
  height: 5.75rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent-soft), 0 8px 20px rgba(0, 0, 0, 0.08);
}

@media (min-width: 640px) {
  .author-card {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
}

.about-stack {
  display: grid;
  gap: 1.1rem;
}

.prose-panel,
.value-list,
.eeat-panel,
.privacy-section {
  padding: 1.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.value-list ol {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.5rem;
}

.eeat-grid {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 0;
}

.eeat-grid dt {
  font-weight: 800;
  font-family: var(--font-display);
}

.eeat-grid dd {
  margin: 0.2rem 0 0;
  color: var(--ink-muted);
}

@media (min-width: 800px) {
  .eeat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.faq-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.15rem;
}

.faq-accordion {
  display: grid;
  gap: 0.55rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0 1rem;
}

.faq-item[hidden] {
  display: none !important;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 0.95rem 0;
  font-weight: 700;
  font-family: var(--font-display);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-a {
  padding: 0 0 1rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
}

.faq-a p {
  margin: 0.8rem 0 0;
}

/* ---------- Static pages: editorial desk pattern ---------- */
.static-mast {
  position: relative;
  margin-bottom: 0;
  padding: 1.75rem 0 2rem;
  background:
    radial-gradient(circle at 92% 18%, rgba(30, 107, 184, 0.16), transparent 36%),
    linear-gradient(180deg, #eef4fa 0%, #fff 78%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.static-mast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}

.static-mast-inner {
  position: relative;
  text-align: left;
  margin-inline: auto;
}

.static-mast-inner > * {
  max-width: 40rem;
}

.static-crumbs {
  margin: 0 0 0.85rem;
}

.static-crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.static-crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  opacity: 0.55;
}

.static-crumbs a {
  color: var(--ink-muted);
  text-decoration: none;
}

.static-crumbs a:hover {
  color: var(--accent);
}

.static-mast-brand {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
}

.static-mast-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.static-mast-lead {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.static-desk {
  display: grid;
  gap: 2rem;
  padding: 2rem 0 3.25rem;
}

.static-desk-stack {
  display: grid;
  gap: 2.5rem;
}

.static-desk-main {
  min-width: 0;
}

.static-kicker {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
}

.static-email {
  display: inline-block;
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid var(--accent);
}

.static-email:hover {
  color: var(--accent);
}

.static-copy {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 34rem;
}

.static-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.static-desk-side {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.static-note {
  padding: 1.15rem 1.2rem;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
}

.static-note-soft {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
}

.static-note h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
}

.static-note p {
  margin: 0 0 0.65rem;
  color: var(--ink-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.static-note p:last-child {
  margin-bottom: 0;
}

.static-statement {
  max-width: 44rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.static-statement-text {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}

.static-prose {
  margin-top: 1rem;
}

.static-value-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.static-value-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.static-value-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.static-value-list span {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--accent);
}

.static-value-list strong {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
}

.static-eeat-head {
  max-width: 40rem;
  margin-bottom: 1rem;
}

.static-eeat-head p:last-child {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
}

.static-eeat-list {
  margin: 0;
  display: grid;
  gap: 1rem;
}

.static-eeat-list > div {
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.static-eeat-list dt {
  font-family: var(--font-display);
  font-weight: 800;
  margin: 0 0 0.25rem;
}

.static-eeat-list dd {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.static-faq-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.25rem;
}

.static-faq-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.65rem 0;
  font: inherit;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.static-faq-tab.is-active,
.static-faq-tab:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.static-faq-list {
  display: grid;
}

.static-faq-item {
  border-bottom: 1px solid var(--line);
  padding: 0.2rem 0;
}

.static-faq-item[hidden] {
  display: none;
}

.static-faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 0;
  display: grid;
  gap: 0.25rem;
}

.static-faq-item summary::-webkit-details-marker {
  display: none;
}

.static-faq-cat {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.static-faq-q {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
}

.static-faq-a {
  padding: 0 0 1.15rem;
}

.static-faq-a p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.7;
  max-width: 40rem;
}

.static-toc ol {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.55rem;
}

.static-toc a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.4;
}

.static-toc a:hover {
  color: var(--accent);
}

.static-doc-intro {
  margin: 0 0 1.5rem;
  color: var(--ink-muted);
  line-height: 1.7;
  font-size: 1.02rem;
}

.static-doc-section {
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}

.static-doc-section h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
}

.static-doc-num {
  color: var(--accent);
  font-size: 0.95rem;
}

.static-doc-section p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.7;
}

.static-doc-intro-block h2,
.static-doc-section h2 {
  margin-bottom: 0.65rem;
}

.static-doc-intro-block p {
  margin: 0 0 0.85rem;
  color: var(--ink-muted);
  line-height: 1.7;
}

.static-doc-intro-block p:last-child {
  margin-bottom: 0;
}

.static-ref-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.4rem;
}

.static-topic-list {
  display: grid;
  margin-top: 0.75rem;
}

.static-topic-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.static-topic-row:last-child {
  border-bottom: 1px solid var(--line);
}

.static-topic-row:hover {
  color: var(--accent);
}

.static-topic-num {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--accent);
}

.static-topic-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.static-topic-body strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}

.static-topic-row:hover .static-topic-body strong {
  color: var(--accent);
}

.static-topic-body span {
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.static-topic-go {
  color: var(--accent);
  font-weight: 800;
}

.static-topic-row:not(:has(.static-topic-num)) {
  grid-template-columns: 1fr auto;
}

@media (min-width: 900px) {
  .static-desk:not(.static-desk-stack) {
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.75fr);
    gap: 2.5rem;
    align-items: start;
  }

  .static-desk:not(.static-desk-stack) .static-toc {
    order: 0;
  }

  .static-desk:not(.static-desk-stack) .static-doc {
    order: 1;
  }

  .static-value-list {
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }

  .static-value-list li:nth-child(odd) {
    padding-right: 1rem;
  }

  .static-value-list li:nth-child(even) {
    padding-left: 1rem;
    border-left: 1px solid var(--line);
  }

  .static-eeat-list {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 2rem;
  }

  .static-desk-side.static-toc {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }
}

/* Privacy: TOC left, doc right on desktop */
@media (min-width: 900px) {
  .static-desk:has(.static-toc) {
    grid-template-columns: minmax(200px, 0.7fr) minmax(0, 1.4fr);
  }
}

.hub-mosaic,
.topic-mosaic {
  display: grid;
  gap: 0.8rem;
}

.hub-card,
.topic-tile {
  display: grid;
  gap: 0.35rem;
  padding: 1.15rem;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.hub-card:hover,
.topic-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.hub-tag,
.topic-tile-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.hub-card h2,
.topic-tile strong {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.hub-card p,
.topic-tile-lead {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

@media (min-width: 720px) {
  .hub-mosaic,
  .topic-mosaic {
    grid-template-columns: repeat(2, 1fr);
  }

  .topic-mosaic-compact {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .hub-mosaic {
    grid-template-columns: repeat(3, 1fr);
  }
}

.topic-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.5rem;
}

.topic-jump a {
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.topic-jump a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.topic-refs ul,
.topic-others {
  margin-top: 2rem;
}

.footer-label {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Footer */
.site-footer {
  margin-top: 2.5rem;
  padding: 2.5rem 0 0;
  background: var(--nav-bg);
  color: rgba(255, 255, 255, 0.8);
}

.footer-inner {
  display: grid;
  gap: 1.75rem;
  padding-bottom: 1.75rem;
}

.footer-brand-name {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.footer-brand-desc {
  margin: 0;
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.65);
}

.footer-cols {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: 1fr 1fr;
}

.footer-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.footer-cols a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.footer-cols a:hover {
  color: #fff;
}

.footer-base {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.9rem 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-base p {
  margin: 0;
}

@media (min-width: 800px) {
  .footer-inner {
    grid-template-columns: 1.4fr 1fr;
  }
}

.empty-note {
  padding: 1.4rem;
  border: 1px dashed var(--line);
  color: var(--ink-muted);
  background: var(--bg-soft);
}

.notfound {
  text-align: center;
  padding: 5rem 0 6rem;
}

/* Motion */
@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .nav-drop-panel,
  .mobile-drawer,
  .mag-strip-card img,
  .mag-hero-link img,
  .mag-card-media img,
  .home-banner-media,
  .home-banner-inner,
  .home-banner-brand::after,
  .cookie-consent-inner {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  .home-banner-media {
    transform: none;
  }
}

/* Cookie consent — slim PDPA bar */
.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  padding: 0.75rem 1rem;
  pointer-events: none;
}

.cookie-consent[hidden] {
  display: none !important;
}

.cookie-consent-inner {
  pointer-events: auto;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
  padding: 0.85rem 1.15rem;
  background: #fff;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 -8px 28px rgba(16, 45, 78, 0.12);
  animation: cookie-in 0.35s var(--ease) both;
}

.cookie-consent-title {
  margin: 0 0 0.15rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.cookie-consent-desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-muted);
  max-width: 42rem;
}

.cookie-consent-desc a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cookie-consent-actions .btn {
  min-height: 2.35rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
}

.cookie-consent-actions .btn-ghost-light {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.cookie-consent-actions .btn-ghost-light:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

@keyframes cookie-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

body.has-cookie-consent {
  padding-bottom: 6.5rem;
}

@media (max-width: 720px) {
  .cookie-consent {
    padding: 0;
  }

  .cookie-consent-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    min-height: 0;
    border-radius: 16px 16px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 1rem 1.1rem 1.15rem;
  }

  .cookie-consent-actions {
    width: 100%;
  }

  .cookie-consent-actions .btn {
    flex: 1;
  }

  body.has-cookie-consent {
    padding-bottom: 10rem;
  }
}

/* =========================================================
   Koidoo home composition — hero / topic dock / digest / trust
   ========================================================= */

.portal-hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #f5fafc;
  background: #152a3a;
}

.portal-hero-plane {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(232, 145, 90, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 50% at 15% 80%, rgba(90, 160, 190, 0.28), transparent 50%),
    linear-gradient(160deg, #152a3a 0%, #1c3a4d 45%, #243f52 100%);
  animation: heroGlow 12s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  from { filter: saturate(1); transform: scale(1); }
  to { filter: saturate(1.08); transform: scale(1.03); }
}

.portal-hero-inner {
  position: relative;
  z-index: 1;
  padding: 7rem 0 3.5rem;
}

.portal-hero-brand {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #fff;
}

.portal-hero-title {
  margin: 0 0 1rem;
  max-width: 18ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.2vw, 2.1rem);
  line-height: 1.25;
  color: #fff1e8;
}

.portal-hero-lead {
  margin: 0 0 1.75rem;
  max-width: 38ch;
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(245, 250, 252, 0.88);
}

.portal-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 1.5px solid rgba(245, 250, 252, 0.45);
  color: #f5fafc;
  background: transparent;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn-ghost:hover {
  background: rgba(245, 250, 252, 0.1);
  border-color: #f5fafc;
  color: #fff;
}

.section {
  padding: 3.25rem 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-link {
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.topic-dock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.topic-card {
  display: grid;
  gap: 0.45rem;
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  color: inherit;
}

.topic-card-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.topic-card-blurb {
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.topic-card-icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: var(--accent-soft);
  margin-bottom: 0.25rem;
}

.tone-apricot .topic-card-icon { background: #fff1e8; }
.tone-sky .topic-card-icon { background: #e5f2f8; }
.tone-mint .topic-card-icon { background: #e7f6ef; }
.tone-coral .topic-card-icon { background: #fde8ea; }
.tone-cobalt .topic-card-icon { background: #dbe7f0; }
.tone-amber .topic-card-icon { background: #fff4df; }

.digest-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
}

.digest-lead {
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.digest-lead:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: inherit;
}

.digest-lead-img,
.digest-lead-fallback {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background:
    linear-gradient(135deg, #1c3a4d, #e8915a 120%);
}

.digest-lead-copy {
  padding: 1.2rem 1.25rem 1.4rem;
}

.digest-meta,
.digest-item-meta {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.digest-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.digest-excerpt {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.digest-list {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.digest-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.digest-item:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: #fffaf6;
  color: inherit;
}

.digest-item-title {
  font-weight: 700;
  line-height: 1.35;
}

.empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px dashed var(--line);
}

.empty-state h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.empty-state p {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
}

.trust-band {
  margin-top: 1rem;
  padding: 3rem 0 3.5rem;
  background:
    linear-gradient(180deg, transparent, rgba(232, 145, 90, 0.08)),
    var(--bg-soft);
}

.trust-band-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: stretch;
}

.trust-copy,
.trust-fact {
  padding: 1.6rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.trust-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.trust-lead {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
  max-width: 42ch;
}

.trust-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.trust-fact-label {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-hot);
}

.trust-fact-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.trust-fact-text,
.trust-fact-note {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.btn-link-accent {
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 900px) {
  .topic-dock,
  .digest-grid,
  .trust-band-inner {
    grid-template-columns: 1fr;
  }

  .portal-hero-inner {
    padding-top: 6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-hero-plane,
  .topic-card,
  .digest-lead {
    animation: none !important;
    transition: none !important;
  }
}
