/*
Theme Name: Nady Planzer
Theme URI:
Author: Nady Planzer
Description: Centered frosted-glass layout with a left desktop navigation and a full-screen mobile overlay menu. Nature green/turquoise palette, light & dark modes, Swup page transitions, and a MapLibre map.
Version: 4.2
Text Domain: nadyplanzer
*/

/* ── Variables (LIGHT defaults) ── */
:root {
  /* Native system sans-serif stack — no webfont downloads */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  /* Serif accent face for quotations — system Times, no webfont download */
  --font-serif: "Times New Roman", Times, Georgia, serif;

  --color-primary: #1a9e8a;
  --color-primary-dark: #0e7060;
  --color-primary-light: #2fc0a8;
  --color-accent: #00c9b0;
  --color-accent-dark: #00a892;

  --color-text: #1a2d26;
  --color-text-light: #3c5c52;

  --bg-image: url("img/backdrop.webp"); /* self-hosted, optimized WebP (was hotlinked from Unsplash) */
  --bg-overlay: rgba(8, 32, 26, 0.30);

  --panel-blur: 16px;

  /* Navigation — turquoise panel; white text with a dark halo for readability */
  --nav-bg: rgba(18, 142, 136, 0.86);
  --text-halo: 0 1px 2px rgba(4, 36, 32, 0.55), 0 0 6px rgba(4, 36, 32, 0.35);
  --nav-border: rgba(255, 255, 255, 0.18);
  --nav-text: rgba(255, 255, 255, 0.94);
  --nav-text-dim: rgba(255, 255, 255, 0.8);
  --nav-hover-bg: rgba(255, 255, 255, 0.12);
  --nav-active-text: #7df5ea;
  --nav-title-color: #ffffff;

  /* Content surface — pure white, fills the whole content column (frosted) */
  --content-bg: rgba(255, 255, 255, 0.82);
  /* Footer — same turquoise family, a step darker than the nav */
  --footer-bg: rgba(15, 124, 118, 0.9);
  --footer-text: rgba(255, 255, 255, 0.88);
  --footer-brand: #7df5ea;
  --footer-link-hover: #7df5ea;
  /* Divider lines for the nav heading & the page heading */
  --separator: rgba(4, 42, 35, 0.3);

  --surface-alt: rgba(234, 255, 246, 0.7);

  /* Tables (fact-sheet cards) */
  --table-stripe: rgba(26, 158, 138, 0.07);
  --table-line: rgba(4, 42, 35, 0.14);
  --table-hover: rgba(0, 201, 176, 0.12);
  --table-label: var(--color-primary-dark);

  --transition: 0.2s ease;
  --radius: 12px;
  --shadow-soft: 0 4px 18px rgba(8, 32, 26, 0.10);
  --shadow-card: 0 14px 44px rgba(8, 32, 26, 0.26);
  --shell-max: 1180px;
  --nav-w: 260px;
  --nav-pad-l: 1.7rem; /* more room on the left (labels + caret gutter) */
  --nav-pad-r: 1rem;   /* tighter on the right */
  --header-h: 5.25rem; /* shared height so the nav & page-header dividers line up */
  --topbar-h: 3.75rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

html { font-size: 16px; scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
  font-family: var(--font-sans);
  background-color: #0e2420;
  min-height: 100vh;
  color: var(--color-text);
  line-height: 1.65;
  overflow-x: hidden;
}
/* Backdrop photo + overlay on position:fixed layers instead of
   background-attachment: fixed — the latter causes black flicker bands on
   Android Chrome while scrolling (and never worked on iOS anyway).
   The tint lives on ::after as a plain background-color (NOT a gradient layer
   inside background-image) so the dark/light flip can cross-fade it —
   gradients/images don't interpolate, background-color does. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-color: #0e2420;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center top;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-color: var(--bg-overlay);
  pointer-events: none;
  z-index: 0; /* paints above ::before (later in paint order), below .site-shell (z-index 1) */
}

/* ───────────────────────────────────────────
   Centered page shell
   ─────────────────────────────────────────── */
.site-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--shell-max);
  margin: 2.5rem auto;
  min-height: calc(100vh - 5rem);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Row holding the aside + main; grows so the footer pins to the bottom */
.site-inner {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1;
}

/* ── Left desktop navigation (stretches to the page length) ── */
.site-nav {
  flex: 0 0 var(--nav-w);
  width: var(--nav-w);
  background-color: var(--nav-bg);
  /* Organic smudges: seamless SVG turbulence tile at a FIXED pixel size, so
     the pattern stays put no matter how long the page gets. (No percentage
     ramp here — it would stretch with the nav height.) */
  background-image: url(./img/smudge.svg);
  background-size: 560px 560px;
  background-repeat: repeat;
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  border-right: 1px solid var(--nav-border);
  text-shadow: var(--text-halo);
  display: flex;
  flex-direction: column;
  padding: 0 var(--nav-pad-r) 1.5rem var(--nav-pad-l); /* no top padding: branding band sits flush */
}

/* ── Nav heading (site branding) — full-width clickable band with a divider ── */
.site-branding {
  margin: 0 calc(-1 * var(--nav-pad-r)) 1.2rem calc(-1 * var(--nav-pad-l));
}
.site-branding a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--header-h);
  padding: 0.4rem var(--nav-pad-r) 0.4rem var(--nav-pad-l);
  border-bottom: 1px solid var(--nav-border);
  transition: background var(--transition);
}
.site-branding a:hover { background: var(--nav-hover-bg); }
.site-title {
  font-family: var(--font-sans); font-weight: 700;
  font-size: 1.32rem;
  color: var(--nav-title-color);
  line-height: 1.3;
  display: block;
}
.site-subtitle {
  font-size: 0.76rem;
  color: var(--nav-text-dim);
  display: block;
  margin-top: 0.35rem;
  line-height: 1.45;
  letter-spacing: 0.03em;
}

/* Search inside the nav — mobile only (desktop keeps it in the page header) */
.nav-search { display: none; }

/* ── Nav menu ── */
.nav-menu { flex: 1; }
.nav-menu > li { margin-bottom: 0.1rem; }
.nav-menu li > a {
  display: block;
  color: var(--nav-text);
  padding: 0.5rem 0.75rem;
  border-radius: 7px;
  transition: background var(--transition), color var(--transition);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}
.nav-menu li > a:hover,
.nav-menu li.current-menu-item > a,
.nav-menu li.current_page_item > a {
  background: var(--nav-hover-bg);
  color: var(--nav-active-text);
}
/* Active (current) link stands out in bold — covers top-level and sub-menu items. */
.nav-menu li.current-menu-item > a,
.nav-menu li.current_page_item > a { font-weight: 700; }
.nav-menu li.menu-item-has-children.current-page-ancestor > a,
.nav-menu li.menu-item-has-children.current_page_parent > a { font-weight: 700; }

.menu-item-has-children { display: flex; flex-wrap: wrap; align-items: center; }
.menu-item-has-children > a { flex: 1; min-width: 0; }
.menu-item-has-children > .sub-menu { flex-basis: 100%; order: 10; }

.np-sub-toggle {
  background: none; border: none;
  color: var(--nav-text-dim);
  cursor: pointer;
  padding: 0.35rem;
  font-size: 1rem; line-height: 1;
  flex-shrink: 0; width: 1.7rem; /* == its height (0.7rem padding + 1rem glyph) → square */
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
  transition: transform 0.2s ease, color 0.15s, background 0.15s;
  /* Pulled left into the gutter (link is flex:1) so a parent item's label
     lines up with its non-parent siblings — at both the top level and in
     sub-menus. Margins keep the glyph centred + the label aligned while the
     button itself is square (footprint sum stays 0). */
  margin-left: -1.55rem; margin-right: -0.15rem;
}
.np-sub-toggle:hover { color: var(--nav-active-text); background: var(--nav-hover-bg); }
.menu-item-has-children.is-expanded > .np-sub-toggle { transform: rotate(90deg); color: var(--nav-active-text); }

.sub-menu { display: none; padding: 0; margin: 0.1rem 0 0.4rem 0.9rem; }
.menu-item-has-children.is-expanded > .sub-menu { display: block; }
.sub-menu li > a { font-size: 0.92rem; color: var(--nav-text-dim); padding: 0.32rem 0.75rem; }
.sub-menu li > a:hover,
.sub-menu li.current-menu-item > a,
.sub-menu li.current_page_item > a { background: var(--nav-hover-bg); color: var(--nav-active-text); }

/* Links & Impressum/Datenschutz hide from the nav column on desktop — the
   page footer already carries them there. On mobile the footer is a long
   scroll away, so they stay in the menu. Two spots: the np-mobile-only-tagged
   primary items AND the footer-menu block pinned to the nav bottom. */
@media (min-width: 881px) {
  .site-nav .nav-menu li.np-mobile-only,
  .site-nav .nav-footer { display: none; }
}

/* ── Nav footer (footer links + theme toggle), pinned to the aside bottom ── */
.nav-footer { margin-top: auto; padding-top: 1.2rem; border-top: 1px solid var(--nav-border); }
.nav-footer .footer-links { display: flex; flex-direction: column; gap: 0.1rem; }
.nav-footer .footer-links li a {
  font-size: 0.75rem; color: var(--nav-text-dim);
  padding: 0.22rem 0.5rem; border-radius: 4px; display: block;
  transition: color var(--transition);
}
.nav-footer .footer-links li a:hover { color: var(--nav-active-text); }

/* ── Theme toggle — an iOS-style slider switch in the page-header row (right
      of the search). Rendered by npc_theme_toggle() inside the Swup container;
      theme.js binds it by delegation and re-syncs state after each swap. ── */
.theme-toggle {
  display: flex; align-items: center; gap: 0.5rem;
  background: none; border: 0; cursor: pointer;
  color: var(--color-text-light);
  font-family: var(--font-sans); font-size: 0.78rem;
  padding: 0.3rem 0; border-radius: 7px; flex: none;
  transition: color var(--transition);
}
.theme-toggle:hover { color: var(--color-primary); }
.toggle-track {
  position: relative; flex: none;
  width: 42px; height: 23px; border-radius: 999px;
  background: var(--toggle-track, rgba(0, 0, 0, 0.14));
}
.theme-toggle:hover .toggle-track { box-shadow: 0 0 0 2px rgba(0, 201, 176, 0.35); }
.theme-toggle[aria-checked="true"] .toggle-track { background: rgba(0, 201, 176, 0.6); }
.toggle-thumb {
  position: absolute; top: 50%; left: 3px; transform: translateY(-50%);
  width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1;
}
.theme-toggle[aria-checked="true"] .toggle-thumb { left: calc(100% - 20px); }
/* Animate only after a real press (np-anim set on click) — the initial JS
   state sync on every page load/swap must NOT slide the thumb. */
.theme-toggle.np-anim .toggle-track { transition: background var(--transition), box-shadow var(--transition); }
.theme-toggle.np-anim .toggle-thumb { transition: left 0.22s ease; }
html.np-dark { --toggle-track: rgba(255, 255, 255, 0.22); }
@media (prefers-color-scheme: dark) {
  html:not(.np-light) { --toggle-track: rgba(255, 255, 255, 0.22); }
}

/* ───────────────────────────────────────────
   Main content column — the surface lives on .site-main (the Swup container)
   so it never disappears during a transition; only .content-area fades.
   ─────────────────────────────────────────── */
.site-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--content-bg);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
}
.content-area {
  flex: 1;
  background: transparent;
}

/* Centered, left-aligned reading column */
.container { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 2.5rem; }

/* Extreme large screens — let the page card and reading column breathe a bit. */
@media (min-width: 1600px) { :root { --shell-max: 1320px; } .container { max-width: 840px; } }
@media (min-width: 2100px) { :root { --shell-max: 1440px; } .container { max-width: 900px; } }

/* ── Heading bar: same height as the nav heading so the dividers line up ── */
.page-header {
  min-height: var(--header-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--separator);
}
.page-header--hero { padding: 0.4rem 0; }
.page-title {
  font-family: var(--font-sans); font-weight: 700;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  color: var(--color-primary-dark);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* fallback while JS scales the font to fit */
}
.page-tagline { color: var(--color-primary); font-size: 0.92rem; letter-spacing: 0.05em; margin-top: 0.3rem; line-height: 1.3; }

/* ── Header search: title on the left, compact search field on the right ──
   No wrapping on desktop: the title shrinks instead (fitPageTitles in
   theme.js scales its font-size down so it always stays on one line). */
.page-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
}
/* Search + theme toggle hug the right edge as one tight group */
.page-header .header-search { margin-left: auto; }
.page-header-text { min-width: 0; }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  /* Fixed width — long page titles shrink (fitPageTitles), not the search */
  flex: 0 0 160px;
}
.header-search-field {
  width: 100%;
  padding: 0.38rem 2.3rem 0.38rem 0.85rem;
  border: 1px solid var(--separator);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.header-search-field:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(26, 158, 138, 0.10);
}
.header-search-field::placeholder { color: var(--color-text-light); opacity: 0.6; }
.header-search-submit {
  position: absolute;
  right: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem; height: 1.7rem;
  background: none; border: none; border-radius: 50%;
  color: var(--color-text-light);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.header-search-submit:hover { color: var(--color-primary); background: rgba(0, 201, 176, 0.08); }
.header-search-submit svg { width: 0.95rem; height: 0.95rem; }

/* ── Search results list ── */
.search-results-count {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 1.3rem;
}
.search-result {
  padding-bottom: 1.2rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--separator);
}
.search-result:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.search-result-title {
  display: inline-block;
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.35;
  color: var(--color-primary-dark);
  transition: color var(--transition);
}
.search-result-title:hover { color: var(--color-accent-dark); }
.search-result-path {
  display: block;
  font-size: 0.76rem;
  color: var(--color-text-light);
  margin-top: 0.1rem;
}
.search-result-snippet {
  font-size: 0.92rem;
  color: var(--color-text);
  line-height: 1.6;
  margin-top: 0.35rem;
}
.search-result mark,
.search-result-title mark {
  background: rgba(0, 201, 176, 0.26);
  color: inherit;
  border-radius: 3px;
  padding: 0 0.12em;
}

.breadcrumbs { margin: 0 0 1.1rem; display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumbs span { font-size: 0.78rem; color: var(--color-text-light); }
.breadcrumbs span a { color: var(--color-text-light); transition: color var(--transition); }
.breadcrumbs span a:hover { color: var(--color-primary); }
.breadcrumbs span + span::before { content: "›"; margin: 0 0.4rem; color: rgba(0, 0, 0, 0.28); }
html.np-dark .breadcrumbs span + span::before { color: rgba(255, 255, 255, 0.45); }
@media (prefers-color-scheme: dark) {
  html:not(.np-light) .breadcrumbs span + span::before { color: rgba(255, 255, 255, 0.45); }
}

/* ── Content body ── */
.page-content { padding: 1.8rem 0 2.2rem; }

/* Names that must never break across lines (npc_nowrap_names filter) */
.np-nowrap { white-space: nowrap; }

/* ── Typography ── */
/* Anchor targets (npc_heading_anchors): stop a little below the viewport top —
   the mobile media block adds the fixed-topbar offset. */
.entry-content :is(h2, h3, h4, h5, h6) { scroll-margin-top: 1.2rem; }
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 {
  font-family: var(--font-sans); font-weight: 700;
  color: var(--color-primary-dark);
  margin: 1.5rem 0 0.5rem;
  line-height: 1.3;
}
.entry-content h1 { font-size: 1.8rem; }
.entry-content h2 { font-size: 1.4rem; margin-top: 1.9rem; }
.entry-content h3 { font-size: 1.15rem; margin-top: 1.7rem; }
.entry-content h4 { font-size: 1rem; }
.entry-content > :first-child { margin-top: 0; }
.entry-content p { margin-bottom: 0.9rem; color: var(--color-text); }
.entry-content a:not(.btn) {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(0, 201, 176, 0.45);
  text-underline-offset: 2px;
}
.entry-content a:not(.btn):hover { color: var(--color-accent-dark); }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; margin-bottom: 0.9rem; }
.entry-content li { list-style: disc; margin-bottom: 0.25rem; }
.entry-content ol li { list-style: decimal; }
.entry-content strong { color: var(--color-primary-dark); }

/* ── Quote blocks (standalone <blockquote> and the testimonial cards) ── */
.entry-content .testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
  margin: 1.4rem 0;
}
.entry-content blockquote,
.entry-content .testimonial-card {
  position: relative;
  background: var(--surface-alt);
  border: 1px solid var(--separator);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1.15rem 1.5rem 1.15rem 3.4rem;
  margin: 1.4rem 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.04rem;
  line-height: 1.6;
  color: var(--color-text-light);
}
.entry-content .testimonial-card { margin: 0; } /* spacing handled by the grid gap */
.entry-content blockquote::before,
.entry-content .testimonial-card::before {
  content: "\201C"; /* big opening quotation mark, inside on the left */
  position: absolute;
  left: 0.65rem;
  top: 0.55rem;
  font-family: var(--font-serif); font-weight: 700; font-style: normal;
  font-size: 3.6rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.4;
  pointer-events: none;
}
/* When a blockquote sits inside a testimonial card, the card is the block */
.entry-content .testimonial-card blockquote {
  position: static;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
.entry-content .testimonial-card blockquote::before { content: none; }

.entry-content blockquote p { margin-bottom: 0.5rem; }
.entry-content blockquote p:last-of-type { margin-bottom: 0; }

/* Author inside the block — right-aligned, slightly less opaque, back to sans */
.entry-content blockquote cite,
.entry-content .testimonial-author {
  display: block;
  margin-top: 0.6rem;
  text-align: right;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  opacity: 0.6;
}
.entry-content blockquote cite::before,
.entry-content .testimonial-author::before { content: "— "; }

/* Long testimonials: theme.js trims the quote to whole sentences that fit a
   uniform preview height and splits off the rest into .tc-rest; the ellipsis
   is appended in the collapsed state, and the "Weiterlesen" toggle reveals it.
   Cards line up via the grid's default row-stretch. */
.entry-content .testimonial-card:not(.is-open) .tc-rest { display: none; }
.entry-content .testimonial-card:not(.is-open):not(.tc-ends-ellipsis) .tc-vis::after { content: "\00A0\2026"; }
.entry-content .testimonial-toggle {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-primary-dark);
  cursor: pointer;
  transition: color var(--transition);
}
.entry-content .testimonial-toggle::after { content: " \25BE"; font-size: 0.75em; }
.entry-content .testimonial-card.is-open .testimonial-toggle::after { content: " \25B4"; }
.entry-content .testimonial-toggle:hover { color: var(--color-accent-dark); }
html.np-dark .entry-content .testimonial-toggle { color: var(--color-accent); }

.entry-content img { border-radius: 8px; margin: 1rem 0; }
/* Wide content image — always exactly as wide as the text column,
   even when the file's intrinsic width is smaller. */
.entry-content img.np-wide {
  display: block;
  width: 100%;
  margin: 1.8rem 0;
}
/* Core Image/Table blocks wrap their element in a <figure> that carries the
   custom class — the figure owns the outer margin, the inner element none. */
.entry-content figure.wp-block-image { margin: 1rem 0; }
.entry-content figure.wp-block-image > img { margin: 0; }
.entry-content figure.wp-block-image.np-wide { margin: 1.8rem 0; }
.entry-content .np-wide img {
  display: block;
  width: 100%;
}
.entry-content figure.wp-block-table { margin: 1.4rem 0; }
.entry-content figure.wp-block-table.np-timeline { margin: 1.7rem 0; }
.entry-content figure.wp-block-table > table { margin: 0; }
.entry-content hr { border: none; border-top: 1px solid rgba(0, 0, 0, 0.1); margin: 1.5rem 0; }

/* ── Tables (fact sheets, bank details, prices, …) — frosted "fact card"
      look, same family as .contact-box: soft surface, left accent bar,
      zebra rows. np-timeline (on the table or its figure) opts out (rendered as a timeline). ── */
.entry-content table {
  width: 100%;
  margin: 1.4rem 0;
  font-size: 0.95rem;
}
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) {
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface-alt);
  border: 1px solid var(--separator);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  overflow: hidden;
}
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) th,
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) td {
  padding: 0.68rem 1rem;
  border-bottom: 1px solid var(--table-line);
  vertical-align: top;
  text-align: left;
}
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) tr:last-child > th,
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) tr:last-child > td { border-bottom: none; }
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) tbody tr:nth-child(even) > td {
  background: var(--table-stripe);
}
@media (hover: hover) {
  .entry-content table:not(.np-timeline):not(:where(.np-timeline table)) tbody tr:hover > td {
    background: var(--table-hover);
  }
}
/* Round the corner cells so zebra/hover backgrounds don't poke out. */
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) tr:first-child > td:first-child,
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) tr:first-child > th:first-child { border-top-left-radius: calc(var(--radius) - 4px); }
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) tr:first-child > td:last-child,
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) tr:first-child > th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) tr:last-child > td:first-child { border-bottom-left-radius: calc(var(--radius) - 4px); }
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) tr:last-child > td:last-child { border-bottom-right-radius: calc(var(--radius) - 1px); }
/* Header row (native Table block etc.) */
.entry-content table:not(.np-timeline):not(:where(.np-timeline table)) thead th {
  font-weight: 700;
  color: var(--table-label);
  border-bottom: 2px solid var(--color-accent);
}
/* Fact-sheet tables: first column is a key/label (IBAN, Kursdaten, …).
   Price tables keep normal text there — the amount column is the accent. */
.entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) td:first-child {
  font-weight: 600;
  color: var(--table-label);
}
.entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) td:first-child strong { color: inherit; }
/* Narrow screens: stack label above value (not for price tables — their
   two columns belong side by side). */
@media (max-width: 620px) {
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)),
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) tbody,
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) tr,
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) td { display: block; width: 100%; }
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) td {
    border-bottom: 0;
    padding: 0 1rem 0.7rem;
    border-radius: 0 !important;
  }
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) td:first-child { padding: 0.6rem 1rem 0.15rem; }
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) tr { border-bottom: 1px solid var(--table-line); }
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) tr:last-child { border-bottom: 0; }
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) tbody tr:nth-child(even) { background: var(--table-stripe); }
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) tbody tr:nth-child(even) > td { background: none; }
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) tr:first-child { border-radius: calc(var(--radius) - 4px) calc(var(--radius) - 1px) 0 0; }
  .entry-content table:not(.np-timeline):not(.price-table):not(:where(.np-timeline table)):not(:where(.price-table table)) tr:last-child { border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 4px); }
}

/* Price table — amounts stand out, never wrap */
.entry-content .price-table .price-amount,
.entry-content .price-table td:last-child {
  font-weight: 700;
  color: var(--color-primary-dark);
  text-align: right;
  white-space: nowrap;
}

/* ── Timeline — a vertical, dotted timeline rendered from a plain 2-column
      table (1st cell = year, 2nd = milestone). Add class="np-timeline". ── */
.entry-content :is(table.np-timeline, .np-timeline table),
.entry-content :is(table.np-timeline, .np-timeline table) tbody,
.entry-content :is(table.np-timeline, .np-timeline table) tr,
.entry-content :is(table.np-timeline, .np-timeline table) td {
  display: block; width: auto; border: 0; padding: 0;
}
.entry-content :is(table.np-timeline, .np-timeline table) { margin: 1.7rem 0; }
/* WP core gives figure.wp-block-table overflow:auto (horizontal-scroll guard);
   that scroll box clips the dots' 4px glow at the left edge — undo it here,
   the timeline is a block layout that never overflows sideways. */
.entry-content figure.wp-block-table.np-timeline { overflow: visible; }
.entry-content :is(table.np-timeline, .np-timeline table) tbody { position: relative; }
.entry-content :is(table.np-timeline, .np-timeline table) tbody::before { /* the rail */
  content: ""; position: absolute; left: 6px; top: 0.6rem; bottom: -1.6rem;
  width: 2px; border-radius: 2px;
  /* …and it runs past the last entry, dissolving over its final 7rem */
  background: linear-gradient(180deg, var(--color-accent), var(--color-primary) calc(100% - 7rem), transparent);
  opacity: 0.55;
}
.entry-content :is(table.np-timeline, .np-timeline table) tr { position: relative; padding: 0 0 1.3rem 2rem; }
.entry-content :is(table.np-timeline, .np-timeline table) tr:last-child { padding-bottom: 0; }
.entry-content :is(table.np-timeline, .np-timeline table) tr::before { /* the dot */
  content: ""; position: absolute; left: 0; top: 0.35rem;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(0, 201, 176, 0.18);
}
.entry-content :is(table.np-timeline, .np-timeline table) td:first-child { /* year */
  font-weight: 700; color: var(--color-primary-dark);
  font-size: 0.98rem; letter-spacing: 0.02em; margin-bottom: 0.15rem;
}
.entry-content :is(table.np-timeline, .np-timeline table) td:last-child { line-height: 1.62; }
html.np-dark .entry-content :is(table.np-timeline, .np-timeline table) td:first-child,
html.np-dark .entry-content :is(table.np-timeline, .np-timeline table) td:first-child strong { color: var(--color-accent); }

/* ── Contact box (address / imprint panels) ── */
.entry-content .contact-box {
  background: var(--surface-alt);
  border: 1px solid var(--separator);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.4rem 0;
}
.entry-content .contact-box h3 { margin-top: 0; }
.entry-content .contact-box > :last-child { margin-bottom: 0; }

/* ── Subpage cards (overview pages) ── */
.entry-content .subpage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
/* Exactly 4 cards: cap at two columns (2×2) — three across would always
   leave one card dangling alone on the second row. */
.entry-content .subpage-cards:has(> :nth-child(4):last-child) {
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}
/* Odd card count while the grid sits at two columns (230px cards + 1rem gap:
   three fit only ≥1600px viewports and in the 757–880px no-aside band) —
   stretch the last card across the row instead of leaving it dangling. */
@media (max-width: 756px), (min-width: 880px) and (max-width: 1599px) {
  .entry-content .subpage-cards > .subpage-card:nth-child(odd):last-child {
    grid-column: 1 / -1;
  }
}
.entry-content a.subpage-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-alt);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 1.05rem 1.2rem;
  color: var(--color-text);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.entry-content a.subpage-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: var(--color-accent);
  color: var(--color-text);
}
.entry-content .subpage-card .subpage-card-title {
  display: block;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}
.entry-content .subpage-card .subpage-card-title::after {
  content: " →";
  color: var(--color-accent);
  font-weight: 400;
}
.entry-content .subpage-card .subpage-card-desc {
  display: block;
  font-size: 0.86rem;
  color: var(--color-text-light);
  line-height: 1.5;
  margin-bottom: 0;
}

/* ── Image gallery (.gallery-grid + GLightbox lightbox) ── */
/* --gallery-ratio = tile aspect-ratio (width/height); overridable per page. */
.entry-content .gallery-grid {
  --gallery-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.9rem;
  margin: 1.4rem 0;
}
/* wpautop drops stray <br>/<p> between the images; without this they become
   empty grid items and scatter the tiles into a checkerboard. */
.entry-content .gallery-grid br,
.entry-content .gallery-grid > p:empty { display: none; }
/* Decorative fillers appended by theme.js (padGalleryRows) so an incomplete
   last row still ends flush — same tile shape, a faint smudge wash, never
   clickable and never part of the lightbox. */
.entry-content .gallery-grid .np-gallery-filler,
.entry-content .wp-block-gallery.has-nested-images .np-gallery-filler {
  aspect-ratio: var(--gallery-ratio);
  border-radius: 10px;
  background-color: var(--surface-alt);
  background-image: url(./img/smudge.svg);
  background-size: 560px 560px;
  opacity: 0.38;
  pointer-events: none;
}
.entry-content .gallery-grid a {
  display: block;
  line-height: 0;
  text-decoration: none;
  aspect-ratio: var(--gallery-ratio);
}
.entry-content .gallery-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--gallery-ratio);
  object-fit: cover;
  border-radius: 10px;
  margin: 0;
  cursor: pointer;
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.entry-content .gallery-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(8, 32, 26, 0.32);
}
/* Über mich – taller, more portrait tiles for the life-collage photos. */
body.page-id-8 .entry-content .gallery-grid { --gallery-ratio: 4 / 5; }
@media (max-width: 880px) {
  .entry-content .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }
}

/* ── Native WordPress "Gallery" block, styled like the theme galleries above.
   Lets editors add galleries from the media library and get the same square
   grid + lightbox + row-trim behaviour (see theme.js). ── */
.entry-content .wp-block-gallery.has-nested-images {
  --gallery-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.9rem;
  margin: 1.4rem 0;
}
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image {
  width: auto !important;   /* override the block's flex-basis width */
  margin: 0;
  aspect-ratio: var(--gallery-ratio);
}
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image img {
  width: 100%; height: 100%;
  aspect-ratio: var(--gallery-ratio);
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(8, 32, 26, 0.32);
}
.entry-content .wp-block-gallery .np-orphan-tile { display: none; }
@media (max-width: 880px) {
  .entry-content .wp-block-gallery.has-nested-images { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }
}

/* ── Collapsible <details> — soft accordion cards ── */
.entry-content details:not(.maplibregl-ctrl) {
  margin: 0 0 0.8rem;
  background: var(--surface-alt);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 0.85rem 1.15rem;
  overflow: hidden; /* contains floated images inside */
  transition: border-color var(--transition);
}
.entry-content details:not(.maplibregl-ctrl):hover { border-color: var(--color-accent); }
.entry-content details:not(.maplibregl-ctrl) > summary {
  cursor: pointer;
  color: var(--color-primary-dark);
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  transition: color var(--transition);
}
.entry-content details:not(.maplibregl-ctrl) > summary::-webkit-details-marker { display: none; }
.entry-content details:not(.maplibregl-ctrl) > summary::before {
  content: "▸";
  color: var(--color-primary);
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.entry-content details:not(.maplibregl-ctrl)[open] > summary::before { transform: rotate(90deg); }
.entry-content details:not(.maplibregl-ctrl) > summary:hover { color: var(--color-primary); }
.entry-content details:not(.maplibregl-ctrl)[open] > summary {
  margin-bottom: 0.9rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--separator);
}
.entry-content details:not(.maplibregl-ctrl) > :last-child { margin-bottom: 0; }
.entry-content details:not(.maplibregl-ctrl) h4 { margin-top: 1.2rem; }
.entry-content details:not(.maplibregl-ctrl) h4:first-of-type { margin-top: 0; }
html.np-dark .entry-content details:not(.maplibregl-ctrl) > summary { color: var(--color-accent); }
html.np-dark .entry-content details:not(.maplibregl-ctrl) > summary:hover,
html.np-dark .entry-content details:not(.maplibregl-ctrl) > summary::before { color: var(--color-accent); }
/* Smooth open/close height animation. Progressive enhancement: only where the
   browser can interpolate to/from auto — elsewhere <details> just toggles. */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .entry-content details:not(.maplibregl-ctrl)::details-content {
    height: 0;
    overflow: hidden;
    transition: height 0.28s ease, content-visibility 0.28s allow-discrete;
  }
  .entry-content details:not(.maplibregl-ctrl)[open]::details-content { height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .entry-content details:not(.maplibregl-ctrl)::details-content { transition: none; }
}

/* ── "Media & Text" block ──
   WordPress ships this block with padding:0 8% on the text column, which looks
   oversized inside the theme's narrow content column. Trim that padding and use
   a real column-gap for separation instead; keep the media image tidy. */
.entry-content .wp-block-media-text { column-gap: clamp(1rem, 3vw, 2rem); align-items: center; }
/* Extra .wp-block-media-text ancestor: core's per-block CSS (padding: 0 8%)
   loads AFTER the theme stylesheet, so equal specificity would lose the tie. */
.entry-content .wp-block-media-text .wp-block-media-text__content { padding-inline: 0; }
.entry-content .wp-block-media-text__media img { border-radius: var(--radius); }
.entry-content .wp-block-media-text.np-hero-logo,
.entry-content .wp-block-media-text__media .np-hero-logo { border-radius: 0; } /* keep the transparent hero logo square */

/* ── Buttons ── */
.btn {
  display: inline-block;
  /* --color-primary-dark keeps white text at ~6:1 (WCAG AA); --color-primary was only 3.3:1 */
  background: var(--color-primary-dark); color: #fff !important;
  padding: 0.62rem 1.4rem; border-radius: 7px;
  font-size: 0.88rem; font-weight: 600; letter-spacing: 0.04em;
  transition: background var(--transition);
  cursor: pointer; border: none;
}
.btn:hover { background: #0a564a; color: #fff !important; }

/* ── "Haar[curl]monie" — a small blond curl photo for the wordplay ── */
.entry-content .haarmonie { white-space: nowrap; }
.entry-content .hairlock {
  display: inline-block;
  width: 0.69em; /* matches the trimmed 65×120 asset (ratio ~0.54) */
  height: 1.28em;
  margin: 0 -0.06em; /* tight — the curl nearly joins the two word halves */
  vertical-align: -0.32em;
  background: url(./img/haar-curl.png) center / contain no-repeat;
}

/* ── Post list (archives) ── */
.post-list-item { padding-bottom: 1.6rem; margin-bottom: 1.6rem; border-bottom: 1px solid rgba(0,0,0,0.08); }
.post-list-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.entry-title { font-family: var(--font-sans); font-weight: 700; font-size: 1.4rem; margin-bottom: 0.3rem; }
.entry-title a { color: var(--color-primary-dark); }
.entry-meta { font-size: 0.76rem; color: var(--color-text-light); margin-top: 0.35rem; }
.more-link { display: inline-block; margin-top: 0.4rem; font-weight: 600; color: var(--color-primary); }

/* ── MapLibre map (Kontakt & Anfahrt) ── */
.map-container { margin: 1.75rem 0 0.5rem; }
.np-map { width: 100%; height: 320px; display: block; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-soft); }
.np-map--unavailable { display: flex; align-items: center; justify-content: center; text-align: center; padding: 1.25rem; background: var(--surface-alt); color: var(--color-text-light); font-size: 0.9rem; box-shadow: none; }
.map-links { display: flex; gap: 0.75rem; margin-top: 0.85rem; flex-wrap: wrap; }
/* Insulate MapLibre's own UI from .entry-content colour leaks (links, <strong>,
   text colour). Popup palette is driven by vars so light/dark just swaps them —
   fixes light-on-white (invisible) popup text under *system* dark mode. */
.np-map { --map-pop-bg: #ffffff; --map-pop-fg: #24352f; --map-pop-accent: var(--color-primary); }
.np-map .maplibregl-popup-content { background: var(--map-pop-bg); color: var(--map-pop-fg); }
.np-map .maplibregl-popup-content strong { color: var(--map-pop-accent); }
.np-map .maplibregl-popup-close-button { color: var(--map-pop-fg); }
.np-map .maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--map-pop-bg); }
.np-map .maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--map-pop-bg); }
/* Attribution: same var-swap as the popup — light pill in light mode, theme
   surface in dark mode (!important overrides the theme's .entry-content a
   leak, which otherwise out-specifies us; the pill background + color stop
   the body color from bleeding in). */
.np-map {
  --map-attrib-bg: rgba(255, 255, 255, 0.85);
  --map-attrib-fg: rgba(0, 0, 0, 0.75);
  --map-attrib-link: rgba(0, 0, 0, 0.68);
  --map-attrib-link-hover: rgba(0, 0, 0, 0.9);
}
/* !important: maplibre's own sheet uses higher-specificity selectors
   (.maplibregl-ctrl.maplibregl-ctrl-attrib, .maplibregl-compact) */
.np-map .maplibregl-ctrl-attrib { background-color: var(--map-attrib-bg) !important; color: var(--map-attrib-fg) !important; }
.np-map .maplibregl-ctrl-attrib a { color: var(--map-attrib-link) !important; text-decoration: none; }
.np-map .maplibregl-ctrl-attrib a:hover { color: var(--map-attrib-link-hover) !important; text-decoration: underline; }

html.np-dark .np-map {
  --map-pop-bg: #16261f; --map-pop-fg: rgba(232, 244, 240, 0.94); --map-pop-accent: var(--color-accent);
  --map-attrib-bg: rgba(22, 38, 31, 0.85);
  --map-attrib-fg: rgba(218, 238, 233, 0.8);
  --map-attrib-link: rgba(218, 238, 233, 0.72);
  --map-attrib-link-hover: rgba(232, 244, 240, 0.95);
}
@media (prefers-color-scheme: dark) {
  html:not(.np-light) .np-map {
    --map-pop-bg: #16261f; --map-pop-fg: rgba(232, 244, 240, 0.94); --map-pop-accent: var(--color-accent);
    --map-attrib-bg: rgba(22, 38, 31, 0.85);
    --map-attrib-fg: rgba(218, 238, 233, 0.8);
    --map-attrib-link: rgba(218, 238, 233, 0.72);
    --map-attrib-link-hover: rgba(232, 244, 240, 0.95);
  }
}

/* ── Site footer (spans the full shell width, covering the aside) ── */
.site-footer {
  background-color: var(--footer-bg);
  /* Same fixed-size smudge tile (offset so it reads differently from the
     nav), swept darker from left to right */
  background-image:
    linear-gradient(105deg, rgba(4, 36, 32, 0.04) 0%, rgba(4, 36, 32, 0.30) 100%),
    url(./img/smudge.svg);
  background-size: auto, 560px 560px;
  background-repeat: no-repeat, repeat;
  background-position: 0 0, -180px -320px;
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  color: var(--footer-text);
  text-shadow: var(--text-halo);
  padding: 1.5rem 2.5rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--nav-border);
}
.footer-inner { display: flex; justify-content: space-between; gap: 1.5rem 3rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.footer-col { min-width: 0; overflow-wrap: break-word; }
.footer-col--right { text-align: right; margin-left: auto; }
.footer-col--right .footer-links { display: flex; flex-direction: column; gap: 0.15rem; align-items: flex-end; }
.footer-brand { font-family: var(--font-sans); font-weight: 700; font-size: 0.95rem; color: var(--footer-brand); margin-bottom: 0.25rem; }
.footer-inner a { color: var(--footer-text); transition: color var(--transition); }
.footer-inner a:hover { color: var(--footer-link-hover); text-decoration: underline; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.4rem 1.5rem; flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.16); padding-top: 0.7rem; margin-top: 0.5rem;
}
.footer-copy { font-size: 0.72rem; opacity: 0.7; }
.footer-credit { font-size: 0.72rem; opacity: 0.85; }
.footer-credit a { color: var(--footer-link-hover); font-weight: 600; }
.footer-credit a:hover { color: var(--footer-text); text-decoration: underline; }

/* ───────────────────────────────────────────
   Mobile top bar + overlay nav
   ─────────────────────────────────────────── */
.site-topbar { display: none; }

.menu-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: none;
  border: 1px solid var(--nav-border);
  color: var(--nav-text);
  padding: 0.45rem 0.9rem; border-radius: 7px; cursor: pointer;
  font-family: var(--font-sans); font-size: 0.9rem;
}

.nav-close {
  display: none;
  position: absolute; top: 1rem; right: 1.1rem;
  width: 2.4rem; height: 2.4rem;
  align-items: center; justify-content: center;
  background: var(--nav-hover-bg);
  border: 1px solid var(--nav-border); border-radius: 50%;
  color: var(--nav-active-text); font-size: 1.2rem; cursor: pointer;
}
.nav-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(4, 18, 14, 0.55);
  backdrop-filter: blur(2px);
  z-index: 290;
  opacity: 0; transition: opacity 0.25s ease;
}
.nav-backdrop.is-visible { display: block; opacity: 1; }

/* ── Swup page transitions (only the inner content fades; surface persists) ── */
.transition-fade { transition: opacity 0.22s ease; opacity: 1; }
html.is-animating .transition-fade { opacity: 0; }

/* ── Smooth dark/light flip — the toggle JS puts np-theme-anim on <html> for
      ~450ms around the class switch, cross-fading every colour property.
      The toggle thumb is excluded so its own left-slide keeps working;
      prefers-reduced-motion still wins (0.001ms !important further down). ── */
html.np-theme-anim body,
html.np-theme-anim *:not(.toggle-thumb),
html.np-theme-anim *::before,
html.np-theme-anim *::after {
  transition: background-color 0.35s ease, background 0.35s ease, color 0.35s ease,
    border-color 0.35s ease, box-shadow 0.35s ease, fill 0.35s ease !important;
}

/* ───────────────────────────────────────────
   Responsive
   ─────────────────────────────────────────── */
@media (max-width: 880px) {
  .site-shell {
    margin: 0; border-radius: 0; min-height: 100vh;
    box-shadow: none; padding-top: var(--topbar-h);
  }

  .site-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; z-index: 250;
    height: var(--topbar-h); padding: 0 1.1rem;
    background: var(--nav-bg);
    backdrop-filter: blur(var(--panel-blur));
    -webkit-backdrop-filter: blur(var(--panel-blur));
    border-bottom: 1px solid var(--nav-border);
    text-shadow: var(--text-halo);
  }
  .topbar-brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
  .topbar-name { font-family: var(--font-sans); font-weight: 700; font-size: 1.15rem; color: var(--nav-title-color); }
  .topbar-tagline { font-size: 0.7rem; color: var(--nav-text-dim); letter-spacing: 0.03em; }

  .site-nav {
    position: fixed; inset: 0;
    width: 100%; max-width: 360px;
    height: 100dvh; max-height: 100dvh;
    z-index: 300; border-right: 1px solid var(--nav-border);
    transform: translateX(-100%); transition: transform 0.28s ease;
    padding: 0 var(--nav-pad-r) 1.5rem var(--nav-pad-l);
    overflow-y: auto;
  }
  .site-nav.is-open { transform: translateX(0); }
  /* The branding band mirrors the topbar exactly (height, padding, type
     sizes) so the title doesn't jump when the overlay opens over it. */
  .site-branding a {
    min-height: var(--topbar-h);
    justify-content: center;
    padding: 0 1.1rem;
  }
  .site-branding .site-title { font-size: 1.15rem; line-height: 1.15; }
  .site-branding .site-subtitle { font-size: 0.7rem; line-height: 1.15; margin-top: 0; }
  .nav-close { display: flex; top: 0.675rem; /* centered in the topbar-high band */ }
  body.nav-open .site-topbar { opacity: 0; pointer-events: none; }

  /* Search moves from the page header into the menu overlay */
  .nav-search { display: block; margin: 0.2rem 0 1.1rem; }
  .site-nav .header-search { flex: 1 1 auto; }
  .site-nav .header-search-field {
    border-color: var(--nav-border);
    background: var(--nav-hover-bg);
    color: var(--nav-text);
    font-size: 0.95rem;
    padding: 0.55rem 2.5rem 0.55rem 1rem;
  }
  .site-nav .header-search-field::placeholder { color: var(--nav-text-dim); opacity: 1; }
  .site-nav .header-search-field:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(0, 201, 176, 0.25);
  }
  .site-nav .header-search-submit { color: var(--nav-text-dim); width: 2rem; height: 2rem; right: 0.35rem; }
  .site-nav .header-search-submit:hover { color: #fff; background: var(--nav-hover-bg); }
  .page-header .header-search { display: none; }
  /* …except on the search results page, where refining in place matters */
  body.search .page-header .header-search { display: flex; flex: 1 1 100%; min-width: 0; }
  body.search .page-header .container { flex-wrap: wrap; }

  .page-header { min-height: 0; padding: 1.1rem 0; }
  .container { padding: 0 1.1rem; }
  /* Anchor jumps must clear the fixed topbar */
  .entry-content :is(h2, h3, h4, h5, h6) { scroll-margin-top: calc(var(--topbar-h) + 1rem); }
  .page-content { padding: 1.3rem 0 1.6rem; }
  .site-footer { padding: 1.4rem 1.1rem; }
  .footer-inner { flex-direction: column; gap: 1rem; }
  .footer-col--right { text-align: left; margin-left: 0; }
  .footer-col--right .footer-links { align-items: flex-start; }
  .footer-bottom { flex-direction: column; gap: 0.35rem; }
}

/* ───────────────────────────────────────────
   Dark mode (system default + manual toggle)
   ─────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  html:not(.np-light) {
    --bg-overlay: rgba(6, 20, 16, 0.62);
    --nav-bg: rgba(9, 58, 54, 0.76);
    --text-halo: none;
    --nav-border: rgba(255, 255, 255, 0.1);
    --nav-text: rgba(255, 255, 255, 0.88);
    --nav-text-dim: rgba(255, 255, 255, 0.65);
    --nav-hover-bg: rgba(0, 201, 176, 0.18);
    --nav-active-text: #7df5ea;
    --nav-title-color: #ffffff;
    --content-bg: rgba(11, 26, 22, 0.78);
    --footer-bg: rgba(7, 46, 43, 0.83);
    --footer-text: rgba(178, 218, 205, 0.88);
    --footer-brand: var(--color-accent);
    --footer-link-hover: var(--color-accent);
    --separator: rgba(255, 255, 255, 0.13);
    --color-text: rgba(218, 238, 233, 0.92);
    --color-text-light: rgba(155, 205, 190, 0.8);
    --surface-alt: rgba(27, 50, 42, 0.8);
    --table-stripe: rgba(0, 201, 176, 0.06);
    --table-line: rgba(255, 255, 255, 0.09);
    --table-hover: rgba(0, 201, 176, 0.13);
    --table-label: var(--color-accent);
  }
}
html.np-dark {
  --bg-overlay: rgba(6, 20, 16, 0.62);
  --nav-bg: rgba(9, 58, 54, 0.76);
  --text-halo: none;
  --nav-border: rgba(255, 255, 255, 0.1);
  --nav-text: rgba(255, 255, 255, 0.88);
  --nav-text-dim: rgba(255, 255, 255, 0.65);
  --nav-hover-bg: rgba(0, 201, 176, 0.18);
  --nav-active-text: #7df5ea;
  --nav-title-color: #ffffff;
  --content-bg: rgba(11, 26, 22, 0.78);
  --footer-bg: rgba(7, 46, 43, 0.83);
  --footer-text: rgba(178, 218, 205, 0.88);
  --footer-brand: var(--color-accent);
  --footer-link-hover: var(--color-accent);
  --separator: rgba(255, 255, 255, 0.13);
  --color-text: rgba(218, 238, 233, 0.92);
  --color-text-light: rgba(155, 205, 190, 0.8);
  --surface-alt: rgba(27, 50, 42, 0.8);
  --table-stripe: rgba(0, 201, 176, 0.06);
  --table-line: rgba(255, 255, 255, 0.09);
  --table-hover: rgba(0, 201, 176, 0.13);
  --table-label: var(--color-accent);
}

/* Dark element overrides */
html.np-dark .entry-content h1, html.np-dark .entry-content h2,
html.np-dark .entry-content h3, html.np-dark .entry-content h4,
html.np-dark .page-title, html.np-dark .page-tagline,
html.np-dark .entry-title a, html.np-dark .footer-brand { color: var(--color-accent); }
html.np-dark .entry-content strong { color: var(--color-accent-dark); }
html.np-dark .entry-content a:not(.btn) { color: var(--color-accent); }
html.np-dark .entry-content hr { border-top-color: rgba(255,255,255,0.1); }
html.np-dark .entry-content blockquote::before { color: var(--color-accent); }
html.np-dark .entry-content .subpage-card .subpage-card-title,
html.np-dark .entry-content .price-table .price-amount { color: var(--color-accent); }
html.np-dark .entry-content a.subpage-card { color: var(--color-text); }
html.np-dark .footer-bottom { border-top-color: rgba(255,255,255,0.08); }
html.np-dark .search-result-title { color: var(--color-accent); }
html.np-dark .search-result-title:hover { color: var(--color-primary-light); }
html.np-dark .search-result mark,
html.np-dark .search-result-title mark { background: rgba(0, 201, 176, 0.34); }
html.np-dark .header-search-field:focus { box-shadow: 0 0 0 2px rgba(0, 201, 176, 0.14); }
@media (prefers-color-scheme: dark) {
  html:not(.np-light) .entry-content h1, html:not(.np-light) .entry-content h2,
  html:not(.np-light) .entry-content h3, html:not(.np-light) .entry-content h4,
  html:not(.np-light) .page-title, html:not(.np-light) .page-tagline,
  html:not(.np-light) .entry-title a, html:not(.np-light) .footer-brand { color: var(--color-accent); }
  html:not(.np-light) .entry-content strong { color: var(--color-accent-dark); }
  html:not(.np-light) .entry-content a:not(.btn) { color: var(--color-accent); }
  html:not(.np-light) .entry-content hr { border-top-color: rgba(255,255,255,0.1); }
  html:not(.np-light) .entry-content .subpage-card .subpage-card-title,
  html:not(.np-light) .entry-content .price-table .price-amount { color: var(--color-accent); }
  html:not(.np-light) .entry-content a.subpage-card { color: var(--color-text); }
  html:not(.np-light) .entry-content details:not(.maplibregl-ctrl) > summary { color: var(--color-accent); }
  html:not(.np-light) .footer-bottom { border-top-color: rgba(255,255,255,0.08); }
  html:not(.np-light) .search-result-title { color: var(--color-accent); }
  html:not(.np-light) .search-result-title:hover { color: var(--color-primary-light); }
  html:not(.np-light) .search-result mark,
  html:not(.np-light) .search-result-title mark { background: rgba(0, 201, 176, 0.34); }
  html:not(.np-light) .header-search-field:focus { box-shadow: 0 0 0 2px rgba(0, 201, 176, 0.14); }
}

/* Light overrides (manual) — same as :root defaults */
html.np-light {
  --bg-overlay: rgba(8, 32, 26, 0.30);
  --nav-bg: rgba(18, 142, 136, 0.86);
  --text-halo: 0 1px 2px rgba(4, 36, 32, 0.55), 0 0 6px rgba(4, 36, 32, 0.35);
  --nav-border: rgba(255, 255, 255, 0.18);
  --nav-text: rgba(255, 255, 255, 0.94);
  --nav-text-dim: rgba(255, 255, 255, 0.8);
  --nav-hover-bg: rgba(255, 255, 255, 0.12);
  --nav-active-text: #7df5ea;
  --nav-title-color: #ffffff;
  --content-bg: rgba(255, 255, 255, 0.82);
  --footer-bg: rgba(15, 124, 118, 0.9);
  --footer-text: rgba(255, 255, 255, 0.88);
  --footer-brand: #7df5ea;
  --footer-link-hover: #7df5ea;
  --separator: rgba(4, 42, 35, 0.3);
  --color-text: #1a2d26;
  --color-text-light: #3c5c52;
  --surface-alt: rgba(234, 255, 246, 0.7);
}

/* ───────────────────────────────────────────
   Mobile GPU-glitch mitigations
   backdrop-filter on large scrolling/fixed panels causes black rectangle
   artifacts in Android Chrome. Below the desktop breakpoint the blur is
   disabled and the panels get more opaque colours instead — visually close,
   glitch-free. (Keep these AFTER the dark-mode blocks so they win.)
   ─────────────────────────────────────────── */
@media (max-width: 880px) {
  .site-nav,
  .site-main,
  .site-footer,
  .site-topbar,
  .nav-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav-backdrop { background: rgba(4, 18, 14, 0.65); }
  /* The topbar and nav overlay sit over scrolling text: without blur, ANY
     translucency lets letterforms ghost through — make them fully opaque. */
  :root,
  html.np-light {
    --nav-bg: rgb(18, 142, 136);
    --content-bg: rgba(255, 255, 255, 0.93);
    --footer-bg: rgba(15, 124, 118, 0.97);
  }
  html.np-dark {
    --nav-bg: rgb(9, 50, 46);
    --content-bg: rgba(11, 26, 22, 0.95);
    --footer-bg: rgba(7, 46, 43, 0.96);
  }
}
@media (max-width: 880px) and (prefers-color-scheme: dark) {
  html:not(.np-light) {
    --nav-bg: rgb(9, 50, 46);
    --content-bg: rgba(11, 26, 22, 0.95);
    --footer-bg: rgba(7, 46, 43, 0.96);
  }
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Custom classes */

.wp-block-heading.reduced-margin {
  margin-top: 0;
}

/* ── Lightbox captions in dark mode — GLightbox ships a white caption bar
      (background #fff) while the caption text inherits the theme's pale
      dark-mode text color → unreadable. Dark surface + explicit colors. ── */
html.np-dark .glightbox-clean .gslide-description { background: #14241f; }
html.np-dark .glightbox-clean :is(.gslide-title, .gslide-desc) { color: rgba(218, 238, 233, 0.92); }
@media (prefers-color-scheme: dark) {
  html:not(.np-light) .glightbox-clean .gslide-description { background: #14241f; }
  html:not(.np-light) .glightbox-clean :is(.gslide-title, .gslide-desc) { color: rgba(218, 238, 233, 0.92); }
}