/* Base (F1 WP-1): the page, Bootstrap's variables mapped onto the tokens, the layout frame,
   focus, the skip link, buttons and the search field. Semantic tokens only. */

:root {
  --bs-body-bg: var(--color-paper);
  --bs-body-color: var(--color-ink);
  --bs-body-font-family: var(--font-sans);
  --bs-body-font-size: var(--text-base);
  --bs-body-line-height: var(--leading);
  --bs-border-color: var(--color-line);
  --bs-link-color: var(--color-accent);
  --bs-link-color-rgb: 44, 52, 216;
  --bs-link-hover-color: var(--color-accent-hover);
  --bs-link-hover-color-rgb: 31, 37, 143;
  --bs-emphasis-color: var(--color-ink);
  --bs-secondary-color: var(--color-ink-muted);
  --bs-font-monospace: var(--font-mono);
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  font-kerning: normal;
  overflow-wrap: break-word;
}

main { flex: 1 0 auto; }

/* The frame: one column, a 16 px gutter at every width, never wider than the page. */
.frame {
  width: 100%;
  max-width: calc(var(--page-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.frame--narrow { max-width: calc(48rem + 2 * var(--gutter)); }
.page { padding-block: var(--space-3) var(--space-5); }

img, svg { max-width: 100%; height: auto; }

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

:focus-visible { outline: var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: var(--weight-semibold);
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 0; color: var(--color-accent-ink); }

/* Buttons: the primary action is the accent, the secondary an outline in ink. */
.btn-gf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-ink);
  font: var(--weight-semibold) var(--text-sm) / 1.2 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn-gf:hover { border-color: var(--color-ink-muted); color: var(--color-ink); text-decoration: none; }
.btn-gf--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.btn-gf--primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: var(--color-accent-ink); }
.btn-gf--small { min-height: 2rem; padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.ext::after { content: "\00a0\2197"; }   /* ↗ after a link that leaves the site */

/* The reader's controls on the public pages (F7 UI-2, D-18): Save and Follow, in the page as
   links, for a signed-in reader swapped for toggles; a list row's star slot is empty until then.
   The star is quiet, like the row's other actions (D-38). */
.ctl { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.ctl__icon { width: 18px; height: 18px; flex: none; }
.ctl__plus, .ctl__tick { font-weight: var(--weight-bold); line-height: 1; }
.ctl.is-on .ctl__button { border-color: var(--color-accent); background: var(--color-accent-tint); color: var(--color-ink); }
.ctl__note { flex-basis: 100%; font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--color-ink-soft); white-space: normal; }
.ctl--star:empty { display: none; }
.ctl__star {
  display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-ink-muted); cursor: pointer;
  transition: color var(--motion) ease, background-color var(--motion) ease;
}
.ctl__star:hover { color: var(--color-accent); background: var(--color-accent-soft); }
.ctl.is-on .ctl__star { color: var(--color-accent); }
/* The pin (F7 UI-7): on an index card, quiet like the star; the display slots hide until filled. */
.ctl__pin { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-ink-muted); cursor: pointer; transition: color var(--motion) ease, background-color var(--motion) ease; }
.ctl__pin:hover { color: var(--color-accent); background: var(--color-accent-soft); }
.ctl.is-on .ctl__pin { color: var(--color-accent); }
.ctl--pin:empty, .pins:empty { display: none; }

/* What a free account adds (F7 D-22). */
.benefits { display: grid; gap: var(--space-3); margin: var(--space-4) 0; }
.benefit { padding: var(--space-4); border: 1px solid var(--color-line); border-left: 4px solid var(--color-highlight); border-radius: var(--radius); background: var(--color-surface); }
.benefit__name { margin-bottom: var(--space-1); }
.benefit__value { margin: 0; color: var(--color-ink-soft); }
.benefits__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* The search field (the header's, the home page's large one): the glass drawn as a line
   icon inside the field — an echo of the logo, not a copy of it. */
.search { display: flex; width: 100%; }
.search__field { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.search__icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--color-ink-muted);
  pointer-events: none;
}
.search__input {
  width: 100%;
  min-width: 0;
  height: 2.5rem;
  padding: 0 var(--space-3) 0 2.5rem;
  border: 1px solid var(--color-line-strong);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--color-surface);
  color: var(--color-ink);
  font: var(--text-sm) / 1 var(--font-sans);
}
.search__input::placeholder { color: var(--color-ink-muted); opacity: 1; }
.search__input:focus-visible { outline-offset: -1px; border-radius: var(--radius) 0 0 var(--radius); }
.search__input:focus-visible ~ .search__icon, .search__field:focus-within .search__icon { color: var(--color-accent); }
.search__button {
  flex: 0 0 auto;
  height: 2.5rem;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font: var(--weight-semibold) var(--text-sm) / 1 var(--font-sans);
  cursor: pointer;
}
.search__button:hover { background: var(--color-accent-hover); }
.search--large .search__input, .search--large .search__button { height: 3rem; font-size: var(--text-base); }
.search--large .search__icon { width: 20px; height: 20px; }
.search--large .search__input { padding-left: 2.75rem; }

/* Motion: every transition is --motion long, and nothing moves for a reader who asked for less. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}

.visually-hidden-gf {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important; border: 0 !important;
}

/* The authority groups (F1 D-31): an element with data-group="<kind>" gets --group, its strip
   colour; .group-tag is the kind named beside a swatch of it. */
[data-group="presidency"] { --group: var(--color-group-presidency); }
[data-group="parliament"] { --group: var(--color-group-parliament); }
[data-group="chapter9"] { --group: var(--color-group-chapter9); }
[data-group="national_department"] { --group: var(--color-group-national_department); }
[data-group="regulator"] { --group: var(--color-group-regulator); }
[data-group="public_entity"] { --group: var(--color-group-public_entity); }
[data-group="board"] { --group: var(--color-group-board); }
[data-group="court"] { --group: var(--color-group-court); }
[data-group="other"] { --group: var(--color-group-other); }
.group-tag { display: inline-flex; align-items: center; gap: 0.4rem; }
.group-tag::before { content: ""; flex: none; width: 0.625rem; height: 0.625rem; border-radius: 2px; background: var(--group, var(--color-line-strong)); }
