/* Site-wide header, footer and shared bits, in the topic-page style.
   Loaded on every page before the page's own stylesheet (topic.css or styles.css). */

body { margin: 0; background: #FFFFFF; color: #15171A; font-family: 'IBM Plex Sans', system-ui, sans-serif; }
[hidden] { display: none !important; }

.ct-skip-link { position: absolute; left: -9999px; top: auto; }
.ct-skip-link:focus { left: 16px; top: 16px; z-index: 30; padding: 8px 12px; border-radius: 6px; background: #15171A; color: #FFFFFF; }

/* Header */
.ct-header { border-bottom: 1px solid #D9DADC; background: #FFFFFF; font-family: 'IBM Plex Sans', system-ui, sans-serif; }
.ct-header-inner { max-width: 1200px; margin: 0 auto; padding: 14px 24px; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.ct-logo, .ct-logo:hover { display: inline-flex; align-items: baseline; gap: 0.36em; color: #15171A; text-decoration: none; font-family: 'Newsreader', Georgia, serif; font-size: 30px; line-height: 1; letter-spacing: -0.01em; }
/* The tagline sits under the wordmark, lined up with "Collective" (mark 0.8em + gap 0.36em). */
.ct-brand { display: flex; flex-direction: column; gap: 5px; flex: none; }
.ct-tagline { margin: 0; padding-left: 34.8px; color: #5C6169; font-family: 'Newsreader', Georgia, serif; font-style: italic; font-size: 14.5px; line-height: 1.15; letter-spacing: 0.01em; white-space: nowrap; }
.ct-logo-light { font-weight: 400; }
.ct-logo-strong { font-weight: 700; }
/* The mark sits on the text's baseline and reaches the top of the tall letters (l, T), at any size. */
.ct-logo svg, .ct-footer-logo svg { flex-shrink: 0; width: 0.8em; height: 0.8em; }
.ct-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; flex: 1 1 auto; font-size: 15px; font-weight: 500; line-height: 20px; }
.ct-nav a, .ct-nav a:hover { color: #4A4F57; text-decoration: none; padding: 10px 0; border-bottom: 3px solid transparent; }
.ct-nav a:hover { color: #15171A; }
.ct-nav a[aria-current="page"] { color: #15171A; border-bottom-color: #B23A22; }
.ct-header-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* Sites with many areas (src/site/chrome.js): one line with the chosen areas, then "More
   topics". Areas that do not fit wrap onto a second line of the row, which is cut off; the menu
   lists those and the areas not in the row. */
.ct-nav-many { flex: 1 1 280px; flex-wrap: nowrap; min-width: 0; }
.ct-nav-row { display: flex; flex-wrap: wrap; gap: 0 22px; flex: 0 1 auto; min-width: 0; height: 43px; overflow: hidden; }
.ct-topics { position: relative; flex: none; }
.ct-nav-many .ct-topics { margin-left: auto; }
.ct-topics summary { display: inline-flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 3px solid transparent; color: #4A4F57; cursor: pointer; list-style: none; white-space: nowrap; }
.ct-topics summary::-webkit-details-marker { display: none; }
.ct-topics summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.ct-topics[open] summary::after { transform: translateY(1px) rotate(225deg); }
.ct-topics summary:hover, .ct-topics[open] summary { color: #15171A; }
/* A ring only when reached with the keyboard, not after a click. */
.ct-topics summary:focus { outline: none; }
.ct-topics summary:focus-visible { outline: 2px solid #15171A; outline-offset: 4px; border-radius: 4px; }
.ct-nav > a { flex: none; }
.ct-topics-panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 25; display: grid; grid-template-columns: repeat(2, minmax(200px, 1fr)); gap: 0 16px; width: max-content; max-width: min(560px, calc(100vw - 32px)); padding: 10px 14px; border: 1px solid #D9DADC; border-radius: 12px; background: #FFFFFF; box-shadow: 0 8px 24px rgba(21, 23, 26, 0.12); }
.ct-topics-panel a, .ct-topics-panel a:hover { display: block; padding: 8px 0; border-bottom: 0; }
.ct-topics-panel a[aria-current="page"] { color: #B23A22; }
/* Areas already in the row are left out of the menu (src/site/chrome.js). */
.ct-topics-panel a[hidden], .ct-topics[hidden] { display: none; }
/* After a row of areas the menu sits far right, so it opens towards the left. */
.ct-nav-row + .ct-topics .ct-topics-panel { left: auto; right: 0; }

/* Lokalt (src/local/menu.js): the reader's pinned kommuner, then a menu of every kommune with a
   filter box. Same look as "More topics". */
.ct-nav .ct-nav-pin { flex: none; }
.ct-local { position: relative; flex: none; }
.ct-local summary { display: inline-flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 3px solid transparent; color: #4A4F57; cursor: pointer; list-style: none; white-space: nowrap; }
.ct-local summary::-webkit-details-marker { display: none; }
.ct-local summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.ct-local[open] summary::after { transform: translateY(1px) rotate(225deg); }
.ct-local summary:hover, .ct-local[open] summary { color: #15171A; }
.ct-local summary[aria-current="page"] { color: #15171A; border-bottom-color: #B23A22; }
.ct-local summary:focus { outline: none; }
.ct-local summary:focus-visible { outline: 2px solid #15171A; outline-offset: 4px; border-radius: 4px; }
.ct-local-panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 25; width: min(760px, calc(100vw - 48px)); max-height: min(70vh, 640px); overflow-y: auto; box-sizing: border-box; padding: 14px 18px 18px; border: 1px solid #D9DADC; border-radius: 12px; background: #FFFFFF; box-shadow: 0 8px 24px rgba(21, 23, 26, 0.12); }
.ct-local-top { position: sticky; top: -14px; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: -14px -18px 6px; padding: 14px 18px 10px; background: #FFFFFF; }
.ct-local-find { flex: 1 1 220px; box-sizing: border-box; min-height: 40px; padding: 0 12px; border: 1px solid #C9CBCF; border-radius: 8px; font: 15px 'IBM Plex Sans', system-ui, sans-serif; color: #15171A; }
.ct-local-find:focus { outline: none; border-color: #15171A; box-shadow: 0 0 0 4px rgba(21, 23, 26, 0.08); }
.ct-nav .ct-local-all, .ct-nav .ct-local-all:hover { padding: 8px 0; border-bottom: 0; color: #B23A22; font-size: 14px; }
.ct-local-heading { margin: 12px 0 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #5F6670; }
.ct-local-links { columns: 4 140px; column-gap: 16px; }
.ct-nav .ct-local-links a, .ct-nav .ct-local-links a:hover { display: block; padding: 5px 0; border-bottom: 0; font-size: 14px; font-weight: 400; break-inside: avoid; }
.ct-nav .ct-local-links a:hover { color: #B23A22; }
.ct-nav .ct-local-links a[aria-current="page"] { color: #B23A22; font-weight: 600; }
.ct-local-region[hidden], .ct-local-list[hidden], .ct-local-links a[hidden] { display: none; }
.ct-local-none { margin: 12px 0 0; color: #5F6670; font-size: 14px; }
/* Pinned kommuner push the menu to the right, so on wider screens the panel hangs from the
   header's right edge instead, where it always fits. */
@media (min-width: 601px) {
  .ct-header-inner { position: relative; }
  .ct-local { position: static; }
  .ct-local-panel { left: auto; right: 24px; top: calc(100% - 8px); width: min(760px, calc(100% - 48px)); }
}
.ct-login, .ct-login:hover { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid #15171A; border-radius: 999px; color: #15171A; text-decoration: none; font-size: 15px; font-weight: 500; }

/* Account menu */
.ct-account { position: relative; }
/* A round avatar (photo or initial) in a 44px tap target; the name is inside the menu. */
.ct-account-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; list-style: none; }
.ct-account-toggle::-webkit-details-marker { display: none; }
.ct-account-toggle:focus { outline: none; }
.ct-avatar-img, .ct-avatar-initial { width: 36px; height: 36px; border-radius: 50%; box-sizing: border-box; transition: box-shadow 0.15s; }
.ct-avatar-img { display: block; object-fit: cover; background: #EDEBE6; }
.ct-avatar-initial { display: inline-flex; align-items: center; justify-content: center; background: #EDEBE6; color: #3A3F46; font: 600 15px 'IBM Plex Sans', system-ui, sans-serif; }
.ct-account-toggle:hover .ct-avatar-img, .ct-account-toggle:hover .ct-avatar-initial { box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #C9CBCF; }
.ct-account-toggle:focus-visible .ct-avatar-img, .ct-account-toggle:focus-visible .ct-avatar-initial,
.ct-account[open] .ct-avatar-img, .ct-account[open] .ct-avatar-initial { box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #15171A; }
.ct-account-who { display: flex; flex-direction: column; gap: 2px; margin: 0 0 4px; padding: 8px 12px 10px; border-bottom: 1px solid #E3E4E6; }
.ct-account-name { font-size: 15px; font-weight: 500; color: #15171A; overflow-wrap: anywhere; }
.ct-account-handle { font-size: 13px; color: #5F6670; overflow-wrap: anywhere; }
.ct-account-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 25; min-width: 220px; padding: 8px; border: 1px solid #D9DADC; border-radius: 12px; background: #FFFFFF; box-shadow: 0 8px 24px rgba(21, 23, 26, 0.12); }
.ct-account-links { margin: 0; padding: 0; list-style: none; }
.ct-account-links a, .ct-account-logout button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; box-sizing: border-box; border: 0; border-radius: 8px; background: transparent; color: #15171A; text-decoration: none; font: 500 15px 'IBM Plex Sans', system-ui, sans-serif; text-align: left; cursor: pointer; }
.ct-account-links a:hover, .ct-account-logout button:hover { background: #F3F2EE; color: #15171A; }
.ct-account-logout { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid #E3E4E6; }

/* Admin "View as User" banner, under the header on every page */
.ct-view-as { background: #FFF1DE; border-bottom: 1px solid #E8C79A; color: #4A2A05; font-size: 15px; }
.ct-view-as-inner { max-width: 1200px; margin: 0 auto; padding: 10px 24px; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.ct-view-as p { margin: 0; flex: 1 1 420px; }
.ct-view-as form { margin: 0; }
.ct-view-as button { min-height: 40px; padding: 0 16px; border: 1px solid #4A2A05; border-radius: 999px; background: #FFFFFF; color: #4A2A05; font: 500 14px 'IBM Plex Sans', system-ui, sans-serif; cursor: pointer; }

/* Made-up demo content label */
.ct-demo-notice { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border: 1px dashed #B23A22; border-radius: 10px; background: #FDF4F1; color: #5A1D12; font-size: 14px; line-height: 1.45; }
.ct-demo-badge { flex: 0 0 auto; padding: 2px 8px; border-radius: 4px; background: #B23A22; color: #FFFFFF; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

/* Notices after an action (log in, log out …) */
.ct-flash { margin: 0; padding: 12px 16px; border-radius: 10px; background: #EEF3FD; color: #15171A; font-size: 15px; }
.ct-flash-error { background: #FDECEA; color: #7A1F12; }

/* Footer */
.ct-footer { border-top: 1px solid #D9DADC; font-family: 'IBM Plex Sans', system-ui, sans-serif; }
.ct-footer-inner { max-width: 1200px; margin: 0 auto; padding: 24px; box-sizing: border-box; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; font-size: 14px; color: #5F6670; }
.ct-footer-logo { display: inline-flex; align-items: baseline; gap: 0.36em; font-family: 'Newsreader', Georgia, serif; font-size: 20px; line-height: 1; color: #15171A; }
.ct-footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ct-footer-links a, .ct-footer-links a:hover { color: #4A4F57; }

@media (max-width: 600px) {
  .ct-topics-panel { grid-template-columns: 1fr; }
  .ct-footer-inner { padding: 20px 16px; }
}

/* Burger menu, on phones only: the sections, account links and a few footer links drop down
   under the header. */
.ct-menu { display: none; }
.ct-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; color: #15171A; cursor: pointer; list-style: none; }
.ct-menu-toggle::-webkit-details-marker { display: none; }
.ct-menu-icon { position: relative; width: 20px; height: 2px; border-radius: 1px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
.ct-menu[open] .ct-menu-toggle { background: #F3F2EE; }
.ct-menu[open] .ct-menu-icon { background: transparent; box-shadow: none; }
.ct-menu[open] .ct-menu-icon::before, .ct-menu[open] .ct-menu-icon::after { content: ""; position: absolute; left: 0; top: 0; width: 20px; height: 2px; border-radius: 1px; background: #15171A; transform: rotate(45deg); }
.ct-menu[open] .ct-menu-icon::after { transform: rotate(-45deg); }
/* The dimmed page under the open menu is part of the toggle, so tapping it closes the menu. */
.ct-menu[open] .ct-menu-toggle::after { content: ""; position: fixed; left: 0; right: 0; top: 57px; bottom: 0; background: rgba(21, 23, 26, 0.55); cursor: default; }
.ct-menu-panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 1; max-height: calc(100vh - 57px); overflow-y: auto; box-sizing: border-box; padding: 4px 16px 20px; background: #FFFFFF; border-radius: 0 0 18px 18px; box-shadow: 0 12px 32px rgba(21, 23, 26, 0.25); }
.ct-menu-sections { display: flex; flex-direction: column; }
.ct-menu-item, .ct-menu-item:hover { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid #E3E4E6; color: #15171A; text-decoration: none; font-size: 18px; font-weight: 500; }
.ct-menu-item::after { content: ""; margin: 0 6px 0 auto; width: 8px; height: 8px; border-top: 2px solid #5F6670; border-right: 2px solid #5F6670; transform: rotate(45deg); }
.ct-menu-item[aria-current="page"] { padding-left: 14px; box-shadow: inset 4px 0 0 #B23A22; font-weight: 600; }
.ct-menu-login, .ct-menu-login:hover { display: flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 16px; border-radius: 999px; background: #15171A; color: #FFFFFF; text-decoration: none; font-size: 16px; font-weight: 500; }
.ct-menu-account { margin: 16px 0 0; padding: 0; list-style: none; }
.ct-menu-user { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.ct-menu-user-name { font-size: 16px; font-weight: 500; color: #15171A; }
.ct-menu-user-handle { font-size: 13px; color: #5F6670; }
.ct-menu-account form { margin: 0; }
.ct-menu-account a, .ct-menu-account button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0; border: 0; background: transparent; color: #15171A; text-decoration: none; font: 500 16px 'IBM Plex Sans', system-ui, sans-serif; cursor: pointer; }
.ct-menu-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 20px; margin: 12px 0 0; font-size: 14px; }
.ct-menu-more a, .ct-menu-more a:hover { display: inline-flex; align-items: center; min-height: 44px; color: #4A4F57; }

@media (max-width: 600px) {
  /* The header stays at the top while scrolling; anchors land below it. */
  html { scroll-padding-top: 64px; }
  .ct-header { position: sticky; top: 0; z-index: 30; }
  .ct-header-inner { flex-wrap: nowrap; min-height: 56px; padding: 6px 6px 6px 16px; }
  .ct-logo, .ct-logo:hover { font-size: 23px; }
  .ct-brand { gap: 3px; }
  .ct-tagline { padding-left: 26.7px; font-size: 12.5px; }
  .ct-nav, .ct-header-actions { display: none; }
  .ct-menu { display: block; margin-left: auto; }
}

/* ------------------------------------------------------------------------------------------
   Finishing touches, on every page: one set of colours and timings, feedback when a button is
   hovered or pressed, a clear focus ring for keyboard users, calm motion, and small type
   details. Motion is switched off for people who ask their device for less of it.
   ------------------------------------------------------------------------------------------ */
:root {
  --ct-ink: #15171A;
  --ct-ink-soft: #4A4F57;
  --ct-muted: #5F6670;
  --ct-line: #D9DADC;
  --ct-line-strong: #C9CBCF;
  --ct-paper: #FFFFFF;
  --ct-paper-warm: #F3F2EE;
  --ct-brand: #B23A22;
  --ct-brand-soft: #FDF4F1;
  --ct-focus: #1D4ED8;
  --ct-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ct-fast: 140ms;
  --ct-medium: 220ms;
  --ct-shadow-pop: 0 1px 2px rgba(21, 23, 26, 0.06), 0 12px 32px rgba(21, 23, 26, 0.12);
  color-scheme: light;
  accent-color: var(--ct-ink);
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; -webkit-tap-highlight-color: transparent; }
::selection { background: #FBE2D9; color: var(--ct-ink); }

/* Calm page changes: the new page fades in instead of flashing white (browsers that support it). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: var(--ct-ease); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Headlines break into even lines; body text avoids a lonely last word. */
h1, h2, h3, h4,
.tp-title, .tp-headline, .tp-entry-headline, .tp-suggestion-title, .tp-rail-headline,
.fp-page-title, .fpm-hero-title, .fpm-row-headline, .fpm-ask-title, .fpm-topic-title, .fpm-quote-text { text-wrap: balance; }
p, li, .tp-lead, .tp-body, .fpm-hero-dek { text-wrap: pretty; }
/* Times line up in columns */
.tp-time, .fpm-now-time, .fpm-row-meta, .tp-version-when, .tp-source-when { font-variant-numeric: tabular-nums; }

/* One focus ring everywhere, shown only for keyboard use */
:where(a, button, summary, input, textarea, select, [tabindex]):focus-visible { outline: 2px solid var(--ct-focus); outline-offset: 2px; border-radius: 6px; }
.ct-skip-link:focus { box-shadow: var(--ct-shadow-pop); }

/* Pressing any button gives a small, quick nudge */
:where(button, .ct-login, .tp-more, .tp-follow, .tp-publish, .tp-ask-send, .chip, .button) { touch-action: manipulation; }
@media (prefers-reduced-motion: no-preference) {
  :where(button, .ct-login, .tp-more, .button):not(:disabled):active { transform: scale(0.97); }
}

/* Header: stays in reach while reading, slightly see-through */
.ct-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, 0.88); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); }
html { scroll-padding-top: 88px; }
.ct-nav a, .ct-topics summary { transition: color var(--ct-fast) ease, border-color var(--ct-medium) var(--ct-ease); }
.ct-nav a:hover { border-bottom-color: var(--ct-line); }
.ct-nav a[aria-current="page"]:hover { border-bottom-color: var(--ct-brand); }
.ct-login { transition: background-color var(--ct-fast) ease, color var(--ct-fast) ease, transform var(--ct-fast) ease; }
.ct-login:hover { background: var(--ct-ink); color: #FFFFFF; }
/* Logo: the two pages swap colours on hover, two sides of the same story */
.ct-logo .ct-mark-left, .ct-logo .ct-mark-right { transition: fill var(--ct-medium) ease; }
.ct-logo:hover .ct-mark-left { fill: #8A2B1E; }
.ct-logo:hover .ct-mark-right { fill: #C4432B; }

/* Dropdowns (Topics, account) open with a short fade and lift */
@keyframes ct-pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes ct-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ct-slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.ct-topics-panel, .ct-account-panel { box-shadow: var(--ct-shadow-pop); transform-origin: top left; }
.ct-account-panel { transform-origin: top right; }
.ct-topics summary::after { transition: transform var(--ct-medium) var(--ct-ease); }
.ct-topics[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.ct-topics-panel a, .ct-account-links a, .ct-account-logout button { transition: background-color var(--ct-fast) ease, color var(--ct-fast) ease; }
.ct-topics-panel a { margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; }
.ct-topics-panel a:hover { background: var(--ct-paper-warm); color: var(--ct-ink); }
@media (prefers-reduced-motion: no-preference) {
  .ct-topics[open] .ct-topics-panel, .ct-account[open] .ct-account-panel { animation: ct-pop-in var(--ct-medium) var(--ct-ease); }
  .ct-menu[open] .ct-menu-panel { animation: ct-slide-down var(--ct-medium) var(--ct-ease); }
  .ct-menu[open] .ct-menu-toggle::after { animation: ct-fade-in var(--ct-medium) ease; }
}
.ct-menu-toggle { transition: background-color var(--ct-fast) ease; }
.ct-menu-item { transition: background-color var(--ct-fast) ease; }
.ct-menu-item:active { background: var(--ct-paper-warm); }

/* Notices sit softly in the page */
.ct-flash, .ct-demo-notice { animation: ct-fade-in var(--ct-medium) ease; }

/* Footer: at the bottom of the window even on short pages, a little more air */
body { min-height: 100vh; min-height: 100dvh; }
.ct-footer { position: sticky; top: 100vh; top: 100dvh; margin-top: 48px; background: #FAFAF8; }
.ct-footer-inner { padding-top: 32px; padding-bottom: 32px; }
.ct-footer-links a { text-decoration: none; transition: color var(--ct-fast) ease; }
.ct-footer-links a:hover { color: var(--ct-ink); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  @view-transition { navigation: none; }
}
/* On phones the header stays solid: the blur would trap the menu's dimmed backdrop inside it. */
@media (max-width: 600px) {
  .ct-header { background: #FFFFFF; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html { scroll-padding-top: 64px; }
  .ct-footer { margin-top: 32px; }
}

/* ------------------------------------------------------------------------------------------
   Search (src/site/chrome.js, src/public/search.js): a round button in the header opens a
   panel at the top of the window with suggestions as you type. On phones the panel fills the
   screen. Each suggestion is labelled with what it is: category, topic, person, news …
   ------------------------------------------------------------------------------------------ */
.ct-search-toggle, .ct-search-toggle:hover { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 999px; color: #15171A; text-decoration: none; transition: background-color var(--ct-fast) ease; }
.ct-search-toggle:hover { background: var(--ct-paper-warm); }
.ct-search-toggle + .ct-header-actions { margin-left: -22px; }
html.ct-search-open { overflow: hidden; }
.ct-search { position: fixed; inset: 0; z-index: 60; }
.ct-search-backdrop { position: absolute; inset: 0; background: rgba(21, 23, 26, 0.45); }
.ct-search-panel { position: relative; display: flex; flex-direction: column; width: min(680px, calc(100% - 32px)); max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); margin: 72px auto 0; border-radius: 16px; background: #FFFFFF; box-shadow: 0 2px 4px rgba(21, 23, 26, 0.08), 0 24px 64px rgba(21, 23, 26, 0.28); overflow: hidden; }
.ct-search-form { position: relative; display: flex; align-items: center; gap: 12px; flex: none; margin: 0; padding: 0 12px 0 20px; border-bottom: 1px solid #E3E4E6; color: #5F6670; }
.ct-search-input { flex: 1 1 auto; min-width: 0; height: 60px; padding: 0; border: 0; background: transparent; color: #15171A; font: 400 19px 'IBM Plex Sans', system-ui, sans-serif; outline: none; -webkit-appearance: none; appearance: none; }
.ct-search-input:focus-visible { outline: none; }
.ct-search-input::-webkit-search-cancel-button { display: none; }
.ct-search-input::placeholder { color: #8A9099; }
.ct-search-close { flex: none; min-height: 32px; padding: 0 10px; border: 1px solid #D9DADC; border-radius: 8px; background: #FFFFFF; color: #5F6670; font: 500 12px 'IBM Plex Mono', ui-monospace, monospace; cursor: pointer; }
.ct-search-close:hover { border-color: #15171A; color: #15171A; }
/* A thin line runs along the bottom of the box while results are on their way. */
@keyframes ct-search-loading { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.ct-search.is-loading .ct-search-form::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 40%; height: 2px; background: var(--ct-brand); animation: ct-search-loading 0.9s ease-in-out infinite; }
.ct-search-results { overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px 8px; }
.ct-search-results:empty { display: none; }
.ct-sr-heading { margin: 10px 12px 4px; font: 600 12px 'IBM Plex Sans', system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: #5F6670; }
.ct-sr, .ct-sr:hover { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #15171A; text-decoration: none; }
.ct-sr:hover, .ct-sr[aria-selected="true"] { background: #F3F2EE; }
.ct-sr-label { justify-self: start; padding: 2px 8px; border-radius: 999px; background: #F3F2EE; color: #4A4F57; font: 600 10.5px 'IBM Plex Sans', system-ui, sans-serif; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; }
.ct-sr:hover .ct-sr-label, .ct-sr[aria-selected="true"] .ct-sr-label { background: #FFFFFF; }
.ct-sr-label-section, .ct-sr-label-theme, .ct-sr:hover .ct-sr-label-section, .ct-sr:hover .ct-sr-label-theme { background: #FDF4F1; color: #8A2B1E; }
.ct-sr-label-topic, .ct-sr:hover .ct-sr-label-topic, .ct-sr[aria-selected="true"] .ct-sr-label-topic { background: #15171A; color: #FFFFFF; }
.ct-sr-label-person, .ct-sr:hover .ct-sr-label-person { background: #EAF1FB; color: #1D4ED8; }
.ct-sr-text { display: grid; gap: 2px; min-width: 0; }
.ct-sr-title { font-family: 'Newsreader', Georgia, serif; font-size: 18px; line-height: 1.3; font-weight: 600; }
.ct-sr-snippet { font-size: 14px; line-height: 1.45; color: #2E3238; }
.ct-sr-sub { overflow: hidden; font-size: 13px; color: #5F6670; text-overflow: ellipsis; white-space: nowrap; }
.ct-sr mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--ct-brand); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ct-sr-all, .ct-sr-all:hover { display: block; margin-top: 4px; font-size: 15px; font-weight: 500; color: #15171A; }
.ct-sr-empty { margin: 0; padding: 18px 12px; font-size: 15px; line-height: 1.5; color: #2E3238; }
@media (prefers-reduced-motion: no-preference) {
  .ct-search:not([hidden]) .ct-search-backdrop { animation: ct-fade-in var(--ct-medium) ease; }
  .ct-search:not([hidden]) .ct-search-panel { animation: ct-pop-in var(--ct-medium) var(--ct-ease); }
}
@media (max-width: 600px) {
  .ct-search-toggle { margin-left: auto; }
  .ct-menu { margin-left: 0; }
  .ct-search-panel { width: 100%; height: 100%; max-height: none; margin: 0; border-radius: 0; }
  .ct-search-form { padding: 0 8px 0 16px; }
  .ct-search-input { height: 56px; font-size: 17px; }
  /* No Esc key on a phone: the close button shows a cross instead. */
  .ct-search-close { width: 40px; min-height: 40px; padding: 0; border: 0; font-size: 0; }
  .ct-search-close::before { content: "\2715"; font: 400 20px 'IBM Plex Sans', system-ui, sans-serif; color: #15171A; }
  .ct-sr, .ct-sr:hover { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* Photos carry width and height so the page does not jump while they load (src/site/assets.js);
   their shown height still comes from the styles. */
:where(img[width][height]) { height: auto; }
