/*
 * FarosCMS default theme — global styles.
 *
 * 1. Tokens (palette, mode, font, shape)   5. Header and navigation
 * 2. Base and typography                   6. Page templates (heroes, cards, archives, search)
 * 3. Layout, sections, tones               7. Forms
 * 4. Buttons, eyebrow, prose, utilities    8. Footer
 *
 * Block styles live next to each block in blocks/<type>/block.css and load only where used.
 * Site-specific changes belong in custom/assets/css/custom.css.
 */

/* Inter (SIL Open Font License, see assets/fonts/inter/OFL.txt): variable 300–800, split by script so a
   page downloads only the subsets its text uses. Bump ?v= when the files change. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/inter/inter-greek-ext.woff2?v=4.1") format("woff2");
  unicode-range: U+1F00-1FFF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/inter/inter-greek.woff2?v=4.1") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/inter/inter-latin-ext.woff2?v=4.1") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/inter/inter-latin.woff2?v=4.1") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 1. Tokens ---------------------------------------------------------------- */

:root {
  color-scheme: light;

  --font-system: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-sans: "Inter", var(--font-system);
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font-body: var(--font-sans);
  --font-heading: var(--font-sans);
  --heading-weight: 700;
  --heading-tracking: -0.028em;

  --step--2: 0.78rem;
  --step--1: 0.875rem;
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.07rem + 0.3vw, 1.3rem);
  --step-2: clamp(1.35rem, 1.2rem + 0.7vw, 1.75rem);
  --step-3: clamp(1.65rem, 1.35rem + 1.4vw, 2.4rem);
  --step-4: clamp(2rem, 1.5rem + 2.4vw, 3.3rem);
  --step-5: clamp(2.4rem, 1.6rem + 3.8vw, 4.6rem);

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;
  --section-space: clamp(3.5rem, 2.4rem + 5vw, 7rem);

  --container: 76rem;
  --container-narrow: 46rem;
  --gutter: clamp(1.25rem, 0.8rem + 2.4vw, 2.5rem);

  --radius-s: 0.5rem;
  --radius-m: 0.875rem;
  --radius-l: 1.25rem;
  --radius-xl: 1.75rem;
  --radius-button: 999px;

  --shadow-s: 0 1px 2px rgb(15 23 42 / 0.06), 0 1px 1px rgb(15 23 42 / 0.04);
  --shadow-m: 0 22px 44px -28px rgb(15 23 42 / 0.45);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Neutrals, light */
  --n-bg: #ffffff;
  --n-surface: #f5f6f8;
  --n-surface-2: #eceff3;
  --n-text: #0e1726;
  --n-muted: #4a5568;
  --n-border: #e2e6ec;
  --n-border-strong: #c3cad5;

  /* Neutrals, dark (also used by the contrast tone) */
  --d-bg: #0b1220;
  --d-surface: #111a2c;
  --d-surface-2: #182339;
  --d-text: #e8edf4;
  --d-muted: #a6b3c5;
  --d-border: #223049;
  --d-border-strong: #33445f;

  /* Palette: slate (default). l-* for light backgrounds, d-* for dark ones. */
  --accent-l: #1e293b;
  --accent-l-hover: #0f172a;
  --accent-l-soft: #eef2f6;
  --accent-d: #e2e8f0;
  --accent-d-hover: #f8fafc;
  --accent-d-soft: #1a2436;
  --accent-contrast-l: #ffffff;
  --accent-contrast-d: #0b1220;

  --color-danger: #b42318;
  --color-success: #067647;
}

:root[data-theme="indigo"] {
  --accent-l: #4338ca; --accent-l-hover: #3730a3; --accent-l-soft: #eef0ff;
  --accent-d: #a5b4fc; --accent-d-hover: #c7d2fe; --accent-d-soft: #1c2146;
}
:root[data-theme="emerald"] {
  --accent-l: #047857; --accent-l-hover: #065f46; --accent-l-soft: #e7f6ef;
  --accent-d: #6ee7b7; --accent-d-hover: #a7f3d0; --accent-d-soft: #10281f;
}
:root[data-theme="teal"] {
  --accent-l: #0f766e; --accent-l-hover: #115e59; --accent-l-soft: #e6f5f3;
  --accent-d: #5eead4; --accent-d-hover: #99f6e4; --accent-d-soft: #0f2a2a;
}
:root[data-theme="rose"] {
  --accent-l: #be123c; --accent-l-hover: #9f1239; --accent-l-soft: #fdecef;
  --accent-d: #fda4af; --accent-d-hover: #fecdd3; --accent-d-soft: #2d1620;
}
:root[data-theme="amber"] {
  --accent-l: #b45309; --accent-l-hover: #92400e; --accent-l-soft: #fdf3e4;
  --accent-d: #fcd34d; --accent-d-hover: #fde68a; --accent-d-soft: #2a2010;
}

:root[data-font="serif"] {
  --font-body: var(--font-serif);
  --font-heading: var(--font-serif);
  --heading-weight: 600;
  --heading-tracking: -0.015em;
}
:root[data-font="system"] {
  --font-sans: var(--font-system);
}
:root[data-font="display"] {
  --font-heading: var(--font-serif);
  --heading-weight: 600;
  --heading-tracking: -0.015em;
}

:root[data-shape="sharp"] {
  --radius-s: 0.125rem; --radius-m: 0.25rem; --radius-l: 0.375rem; --radius-xl: 0.5rem; --radius-button: 0.25rem;
}
:root[data-shape="rounded"] {
  --radius-s: 0.75rem; --radius-m: 1.125rem; --radius-l: 1.75rem; --radius-xl: 2.5rem; --radius-button: 999px;
}

/* Semantic tokens: light mode */
:root {
  --color-bg: var(--n-bg);
  --color-surface: var(--n-surface);
  --color-surface-2: var(--n-surface-2);
  --color-text: var(--n-text);
  --color-muted: var(--n-muted);
  --color-border: var(--n-border);
  --color-border-strong: var(--n-border-strong);
  --accent: var(--accent-l);
  --accent-hover: var(--accent-l-hover);
  --accent-soft: var(--accent-l-soft);
  --accent-contrast: var(--accent-contrast-l);
  --color-focus: var(--accent-l);
  --card-bg: var(--n-bg);
}

/* The page background outside any toned section (used by blocks that sit on it). */
:root {
  --page-bg: var(--color-bg);
}

/* Dark mode: explicit (.dark, set by the mode switch) or following the system while mode is "system" */
:root.dark {
  color-scheme: dark;
  --color-bg: var(--d-bg);
  --color-surface: var(--d-surface);
  --color-surface-2: var(--d-surface-2);
  --color-text: var(--d-text);
  --color-muted: var(--d-muted);
  --color-border: var(--d-border);
  --color-border-strong: var(--d-border-strong);
  --accent: var(--accent-d);
  --accent-hover: var(--accent-d-hover);
  --accent-soft: var(--accent-d-soft);
  --accent-contrast: var(--accent-contrast-d);
  --color-focus: var(--accent-d);
  --card-bg: var(--d-surface);
  --color-danger: #fda29b;
  --color-success: #75e0a7;
  --shadow-m: 0 22px 44px -28px rgb(0 0 0 / 0.8);
}
@media (prefers-color-scheme: dark) {
  :root[data-mode="system"]:not(.light) {
    color-scheme: dark;
    --color-bg: var(--d-bg);
    --color-surface: var(--d-surface);
    --color-surface-2: var(--d-surface-2);
    --color-text: var(--d-text);
    --color-muted: var(--d-muted);
    --color-border: var(--d-border);
    --color-border-strong: var(--d-border-strong);
    --accent: var(--accent-d);
    --accent-hover: var(--accent-d-hover);
    --accent-soft: var(--accent-d-soft);
    --accent-contrast: var(--accent-contrast-d);
    --color-focus: var(--accent-d);
    --card-bg: var(--d-surface);
    --color-danger: #fda29b;
    --color-success: #75e0a7;
    --shadow-m: 0 22px 44px -28px rgb(0 0 0 / 0.8);
  }
}

/* Legacy aliases used by older templates */
:root {
  --bg: var(--color-bg);
  --text: var(--color-text);
  --muted: var(--color-muted);
  --line: var(--color-border);
  --surface: var(--color-surface);
}

/* 2. Base and typography ------------------------------------------------------ */

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

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

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

body,
body.theme-body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5em;
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  line-height: 1.15;
  text-wrap: balance;
}

h1 { font-size: var(--step-5); line-height: 1.04; }
h2 { font-size: var(--step-4); line-height: 1.08; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); letter-spacing: -0.01em; }
h5,
h6 { font-size: var(--step-0); letter-spacing: 0; }

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

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

img {
  display: block;
}

picture {
  display: block;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-xl) 0;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 3. Layout, sections, tones ------------------------------------------------ */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-shell {
  flex: 1;
  outline: none;
}

.container,
.site-wrap {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.container-narrow {
  width: min(100% - 2 * var(--gutter), var(--container-narrow));
  margin-inline: auto;
}

.section-stack {
  display: grid;
  gap: var(--space-m);
}

/* Blocks: every block is a <section class="block tone-* space-*"> */
.block {
  position: relative;
  padding-block: var(--section-space);
  background: var(--section-bg, var(--color-bg));
  color: var(--color-text);
}

.space-compact { --section-space: clamp(2.5rem, 2rem + 2.5vw, 4rem); }
.space-spacious { --section-space: clamp(5rem, 3rem + 8vw, 10rem); }
.space-none { --section-space: 0px; }

/* Two neighbouring sections on the same background share one gap. A full-width cover image is its own background,
   so the section after it keeps its own top space. */
.block.tone-default:not(.block--cover, .block-hero.block--steps) + .block.tone-default:not(.block-hero),
.block.tone-muted + .block.tone-muted {
  padding-top: 0;
}

.tone-muted {
  --section-bg: var(--color-surface);
  --card-bg: var(--color-bg);
}

.tone-contrast,
.tone-accent {
  color-scheme: dark;
  --color-bg: var(--d-bg);
  --color-surface: var(--d-surface);
  --color-surface-2: var(--d-surface-2);
  --color-text: var(--d-text);
  --color-muted: var(--d-muted);
  --color-border: var(--d-border);
  --color-border-strong: var(--d-border-strong);
  --accent: var(--accent-d);
  --accent-hover: var(--accent-d-hover);
  --accent-soft: var(--accent-d-soft);
  --accent-contrast: var(--accent-contrast-d);
  --color-focus: var(--accent-d);
  --card-bg: var(--d-surface);
  --section-bg: var(--d-bg);
}

:root.dark .tone-contrast {
  --section-bg: var(--d-surface);
  --card-bg: var(--d-surface-2);
}
@media (prefers-color-scheme: dark) {
  :root[data-mode="system"]:not(.light) .tone-contrast {
    --section-bg: var(--d-surface);
    --card-bg: var(--d-surface-2);
  }
}

/* Accent band: the palette colour as background, with matching text and controls. */
.tone-accent {
  color-scheme: light dark;
  --section-bg: var(--accent-l);
  --color-text: var(--accent-contrast-l);
  /* Full-strength text: a lighter shade would drop below 4.5:1 on the brighter palettes. */
  --color-muted: var(--accent-contrast-l);
  --color-border: color-mix(in srgb, var(--accent-contrast-l) 22%, transparent);
  --color-border-strong: color-mix(in srgb, var(--accent-contrast-l) 50%, transparent);
  --accent: var(--accent-contrast-l);
  --accent-hover: var(--accent-contrast-l);
  --accent-contrast: var(--accent-l);
  --color-focus: var(--accent-contrast-l);
  --card-bg: color-mix(in srgb, var(--accent-contrast-l) 10%, transparent);
}

:root:not([data-theme]) .tone-accent,
:root[data-theme="slate"] .tone-accent {
  --section-bg: #111827;
}

/* 4. Buttons, eyebrow, prose, utilities -------------------------------------- */

.btn {
  --btn-bg: transparent;
  --btn-text: var(--color-text);
  --btn-border: var(--color-border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.875rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-button);
  background: var(--btn-bg);
  color: var(--btn-text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover {
  --btn-border: var(--color-text);
  color: var(--btn-text);
}

.btn-primary {
  --btn-bg: var(--accent);
  --btn-text: var(--accent-contrast);
  --btn-border: var(--accent);
}

.btn-primary:hover {
  --btn-bg: var(--accent-hover);
  --btn-border: var(--accent-hover);
}

.btn-icon {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}

.btn:hover .btn-icon {
  transform: translateX(3px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-l);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.text-link .btn-icon {
  width: 1em;
  height: 1em;
}

.text-link:hover .btn-icon {
  transform: translateX(3px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 var(--space-s);
  color: var(--accent);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.section-header {
  max-width: 44rem;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}

.section-header.is-center {
  margin-inline: auto;
  text-align: center;
}

.section-header.is-center .eyebrow {
  justify-content: center;
}

.section-header > :last-child {
  margin-bottom: 0;
}

.section-title {
  margin: 0 0 var(--space-s);
}

.lead {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--step-1);
  line-height: 1.6;
}

.prose,
.prose-block {
  font-size: var(--step-0);
  line-height: 1.75;
}

.prose > :first-child,
.prose-block > :first-child {
  margin-top: 0;
}

.prose > :last-child,
.prose-block > :last-child {
  margin-bottom: 0;
}

.prose :is(h2, h3, h4),
.prose-block :is(h2, h3, h4) {
  margin: 1.8em 0 0.6em;
}

.prose h2,
.prose-block h2 { font-size: var(--step-3); }
.prose h3,
.prose-block h3 { font-size: var(--step-2); }

.prose :is(ul, ol),
.prose-block :is(ul, ol) {
  padding-left: 1.25em;
  margin: 0 0 1.2em;
}

.prose li + li,
.prose-block li + li {
  margin-top: 0.35em;
}

.prose li::marker,
.prose-block li::marker {
  color: var(--accent);
}

.prose blockquote,
.prose-block blockquote {
  margin: 1.6em 0;
  padding-left: 1.2em;
  border-left: 3px solid var(--accent);
  color: var(--color-muted);
  font-size: var(--step-1);
}

.prose img,
.prose-block img {
  border-radius: var(--radius-m);
}

.prose :not(pre) > code,
.prose-block :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
  background: var(--color-surface-2);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose pre,
.prose-block pre {
  overflow-x: auto;
  padding: var(--space-s);
  border-radius: var(--radius-m);
  background: var(--color-surface);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose table,
.prose-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.prose :is(th, td),
.prose-block :is(th, td) {
  padding: 0.6em 0.75em;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.prose th,
.prose-block th {
  border-bottom-color: var(--color-border-strong);
  font-weight: 650;
}

.table-wrap {
  margin: 1.6em 0;
  overflow-x: auto;
}

.table-wrap:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.table-wrap table {
  min-width: 28rem;
  margin: 0;
}

.checklist ul,
ul.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li,
ul.checklist li {
  position: relative;
  padding-left: 1.9em;
}

.checklist li::before,
ul.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 1.2em;
  height: 1.2em;
  border-radius: 999px;
  background: var(--accent-soft) no-repeat center / 0.8em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

.icon-badge {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-m);
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-badge svg {
  width: 1.5rem;
  height: 1.5rem;
}

.media-frame {
  overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--color-surface-2);
}

/* <picture> wrappers from image() fill their frame like the <img> inside. */
.media-frame picture,
.content-item-media picture {
  width: 100%;
  height: 100%;
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 300;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-s);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0.75rem);
}

/* 5. Header and navigation ---------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 50;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.header-spacer {
  height: 0;
}

body.header-sticky .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 12px 32px -24px rgb(15 23 42 / 0.4);
  animation: header-slide-down 0.24s var(--ease) both;
}

@keyframes header-slide-down {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.header-row {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  min-height: 4.5rem;
  padding: 0.6rem 0;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text);
  text-decoration: none;
}

.site-brand:hover {
  color: var(--color-text);
}

.site-brand-logo {
  width: auto;
  height: 2.25rem;
}

.site-brand-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: var(--heading-weight);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.site-brand-tagline {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.site-nav {
  margin-left: auto;
}

.nav-list,
.footer-list,
.search-results {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list-1 {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-button);
  color: var(--color-muted);
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active,
.nav-link.is-trail,
.nav-item.is-active > .nav-link,
.nav-item.is-trail > .nav-link {
  color: var(--color-text);
  background: var(--color-surface);
}

.nav-item.is-active > .nav-link {
  color: var(--color-text);
}

.nav-item.nav-cta > .nav-link,
.nav-link.nav-cta {
  margin-left: 0.4rem;
  padding-inline: 1.05rem;
  background: var(--accent);
  color: var(--accent-contrast);
}

.nav-item.nav-cta > .nav-link:hover,
.nav-link.nav-cta:hover,
.nav-item.nav-cta.is-active > .nav-link {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}

.nav-list-2,
.nav-list-3 {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 20;
  display: none;
  min-width: 14rem;
  padding: 0.4rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-bg);
  box-shadow: var(--shadow-m);
}

.nav-list-2::before {
  content: "";
  position: absolute;
  inset: -0.5rem 0 auto;
  height: 0.5rem;
}

.nav-list-3 {
  top: -0.4rem;
  left: calc(100% + 0.4rem);
}

.nav-item:hover > .nav-list,
.nav-item:focus-within > .nav-list,
.nav-item.is-open > .nav-list {
  display: block;
}

/* Dismissed with Escape: stays closed until the pointer or focus leaves the item. */
.nav-item.is-dismissed > .nav-list {
  display: none;
}

.nav-list-2 .nav-link,
.nav-list-3 .nav-link {
  width: 100%;
  border-radius: var(--radius-s);
}

.header-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.25rem;
}

.search-link,
.mobile-menu-button,
.mobile-drawer-close {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
}

.search-link:hover,
.mobile-menu-button:hover,
.mobile-drawer-close:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.search-link svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.mobile-menu-button {
  display: none;
  gap: 0.2rem;
  align-content: center;
}

.mobile-menu-button span {
  display: block;
  width: 1rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.lang-switcher {
  display: inline-flex;
  gap: 0.3rem;
}

.lang-switcher a {
  display: inline-grid;
  place-items: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.lang-switcher a:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.mode-switch {
  display: inline-grid;
  place-items: center;
  min-height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.mode-switch-track {
  display: inline-flex;
  align-items: center;
  width: 2.6rem;
  height: 1.45rem;
  padding: 0.15rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
}

.mode-switch-thumb {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: var(--color-muted);
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}

.mode-switch.is-dark .mode-switch-thumb {
  transform: translateX(1.1rem);
  background: var(--accent);
}

.mode-switch:focus-visible {
  outline: none;
}

.mode-switch:focus-visible .mode-switch-track {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Mobile drawer: hidden from keyboard and screen readers while closed. */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgb(11 18 32 / 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.mobile-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 130;
  display: flex;
  flex-direction: column;
  width: min(22rem, 88vw);
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
  visibility: hidden;
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease), visibility 0s linear 0.3s;
}

body.mobile-menu-open {
  overflow: hidden;
}

body.mobile-menu-open .mobile-drawer-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.mobile-menu-open .mobile-drawer {
  visibility: visible;
  transform: translateX(0);
  transition: transform 0.3s var(--ease), visibility 0s;
}

/* Phone menu styles (Theme settings > Header > Phone menu). The side drawer from the left is the base above. */
.mobile-drawer {
  height: 100vh;
  height: 100dvh;
}

.mobile-drawer--drawer_right {
  inset: 0 0 0 auto;
  border-right: 0;
  border-left: 1px solid var(--color-border);
  transform: translateX(100%);
}

.mobile-drawer--fullscreen {
  inset: 0;
  width: auto;
  border: 0;
  opacity: 0;
  transform: none;
  transition: opacity 0.25s var(--ease), visibility 0s linear 0.25s;
}

body.mobile-menu-open .mobile-drawer--fullscreen {
  opacity: 1;
  transition: opacity 0.25s var(--ease), visibility 0s;
}

.mobile-drawer--fullscreen .mobile-drawer-nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-m) var(--space-l);
}

.mobile-drawer--fullscreen .mobile-link {
  padding: 0.45rem 0.25rem;
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 1rem + 3.5vw, 2.4rem);
  font-weight: var(--heading-weight);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.mobile-drawer--fullscreen .mobile-item .mobile-menu .mobile-link {
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 550;
  letter-spacing: 0;
}

.mobile-drawer--top_sheet,
.mobile-drawer--bottom_sheet {
  width: auto;
  height: auto;
  max-height: 88vh;
  max-height: 88dvh;
  border: 0;
}

.mobile-drawer--top_sheet {
  inset: 0 0 auto;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-l) var(--radius-l);
  box-shadow: 0 24px 48px -24px rgb(11 18 32 / 0.5);
  transform: translateY(-100%);
}

.mobile-drawer--bottom_sheet {
  inset: auto 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--color-border);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: 0 -24px 48px -24px rgb(11 18 32 / 0.5);
  transform: translateY(100%);
}

/* The little handle that says "this comes from the bottom". */
.mobile-drawer--bottom_sheet::before {
  content: "";
  flex: none;
  align-self: center;
  width: 2.75rem;
  height: 0.3rem;
  margin-top: 0.6rem;
  border-radius: 999px;
  background: var(--color-border-strong);
}

.mobile-drawer--bottom_sheet .mobile-drawer-header {
  border-bottom: 0;
  padding-bottom: 0.25rem;
}

body.mobile-menu-open .mobile-drawer--top_sheet,
body.mobile-menu-open .mobile-drawer--bottom_sheet {
  transform: translateY(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem var(--space-m);
  border-bottom: 1px solid var(--color-border);
}

.mobile-drawer-title {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
}

.mobile-drawer-close {
  font-size: 1.4rem;
  line-height: 1;
}

.mobile-drawer-nav {
  overflow: auto;
  padding: var(--space-s) var(--space-s);
}

.mobile-menu {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-item .mobile-menu {
  display: none;
  margin-top: 0.2rem;
  padding-left: 0.85rem;
}

.mobile-item.is-open > .mobile-menu {
  display: grid;
}

.mobile-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.25rem;
}

.mobile-link {
  display: block;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-s);
  color: var(--color-text);
  font-weight: 550;
  text-decoration: none;
}

.mobile-link:hover,
.mobile-item.is-active > .mobile-link,
.mobile-item.is-trail > .mobile-link,
.mobile-item.is-active > .mobile-link-row > .mobile-link,
.mobile-item.is-trail > .mobile-link-row > .mobile-link {
  background: var(--color-surface);
  color: var(--color-text);
}

.mobile-submenu-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-bg);
  color: var(--color-muted);
  cursor: pointer;
}

.mobile-item.is-open > .mobile-link-row > .mobile-submenu-toggle {
  background: var(--color-surface);
  color: var(--color-text);
}

.drawer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  margin-top: auto;
  padding: var(--space-s) var(--space-m);
  border-top: 1px solid var(--color-border);
}

.drawer-icons-wrap {
  padding: 0 var(--space-m) var(--space-m);
}

.footer-icons,
.drawer-icons {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Header options (Theme settings > Header) ------------------------------------ */

.site-header[data-sticky="always"] {
  position: sticky;
  top: 0;
}

body.header-solid .site-header[data-sticky="always"] {
  background: color-mix(in srgb, var(--color-bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}

.topbar {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: var(--step--1);
}

.topbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.45rem 0;
}

.topbar p,
.header-contacts {
  margin: 0;
}

.topbar-contacts,
.header-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.topbar a,
.header-contacts a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: inherit;
  text-decoration: none;
}

.topbar a:hover,
.header-contacts a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

.topbar svg,
.header-contacts svg {
  width: 1rem;
  height: 1rem;
  color: var(--accent);
}

.header-contacts {
  margin-left: auto;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.header-cta {
  min-height: 2.5rem;
  margin-left: 0.25rem;
  padding: 0.5rem 1.1rem;
}

.drawer-cta {
  width: 100%;
  margin-top: var(--space-s);
}

.header-bar {
  border-top: 1px solid var(--color-border);
  background: var(--section-bg, transparent);
  color: var(--color-text);
}

.header-bar .site-nav {
  margin-left: 0;
}

.header-bar .nav-list-1 {
  flex-wrap: wrap;
  padding: 0.4rem 0;
}

.header-bar.tone-accent .nav-link:not(.nav-cta):hover,
.header-bar.tone-accent .nav-item.is-active > .nav-link:not(.nav-cta),
.header-bar.tone-accent .nav-item.is-trail > .nav-link:not(.nav-cta) {
  background: color-mix(in srgb, var(--accent-contrast-l) 16%, transparent);
  color: var(--accent-contrast-l);
}

.header-bar.tone-accent .nav-link:not(.nav-cta) {
  color: var(--accent-contrast-l);
}

/* Stacked: brand left, contacts and tools right, menu in the bar below. */
.header--stacked .header-tools {
  margin-left: auto;
}

.header--stacked .header-contacts + .header-tools {
  margin-left: var(--space-m);
}

/* Centered: brand in the middle, navigation centred underneath. */
.header--centered .header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}

.header--centered .mobile-menu-button {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.header--centered .site-brand {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

.header--centered .header-tools {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.header--centered .header-bar .nav-list-1 {
  justify-content: center;
}

/* Minimal: brand, CTA, and a menu button on every screen size. */
.header--minimal .mobile-menu-button {
  display: inline-grid;
  order: 3;
}

.header--minimal .header-tools {
  margin-left: auto;
}

/* Transparent over an opening hero; solid again once the page scrolls under it. */
.has-transparent-header .site-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  border-bottom-color: transparent;
  background: transparent;
}

.has-transparent-header .site-header[data-sticky="always"] {
  position: fixed;
}

.has-transparent-header .site-header .topbar,
.has-transparent-header .site-header .header-bar.tone-default {
  border-color: color-mix(in srgb, currentColor 18%, transparent);
  background: transparent;
}

body.has-transparent-header.header-solid .site-header[data-sticky="always"],
body.has-transparent-header.header-sticky .site-header {
  border-bottom-color: var(--color-border);
  background: color-mix(in srgb, var(--color-bg) 90%, transparent);
}

/* Light text over a dark hero until the header turns solid (sticky modes differ in when). */
body.has-transparent-header:not(.header-sticky) .site-header.is-on-dark:not([data-sticky="always"]),
body.has-transparent-header:not(.header-solid) .site-header.is-on-dark[data-sticky="always"] {
  color-scheme: dark;
  --color-text: #ffffff;
  --color-muted: rgb(255 255 255 / 0.88);
  --color-border: rgb(255 255 255 / 0.28);
  --color-border-strong: rgb(255 255 255 / 0.5);
  --color-surface: rgb(255 255 255 / 0.14);
  --color-bg: transparent;
  --accent: #ffffff;
  --accent-hover: #e8edf4;
  --accent-contrast: #0b1220;
  --color-focus: #ffffff;
  color: #ffffff;
}

.has-transparent-header .main-shell > .block:first-child {
  padding-top: calc(var(--header-height, 4.5rem) + clamp(2.5rem, 1rem + 5vw, 6rem));
}

.has-transparent-header .main-shell > .block-hero:is(.block--cover, .block--steps):first-child {
  padding-top: calc(var(--header-height, 4.5rem) + clamp(5rem, 10vw, 9rem));
}

/* A photo behind the title area: a darker top edge under the transparent header keeps its light text readable. */
.has-transparent-header .main-shell > .single-hero.has-image:first-child::before {
  background-image: linear-gradient(180deg, rgb(11 18 32 / 0.6), rgb(11 18 32 / 0.8)), var(--hero-image);
}

/* The same when the page opens with its title area: room for the header on top of each layout's own space. */
.has-transparent-header .main-shell > .single-hero:first-child .single-hero-inner {
  padding-top: calc(var(--header-height, 4.5rem) + clamp(4.5rem, 12vw, 9rem));
}

.has-transparent-header .main-shell > .single-hero-centered:first-child .single-hero-inner {
  padding-top: calc(var(--header-height, 4.5rem) + clamp(3rem, 8vw, 5.5rem));
}

.has-transparent-header .main-shell > .single-hero-split:first-child .single-hero-inner {
  padding-top: calc(var(--header-height, 4.5rem) + clamp(3rem, 8vw, 6rem));
}

.has-transparent-header .main-shell > .single-hero-minimal:first-child .single-hero-inner {
  padding-top: calc(var(--header-height, 4.5rem) + clamp(3.5rem, 9vw, 7rem));
}

.has-transparent-header .main-shell > .single-hero-cover:first-child .single-hero-inner {
  padding-top: calc(var(--header-height, 4.5rem) + clamp(6rem, 12vw, 10rem));
}

/* Bottom bar on phones: menu, call, email, and the header CTA within thumb reach. */
.mobile-bar {
  display: none;
}

@media (max-width: 860px) {
  body.has-mobile-bar {
    padding-bottom: calc(3.75rem + env(safe-area-inset-bottom));
  }

  .has-mobile-bar .mobile-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-bg) 94%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
  }

  .has-mobile-bar .header-cta {
    display: none;
  }
}

.mobile-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 3.75rem;
  padding: 0.3rem;
  border: 0;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.mobile-bar-item svg {
  width: 1.35rem;
  height: 1.35rem;
}

.mobile-bar-item.is-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.mobile-bar-item:focus-visible {
  outline-offset: -3px;
}

/* 6. Page templates ------------------------------------------------------------- */

.single-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  background: var(--hero-bg, var(--color-surface));
}

.single-hero.has-image {
  /* Dark underneath the photo: the light text stays readable while the picture loads, or if it never does. */
  background: var(--hero-bg, #0b1220);
  color: #f8fafc;
}

.single-hero.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: linear-gradient(180deg, rgb(11 18 32 / 0.25), rgb(11 18 32 / 0.8)), var(--hero-image);
  background-position: center;
  background-size: cover;
}

.single-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-xs);
  padding: clamp(4.5rem, 12vw, 9rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

.single-hero-inner h1 {
  max-width: 22ch;
  margin: 0;
  font-size: var(--step-5);
}

.single-hero-subtitle {
  max-width: 62ch;
  margin: 0;
  color: var(--color-muted);
  font-size: var(--step-1);
}

.single-hero.has-image .single-hero-subtitle,
.single-hero.has-image .single-hero-meta {
  color: rgb(248 250 252 / 0.9);
}

.single-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0;
  color: var(--color-muted);
  font-size: var(--step--1);
}

.single-hero-meta a {
  color: inherit;
}

.single-hero-centered {
  border-bottom: 0;
  background: var(--hero-bg, var(--color-bg));
  color: var(--color-text);
}

.single-hero-centered .single-hero-inner {
  justify-items: center;
  gap: var(--space-s);
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.2rem, 6vw, 4rem);
  text-align: center;
}

.single-hero-centered .single-hero-inner h1 {
  max-width: 18ch;
}

.single-hero-centered .single-hero-subtitle {
  margin: 0 auto;
  max-width: 56ch;
}

.single-hero-centered .single-hero-meta {
  justify-content: center;
}

.single-hero-media {
  width: 100%;
  margin-top: clamp(1.25rem, 3vw, 2.5rem);
  overflow: hidden;
  border-radius: var(--radius-l);
}

.single-hero-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.single-hero-centered + .single-body {
  padding-top: 0;
}

/* Title layouts shared with the Hero block: split, cover and minimal. */
.single-hero-split,
.single-hero-minimal {
  isolation: isolate;
  border-bottom: 0;
  background: var(--hero-bg, var(--color-bg));
  color: var(--color-text);
}

/* The soft glow in the palette colour behind the text, as in the Hero block. */
.single-hero-split::before,
.single-hero-minimal::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -30%;
  right: -15%;
  width: min(70vw, 56rem);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
  pointer-events: none;
}

.single-hero-split .single-hero-inner {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

.single-hero-split.no-media .single-hero-inner {
  grid-template-columns: minmax(0, 1fr);
}

.single-hero-content {
  display: grid;
  gap: var(--space-xs);
}

.single-hero-split .single-hero-media {
  margin-top: 0;
  box-shadow: var(--shadow-m);
}

.single-hero-split .single-hero-media img {
  aspect-ratio: 4 / 5;
  max-height: 40rem;
}

.single-hero-minimal .single-hero-inner {
  justify-items: center;
  gap: var(--space-s);
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}

.single-hero-minimal .single-hero-inner h1 {
  max-width: 15ch;
  font-size: clamp(2.8rem, 1.5rem + 5.8vw, 6.25rem);
  line-height: 1.03;
}

.single-hero-minimal .single-hero-subtitle {
  margin: 0 auto;
  max-width: 56ch;
}

.single-hero-minimal .single-hero-meta {
  justify-content: center;
}

.single-hero-minimal::before {
  top: -45%;
  right: auto;
  left: 50%;
  translate: -50% 0;
}

/* Cover: light text over a full-width image, kept readable by two shades. */
.single-hero-cover {
  display: grid;
  align-items: end;
  min-height: min(70vh, 40rem);
  border-bottom: 0;
  background: #0b1220;
  color: #ffffff;
  color-scheme: dark;
  --color-text: #ffffff;
  --color-muted: rgb(255 255 255 / 0.86);
  --color-focus: #ffffff;
}

.single-hero-cover .single-hero-inner {
  padding: clamp(6rem, 12vw, 10rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

.single-hero-cover .single-hero-subtitle,
.single-hero-cover .single-hero-meta {
  color: rgb(255 255 255 / 0.9);
}

.single-hero-cover-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.single-hero-cover-media picture,
.single-hero-cover-media img {
  width: 100%;
  height: 100%;
}

.single-hero-cover-media img {
  object-fit: cover;
}

.single-hero-cover-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(11 18 32 / 0.55) 0%, rgb(11 18 32 / 0.15) 65%, transparent 100%),
    linear-gradient(180deg, rgb(11 18 32 / 0.25) 0%, rgb(11 18 32 / 0.35) 40%, rgb(11 18 32 / 0.88) 100%);
}

@media (max-width: 900px) {
  .single-hero-split .single-hero-inner {
    grid-template-columns: 1fr;
  }

  .single-hero-split .single-hero-media img {
    aspect-ratio: 4 / 3;
  }
}

.single-body {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem);
}

.single-body > .prose-block,
.single-body.is-narrow {
  max-width: var(--container-narrow);
}

/* "With sidebar" template */
.with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: start;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem);
}

.with-sidebar-main {
  max-width: var(--container-narrow);
}

.with-sidebar-main :is(h2, h3) {
  scroll-margin-top: calc(var(--header-height, 4.5rem) + 1.5rem);
}

.with-sidebar-aside {
  position: sticky;
  top: calc(var(--header-height, 4.5rem) + 1.5rem);
  display: grid;
  gap: var(--space-m);
}

.sidebar-card {
  padding: var(--space-m);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background: var(--card-bg);
}

.sidebar-title {
  margin: 0 0 var(--space-xs);
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-links {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-links a {
  display: block;
  padding: 0.4rem 0.6rem;
  margin-inline: -0.6rem;
  border-radius: var(--radius-s);
  color: var(--color-text);
  font-size: 0.95rem;
  line-height: 1.4;
  text-decoration: none;
}

.sidebar-links a:hover {
  background: var(--color-surface);
}

.sidebar-links a.is-current {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-cta {
  background: var(--color-surface);
}

.sidebar-cta-title {
  margin: 0 0 var(--space-2xs);
  font-size: var(--step-1);
}

.sidebar-cta p {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.sidebar-contacts {
  display: grid;
  gap: 0.4rem;
}

.sidebar-contacts a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  text-decoration: none;
}

.sidebar-contacts svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--accent);
}

.sidebar-cta .btn {
  width: 100%;
}

@media (max-width: 960px) {
  .with-sidebar {
    /* minmax(0, …): a wide table or image scrolls inside its column instead of widening the page. */
    grid-template-columns: minmax(0, 1fr);
  }

  .with-sidebar-aside {
    position: static;
  }
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: clamp(1rem, 0.6rem + 1.5vw, 1.75rem);
}

/* Card: one link (the title) stretched over the whole card. */
.content-item {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background: var(--card-bg);
  transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.content-item:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-m);
}

@media (prefers-reduced-motion: no-preference) {
  .content-item:hover {
    transform: translateY(-3px);
  }
}

.content-item:focus-within {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.content-item-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-surface-2);
}

.content-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.content-item:hover .content-item-media img {
  transform: scale(1.03);
}

.content-item-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-m);
}

.content-item-title {
  margin: 0;
  font-size: var(--step-1);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.content-item-title a {
  color: var(--color-text);
  text-decoration: none;
}

.content-item-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.content-item-title a:focus-visible {
  outline: none;
}

.content-item p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.content-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.75rem;
  margin: 0;
  color: var(--color-muted);
  font-size: var(--step--1);
}

.content-meta .content-type {
  color: var(--accent);
  font-weight: 600;
}

.content-item-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: var(--space-2xs);
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.content-item-more svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s var(--ease);
}

.content-item:hover .content-item-more svg {
  transform: translateX(3px);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2xs);
}

.search-results {
  display: grid;
  gap: var(--space-s);
}

/* 7. Forms ----------------------------------------------------------------------- */

.form-section {
  display: grid;
  gap: var(--space-s);
}

.form-grid {
  display: grid;
  gap: var(--space-s);
}

.form-grid label,
.form-grid fieldset,
.form-field {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.form-grid label > span:first-child,
.form-grid legend {
  font-size: 0.95rem;
  font-weight: 600;
}

.form-grid fieldset {
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
}

.form-grid legend {
  padding: 0 0.35rem;
}

.form-grid input:not([type="checkbox"], [type="radio"]),
.form-grid textarea,
.form-grid select,
.search-form input {
  width: 100%;
  min-height: 2.875rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.form-grid textarea {
  min-height: 8rem;
  resize: vertical;
}

.form-grid input:not([type="checkbox"], [type="radio"]):focus,
.form-grid textarea:focus,
.form-grid select:focus,
.search-form input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.form-grid [aria-invalid="true"] {
  border-color: var(--color-danger) !important;
}

.form-grid input[type="checkbox"],
.form-grid input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
}

.form-grid .inline {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 400;
}

.form-grid small {
  color: var(--color-muted);
  font-size: var(--step--1);
}

.form-grid button,
.search-form button {
  justify-self: start;
  min-height: 2.875rem;
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-button);
  background: var(--accent);
  color: var(--accent-contrast);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.form-grid button:hover,
.search-form button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.form-required {
  color: var(--color-danger);
}

.form-success,
.form-error {
  margin: 0;
}

.form-grid .form-error,
small.form-error {
  color: var(--color-danger);
  font-weight: 500;
}

p.form-success,
p.form-error {
  padding: var(--space-s);
  border-radius: var(--radius-m);
  border: 1px solid currentColor;
}

p.form-success {
  color: var(--color-success);
  background: color-mix(in srgb, var(--color-success) 8%, transparent);
}

p.form-error {
  color: var(--color-danger);
  background: color-mix(in srgb, var(--color-danger) 8%, transparent);
}

/* Card around a form placed in a block (form, contact). */
.form-block-card {
  padding: clamp(1.5rem, 1rem + 2vw, 2.75rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  box-shadow: var(--shadow-s);
}

.form-honeypot {
  position: absolute;
  left: -99999px;
}

/* 8. Footer ----------------------------------------------------------------------- */

.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: 0;
  color-scheme: dark;
  --color-text: var(--d-text);
  --color-muted: var(--d-muted);
  --color-border: var(--d-border);
  --color-border-strong: var(--d-border-strong);
  --accent: var(--accent-d);
  --accent-hover: var(--accent-d-hover);
  --color-focus: var(--accent-d);
  background: var(--footer-bg, #0b1220);
  color: var(--color-text);
}

.site-footer.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: linear-gradient(180deg, rgb(11 18 32 / 0.55), rgb(11 18 32 / 0.9)), var(--footer-image);
  background-position: center;
  background-size: cover;
}

.site-footer-inner {
  position: relative;
  z-index: 1;
  padding-top: clamp(3rem, 6vw, 5rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: var(--space-xl);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.footer-brand {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-heading);
  font-size: var(--step-2);
  font-weight: var(--heading-weight);
  letter-spacing: -0.02em;
}

.footer-summary {
  max-width: 36ch;
  margin: 0;
  color: var(--color-muted);
}

.footer-title {
  margin: 0 0 var(--space-s);
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-list {
  display: grid;
  gap: 0.55rem;
}

.site-footer address {
  font-style: normal;
}

.footer-copy {
  margin: 0;
}

.footer-link {
  color: var(--color-text);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding: var(--space-m) 0 var(--space-l);
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: var(--step--1);
}

.footer-icons,
.drawer-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-icons a,
.drawer-icons a {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  text-decoration: none;
}

.footer-icons a:hover,
.drawer-icons a:hover {
  background: var(--color-text);
  color: var(--color-bg, #0b1220);
}

.footer-icons svg,
.drawer-icons svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

/* Footer layouts: simple (one row) and centered. */
.footer-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-s) var(--space-l);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.footer-compact .footer-brand {
  margin: 0;
}

.footer-inline-nav .footer-list-1,
.footer-inline-nav > .footer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
}

.footer-inline-nav .footer-list .footer-list {
  display: none;
}

.footer--simple .footer-inline-nav {
  margin-left: auto;
}

.footer-inline-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin: 0;
}

.footer--centered .footer-compact {
  flex-direction: column;
  text-align: center;
}

.footer--centered .footer-summary {
  margin-inline: auto;
}

.footer--centered .footer-inline-nav .footer-list-1,
.footer--centered .footer-inline-nav > .footer-list,
.footer--centered .footer-bottom {
  justify-content: center;
}

.footer--centered .footer-bottom {
  flex-direction: column;
  text-align: center;
}

/* Responsive ----------------------------------------------------------------------- */

@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .header-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-xs);
    min-height: 4rem;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .site-brand {
    min-width: 0;
  }

  /* The bottom bar has its own Menu button, so the header does not repeat it. */
  body.has-mobile-bar .site-header .mobile-menu-button {
    display: none;
  }

  body.has-mobile-bar .site-header .header-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .site-brand-tagline,
  .site-nav,
  .header-bar,
  .header-contacts {
    display: none;
  }

  .header-tools {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .header-tools .lang-switcher,
  .header-tools .search-link {
    display: none;
  }
}

/* 12. Content types: fact sheet, archive filters, pagination ------------------- */

.single-facts {
  padding-top: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.type-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--space-s) var(--space-l);
  margin: 0;
  padding: var(--space-m) var(--space-l);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
}

.type-field {
  min-width: 0;
}

.type-field dt {
  margin: 0 0 0.15rem;
  color: var(--color-muted);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.type-field dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 550;
}

.type-field dd a {
  color: var(--accent);
}

.type-field dd img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-m);
}

.archive-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-s) var(--space-m);
  margin-bottom: var(--space-l);
}

.archive-filter {
  display: grid;
  gap: 0.3rem;
  min-width: min(100%, 12rem);
  font-size: var(--step--1);
  font-weight: 600;
}

.archive-filter select {
  min-height: 2.875rem;
  padding: 0.6rem 2.25rem 0.6rem 0.9rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background-color: var(--card-bg);
  color: var(--color-text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
}

.archive-filter select:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.archive-count {
  margin: calc(-1 * var(--space-s)) 0 var(--space-m);
  color: var(--color-muted);
  font-size: var(--step--1);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-s) var(--space-m);
  margin-top: var(--space-xl);
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination a {
  display: inline-grid;
  place-items: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

.pagination a:hover {
  border-color: var(--color-border-strong);
}

.pagination a[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.pagination a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.pagination-step {
  border-color: var(--color-border-strong) !important;
}
