/**
 * @file
 * Governance landing page — page--about-us--governance.
 *
 * Refined to an institutional, accessible standard (high contrast, generous
 * vertical rhythm, clear hierarchy, visible focus, reduced-motion aware) on the
 * WHO palette. CSS-only: it styles the editor-managed block HTML rendered in
 * each .gov-tab-body (one panel per governing body), so editors keep editing
 * content as usual. Tab UI is scoped via .gov-tabs.
 */

/* ── Tab navigation — institutional underline tabs (scoped to .gov-tabs) ───── */
.gov-tabs .topic-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 2px solid var(--who-gray-200);
  margin-bottom: 34px;
}

.gov-tabs .topic-tab-btn {
  position: relative;
  padding: 14px 22px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--who-gray-600);
  cursor: pointer;
  border-radius: var(--who-radius-sm) var(--who-radius-sm) 0 0;
  transition: color var(--who-transition), background var(--who-transition);
}

.gov-tabs .topic-tab-btn::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -2px;
  height: 2px;
  background: transparent;
  border-radius: 2px 2px 0 0;
  transition: background var(--who-transition);
}

.gov-tabs .topic-tab-btn:hover {
  color: var(--who-navy);
  background: var(--who-gray-50);
}

.gov-tabs .topic-tab-btn.is-active {
  color: var(--who-navy);
  font-weight: 700;
}

.gov-tabs .topic-tab-btn.is-active::after {
  background: var(--who-blue);
}

.gov-tabs .topic-tab-btn:focus-visible {
  outline: 3px solid var(--who-blue-25);
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .gov-tabs .topic-tabs-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .gov-tabs .topic-tabs-nav::-webkit-scrollbar { display: none; }
  .gov-tabs .topic-tab-btn { white-space: nowrap; flex: 0 0 auto; }
}

/* ── Prose — full container width, one harmonised text size ───────────────── */
.gov-tab-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--who-gray-700);
}
.gov-tab-body p,
.gov-tab-body li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--who-gray-700);
}
.gov-tab-body p { margin: 0 0 16px; }
.gov-tab-body a { color: var(--who-blue); }
.gov-tab-body a:hover { text-decoration: underline; }

/* Editors sometimes paste inline sizes (e.g. font-size:23px) — flatten them
   so every panel reads at the same size. */
.gov-tab-body [style*="font-size"] {
  font-size: inherit !important;
}

/* Legacy BS3 offset columns (.col-md-10.col-md-offset-1) squeezed and shifted
   the prose — neutralise them so panel content spans the full width. */
.gov-tab-body [class*="col-md-offset"] { margin-left: 0; }
.gov-tab-body .col-md-10,
.gov-tab-body .col-md-12 {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
}

/* Content heading inside a panel (e.g. "Next Health Assembly") */
.gov-tab-body .tab-content-title,
.gov-tab-body h3 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--who-navy);
  margin: 34px 0 14px;
}

/* Section eyebrow heading (e.g. "Useful documents") */
.gov-tab-body h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--who-navy);
  margin: 36px 0 16px;
}
.gov-tab-body h4::before {
  content: "";
  width: 26px;
  height: 3px;
  background: var(--who-gold);
  border-radius: 2px;
}

/* ── "Useful documents" link list → document cards ─────────────────────────── */
.gov-tab-body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.gov-tab-body ul li { margin: 0; }

.gov-tab-body ul li a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 38px 14px 16px;
  min-height: 60px;
  height: 100%;
  background: var(--who-white);
  border: 1px solid var(--who-gray-200);
  border-radius: var(--who-radius-md, 10px);
  font-size: 14px;
  font-weight: 600;
  color: var(--who-navy);
  text-decoration: none;
  line-height: 1.4;
  transition: border-color var(--who-transition), box-shadow var(--who-transition), transform var(--who-transition);
}
/* File icon (left) */
.gov-tab-body ul li a::before {
  content: "";
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230093d0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E") no-repeat center / 22px;
}
/* Chevron affordance (right) */
.gov-tab-body ul li a::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 16px;
  height: 16px;
  opacity: 0;
  transform: translateX(-4px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300205c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E") no-repeat center / 16px;
  transition: opacity var(--who-transition), transform var(--who-transition);
}
.gov-tab-body ul li a:hover {
  border-color: var(--who-blue);
  box-shadow: 0 6px 18px rgba(12, 43, 100, 0.10);
  transform: translateY(-2px);
  /* Text stays navy on hover — blue (#009ADE) on white is below 4.5:1. */
}
.gov-tab-body ul li a:hover::after { opacity: 1; transform: translateX(0); }
.gov-tab-body ul li a:focus-visible {
  outline: 3px solid var(--who-blue-25);
  outline-offset: 2px;
  border-color: var(--who-blue);
}

/* ── Subregion membership columns (.row > .col-md-4) ────────────────────────── */
.gov-tab-body .row {
  margin-top: 8px;
  row-gap: 18px;
}
.gov-tab-body .col-md-4 {
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}
.gov-tab-body .col-md-4 strong,
.gov-tab-body .col-md-4 h5,
.gov-tab-body h5 {
  display: inline-block;
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--who-navy);
}

/* ── Image + text (.img-left / .img-left-center) ───────────────────────────── */
.gov-tab-body .img-left img,
.gov-tab-body .img-left-center img {
  float: left;
  max-width: 40%;
  height: auto;
  margin: 4px 24px 14px 0;
  border-radius: var(--who-radius-md, 10px);
  border: 1px solid var(--who-gray-200);
}
.gov-tab-body .img-left::after,
.gov-tab-body .img-left-center::after { content: ""; display: block; clear: both; }

@media (max-width: 640px) {
  .gov-tab-body .img-left img,
  .gov-tab-body .img-left-center img { float: none; max-width: 100%; margin: 0 0 16px; }
}

/* ── File download / preview links → outlined document buttons ─────────────── */
.gov-tab-body .link-file-download,
.gov-tab-body .link-file-preview {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 44px;
  margin: 6px 10px 6px 0;
  padding: 11px 18px 11px 42px;
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1.3;
  color: var(--who-navy);
  background-color: var(--who-white);
  background-repeat: no-repeat;
  background-position: 16px center;
  background-size: 18px;
  border: 1.5px solid var(--who-gray-300);
  border-radius: var(--who-radius-sm, 8px);
  text-decoration: none;
  transition: border-color var(--who-transition), background-color var(--who-transition), color var(--who-transition);
}
.gov-tab-body .link-file-download {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300205c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
}
.gov-tab-body .link-file-preview {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300205c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.gov-tab-body .link-file-download:hover,
.gov-tab-body .link-file-preview:hover {
  border-color: var(--who-blue);
  background-color: var(--who-blue-light);
  /* Text stays navy on hover for AA contrast. */
}
.gov-tab-body .link-file-download:focus-visible,
.gov-tab-body .link-file-preview:focus-visible {
  outline: 3px solid var(--who-blue-25);
  outline-offset: 2px;
}
/* The buttons draw their own SVG icons; hide the legacy FontAwesome <i> tags
   (the fa font isn't loaded by who26, so they render as stray boxes). */
.gov-tab-body .link-file-download .fa,
.gov-tab-body .link-file-preview .fa,
.gov-tab-body .more-link .fa {
  display: none;
}

/* ── Session callout (.light-blue-background) → centered CTA banner ────────── */
.gov-tab-body .light-blue-background {
  position: relative;
  margin-top: 36px;
  padding: 34px 32px 30px;
  background: var(--who-blue-light);
  border: 1px solid rgba(0, 147, 208, 0.25);
  border-radius: var(--who-radius-md);
  text-align: center;
}
.gov-tab-body .light-blue-background h3 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--who-navy);
}
.gov-tab-body .light-blue-background p {
  color: var(--who-gray-800);
  margin: 0 auto 24px;
  max-width: 82ch;
}
/* Editors put each button in its own .more-link div: render them as
   inline-level flex boxes so they sit side by side, centered by the banner's
   text-align, with spacing that also holds when they wrap on mobile. */
.gov-tab-body .light-blue-background .more-link {
  display: inline-flex;
  margin: 10px 8px 0;
  vertical-align: middle;
}
/* Outside the callout, a .more-link stays a plain left-aligned button row. */
.gov-tab-body .more-link {
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Buttons inside panels ─────────────────────────────────────────────────── */
.gov-tab-body .more-link .btn,
.gov-tab-body .light-blue-background .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--who-radius-sm);
  text-decoration: none;
  background: var(--who-navy);
  color: var(--who-white);
  border: 1.5px solid var(--who-navy);
  transition: background var(--who-transition), color var(--who-transition), border-color var(--who-transition);
}
.gov-tab-body .more-link .btn:hover,
.gov-tab-body .light-blue-background .btn:hover {
  background: var(--who-blue);
  border-color: var(--who-blue);
}
.gov-tab-body .btn.btn-white-background {
  background: var(--who-white);
  color: var(--who-navy);
  border-color: var(--who-gray-300);
}
.gov-tab-body .btn.btn-white-background:hover {
  background: var(--who-navy);
  color: var(--who-white);
  border-color: var(--who-navy);
}
/* In the session callout, the first button is the primary action (solid navy)
   and the following ones stay outlined — hierarchy without touching the
   editor markup. */
.gov-tab-body .light-blue-background .more-link:first-of-type .btn {
  background: var(--who-navy);
  color: var(--who-white);
  border-color: var(--who-navy);
}
.gov-tab-body .light-blue-background .more-link:first-of-type .btn:hover {
  background: var(--who-blue);
  border-color: var(--who-blue);
}
.gov-tab-body .btn:focus-visible {
  outline: 3px solid var(--who-blue-25);
  outline-offset: 2px;
}

/* ── Respect reduced-motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .gov-tabs .topic-tab-btn,
  .gov-tab-body ul li a,
  .gov-tab-body ul li a::after,
  .gov-tab-body .link-file-download,
  .gov-tab-body .link-file-preview,
  .gov-tab-body .btn {
    transition: none;
  }
  .gov-tab-body ul li a:hover { transform: none; }
}
