/* ==========================================================================
   EUAPA — Eurooppapolitiikan asiantuntijapaneeli
   Theme stylesheet. Tokens sampled directly from ES2026 Web style guide.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  /* Blues — dominant, 60 % of surface colour */
  --es-blue:         #0155A4;
  --es-navy:         #1A366D;
  --es-indigo:       #172F88;
  --es-bright:       #0B8DE4;
  --es-sky:          #7AD2FF;

  /* Yellow — first accent, 30 % */
  --es-yellow:       #FFE500;
  --es-yellow-deep:  #E6CF00;
  --es-yellow-soft:  #FFF171;
  --es-yellow-pale:  #FFF5A4;

  /* Accent set — 10 %, used only as theme coding */
  --es-pink:         #D0005F;
  --es-purple:       #6975D0;
  --es-teal:         #41B8D5;
  --es-green:        #589189;

  /* Greys */
  --es-grey-700:     #4D5D87;
  --es-grey-500:     #7A86A5;
  --es-grey-300:     #A6AEC3;
  --es-grey-100:     #D3D7E1;

  /* Surfaces */
  --paper:           #FFFFFF;
  --paper-tint:      #F4F6FA;
  --paper-blue:      #E1F5FF;
  --rule:            #D3D7E1;
  --rule-strong:     #A6AEC3;

  /* Ink */
  --ink:             #1A366D;
  --ink-soft:        #4D5D87;
  --ink-invert:      #FFFFFF;

  /* Type */
  --font-display: "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-heading: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-meta:    "Poppins", system-ui, sans-serif;

  /* Rhythm */
  --measure: 68ch;
  --shell: 1240px;
  --shell-narrow: 860px;
  --gap: 1.5rem;
  --pad-section: clamp(3rem, 6vw, 5.5rem);
  --rule-lead: 4px;          /* the vertical rule carried from the logotype */

  --focus: 0 0 0 3px #FFE500, 0 0 0 6px #1A366D;
}

/* ---------- 2. Reset & base --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--es-blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { background: var(--es-sky); color: var(--es-navy); text-decoration-color: var(--es-navy); }
a:active { background: var(--es-navy); color: #fff; }
a:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* ---------- 3. Typography ------------------------------------------------ */
h1, .h1 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.625rem, 5.4vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
  margin: 0 0 1rem;
  color: var(--es-navy);
  text-wrap: balance;
  /* Finnish compounds regularly outrun a heading measure. Three layers:
     hyphens:auto breaks with a visible hyphen where the browser ships fi
     patterns; the reduced mobile size lets most compounds fit outright; and
     overflow-wrap is the last resort so nothing ever escapes the viewport. */
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}
h2, .h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 2.5rem 0 .75rem;
  color: var(--es-navy);
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}
h3, .h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 2rem 0 .5rem;
  color: var(--es-navy);
}
h4, .h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1.33;
  margin: 1.5rem 0 .5rem;
  color: var(--es-navy);
}
h5, .h5 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: .875rem;
  line-height: 1.29;
  margin: 1.25rem 0 .375rem;
  color: var(--es-navy);
}

p { margin: 0 0 1.1em; max-width: var(--measure); }

.ingress {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.4;
  color: var(--ink);
  max-width: 58ch;
}
.ingress strong { font-weight: 700; }

.small,
figcaption {
  font-family: var(--font-body);
  font-size: .8125rem;
  line-height: 1.4;
  color: var(--ink-soft);
}
figcaption { font-style: italic; padding-top: .5rem; }

.meta {
  font-family: var(--font-meta);
  font-size: .75rem;
  line-height: 1.17;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

blockquote {
  margin: 2rem 0;
  padding: .25rem 0 .25rem 1.5rem;
  border-left: var(--rule-lead) solid var(--es-yellow);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  line-height: 1.45;
}
blockquote p:last-child { margin-bottom: 0; }

/* ---------- 4. Layout shells -------------------------------------------- */
.shell { width: min(100% - 2.5rem, var(--shell)); margin-inline: auto; }
.shell-narrow { width: min(100% - 2.5rem, var(--shell-narrow)); margin-inline: auto; }

.section { padding-block: var(--pad-section); }
.section--tint { background: var(--paper-tint); }
.section--blue { background: var(--es-navy); color: #fff; }
.section--blue h2, .section--blue h3, .section--blue h4 { color: #fff; }
.section--blue a { color: var(--es-sky); }
.section--blue .meta { color: var(--es-sky); }

.stack > * + * { margin-top: 1rem; }

/* Section heading with the logotype rule carried through */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  padding-bottom: .875rem;
  margin-bottom: 2rem;
}
.section-head h2 { margin: 0; }
.section-head .eyebrow { margin-bottom: .375rem; }

.eyebrow {
  display: block;
  font-family: var(--font-meta);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--es-blue);
  margin-bottom: .5rem;
}
.section--blue .eyebrow { color: var(--es-sky); }

/* ---------- 5. Skip link ------------------------------------------------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--es-yellow); color: var(--es-navy);
  padding: .75rem 1.25rem; font-family: var(--font-meta); font-size: .875rem;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- 6. Header: association strip + main bar ---------------------- */
.site-header { position: sticky; top: 0; z-index: 100; }

.assoc-strip {
  background: var(--es-navy);
  color: #fff;
  font-family: var(--font-meta);
  font-size: .75rem;
  letter-spacing: .02em;
}
.assoc-strip__inner {
  display: flex; align-items: center; gap: 1rem;
  justify-content: space-between;
  min-height: 40px;
  padding-block: .375rem;
  flex-wrap: wrap;
}
.assoc-strip__note { display: flex; align-items: center; gap: .625rem; }
.assoc-strip__note span { opacity: .92; }
.assoc-strip a {
  color: #fff; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.45);
  padding-bottom: 1px;
}
.assoc-strip a:hover { color: #fff; border-bottom-color: var(--es-yellow); background: none; }
.assoc-strip__logo { height: 22px; width: auto; opacity: .95; }
.assoc-strip__parent {
  display: inline-flex; align-items: center; gap: .5rem;
  white-space: nowrap;
}


.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(26,54,109,.04);
}
.masthead__inner {
  display: flex; align-items: center; gap: 1.5rem;
  justify-content: space-between;
  min-height: 76px;
  padding-block: .75rem;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand:hover { background: none; }
.brand img { height: 44px; width: auto; }
.brand__fallback {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 700; line-height: .95; color: var(--es-blue);
  border-left: var(--rule-lead) solid var(--es-blue);
  padding-left: .75rem; font-size: 1.125rem;
}
.brand__fallback b { display: block; font-weight: 700; }
.brand__fallback span { display: block; font-weight: 400; letter-spacing: .01em; }

/* ---------- 7. Navigation ------------------------------------------------ */
.nav-cluster { display: flex; align-items: center; gap: 1.25rem; }

.primary-nav ul {
  display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0;
  align-items: center;
}
.primary-nav a {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .9375rem;
  color: var(--es-navy);
  text-decoration: none;
  padding: .5rem 0;
  display: inline-block;
  border-bottom: 3px solid transparent;
}
.primary-nav a:hover { background: none; color: var(--es-blue); border-bottom-color: var(--es-sky); }
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a,
.primary-nav .is-current > a {
  border-bottom-color: var(--es-yellow);
  color: var(--es-blue);
}

.nav-toggle {
  display: none;
  background: var(--es-navy); color: #fff; border: 0;
  font-family: var(--font-meta); font-size: .75rem; letter-spacing: .08em;
  text-transform: uppercase; padding: .625rem .875rem; cursor: pointer;
  align-items: center; gap: .5rem;
}
.nav-toggle__bars { display: inline-block; width: 16px; height: 10px; position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after,
.nav-toggle__bars span {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: #fff;
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars span { top: 4px; }
.nav-toggle__bars::after { bottom: 0; }

/* Language switcher */
.lang-switch { display: flex; align-items: center; gap: .125rem; }
.lang-switch a, .lang-switch span {
  font-family: var(--font-meta); font-size: .75rem; letter-spacing: .06em;
  text-transform: uppercase; padding: .3125rem .5rem; text-decoration: none;
  color: var(--ink-soft); border: 1px solid transparent;
}
.lang-switch a:hover { background: var(--es-sky); color: var(--es-navy); }
.lang-switch .is-active {
  background: var(--es-navy); color: #fff; font-weight: 600;
}
.lang-switch--strip a, .lang-switch--strip span { color: rgba(255,255,255,.75); border: 0; }
.lang-switch--strip a:hover { background: rgba(255,255,255,.14); color: #fff; }
.lang-switch--strip .is-active { background: #fff; color: var(--es-navy); }

/* ---------- 8. Hero ------------------------------------------------------ */
.hero {
  position: relative;
  background-color: var(--es-navy);
  background-image:
    linear-gradient(105deg, rgba(23,47,136,.90) 0%, rgba(1,85,164,.72) 48%, rgba(11,141,228,.42) 100%),
    var(--hero-image, none);
  background-size: cover;
  background-position: center 42%;
  color: #fff;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(4rem, 8vw, 6rem);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset-inline: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg,
    var(--es-yellow) 0 22%, var(--es-sky) 22% 48%, var(--es-blue) 48% 100%);
}
.hero__inner { position: relative; }
.hero h1 { color: #fff; max-width: 20ch; }
.hero .eyebrow { color: var(--es-yellow); }
.hero__lede {
  font-family: var(--font-heading);
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  line-height: 1.45;
  max-width: 54ch;
  color: rgba(255,255,255,.94);
  margin: 0 0 2rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Hero with an overlapping record card */
.hero--front { padding-bottom: clamp(6rem, 12vw, 9rem); }
/* The overlapping record card is the transition here, so the accent stripe
   would be a second one competing with it. */
.hero--front::after { display: none; }
.hero-featured {
  margin-top: -6.5rem;
  position: relative;
  z-index: 2;
}

/* Compact page hero for interior pages */
.page-hero {
  background: var(--es-navy);
  color: #fff;
  padding-block: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 6px solid var(--es-yellow);
}
.page-hero h1 { color: #fff; }
.page-hero .eyebrow { color: var(--es-sky); }
.page-hero__lede { max-width: 60ch; color: rgba(255,255,255,.92); font-family: var(--font-heading); font-size: 1.0625rem; line-height: 1.45; margin: 0; }
.page-hero--image {
  background-image:
    linear-gradient(100deg,
      rgba(26,54,109,.93) 0%,
      rgba(26,54,109,.84) 32%,
      rgba(23,47,136,.50) 62%,
      rgba(11,141,228,.16) 100%),
    var(--hero-image, none);
  background-size: cover;
  background-position: center 38%;
}

/* ---------- 9. Buttons --------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-heading); font-weight: 700; font-size: .9375rem;
  padding: .75rem 1.25rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--es-yellow); color: var(--es-navy); border-color: var(--es-yellow); }
.btn--primary:hover { background: var(--es-navy); color: #fff; border-color: var(--es-navy); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn--ghost:hover { background: #fff; color: var(--es-navy); border-color: #fff; }
.btn--solid { background: var(--es-blue); color: #fff; border-color: var(--es-blue); }
.btn--solid:hover { background: var(--es-navy); color: #fff; border-color: var(--es-navy); }
.btn--quiet { background: transparent; color: var(--es-blue); border-color: var(--rule-strong); }
.btn--icon { padding: .5625rem; }
.btn--icon svg { width: 18px; height: 18px; display: block; }
.btn--quiet:hover { background: var(--es-navy); color: #fff; border-color: var(--es-navy); }

/* ---------- 10. Badges, chips, theme coding ------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: .375rem;
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .09em;
  text-transform: uppercase; line-height: 1;
  padding: .4375rem .625rem;
  background: var(--es-yellow-pale); color: var(--es-navy);
  text-decoration: none;
  white-space: nowrap;
}
.badge--type { background: var(--es-yellow); font-weight: 500; }
.badge--rapid { background: var(--es-navy); color: #fff; }
.badge--report { background: var(--es-indigo); color: #fff; }
.badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--rule-strong); color: var(--ink-soft); }
a.badge:hover { background: var(--es-sky); color: var(--es-navy); }

/* Theme (aihe) coding — the accent 10 % lives here and nowhere else */
.theme-chip {
  display: inline-flex; align-items: center; gap: .4375rem;
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .06em;
  text-transform: uppercase; text-decoration: none; color: var(--ink-soft);
  padding: .25rem 0;
}
.theme-chip::before {
  content: ""; width: 10px; height: 10px; flex: none;
  background: var(--theme-color, var(--es-grey-300));
}
.theme-chip:hover { background: none; color: var(--es-navy); }

/* Themes are open-ended: each term carries its own colour, set inline as
   --theme-color from the term's colour meta. No hard-coded theme list. */

/* ---------- 11. Signature: the document record card ---------------------- */
.record {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: var(--rule-lead) solid var(--es-blue);
  padding: 1.5rem 1.5rem 1.25rem;
  position: relative;
}
.record--rapid { border-left-color: var(--es-yellow); }
.record--report { border-left-color: var(--es-indigo); }
.record--feature {
  border: 1px solid rgba(26,54,109,.10);
  border-left: 6px solid var(--es-yellow);
  box-shadow: 0 18px 40px -24px rgba(26,54,109,.55), 0 2px 4px rgba(26,54,109,.06);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.record__top {
  display: flex; align-items: center; gap: .625rem; flex-wrap: wrap;
  margin-bottom: .875rem;
}
.record__title {
  overflow-wrap: break-word; hyphens: auto;
  font-family: var(--font-heading); font-weight: 800;
  font-size: clamp(1.125rem, 2vw, 1.5rem); line-height: 1.22;
  letter-spacing: -.01em;
  margin: 0 0 .625rem; color: var(--es-navy);
}
.record--feature .record__title { font-size: clamp(1.375rem, 2.6vw, 1.875rem); }
.record__title a { color: inherit; text-decoration: none; }
.record__title a:hover { background: none; color: var(--es-blue); text-decoration: underline; text-underline-offset: 4px; }
.record__summary { color: var(--ink-soft); margin: 0 0 1rem; max-width: 62ch; font-size: .9375rem; }

/* the hairline definition grid */
/* Dividers are box-shadows on the cells, not a coloured background showing
   through 1px gaps. With the old technique an odd number of cells left the
   final slot empty and it rendered as a grey block. Shadows take no layout
   space, so an empty slot is simply nothing. */
.record__data {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 0;
  background: transparent;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 1rem 0;
  overflow: hidden;
}
.record__data > div {
  background: transparent;
  padding: .625rem .75rem .6875rem;
  box-shadow: 1px 0 0 var(--rule), 0 1px 0 var(--rule);
}
.record__data dt {
  font-family: var(--font-meta); font-size: .625rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--es-grey-500); margin: 0 0 .25rem;
}
.record__data dd {
  margin: 0; font-family: var(--font-heading); font-weight: 700;
  font-size: .875rem; color: var(--es-navy); line-height: 1.3;
}

.record__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.record__themes { display: flex; gap: .875rem; flex-wrap: wrap; }

/* language availability chips */
.langs { display: flex; gap: .25rem; align-items: center; }
.langs__label {
  font-family: var(--font-meta); font-size: .625rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--es-grey-500); margin-right: .25rem;
}
.langs a, .langs span {
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .06em;
  text-transform: uppercase; padding: .25rem .4375rem; text-decoration: none;
  border: 1px solid var(--rule-strong); color: var(--es-blue); line-height: 1;
}
.langs a:hover { background: var(--es-navy); color: #fff; border-color: var(--es-navy); }
.langs .is-missing { color: var(--es-grey-300); border-color: var(--rule); text-decoration: line-through; }

/* PDF download row */
.file-dl {
  display: flex; align-items: center; gap: .875rem;
  background: var(--paper-tint);
  border: 1px solid var(--rule);
  border-left: var(--rule-lead) solid var(--es-blue);
  padding: .875rem 1rem;
  text-decoration: none;
  color: var(--es-navy);
  transition: background-color .15s ease;
}
.file-dl:hover { background: var(--paper-blue); color: var(--es-navy); }
.file-dl:active { background: var(--es-navy); color: #fff; }
.file-dl:active .file-dl__meta { color: rgba(255,255,255,.8); }
.file-dl__icon {
  flex: none; width: 38px; height: 46px; position: relative;
  background: var(--es-blue); color: #fff;
  font-family: var(--font-meta); font-size: .625rem; font-weight: 600;
  letter-spacing: .04em;
  display: grid; place-items: end center; padding-bottom: .3125rem;
  clip-path: polygon(0 0, 74% 0, 100% 22%, 100% 100%, 0 100%);
}
.file-dl__body { min-width: 0; flex: 1; }
.file-dl__name {
  font-family: var(--font-heading); font-weight: 700; font-size: .9375rem;
  line-height: 1.3; display: block; margin-bottom: .1875rem;
}
.file-dl__meta {
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-soft);
}
.file-dl__arrow { flex: none; font-size: 1.25rem; line-height: 1; }

.file-list { display: grid; gap: .625rem; margin: 1.25rem 0; }

/* ---------- 12. Listings ------------------------------------------------- */
.record-list { display: grid; gap: 1.25rem; }
.record-list--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Compact index row — used for long archives */
.doc-row {
  display: grid;
  grid-template-columns: 128px 1fr auto;
  gap: 1.5rem;
  align-items: start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.doc-row:first-child { border-top: 1px solid var(--rule); }
.doc-row__date {
  font-family: var(--font-meta); font-size: .75rem; letter-spacing: .06em;
  color: var(--es-grey-500); text-transform: uppercase; padding-top: .25rem;
}
.doc-row__title {
  overflow-wrap: break-word; hyphens: auto;
  font-family: var(--font-heading); font-weight: 800; font-size: 1.125rem;
  line-height: 1.28; margin: 0 0 .375rem; color: var(--es-navy);
}
.doc-row__title a { color: inherit; text-decoration: none; }
.doc-row__title a:hover { background: none; color: var(--es-blue); text-decoration: underline; text-underline-offset: 4px; }
.doc-row__excerpt { font-size: .9375rem; color: var(--ink-soft); margin: 0 0 .5rem; max-width: 62ch; }
.doc-row__side { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; text-align: right; }
.doc-row__meta { display: flex; gap: .875rem; flex-wrap: wrap; align-items: center; }

/* ---------- 13. Filters & search ---------------------------------------- */
.filter-bar {
  background: var(--paper-tint);
  border: 1px solid var(--rule);
  border-left: var(--rule-lead) solid var(--es-navy);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.filter-bar__row {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end;
}
.field { display: flex; flex-direction: column; gap: .375rem; flex: 1 1 190px; }
.field label {
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-soft);
}
.field input[type="search"],
.field input[type="text"],
.field select {
  font-family: var(--font-body); font-size: .9375rem;
  padding: .625rem .75rem;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  min-height: 44px;
  border-radius: 0;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--es-blue) 50%), linear-gradient(135deg, var(--es-blue) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 2.25rem; }
.field input:focus, .field select:focus { outline: none; box-shadow: var(--focus); }

.filter-tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.filter-tags a {
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .06em;
  text-transform: uppercase; padding: .4375rem .625rem;
  background: var(--paper); border: 1px solid var(--rule-strong);
  text-decoration: none; color: var(--ink-soft);
}
.filter-tags a:hover { background: var(--es-sky); color: var(--es-navy); }
.filter-tags .is-on { background: var(--es-navy); color: #fff; border-color: var(--es-navy); }

.result-count {
  font-family: var(--font-meta); font-size: .75rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1rem;
}

/* ---------- 14. Memo article & structure spine --------------------------- */
.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-areas:
    "body aside"
    "body cite";
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.doc-body  { grid-area: body; }
.doc-aside { grid-area: aside; }
.doc-cite  { grid-area: cite; }
.doc-layout--reverse { grid-template-columns: 280px minmax(0, 1fr); }

.doc-aside { position: sticky; top: 140px; }

.spine {
  border-top: 2px solid var(--es-navy);
  padding-top: .875rem;
}
.spine__title {
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft); margin: 0 0 .75rem;
}
.spine ol { list-style: none; margin: 0; padding: 0; counter-reset: spine; }
.spine li { counter-increment: spine; border-bottom: 1px solid var(--rule); }
.spine a {
  display: grid; grid-template-columns: 1.75rem 1fr; gap: .25rem;
  padding: .625rem 0; text-decoration: none;
  font-family: var(--font-heading); font-weight: 700; font-size: .875rem;
  line-height: 1.3; color: var(--ink-soft);
}
.spine a::before {
  content: counter(spine, decimal-leading-zero);
  font-family: var(--font-meta); font-weight: 400; font-size: .6875rem;
  color: var(--es-grey-300); padding-top: .1875rem;
}
.spine a:hover { background: none; color: var(--es-blue); }
.spine a[aria-current="true"] { color: var(--es-blue); }
.spine a[aria-current="true"]::before { color: var(--es-yellow-deep); }

.doc-body { font-size: 1.0625rem; }
.doc-body h2 { scroll-margin-top: 150px; }
.doc-body h2::before {
  content: "";
  display: block; width: 2.5rem; height: var(--rule-lead);
  background: var(--es-yellow); margin-bottom: .75rem;
}
.doc-body ul, .doc-body ol { max-width: var(--measure); padding-left: 1.25rem; }
.doc-body li { margin-bottom: .4375rem; }
.doc-body table { width: 100%; border-collapse: collapse; margin: 1.75rem 0; font-size: .9375rem; }
.doc-body th, .doc-body td { text-align: left; padding: .625rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.doc-body thead th { background: var(--paper-tint); font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }

.doc-header { border-bottom: 1px solid var(--rule); padding-bottom: 1.75rem; margin-bottom: 2rem; }
.doc-header__meta { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }

/* A paragraph given the "verdict" class in the editor becomes the callout.
   No wrapper markup, so the author only sets a class. */
.doc-body p.verdict {
  border: 1px solid var(--rule);
  border-left: var(--rule-lead) solid var(--es-yellow);
  background: #FFFDF0;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  max-width: none;
}

/* Callout used for the fact-check verdict */
.verdict {
  border: 1px solid var(--rule);
  border-left: var(--rule-lead) solid var(--es-navy);
  background: var(--paper-tint);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.verdict__label {
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft); margin: 0 0 .5rem;
}
.verdict p:last-child { margin-bottom: 0; }
.verdict--yellow { border-left-color: var(--es-yellow); background: #FFFDF0; }

/* Portrait figure — pairs a tall photograph with a block of text */
.figure-split {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.figure-split--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); }
.figure-split figure { margin: 0; }
.figure-split img {
  width: 100%; height: auto; display: block;
  border-left: var(--rule-lead) solid var(--es-yellow);
}
@media (max-width: 820px) {
  .figure-split, .figure-split--flip { grid-template-columns: 1fr; }
  .figure-split--flip figure { order: -1; }
}

/* ---------- 15. People --------------------------------------------------- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem 1.5rem;
}
.person__portrait {
  aspect-ratio: 3 / 4; width: 100%; object-fit: cover;
  background: var(--paper-tint) url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 40'%3E%3Crect width='30' height='40' fill='%23F4F6FA'/%3E%3Ccircle cx='15' cy='15' r='6' fill='%23D3D7E1'/%3E%3Cpath d='M3 40c0-7 5.4-12 12-12s12 5 12 12z' fill='%23D3D7E1'/%3E%3C/svg%3E") center/cover;
  border-bottom: var(--rule-lead) solid var(--es-blue);
  filter: saturate(.92);
}
.person--chair .person__portrait { border-bottom-color: var(--es-yellow); }
.person__name {
  font-family: var(--font-heading); font-weight: 800; font-size: 1.0625rem;
  line-height: 1.25; margin: .875rem 0 .1875rem; color: var(--es-navy);
}
.person__name a { color: inherit; text-decoration: none; }
.person__name a:hover { background: none; color: var(--es-blue); text-decoration: underline; text-underline-offset: 3px; }
.person__role {
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .07em;
  text-transform: uppercase; color: var(--es-blue); margin: 0 0 .375rem;
}
.person__affil { font-size: .875rem; color: var(--ink-soft); margin: 0; }
.person__field { font-size: .8125rem; color: var(--es-grey-500); margin: .375rem 0 0; }

.people-grid--compact { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.5rem 1.25rem; }
.people-grid--list { display: grid; gap: 0; grid-template-columns: 1fr; }
.people-grid--list .person {
  display: grid; grid-template-columns: 84px 1fr; gap: 1.25rem;
  padding: 1.125rem 0; border-bottom: 1px solid var(--rule); align-items: start;
}
.people-grid--list .person__portrait { aspect-ratio: 1; border-bottom-width: 3px; }
.people-grid--list .person__name { margin-top: 0; }

/* ---------- 16. Cards / teasers ------------------------------------------ */
.tile {
  display: block; text-decoration: none; background: var(--paper);
  border: 1px solid var(--rule);
  border-top: var(--rule-lead) solid var(--tile-accent, var(--es-blue));
  padding: 1.5rem; height: 100%;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.tile:hover {
  background: var(--paper);
  box-shadow: 0 12px 28px -20px rgba(26,54,109,.6);
  transform: translateY(-2px);
}
.tile h3 { margin: .5rem 0 .5rem; font-size: 1.1875rem; }
.tile p { color: var(--ink-soft); font-size: .9375rem; margin: 0; }
.tile__link {
  display: inline-flex; align-items: center; gap: .375rem; margin-top: .875rem;
  font-family: var(--font-heading); font-weight: 700; font-size: .875rem; color: var(--es-blue);
}

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }

/* Principles / mandate strip */
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; border-top: 1px solid rgba(255,255,255,.25); }
.principles > div { padding: 1.75rem 1.5rem 1.75rem 0; border-right: 1px solid rgba(255,255,255,.18); padding-right: 1.5rem; }
.principles > div:last-child { border-right: 0; }
.principles h3 { font-size: 1.0625rem; margin: 0 0 .5rem; }
.principles p { font-size: .9375rem; color: rgba(255,255,255,.86); margin: 0; }
.principles__num {
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .1em;
  color: var(--es-yellow); display: block; margin-bottom: .75rem;
}

/* Roster — the named panel, set as a plain list because the names are the point */
.roster {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0;
  border-top: 1px solid rgba(255,255,255,.2);
}
.roster__item { border-bottom: 1px solid rgba(255,255,255,.2); }
.roster__item a {
  display: block; padding: .875rem 1.25rem .875rem 0;
  text-decoration: none; border: 0;
  border-left: var(--rule-lead) solid transparent; padding-left: 1rem;
  transition: border-color .15s ease, background-color .15s ease;
}
.roster__item a:hover { background: rgba(255,255,255,.06); border-left-color: var(--es-yellow); }
.roster__name {
  display: block; font-family: var(--font-heading); font-weight: 800;
  font-size: 1rem; line-height: 1.3; color: #fff;
}
.roster__affil {
  display: block; font-size: .8125rem; line-height: 1.35;
  color: rgba(255,255,255,.72); margin-top: .125rem;
}

/* Memo number above the title in index rows */
.doc-row__num {
  font-family: var(--font-meta); font-size: .625rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--es-grey-500); margin: 0 0 .25rem;
}

/* Year grouping in long archives */
.year-head {
  display: flex; align-items: baseline; gap: .875rem;
  margin: 2.5rem 0 .5rem; padding-bottom: .5rem;
  border-bottom: 2px solid var(--es-navy);
}
.year-head:first-child { margin-top: 0; }
.year-head h2 {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  letter-spacing: .02em; margin: 0; color: var(--es-navy);
}
.year-head span {
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--es-grey-500);
}

/* ---------- 17. Pagination ---------------------------------------------- */
.pagination { display: flex; gap: .375rem; flex-wrap: wrap; margin-top: 2.5rem; }
.pagination .page-numbers {
  font-family: var(--font-meta); font-size: .8125rem;
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule-strong); text-decoration: none; color: var(--es-blue); padding: 0 .625rem;
}
.pagination .page-numbers:hover { background: var(--es-sky); color: var(--es-navy); }
.pagination .current { background: var(--es-navy); color: #fff; border-color: var(--es-navy); }

/* ---------- 18. Footer --------------------------------------------------- */
.site-footer { background: var(--es-navy); color: rgba(255,255,255,.85); margin-top: 0; }
.site-footer a {
  color: rgba(255,255,255,.88); text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.28);
  transition: color .15s ease, border-color .15s ease;
}
.site-footer a:hover { color: #fff; border-bottom-color: var(--es-yellow); background: none; }
.site-footer a:focus-visible { box-shadow: 0 0 0 2px var(--es-yellow); border-radius: 2px; }
.footer-main { padding-block: clamp(2.5rem, 5vw, 4rem); display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.footer-main h4 { color: #fff; font-size: .9375rem; margin: 0 0 .875rem; }
.footer-main ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .9375rem; }
.footer-brand img { height: 48px; width: auto; margin-bottom: 1rem; }
.footer-brand p { font-size: .9375rem; color: rgba(255,255,255,.8); max-width: 42ch; }

.footer-parent {
  border-top: 1px solid rgba(255,255,255,.2);
  border-bottom: 1px solid rgba(255,255,255,.2);
  padding-block: 1.5rem;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  justify-content: space-between;
}
.footer-parent__text { max-width: 56ch; font-size: .9375rem; }
.footer-parent img { height: 42px; width: auto; }
.footer-legal {
  padding-block: 1.25rem;
  display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between;
  font-family: var(--font-meta); font-size: .75rem; color: rgba(255,255,255,.7);
}
.footer-legal ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }

/* ---------- 19. Utilities ------------------------------------------------ */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.u-center { text-align: center; }
.u-mt-0 { margin-top: 0; }
.u-mb-0 { margin-bottom: 0; }
.u-flow > * + * { margin-top: 1.25rem; }
.divider-yellow { height: var(--rule-lead); background: var(--es-yellow); width: 3.5rem; margin: 0 0 1.25rem; }

.notice {
  border: 1px solid var(--rule); border-left: var(--rule-lead) solid var(--es-yellow);
  background: #FFFDF0; padding: 1.125rem 1.25rem; margin: 1.5rem 0;
}
.notice p:last-child { margin-bottom: 0; }

/* WordPress core alignments */
.alignwide { width: min(100%, 1100px); margin-inline: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); max-width: none; }
.aligncenter { margin-inline: auto; }
.wp-caption { margin-bottom: 1.5rem; }
.sticky, .gallery-caption, .bypostauthor { display: block; }

/* ---------- 20. Responsive ---------------------------------------------- */
@media (max-width: 980px) {
  /* The sidebar leads: structure and download are what a reader wants before
     the text, not after it. The citation note stays at the foot. */
  .doc-layout, .doc-layout--reverse {
    grid-template-columns: 1fr;
    grid-template-areas: "aside" "body" "cite";
    gap: 2rem;
  }
  .doc-aside { position: static; }
  .doc-aside > * + * { margin-top: 1.5rem; }
  .spine ol { columns: 2; column-gap: 1.5rem; }
  .footer-main { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    box-shadow: 0 18px 30px -22px rgba(26,54,109,.6);
    display: none;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; gap: 0; align-items: stretch; padding: .5rem 1.25rem 1.25rem; }
  .primary-nav li { border-bottom: 1px solid var(--rule); }
  .primary-nav a { display: block; padding: .875rem 0; border-bottom: 0; border-left: var(--rule-lead) solid transparent; padding-left: .75rem; }
  .primary-nav .current-menu-item > a { border-left-color: var(--es-yellow); border-bottom-color: transparent; }
  .masthead__inner { position: relative; min-height: 64px; gap: .75rem; }
  .brand img { height: 30px; }
  /* The strip above already carries the language switcher — don't repeat it. */
  .masthead .lang-switch { display: none; }
  .nav-cluster { gap: .5rem; }
  .doc-row { grid-template-columns: 1fr; gap: .5rem; }
  .doc-row__side { align-items: flex-start; text-align: left; }
  .doc-row__date { padding-top: 0; }
  .hero-featured { margin-top: -3.5rem; }
  .assoc-strip__inner { justify-content: center; text-align: center; row-gap: .25rem; }
}

@media (max-width: 560px) {
  .footer-main { grid-template-columns: 1fr; }
  .spine ol { columns: 1; }
  /* One column: an odd number of cells can no longer leave an empty slot
     showing the divider colour through it. */
  .record__data { grid-template-columns: 1fr; }
  .assoc-strip { font-size: .6875rem; }
  .assoc-strip__note { flex-direction: column; gap: .25rem; }
  .principles > div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.18); padding-right: 0; }
}

/* ---------- 21. Print ---------------------------------------------------- */
@media print {
  .site-header, .site-footer, .filter-bar, .doc-aside, .pagination, .hero__actions { display: none !important; }
  body { font-size: 11pt; color: #000; }
  a { color: #000; text-decoration: underline; }
  .record { border: 1px solid #999; }
  .doc-layout { grid-template-columns: 1fr; }
}

/* ---------- 22. References ---------------------------------------------- */
/* Inline citation marker */
.euapa-cite {
  display: inline-block;
  font-family: var(--font-meta);
  font-size: .625rem;
  font-weight: 500;
  line-height: 1;
  vertical-align: super;
  min-width: 1.15em;
  padding: .15em .3em;
  margin-left: .1em;
  text-align: center;
  text-decoration: none;
  color: var(--es-blue);
  background: var(--paper-blue);
  border-radius: 2px;
  transition: background-color .12s ease, color .12s ease;
}
.euapa-cite:hover,
.euapa-cite:focus-visible {
  background: var(--es-navy);
  color: #fff;
  text-decoration: none;
}
/* Adjacent citations read as 1,2 rather than colliding */
.euapa-cite + .euapa-cite { margin-left: .05em; }
.euapa-cite + .euapa-cite::before {
  content: ","; color: var(--es-grey-500); margin-right: .15em;
}

/* The source list */
.refs-block {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 2px solid var(--es-navy);
}
.doc-body .refs-block__heading::before { display: none; }
.refs-block__heading {
  font-family: var(--font-meta);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}
.refs { list-style: none; margin: 0; padding: 0; counter-reset: none; max-width: none; }

.ref {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 1.5rem;
  gap: .875rem;
  align-items: start;
  padding: .875rem 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 150px;
}
.ref:first-child { border-top: 1px solid var(--rule); }
.ref:target { background: #FFFDF0; box-shadow: -8px 0 0 #FFFDF0, 8px 0 0 #FFFDF0; }
.ref:target .ref__num { background: var(--es-yellow); color: var(--es-navy); }

.ref__num {
  font-family: var(--font-meta);
  font-size: .6875rem;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem;
  background: var(--paper-tint);
  color: var(--es-blue);
  border: 1px solid var(--rule);
}
.ref__body { min-width: 0; }
.ref__meta {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin: 0 0 .25rem;
}
.ref__type {
  font-family: var(--font-meta);
  font-size: .5625rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1;
  padding: .3em .5em;
  background: var(--es-grey-100);
  color: var(--es-grey-700);
  white-space: nowrap;
}
/* Binding instruments read as the strongest; commentary as the lightest. */
.ref__type--saados    { background: var(--es-navy);   color: #fff; }
.ref__type--ehdotus   { background: var(--es-blue);   color: #fff; }
.ref__type--tuomio    { background: var(--es-indigo); color: #fff; }
.ref__type--tilasto   { background: var(--es-sky);    color: var(--es-navy); }
.ref__type--tutkimus  { background: var(--paper-blue);color: var(--es-navy); }
.ref__type--asiakirja { background: var(--es-grey-100); color: var(--es-grey-700); }
.ref__type--uutinen   { background: transparent; color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--rule-strong); }

/* The instrument identifier: tabular, so long numbers stay scannable */
.ref__id {
  font-family: var(--font-meta);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  color: var(--es-navy);
  font-weight: 500;
  overflow-wrap: break-word;
}
.ref__title {
  margin: 0 0 .1875rem;
  font-size: .9375rem;
  line-height: 1.4;
  max-width: 62ch;
  overflow-wrap: break-word;
}
.ref__title a { color: var(--es-navy); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--rule-strong); }
.ref__title a:hover { background: none; color: var(--es-blue); text-decoration-color: currentColor; }
.ref__pub { margin: .125rem 0 0; font-size: .8125rem; color: var(--ink-soft); }
.ref__note { margin: .25rem 0 0; font-size: .8125rem; color: var(--ink-soft); max-width: 62ch; }
/* A source entered but never cited: present, but visibly secondary */
.ref--uncited .ref__num { color: var(--es-grey-300); }
.ref--uncited { opacity: .78; }
.ref__host {
  margin: .25rem 0 0;
  font-family: var(--font-meta);
  font-size: .625rem;
  letter-spacing: .06em;
  color: var(--es-grey-500);
}
.ref__back {
  font-size: .875rem; text-decoration: none; color: var(--es-grey-300);
  justify-self: end; padding-top: .3125rem;
}
.ref__back:hover { background: none; color: var(--es-blue); }

/* Hover preview popover, added by JS */
.ref-pop {
  position: absolute;
  z-index: 60;
  max-width: 340px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-left: var(--rule-lead) solid var(--es-navy);
  box-shadow: 0 16px 36px -20px rgba(26,54,109,.6);
  padding: .75rem .875rem;
  font-size: .8125rem;
  line-height: 1.4;
  color: var(--ink);
  pointer-events: none;
}
.ref-pop__type {
  font-family: var(--font-meta); font-size: .5625rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--es-grey-500); display: block; margin-bottom: .25rem;
}
.ref-pop__id { font-family: var(--font-meta); font-size: .75rem; color: var(--es-navy); font-weight: 500; display: block; }

/* ---------- 23. Reading progress ---------------------------------------- */
/* A rail beside the structure spine on desktop; a hairline bar on mobile. */
.spine { position: relative; }
/* The rail beside the spine is retired: the progress bar under the menu does
   this job at every width, and two indicators for one thing is one too many. */
.spine__rail { display: none; }

/* On narrow screens the spine is no longer sticky, so progress moves to a rail
   on the left edge — the same vertical-rule motif the logotype and the record
   cards use, and clear of the right edge where the scrollbar and thumb sit. */
/* Sits at the foot of the sticky header, directly beneath the menu. */
.read-bar {
  height: 3px;
  background: rgba(26, 54, 109, .10);
  pointer-events: none;
  display: none;
}
.site-header.has-progress .read-bar { display: block; }
.read-bar__fill {
  height: 100%;
  width: var(--progress, 0%);
  background: var(--es-yellow);
  transition: width .1s linear;
}



@media print {
  .euapa-cite { background: none; color: #000; }
  .refs-block { border-top: 1px solid #999; }
  .ref__back, .read-bar, .spine__rail { display: none !important; }
  .ref { grid-template-columns: 1.5rem 1fr; }
}

/* ---------- 25. Touch target sizing -------------------------------------- */
/* Extend hit areas to the WCAG 2.5.8 minimum of 24px without changing how
   anything looks. Citation markers stay visually small — they belong in
   running text — but gain a thumb-sized hit box on touch devices only, so a
   mouse never has an invisible box stealing clicks from adjacent words. */
@media (pointer: coarse) {
  a.euapa-cite { position: relative; }
  a.euapa-cite::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 28px; height: 28px;
    transform: translate(-50%, -50%);
  }
}

/* Size-based, so these hold regardless of how a device reports its pointer. */
@media (max-width: 820px) {
  .site-footer .footer-main ul { gap: .25rem; }
  .site-footer .footer-main ul a,
  .site-footer .footer-legal ul a {
    display: inline-block;
    padding-block: .3125rem;
  }
  .langs a, .langs span {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 26px; min-width: 26px; padding: .3125rem .5rem;
  }
  .lang-switch a, .lang-switch span {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 26px; padding: .375rem .625rem;
  }
  .about-panel__contact a { display: inline-block; padding-block: .25rem; }
  .ref__back {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 26px; min-width: 26px;
  }
  .theme-chip { min-height: 26px; padding-block: .375rem; }
}

/* ---------- 26. About-the-panel block ------------------------------------ */
.about-panel {
  margin: 3rem 0 0;
  padding: 1.75rem;
  background: var(--paper-tint);
  border: 1px solid var(--rule);
  border-left: var(--rule-lead) solid var(--es-blue);
}
.about-panel__heading {
  font-family: var(--font-meta);
  font-size: .75rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 .875rem;
}
.doc-body .about-panel__heading::before { display: none; }
.about-panel__body p { font-size: .9375rem; line-height: 1.55; max-width: 66ch; }
.about-panel__body p:last-child { margin-bottom: 0; }

.about-panel__contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0;
  background: transparent;
  border-top: 1px solid var(--rule);
  margin: 1.25rem 0 0;
  overflow: hidden;
}
.about-panel__contact > div {
  background: transparent;
  padding: .75rem .875rem .8125rem;
  box-shadow: 1px 0 0 var(--rule);
}
.about-panel__contact dt {
  font-family: var(--font-meta); font-size: .625rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--es-grey-500); margin: 0 0 .25rem;
}
.about-panel__contact dd {
  margin: 0;                       /* browsers indent dd by default */
  font-family: var(--font-heading); font-weight: 700;
  font-size: .875rem; color: var(--es-navy); overflow-wrap: break-word;
}
.about-panel__contact a { color: var(--es-blue); text-decoration: none; }
.about-panel__contact a:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }

/* Front page assembled from blocks */
.euapa-front-editable > .hero:first-child { margin-top: 0; }

@media (max-width: 560px) {
  .about-panel { padding: 1.25rem; }
  .about-panel__contact { grid-template-columns: 1fr; }
}

@media print {
  .about-panel { background: none; border: 1px solid #999; }
}

/* An editor-only hint. Deliberately plainer than a content notice, so it never
   reads as something the panel is saying to its readers. */
.notice--editor {
  border-left-color: var(--es-grey-300);
  background: var(--paper-tint);
  color: var(--ink-soft);
  font-size: .875rem;
}
.notice--editor strong {
  font-family: var(--font-meta); font-size: .6875rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--es-grey-500); margin-right: .25rem;
}

/* The citation note. In the sidebar column on desktop, at the foot on mobile —
   it is what a reader wants after the memo, not before it. */
.doc-cite__inner {
  border-top: 2px solid var(--es-navy);
  padding-top: .875rem;
}
@media (max-width: 980px) {
  .doc-cite__inner { border-top-width: 1px; }
}

/* ---------- 27. Page sidebar --------------------------------------------- */
.page-widgets { margin-top: 2rem; }
.page-widget + .page-widget { margin-top: 1.75rem; }
.page-widget {
  border-top: 2px solid var(--es-navy);
  padding-top: .875rem;
  font-size: .9375rem;
}
.page-widget ul { list-style: none; margin: 0; padding: 0; }
.page-widget li { border-bottom: 1px solid var(--rule); }
.page-widget li a { display: block; padding: .5rem 0; text-decoration: none; color: var(--es-navy); }
.page-widget li a:hover { background: none; color: var(--es-blue); }
.page-widget p:last-child { margin-bottom: 0; }

/* A page hero carrying a picture needs the same contrast floor as the memo
   heroes, so the overlay is inherited from .page-hero--image. Nothing extra
   here beyond keeping the band from collapsing when there is no standfirst. */
.page-hero--image { min-height: 220px; display: flex; align-items: center; }
.page-hero--image > .shell { width: min(100% - 2.5rem, var(--shell)); }

@media (max-width: 560px) {
  .page-hero--image { min-height: 160px; }
}

/* Keep the standfirst inside the dense end of the overlay. Measured worst-case
   over a bright photograph, body text at 60ch reaches the point where the
   gradient has thinned to about 4.6:1 — technically passing, with nothing to
   spare. At 52ch it stays where the overlay is still doing its job. */
.page-hero--image .page-hero__lede { max-width: 52ch; }

/* ---------- 28. Icons ---------------------------------------------------- */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex: none; }
.tile__link .icon { margin-left: .375rem; }
.assoc-strip__parent .icon { width: .875em; height: .875em; margin-left: .25rem; }
.file-dl__arrow .icon { width: 1.25rem; height: 1.25rem; vertical-align: middle; }
.ref__back .icon { width: 1rem; height: 1rem; }
.ref__back {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--es-grey-300);
}
.ref__back:hover { color: var(--es-blue); background: none; }

.pagination .page-numbers { gap: .3125rem; }
.pagination .prev, .pagination .next { display: inline-flex; align-items: center; gap: .375rem; }
.pagination .icon { width: .9em; height: .9em; }

/* ---------- 29. Footer engagement band ----------------------------------- */
.footer-engage {
  background: var(--es-indigo);
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.footer-engage__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}
.engage-col__title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1875rem;
  line-height: 1.25;
  color: #fff;
  margin: 0 0 .5rem;
}
.engage-col__text {
  font-size: .9375rem;
  line-height: 1.5;
  color: rgba(255,255,255,.82);
  margin: 0 0 1.25rem;
  max-width: 46ch;
}

/* Signup */
.request__field label {
  display: block;
  font-family: var(--font-meta);
  font-size: .625rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  margin-bottom: .3125rem;
}
.signup__action { margin: 0 0 .25rem; }
.signup__action .icon { width: .8em; height: .8em; opacity: .8; }
.request__field input {
  flex: 1 1 200px;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: .6875rem .75rem;
  min-height: 46px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.06);
  color: #fff;
  border-radius: 0;
}
.request__field input::placeholder { color: rgba(255,255,255,.45); }
.request__field input:focus {
  outline: none;
  border-color: var(--es-yellow);
  background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 2px var(--es-yellow);
}
.signup__note,
.request__note {
  font-size: .75rem;
  line-height: 1.45;
  color: rgba(255,255,255,.62);
  margin: .75rem 0 0;
  max-width: 46ch;
}

/* Request panel */
.request__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.request__field { margin: 0; }
.request__field input { width: 100%; }
.request__send { margin-top: .25rem; }
.request__direct {
  margin: .875rem 0 0;
  font-size: .9375rem;
}
.request__direct a { color: #fff; border-bottom: 1px solid rgba(255,255,255,.35); text-decoration: none; }
.request__direct a:hover { border-bottom-color: var(--es-yellow); background: none; }

/* Footer contact block */
.footer-contact {
  font-style: normal;
  display: grid;
  gap: .375rem;
  font-size: .9375rem;
  line-height: 1.4;
}
.footer-contact__org { color: #fff; font-weight: 600; }
.footer-contact span { color: rgba(255,255,255,.82); }

@media (max-width: 560px) {
  .request__fields { grid-template-columns: 1fr; }
  .signup__action .btn { width: 100%; justify-content: center; }
}

@media print {
  .footer-engage { display: none; }
}

.footer-legal ul a .icon { width: .8em; height: .8em; margin-left: .25rem; opacity: .75; }
