/*
  style.css
  LocalGov Drupal Network

  Table of Contents
  -----------------
  1.  Fonts
  2.  Variables
  3.  Reset & Base
  4.  Typography
  5.  Utilities
  6.  Buttons
  7.  Header
  8.  Footer
  9.  Dialog menu
  10. Banner / Hero
  11. Sections
  12. Components
  13. Responsive
  14. Reduced motion
  15. Network overview (home)
*/

/* ============================================================
   1. Fonts
   ============================================================ */

/*
  Fonts load without a flash of fallback text:
  - the four faces used above the fold are preloaded in each page's <head>
  - font-display: optional never swaps fonts after first paint
  - if a font misses the first paint, a size-matched local fallback (Arial)
    is used instead, so the layout does not shift (CLS)
*/

@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow/barlow-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow/barlow-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow/barlow-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow/barlow-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/BarlowCondensed/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/BarlowCondensed/barlow-condensed-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: optional;
}

/* Fallbacks sized to Barlow's metrics (measured against Arial) */
@font-face {
  font-family: "Barlow Fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Liberation Sans");
  font-weight: 400 600;
  size-adjust: 93.9%;
  ascent-override: 106.5%;
  descent-override: 21.3%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Barlow Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Liberation Sans Bold");
  font-weight: 700 800;
  size-adjust: 90.7%;
  ascent-override: 110.3%;
  descent-override: 22.1%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Barlow Condensed Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Liberation Sans Bold");
  font-weight: 700 800;
  size-adjust: 68%; /* tuned for the uppercase headlines */
  ascent-override: 147.1%;
  descent-override: 29.4%;
  line-gap-override: 0%;
}

/* ============================================================
   2. Variables
   ============================================================ */

:root {
  /* Brand colours */
  --color-yellow:          #ffe146;
  --color-teal:            #004459;
  --color-teal-mid:        #005c75;
  --color-teal-dark:       #003244;
  --color-blue-grey:       #668a96; /* map borders: looks like 40% white on the hero, but opaque so overlaps don't add up */
  --color-white:           #ffffff;
  --color-black:           #0b0c0c;

  /* Grey scale */
  --color-grey-lightest:   #f4f5f5;
  --color-grey-lighter:    #eaeaea;
  --color-grey-light:      #cecfd0;
  --color-grey-dark:       #444c50; /* 7:1 or more on every light background (AAA) */

  /* Fonts */
  --font-body:    "Barlow", "Barlow Fallback", system-ui, sans-serif;
  --font-display: "Barlow Condensed", "Barlow Condensed Fallback", sans-serif;

  /* Spacing (4pt scale) */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-12: 48px;
  --sp-24: 96px;

  /* Widths */
  --width-container:  73.75rem; /* 1180px */
  --width-medium:     48rem;

  /* Line heights */
  --line-height:       1.65;
  --line-height-dark:  1.75;
  --line-height-tight: 1.15;

  /* Font sizes */
  --font-size:         1.0625rem; /* 17px */
  --font-size-small:   0.875rem; /* 14px: the smallest text size used */
  --font-size-h1:      clamp(2.2rem, 6vw, 3.75rem);
  --font-size-h2:      clamp(1.6rem, 4vw, 2.4rem);
  --font-size-h3:      clamp(1.15rem, 2.5vw, 1.5rem);
  --font-size-h4:      1rem;

  /* Border */
  --border-radius:      4px;
  --border-radius-md:   8px;
  --border-radius-large: 24px;

  /* Fixed header */
  --header-height: 72px;
  --jumpnav-height: 52px;
  --color-live:            #c8102e; /* the red "live" dot and label (6:1 on white) */

  /* Animation */
  --transition-time: 0.25s;

  /* Vertical rhythm */
  --vertical-rhythm-spacing: calc(var(--line-height) * 1rem);
}

/* ============================================================
   3. Reset & Base
   ============================================================ */

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

html {
  scroll-padding-top: calc(var(--header-height) + var(--jumpnav-height));
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--color-black);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

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

figure {
  margin: 0 0 var(--sp-4) 0;
}

figcaption {
  font-size: var(--font-size-small);
  text-align: center;
  color: var(--color-grey-dark);
  margin-top: var(--sp-2);
}

:where(:not(dialog)) {
  margin-block-start: 0;
}

:where(input, textarea, select, button) {
  font-family: inherit;
  font-size: var(--font-size);
  line-height: inherit;
}

/* Focus visible: black on light backgrounds, yellow on dark ones (set --focus-color per area) */
:focus-visible {
  outline: 3px solid var(--focus-color, var(--color-black));
  outline-offset: 3px;
}

.network-hero,
.banner {
  --focus-color: var(--color-yellow);
}

/* Skip link target: <main tabindex="-1"> takes focus without a ring around the whole page */
main:focus {
  outline: 3px solid transparent;
}

/* Skip link: first focusable element, visible only on focus */
.skip-link {
  position: absolute;
  z-index: 100;
  top: var(--sp-2);
  left: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--border-radius);
  background-color: var(--color-black);
  color: var(--color-yellow);
  font-weight: 700;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
  outline-color: var(--color-yellow);
}

a {
  color: var(--color-teal);
  transition: color var(--transition-time);
}

a:hover {
  color: var(--color-black);
}

/* ============================================================
   4. Typography
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--line-height-tight);
  letter-spacing: -0.01em;
  color: var(--color-black);
  margin-block-end: 0;
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); font-weight: 700; }
h4 { font-size: var(--font-size-h4); font-weight: 700; }

p {
  max-width: 65ch;
  margin-block-end: 0;
}

ul, ol {
  padding-inline-start: var(--sp-6);
}

li {
  margin-block-start: var(--sp-2);
}

small {
  font-size: var(--font-size-small);
}

/* ============================================================
   5. Utilities
   ============================================================ */

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

.lgd-container {
  max-width: var(--width-container);
  margin-inline: auto;
}

.padding-horizontal {
  padding-inline: max(clamp(var(--sp-4), 3vw, var(--sp-8)), env(safe-area-inset-left));
  padding-inline-end: max(clamp(var(--sp-4), 3vw, var(--sp-8)), env(safe-area-inset-right));
}

.flow > * + * {
  margin-block-start: var(--vertical-rhythm-spacing);
}

/* ============================================================
   6. Buttons
   ============================================================ */

:where(button, [type="button"], [type="reset"], [type="submit"], .button) {
  display: inline-block;
  padding: var(--sp-3) var(--sp-6);
  cursor: pointer;
  transition: background-color var(--transition-time), color var(--transition-time), box-shadow var(--transition-time);
  text-decoration: none;
  color: var(--color-black);
  border: 2px solid transparent;
  border-radius: 1000px;
  background-color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.4;
}

:where(button, [type="button"], [type="reset"], [type="submit"], .button):hover,
:where(button, [type="button"], [type="reset"], [type="submit"], .button):focus-visible {
  background-color: var(--color-black);
  color: var(--color-yellow);
  border-color: var(--color-black);
  box-shadow: none;
}

:where(button, [type="button"], [type="reset"], [type="submit"], .button):active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}

.button--accent {
  background-color: var(--color-yellow);
  color: var(--color-black);
}

/* The white button as a link: black text, and white text on the black hover (the plain link colours would win otherwise) */
a.button:not(.button--accent) {
  color: var(--color-black);
}

a.button:not(.button--accent):hover,
a.button:not(.button--accent):focus-visible {
  color: var(--color-white);
}

.button--accent:hover,
.button--accent:focus-visible {
  background-color: var(--color-black);
  border-color: var(--color-black);
  color: var(--color-yellow);
  box-shadow: none;
}

/* ============================================================
   7. Header
   ============================================================ */

.header {
  --header-fg: var(--color-white);
  --header-bg: rgba(0,50,68,.35);
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  color: var(--header-fg);
  transition: color var(--transition-time);
}

/* Tinted, blurred backdrop over the hero; the bottom fades out with an eased mask */
.header::before {
  --header-fade: linear-gradient(to bottom,
    #000 0%,
    #000 50%,
    rgba(0,0,0,.92) 56%,
    rgba(0,0,0,.8) 62%,
    rgba(0,0,0,.65) 69%,
    rgba(0,0,0,.49) 75%,
    rgba(0,0,0,.34) 81%,
    rgba(0,0,0,.2) 87%,
    rgba(0,0,0,.09) 94%,
    transparent 100%);
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: calc(100% + var(--sp-12));
  z-index: -1;
  background-color: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  -webkit-mask-image: var(--header-fade);
  mask-image: var(--header-fade);
  transition: background-color var(--transition-time);
  pointer-events: none;
}

/* Below the hero: plain yellow, black text, no blur or fade (class set in script.js) */
.header--solid {
  --header-fg: var(--color-black);
  --header-bg: var(--color-yellow);
}

.header--solid::before {
  height: 100%;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  -webkit-mask-image: none;
  mask-image: none;
}

/* Jump menu on the homepage: needs JS, slides in below the header after the hero, swipeable when it is too wide */
.jumpnav {
  display: none;
}

.js .jumpnav {
  display: block;
  position: fixed;
  inset: var(--header-height) 0 auto;
  z-index: 90;
  height: var(--jumpnav-height);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background-color: var(--color-teal-dark);
  color: var(--color-white);
  visibility: hidden;
  transform: translateY(-100%);
  --focus-color: var(--color-yellow);
}

.jumpnav::-webkit-scrollbar {
  display: none;
}

.js .jumpnav--visible {
  visibility: visible;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .js .jumpnav {
    transition: transform var(--transition-time), visibility var(--transition-time);
  }
}

.jumpnav__list {
  display: flex;
  align-items: stretch;
  gap: var(--sp-1);
  width: max-content;
  min-width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 max(var(--sp-4), calc((100% - 72rem) / 2));
  list-style: none;
}

.jumpnav a {
  display: flex;
  align-items: center;
  height: 100%;
  min-width: 44px;
  padding-inline: var(--sp-4);
  border-block-end: 4px solid transparent;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--transition-time);
}

.jumpnav a:focus-visible {
  outline-offset: -4px;
}

.jumpnav a:hover {
  background-color: var(--color-teal-mid);
}

.jumpnav a[aria-current="true"] {
  border-block-end-color: var(--color-yellow);
  color: var(--color-yellow);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--header-height);
}

.header__dialog-control {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* Yellow button; on the solid yellow header it turns black with yellow text */
.header__cta {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.header--solid .header__cta {
  background-color: var(--color-black);
  border-color: var(--color-black);
  color: var(--color-yellow);
}

.header--solid .header__cta:hover,
.header--solid .header__cta:focus-visible {
  background-color: var(--color-white);
  border-color: var(--color-black);
  color: var(--color-black);
}

.header__branding {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: var(--sp-4);
  color: inherit;
  text-decoration: none;
}

.header__branding:hover {
  color: inherit;
}

.header__logo {
  height: 40px;
  width: auto;
  flex-shrink: 0;
  /* logo.svg is black; render it white over the hero */
  filter: brightness(0) invert(1);
  transition: filter var(--transition-time);
}

.header--solid .header__logo {
  filter: brightness(0);
}

.header__slogan {
  display: none;
  max-width: 17rem;
  padding-inline-start: var(--sp-4);
  border-inline-start: 1px solid currentColor;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.header__menu-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  border-radius: var(--border-radius-md);
  background-color: transparent;
  color: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.header__menu-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
}

.header__menu-button:hover,
.header__menu-button:focus-visible {
  background-color: rgba(255,255,255,.15);
  color: inherit;
  box-shadow: none;
}

.header--solid .header__menu-button:hover,
.header--solid .header__menu-button:focus-visible {
  background-color: rgba(11,12,12,.08);
}

.header :focus-visible {
  outline-color: currentColor;
}

@media screen and (min-width: 48rem) {
  .header__logo {
    height: 48px;
  }

  .header__slogan {
    display: block;
  }
}

/* ============================================================
   8. Footer
   ============================================================ */

footer {
  background-color: var(--color-yellow);
  padding-block: var(--sp-6);
  margin-top: var(--sp-12);
}

/* No gap when the page ends with a tinted section (e.g. the FAQ) */
main:has(> .faq:last-child) + footer {
  margin-top: 0;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4) var(--sp-8);
}

.footer__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--color-black);
}

.footer__logo svg {
  width: auto;
  height: 40px;
  fill: currentColor;
}

.footer__logo:hover,
.footer__logo:focus-visible {
  color: var(--color-teal);
}

/* Verified digital public good badge (LocalGov Drupal in the DPG registry) */
.footer__dpg {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.footer__dpg img {
  width: auto;
  height: 42px;
}

/* Mobile: logo on top, then main links and imprint/privacy as two rows */
.footer__inner nav {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-6);
}

.footer__menu.footer__menu--legal {
  flex-basis: 100%;
}

/* Desktop: one row, imprint/privacy pushed to the far right */
@media screen and (min-width: 48rem) {
  .footer__inner nav {
    flex-basis: 0%;
  }

  .footer__menu.footer__menu--legal {
    flex-basis: auto;
    margin-inline-start: auto;
  }
}

.footer__menu {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__menu li {
  margin: 0;
}

.footer__menu a {
  display: inline-block;
  padding-block: calc((44px - 1lh) / 2); /* 44px target height; inline (not flex) keeps the space before the ↗ */
  text-decoration: none;
  color: var(--color-black);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: color var(--transition-time);
}

.footer__menu a:hover,
.footer__menu a:focus-visible {
  color: var(--color-teal);
  text-decoration: underline;
}

footer :focus-visible {
  outline-color: var(--color-black);
}

/* ============================================================
   9. Dialog menu
   ============================================================ */

.dialog-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 80%;
  height: 100vh;
  height: 100dvh;
  max-height: none; /* browsers cap modal dialogs at 100% - 2em - 6px by default */
  margin: 0;
  padding: 0;
  transition:
    transform var(--transition-time) ease,
    display var(--transition-time) allow-discrete,
    overlay var(--transition-time) allow-discrete;
  transform: translateX(-100%);
  border: 1px solid var(--color-grey-lighter);
  background-color: var(--color-white);
  box-shadow: 8px 0 32px rgba(0,0,0,.18);
}

.dialog-menu[open] {
  transform: translateX(0);
}

@starting-style {
  .dialog-menu[open] {
    transform: translateX(-100%);
  }
}

.dialog-menu__close {
  display: flex;
  justify-content: flex-end;
  padding: var(--sp-4);
  border-block-end: 1px solid var(--color-grey-lighter);
}

.dialog-menu__menu {
  padding: var(--sp-4);
}

.dialog-menu__menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dialog-menu__menu li + li {
  margin-top: var(--sp-2);
}

.dialog-menu__menu a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  text-decoration: none;
  color: var(--color-black);
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: var(--border-radius-md);
  transition: background-color var(--transition-time);
}

.dialog-menu__menu a:hover,
.dialog-menu__menu a:focus-visible {
  background-color: var(--color-grey-lightest);
  color: var(--color-teal);
}

.dialog-menu__menu a:focus-visible {
  outline-offset: -3px;
}

/* Language switch: the languages below each other, full width like the menu links, the current one on yellow */
.dialog-menu__lang {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-block-start: var(--sp-6);
  padding: var(--sp-4) var(--sp-4) 0;
  border-block-start: 1px solid var(--color-grey-light);
}

.dialog-menu__lang-label {
  color: var(--color-grey-dark);
  font-size: var(--font-size-small);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialog-menu__menu .dialog-menu__lang a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  font-size: 1.125rem;
  border: 2px solid var(--color-black);
  border-radius: var(--border-radius-md);
}

.dialog-menu__menu .dialog-menu__lang a[aria-current="true"] {
  background-color: var(--color-yellow);
  color: var(--color-black);
}

/* ============================================================
   10. Banner / Hero
   ============================================================ */

@keyframes banner-bg {
  from { background-position: 0 50%; }
  50%  { background-position: 100% 50%; }
  to   { background-position: 0 50%; }
}

@keyframes fade-slide-up {
  from { opacity: 0; transform: translateY(0.75rem); }
  to   { opacity: 1; transform: translateY(0); }
}

.banner {
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-teal-mid) 50%, var(--color-teal-dark) 100%);
  background-size: 300% 300%;
  animation: banner-bg 12s ease infinite;
  padding-block: clamp(var(--sp-12), 8vw, var(--sp-24));
  padding-block-start: calc(var(--header-height) + clamp(var(--sp-12), 8vw, var(--sp-24)));
}

.banner__inner {
  display: grid;
  gap: var(--sp-12);
}

/* Hero heading uses display font */
.banner h1 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.01em;
}

.banner h1 {
  font-size: var(--font-size-h1);
  line-height: 1.05;
  margin-block-end: var(--sp-6);
}

.banner p {
  color: rgba(255,255,255,.9);
  line-height: var(--line-height-dark);
  letter-spacing: 0.01em;
  max-width: 55ch;
}

.banner__first-content p {
  animation: fade-slide-up 0.7s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .banner,
  .banner__first-content p {
    animation: none;
    opacity: 1;
  }
}

/* Pretitle: small all-caps label above a heading */
.pretitle {
  margin-block-end: var(--sp-1);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--font-size-small);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-yellow);
}

/* Typewriter ([data-typewriter], see script.js): untyped letters keep their space but are invisible */
.typewriter__rest {
  visibility: hidden;
}

/* Zero net width, so the caret never pushes the text */
.typewriter__caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-inline: 2px -4px;
  vertical-align: -0.12em;
  background-color: currentColor;
  animation: caret-blink 0.8s steps(1) infinite;
}

/* Typing is done: blink three times, the last time fading out, and stay gone */
.is-typed .typewriter__caret {
  animation: caret-finish 2.4s linear forwards;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

@keyframes caret-finish {
  0%, 16.6% { opacity: 1; }
  16.7%, 33.3% { opacity: 0; }
  33.4%, 50% { opacity: 1; }
  50.1%, 66.6% { opacity: 0; }
  66.7% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Invisible until typing starts, so the text doesn't flash in full first.
     Transparent rather than hidden, so screen readers still find the heading. */
  .js [data-typewriter]:not(.is-typing) {
    color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .typewriter__caret {
    animation: none;
  }
}

/* ============================================================
   11. Sections
   ============================================================ */

.section {
  padding-block: clamp(var(--sp-12), 6vw, var(--sp-24));
}

.section__header {
  max-width: var(--width-medium);
  margin-block-end: var(--sp-8);
  margin-inline: auto;
  text-align: center;
}

.section__text {
  max-width: 65ch;
}

/* ============================================================
   12. Components
   ============================================================ */

/* --- Prose containers (legal pages) --- */
.prose-content h2 + p {
  margin-block-start: var(--sp-3);
}

.prose-content * + h2 {
  margin-block-start: var(--sp-12);
}

.prose-content h3 {
  font-size: var(--font-size-h3);
  margin-block-start: var(--sp-8);
  margin-block-end: var(--sp-3);
}

.prose-content h4 {
  font-size: 1rem;
  margin-block-start: var(--sp-6);
  margin-block-end: var(--sp-2);
}

.prose-content p + p {
  margin-block-start: 2.5em; /* at least 1.5 × the line height (WCAG 1.4.8) */
}

.prose-content ul,
.prose-content ol {
  margin-block-start: var(--sp-3);
  margin-block-end: var(--sp-4);
}

.prose-content figure {
  margin-block: var(--sp-8);
}

.prose-content figure img {
  border-radius: var(--border-radius-md);
  width: 100%;
  max-width: 560px;
}

/* ============================================================
   13. Responsive
   ============================================================ */

@media screen and (min-width: 48rem) {
  .banner__inner {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

/* ============================================================
   14. Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .header,
  .header::before,
  .header__logo {
    transition: none;
  }

  :root {
    --transition-time: 0.01s;
  }

  .dialog-menu {
    transition: none;
  }

  @starting-style {
    .dialog-menu[open] {
      transform: translateX(0);
    }
  }

  .footer__menu a {
    transition: none;
    transform: none !important;
  }

  :where(button, [type="button"], [type="reset"], [type="submit"], .button):active {
    transform: none;
  }
}

/* ============================================================
   15. Network overview (home)
   ============================================================ */

.network-hero {
  position: relative;
  color: var(--color-white);
  background:
    radial-gradient(ellipse at 50% 70%, var(--color-teal-mid) 0%, transparent 70%),
    var(--color-teal-dark);
  padding-block-start: calc(var(--header-height) + clamp(var(--sp-4), 8vw - 40px, var(--sp-24) - 40px));
  padding-block-end: var(--sp-12);
  overflow: hidden;
}

.network-hero__intro {
  position: relative;
  z-index: 1;
  max-width: 60rem;
}


.network-hero h1 {
  color: var(--color-white);
  font-size: clamp(2.75rem, 9vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin-block-end: var(--sp-6);
}

.network-hero__lead {
  color: rgba(255,255,255,.9);
  font-size: clamp(1.0625rem, 1.6vw, 1.3125rem);
  line-height: var(--line-height-dark);
  max-width: 52ch;
}

.network-hero h1,
.network-hero__lead {
  animation: fade-slide-up 0.7s ease both;
}

.network-hero__lead {
  animation-delay: 0.15s;
}

/* Intro of "the day at a glance": two blocks of text, side by side from tablet width */
.intro-text {
  display: grid;
  gap: var(--sp-6);
  max-width: 72rem;
  margin: 0 auto var(--sp-12);
  text-align: start;
  font-size: 1.125rem;
  line-height: 1.7;
}

.intro-text p {
  margin: 0;
}

@media (min-width: 48rem) {
  .intro-text {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }
}

/* Austria map: a canvas of dots (assets/js/dotmap.js). The SVG is the fallback without JS. */

.network-hero__grid {
  display: grid;
  align-items: center;
  gap: var(--sp-8);
}

.network-hero__date {
  margin-block-end: var(--sp-4);
  color: var(--color-yellow);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.network-hero__lead a {
  color: inherit;
}

.network-hero__location {
  margin-block-end: 0;
  font-size: clamp(1.0625rem, 1.6vw, 1.3125rem);
  font-weight: 600;
  line-height: var(--line-height-tight);
}

.network-hero__directions {
  margin-block: 0 var(--sp-4);
  font-size: var(--font-size-small);
  line-height: var(--line-height-tight);
}

.network-hero__directions a {
  display: inline-block;
  padding-block: var(--sp-1);
}

.network-hero__directions a {
  color: var(--color-white);
}

.network-hero__directions a:hover {
  color: var(--color-yellow);
}

.network-hero__countdown {
  min-height: 5.5rem;
  margin-block-end: var(--sp-6);
  color: var(--color-white);
  font-size: clamp(1.0625rem, 1.6vw, 1.3125rem);
}

.countdown__label,
.countdown__unit span {
  font-size: var(--font-size-small);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.countdown__label {
  display: block;
  margin-block-end: var(--sp-2);
  color: var(--color-yellow);
}

.countdown__units {
  display: flex;
  gap: var(--sp-2);
}

.countdown__unit {
  min-width: 5rem;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--border-radius-md);
  text-align: center;
}

.countdown__unit strong,
.countdown__unit span {
  display: block;
}

.countdown__unit strong {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
}

.countdown__unit span {
  color: rgba(255,255,255,.85);
}

/* The map sits above the text on small screens and fills the whole hero behind the text on large ones.
   The canvas replaces the static image; without JS or WebGL the image stays. */
.hero-map {
  position: relative;
  aspect-ratio: 4 / 3;
  margin-block-start: calc(-1 * var(--sp-8));
}

.hero-map canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

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

.hero-map canvas ~ .hero-map__static {
  display: none;
}

/* With JS the canvas takes over, so the image stays hidden while the map loads and only shows when the
   map cannot run (dotmap.js adds .is-static). Without JS it is always visible. */
.js .hero-map:not(.is-static) .hero-map__static {
  visibility: hidden;
}

.js .network-hero:not(:has(.hero-map.is-static)) {
  background: var(--color-teal-dark);
}

.hero-map__label {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  left: 0;
  top: 0;
  white-space: nowrap;
  color: var(--color-white);
  font-size: var(--font-size-small);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 0 6px var(--color-teal-dark), 0 0 2px var(--color-teal-dark);
  will-change: transform, opacity;
}

.hero-map__pause {
  position: absolute;
  z-index: 2;
  right: var(--sp-4);
  bottom: var(--sp-4);
  padding: var(--sp-2) var(--sp-1);
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--color-white);
  font: inherit;
  font-size: var(--font-size-small);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.hero-map__pause:hover {
  color: var(--color-yellow);
}

/* Nothing to pause without the canvas, or when the map does not move */
.hero-map:not(:has(canvas)) .hero-map__pause {
  display: none;
}

/* The canvas is one flat colour, so the hero matches it instead of its gradient */
.network-hero:has(.hero-map canvas) {
  background: var(--color-teal-dark);
}

@media (prefers-reduced-motion: reduce) {
  .hero-map__pause {
    display: none;
  }
}

@media screen and (min-width: 64rem) {
  .hero-map {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
    margin: 0;
  }

  .hero-map__static {
    position: absolute;
    right: 3%;
    top: 50%;
    width: 55%;
    transform: translateY(-50%);
  }

}

@media screen and (min-width: 64rem) {
  .network-hero__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--sp-8);
  }

  .network-hero__grid h1 {
    font-size: clamp(2.75rem, 5.2vw, 4.75rem);
  }
}


/* Country cards */

.cards__header {
  margin-block-end: var(--sp-8);
}

.cards__header p {
  margin-block-start: var(--sp-3);
  color: var(--color-grey-dark);
}

.cards {
  display: grid;
  gap: var(--sp-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin: 0;
  padding: var(--sp-8) var(--sp-6);
  border: 1px solid var(--color-black);
  border-radius: var(--border-radius-large);
  background-color: var(--color-white);
  transition: box-shadow var(--transition-time), border-color var(--transition-time);
}

.card:hover,
.card:target {
  border-color: var(--color-teal);
  box-shadow: 0 2px 12px rgba(0,68,89,0.10);
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.card__step {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--color-teal);
}

.card__badge {
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 1000px;
  background-color: var(--color-yellow);
  font-size: var(--font-size-small);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card__badge--eval {
  background-color: var(--color-white);
  border: 1px solid var(--color-grey-light);
}

.card__badge--neutral {
  background-color: var(--color-teal);
  color: var(--color-white);
}

.card__title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
}

.card p {
  color: var(--color-grey-dark);
}

.card__note {
  margin-block-start: var(--sp-6);
}

.card__main {
  align-self: flex-start;
  margin-block-start: auto;
}

.card__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  margin: 0;
  padding: var(--sp-4) 0 0;
  border-block-start: 1px solid var(--color-grey-light);
  list-style: none;
}

.card__links li {
  margin: 0;
}

.card__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  font-size: 0.9375rem;
}

/* Full-bleed picture at the top of a card: cancels the card padding on the top and the sides */
.card__image {
  display: block;
  width: calc(100% + 2 * var(--sp-6));
  max-width: none;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 85%;
  margin: calc(-1 * var(--sp-8)) calc(-1 * var(--sp-6)) 0;
  border-radius: calc(var(--border-radius-large) - 1px) calc(var(--border-radius-large) - 1px) 0 0;
}

.card--resources .card__links {
  margin-block-start: auto;
}

/* Same diagonal stripes as "in evaluation" on the map, in soft grey */
.card--eval,
.card--eval:hover {
  border-color: transparent;
  background: repeating-linear-gradient(45deg, var(--color-grey-lighter) 0 10px, var(--color-white) 10px 20px);
}

/* Cards fade and rise slightly as they scroll into view (script.js adds .is-visible
   and a small --delay so cards revealed together appear one after another) */
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .js .card {
    opacity: 0;
  }

  .js .card.is-visible {
    animation: card-in .6s cubic-bezier(.2, .7, .3, 1) var(--delay, 0s) both;
  }
}

@media screen and (min-width: 48rem) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Cards side by side share their rows (meta, title, text, button, links), so the parts line up
     across the cards whatever their text length or number of links */
  .card {
    grid-row: span 5;
  }

  .card:has(> .card__main) {
    display: grid;
    grid-template-rows: subgrid;
    align-content: start;
  }

  .card__main {
    justify-self: start;
    margin-block-start: 0;
  }
}

@media screen and (min-width: 68rem) {
  .cards {
    grid-template-columns: repeat(6, 1fr);
  }

  .card {
    grid-column: span 2;
  }

  .card--eval,
  .card--resources {
    grid-column: span 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .network-hero h1,
  .network-hero__lead {
    animation: none;
  }

  .card {
    transition: none;
  }
}

/* Sections of the event page: speakers, timetable, venue, tickets, audience */

.section--tinted {
  background-color: var(--color-grey-lightest);
}

.section__header p {
  margin-block-start: var(--sp-3);
  margin-inline: auto;
  color: var(--color-grey-dark);
}

.notice {
  max-width: var(--width-medium);
  margin: 0 auto var(--sp-8);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--border-radius-md);
  background-color: var(--color-yellow);
  color: var(--color-black);
  text-align: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
}

/* Speakers: one profile card per person, the face and the name first */
.people {
  display: grid;
  gap: var(--sp-6);
}

.person {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-6);
  border: 1px solid var(--color-black);
  border-radius: var(--border-radius-large);
  background-color: var(--color-white);
}

.person--more {
  border-color: transparent;
  background: repeating-linear-gradient(45deg, var(--color-grey-lighter) 0 10px, var(--color-white) 10px 20px);
}

/* Portrait and tag, name and position: stacked in narrow cards, side by side when the card is wide enough */
.person {
  container-type: inline-size;
}

.person__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
}

.person__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
}

@container (min-width: 26rem) {
  .person__head {
    flex-direction: row;
    align-items: center;
    gap: var(--sp-6);
  }
}

.person__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
}

.person__role {
  margin: 0;
  color: var(--color-teal);
  font-size: 1.125rem;
  font-weight: 700;
}

.person__bio {
  margin: 0;
  color: var(--color-grey-dark);
}

/* Set by script.js: three lines and an ellipsis until "show more" is pressed */
.person__bio--clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.person__bio:focus {
  outline: none;
}

.person__more {
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-teal);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.person__more:hover {
  text-decoration-thickness: 2px;
}

.speaker__avatar {
  flex: none;
  display: block;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--color-grey-lighter);
}

.speaker__avatar--initials {
  display: grid;
  place-items: center;
  background-color: var(--color-teal);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
}

/* Sessions: the talks, with the speaker (or the note that it is open) */
.sessions {
  display: grid;
  gap: var(--sp-6);
}

.session {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-6);
  border: 1px solid var(--color-black);
  border-radius: var(--border-radius-large);
  background-color: var(--color-white);
}

.session p {
  margin: 0;
  color: var(--color-grey-dark);
}

/* Reached from a timetable row: the card stands out for a moment */
.session:target {
  box-shadow: 0 0 0 4px var(--color-yellow);
}

.session--open {
  border-color: var(--color-grey-light);
}

.session .card__title {
  margin: 0;
}

.session__time {
  margin-inline-start: auto;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--color-teal);
}

.session__speaker {
  margin-block-start: auto;
  padding-block-start: var(--sp-3);
  color: var(--color-black);
  font-weight: 600;
}

/* Speaker of a session: small round portraits next to the name */
.session__person {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-block-start: auto;
  padding-block-start: var(--sp-3);
}

.session__person .session__speaker {
  margin: 0;
  padding: 0;
}

.session__avatars {
  display: flex;
  flex: none;
  gap: var(--sp-1);
}

.session__avatars .speaker__avatar {
  width: 48px;
  height: 48px;
  font-size: 1.125rem;
}

.session .session__speaker--tba {
  color: var(--color-grey-dark);
  font-weight: 400;
  font-style: italic;
}

/* Timetable: sessions that are fixed are white with an ink border, open slots use the soft stripes */
.timetable {
  display: grid;
  gap: var(--sp-3);
  max-width: 56rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.timetable__item {
  display: grid;
  gap: var(--sp-1) var(--sp-6);
  padding: var(--sp-4) var(--sp-6);
  border: 1px solid var(--color-grey-light);
  border-radius: var(--border-radius-md);
}

.timetable__item--fixed {
  border-color: var(--color-black);
  background-color: var(--color-white);
}

.timetable__item--break {
  background-color: var(--color-white);
}

.timetable__item--tba {
  border-color: transparent;
  background: repeating-linear-gradient(45deg, var(--color-grey-lighter) 0 10px, var(--color-white) 10px 20px);
  color: var(--color-grey-dark);
}

.timetable__time {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--color-teal);
}

/* Live marker (script.js, event day only): a blinking red dot and "Now" (in the timetable row and in the hero) */
.live-dot {
  display: inline-block;
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: var(--color-live);
}

/* The running row: a red bar on the left edge, drawn inside the border so nothing moves */
.timetable__item--live {
  box-shadow: inset 6px 0 0 var(--color-live);
}

/* The running row: the dot and "Now" sit right of the time (wrapping below it when the time is long) */
.timetable__item--live .timetable__time {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-3);
}

.timetable__live {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--color-live);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: no-preference) {
  .live-dot {
    animation: live-blink 1.4s ease-in-out infinite;
  }

  @keyframes live-blink {
    50% { opacity: 0.2; }
  }
}

/* On the dark hero the red needs to be lighter to stay visible */
.network-hero .live-dot {
  background-color: #ff6b6b;
}

.network-hero .timetable__live,
.now__label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: #ff8a8a;
  font-size: var(--font-size-small);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The running timetable slot in the hero (replaces the countdown on the event day) */
.now {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--border-radius-md);
}

.now__time {
  display: block;
  margin-block-start: var(--sp-1);
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
}

.now__title {
  display: block;
  font-weight: 700;
}

.now__speaker {
  display: block;
  color: rgba(255,255,255,.85);
}

.timetable__title {
  display: block;
  font-weight: 700;
}

.timetable__title a {
  color: inherit;
  text-decoration: none;
}

.timetable__title a:hover {
  color: var(--color-teal);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.timetable__item--fixed .timetable__title {
  color: var(--color-black);
}

.timetable__speaker {
  display: block;
  color: var(--color-grey-dark);
}

/* Tickets: a dark band, like the hero */
.band {
  background-color: var(--color-teal-dark);
  color: var(--color-white);
}

.band .title,
.band .section__header p {
  color: var(--color-white);
}

.audience {
  display: grid;
  gap: var(--sp-6) var(--sp-8);
  max-width: 60rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.audience h3 {
  margin-block-end: var(--sp-2);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
}

.audience p {
  color: var(--color-grey-dark);
}

@media screen and (min-width: 48rem) {
  .sessions {
    grid-template-columns: repeat(2, 1fr);
  }

  .timetable__item {
    grid-template-columns: 11rem 1fr;
  }

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

@media screen and (min-width: 64rem) {
  .people {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* The pair has a picture in one card, so its rows can't be shared: each card stacks its own parts */
@media screen and (min-width: 48rem) {
  .cards--pair .card:has(> .card__main) {
    display: flex;
    grid-template-rows: none;
  }

  .cards--pair .card__links {
    margin-block-start: auto;
  }
}

@media screen and (min-width: 68rem) {
  .cards--pair .card {
    grid-column: span 3;
  }
}

/* FAQ (content and FAQPage JSON-LD come from tools/map/site.mjs) */

.faq {
  background-color: var(--color-grey-lightest);
}

.faq__list {
  display: grid;
  gap: var(--sp-8) var(--sp-12);
}

.faq__item {
  padding-block-start: var(--sp-4);
  border-block-start: 1px solid var(--color-grey-light);
}

.faq__question {
  margin-block-end: var(--sp-2);
}

.faq__item p {
  color: var(--color-grey-dark);
}

.page-dates {
  max-width: none;
  margin-block-start: var(--sp-12);
  font-size: var(--font-size-small);
  color: var(--color-grey-dark);
  text-align: center;
}

@media screen and (min-width: 48rem) {
  .faq__list {
    grid-template-columns: repeat(2, 1fr);
  }
}
