/* ===========================
   "Editorial" theme — layered on top of styles.css for sites whose
   sites.theme = 'editorial' (currently only branaldi.hu — see
   migrations/2026_11_02_add_site_theme.sql). Ported from the client's
   Next.js prototype (websitebranaldi, src/app/editorial.css): Barlow body +
   Playfair Display titles, pill navigation, large rounded bordered cards,
   red-accent pill buttons, and a light/dark mode (toggle in the navbar,
   app.js; stored choice applied pre-paint in includes/layout-top.php).

   Every selector is prefixed with body.theme-editorial: that's (0,1,1)+,
   so it reliably beats styles.css's generic rules AND its
   body.site-branaldi overrides (same specificity, this file loads later).
   The red accent stays var(--color-accent), so admin/site-edit.php's
   accent color still applies; font_heading/color_dark don't (this theme
   has its own fixed typography and ink color).

   Careful with `display` here: styles.css toggles visibility of several
   elements through `display` (mobile .navbar-menu, .menu-toggle,
   .scroll-top, .cookie-consent[hidden]) at LOWER specificity than these
   rules — setting `display` on those elements here would silently break
   the toggle, so any such rule re-states the hidden state explicitly. */

/* --- Self-hosted fonts (assets/fonts, SIL Open Font License) ---
   Barlow + Playfair Display, latin + latin-ext (Hungarian ő/ű live in
   latin-ext) only, copied from Google Fonts' own woff2 files. Served from
   our own origin instead of fonts.googleapis.com: no render-blocking
   third-party CSS request (Lighthouse), and visitors' IPs aren't sent to
   Google (GDPR). Playfair Display is a variable font — one file per subset
   covers every weight. */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/barlow-400-latin-ext.woff2') 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/barlow-400-latin.woff2') 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;
}

@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/barlow-500-latin-ext.woff2') 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/barlow-500-latin.woff2') 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;
}

@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/barlow-600-latin-ext.woff2') 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/barlow-600-latin.woff2') 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;
}

@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/barlow-700-latin-ext.woff2') 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/barlow-700-latin.woff2') 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;
}

@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../assets/fonts/barlow-800-latin-ext.woff2') 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../assets/fonts/barlow-800-latin.woff2') 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;
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../assets/fonts/playfair-display-latin-ext.woff2') 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../assets/fonts/playfair-display-latin.woff2') 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;
}

body.theme-editorial {
  --ed-bg: #ffffff;
  --ed-surface: #f5f5f7;
  --ed-surface-2: #ececef;
  --ed-ink: #0e0e0e;
  --ed-muted: #52555e;
  --ed-muted-2: #3a3c42;
  --ed-line: rgba(14, 14, 14, 0.12);
  --ed-grid-line: rgba(14, 14, 14, 0.055);
  --ed-red: var(--color-accent);
  --ed-red-soft: color-mix(in srgb, var(--color-accent) 8%, transparent);
  --ed-footer: #0e0e0e;
  --ed-radius: 24px;
  --ed-radius-sm: 18px;
  --ed-shadow: 0 18px 45px rgba(20, 20, 43, 0.08);
  --ed-display: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ed-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;

  /* Neutralize the classic branaldi typography (styles.css body.site-branaldi). */
  --heading-first-letter-style: normal;
  --heading-text-transform: none;
  --heading-font-weight: 600;
  --heading-letter-spacing: -0.035em;
  --nav-letter-spacing: 0;

  background: var(--ed-bg);
  color: var(--ed-ink);
  font-family: var(--ed-display);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

html[data-theme='dark'] body.theme-editorial {
  --ed-bg: #0e0e0e;
  --ed-surface: #1e1f23;
  --ed-surface-2: #2a2b30;
  --ed-ink: #f5f5f7;
  --ed-muted: #a7a9b0;
  --ed-muted-2: #d1d2d6;
  --ed-line: rgba(255, 255, 255, 0.15);
  --ed-grid-line: rgba(255, 255, 255, 0.06);
  --ed-red-soft: color-mix(in srgb, var(--color-accent) 16%, transparent);
  --ed-footer: #08090b;
  --ed-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* Only ever set by the editorial theme's own toggle, so it can't leak to
   other sites. Keeps overscroll/rubber-band areas dark too. */
html[data-theme='dark'] {
  background: #0e0e0e;
}

body.theme-editorial ::selection {
  background: var(--ed-red);
  color: #fff;
}

body.theme-editorial :is(a, button, input, textarea):focus-visible {
  outline: 2px solid var(--ed-red);
  outline-offset: 3px;
}

body.theme-editorial h1,
body.theme-editorial h2,
body.theme-editorial h3 {
  font-family: var(--ed-serif);
  font-weight: 600;
  letter-spacing: -0.03em;
}

body.theme-editorial .container {
  max-width: 1288px;
  padding: 0 24px;
}

/* --- Navbar --- */
body.theme-editorial .navbar {
  border-bottom: 1px solid var(--ed-line);
  background: color-mix(in srgb, var(--ed-bg) 88%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: none;
}

body.theme-editorial .navbar .container {
  min-height: 78px;
  padding-top: 0;
  padding-bottom: 0;
  gap: 24px;
}

body.theme-editorial .navbar-logo img {
  height: 32px;
}

/* The admin-uploaded logo is dark-on-transparent; render it as a solid
   light mark in dark mode instead of needing a second upload. */
html[data-theme='dark'] body.theme-editorial .navbar-logo img {
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

body.theme-editorial .navbar-menu {
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--ed-line);
  border-radius: 999px;
  background: var(--ed-surface);
}

body.theme-editorial .navbar-menu a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ed-muted);
  font-family: var(--ed-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

body.theme-editorial .navbar-menu a:hover,
body.theme-editorial .navbar-menu a.active {
  background: var(--ed-bg);
  color: var(--ed-ink);
  box-shadow: 0 1px 6px rgba(14, 14, 14, 0.06);
}

body.theme-editorial .navbar-menu a.active::after {
  content: none;
}

body.theme-editorial .navbar-actions {
  gap: 10px;
}

body.theme-editorial .theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--ed-line);
  border-radius: 999px;
  background: transparent;
  color: var(--ed-ink);
  font-family: var(--ed-display);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

body.theme-editorial .theme-toggle:hover {
  border-color: var(--ed-ink);
  background: var(--ed-surface);
  transform: rotate(-2deg);
}

body.theme-editorial .lang-pill {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--ed-line);
  border-radius: 999px;
}

body.theme-editorial .lang-pill a,
body.theme-editorial .lang-pill span {
  min-width: 32px;
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--ed-muted);
  font-family: var(--ed-display);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
}

body.theme-editorial .lang-pill a:hover {
  color: var(--ed-ink);
}

body.theme-editorial .lang-pill .is-active {
  background: var(--ed-ink);
  color: var(--ed-bg);
}

body.theme-editorial .menu-toggle {
  width: 42px;
  height: 42px;
  justify-content: center;
  border: 1px solid var(--ed-line);
  border-radius: 50%;
  color: var(--ed-ink);
  font-size: 18px;
}

body.theme-editorial .menu-toggle:hover {
  color: var(--ed-red);
}

/* Two bars that morph into an X while the menu is open. */
body.theme-editorial .menu-toggle-bars {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
}

body.theme-editorial .menu-toggle-bars > span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1), top 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.theme-editorial .menu-toggle-bars > span:first-child {
  top: 0;
}

body.theme-editorial .menu-toggle-bars > span:last-child {
  top: 8px;
}

body.theme-editorial .menu-toggle[aria-expanded='true'] .menu-toggle-bars > span:first-child {
  top: 4px;
  transform: rotate(45deg);
}

body.theme-editorial .menu-toggle[aria-expanded='true'] .menu-toggle-bars > span:last-child {
  top: 4px;
  transform: rotate(-45deg);
}

/* Desktop: the quick-contact block only belongs in the mobile panel. */
body.theme-editorial .mobile-menu-footer {
  display: none;
}

/* --- Buttons (every CTA-like link/button the blocks render) --- */
body.theme-editorial .btn-tovabb,
body.theme-editorial .hero-cta-card,
body.theme-editorial .btn-pdf,
body.theme-editorial .contact-form .btn-submit,
body.theme-editorial .cookie-consent .btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 26px;
  border: 1px solid var(--ed-red);
  border-radius: var(--ed-radius-sm);
  background: var(--ed-red);
  color: #fff;
  font-family: var(--ed-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  box-shadow: var(--ed-shadow);
  opacity: 1;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

body.theme-editorial .btn-tovabb:hover,
body.theme-editorial .hero-cta-card:hover,
body.theme-editorial .btn-pdf:hover,
body.theme-editorial .contact-form .btn-submit:hover,
body.theme-editorial .cookie-consent .btn-submit:hover {
  border-color: var(--ed-ink);
  background: var(--ed-ink);
  color: var(--ed-bg);
  opacity: 1;
  transform: translateY(-2px);
}

/* --- Hero: headline block above the slider, slider in a rounded card --- */
body.theme-editorial .hero {
  display: flex;
  flex-direction: column;
  padding: 72px 0 40px;
  background: var(--ed-bg);
}

body.theme-editorial .hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--ed-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ed-grid-line) 1px, transparent 1px);
  background-size: 88px 88px;
  -webkit-mask-image: radial-gradient(ellipse at 18% 20%, black, transparent 66%);
  mask-image: radial-gradient(ellipse at 18% 20%, black, transparent 66%);
}

/* A hero with no title/subtitle/CTA (e.g. a second, image-only slider
   further down a page) shouldn't reserve headline space. */
body.theme-editorial .hero:has(.hero-content:empty) {
  padding-top: 24px;
}

body.theme-editorial .hero-content:empty {
  display: none;
}

/* Two columns like the prototype's hero intro: the title on the left,
   subtitle + CTA stacked on the right. */
body.theme-editorial .hero-content,
body.theme-editorial .hero-content.hero-content-cta-only {
  position: relative;
  top: auto;
  bottom: auto;
  left: auto;
  order: -1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-content: start;
  justify-items: start;
  gap: 30px 54px;
  margin-bottom: 44px;
  text-align: left;
  transform: none;
  z-index: 1;
}

body.theme-editorial .hero-content > h1 {
  grid-column: 1;
  grid-row: 1 / span 2;
}

body.theme-editorial .hero-content > .hero-subtitle {
  grid-column: 2;
  align-self: end;
}

body.theme-editorial .hero-content > .hero-cta-card {
  grid-column: 2;
  align-self: start;
}

/* No subtitle: the lone CTA sits level with the title's last line. */
body.theme-editorial .hero-content:not(:has(.hero-subtitle)) > .hero-cta-card {
  align-self: end;
}

/* The classic theme fades the overlaid headline out on later slides; here
   it sits above the slider, so it stays put. */
body.theme-editorial .hero-content.hero-content-hidden {
  opacity: 1;
  pointer-events: auto;
}

body.theme-editorial .hero h1 {
  width: auto;
  max-width: 100%;
  padding: 0;
  background: none;
  box-shadow: none;
  color: var(--ed-ink);
  font-family: var(--ed-display);
  font-size: clamp(2.8rem, 6.8vw, 6.1rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.06em;
}

body.theme-editorial .hero-subtitle {
  width: auto;
  max-width: 600px;
  padding: 0;
  background: none;
  box-shadow: none;
  color: var(--ed-muted);
  font-size: clamp(1.18rem, 1.55vw, 1.42rem);
  line-height: 1.56;
}

body.theme-editorial .hero-cta-card {
  min-height: 52px;
  padding: 0 28px;
}

body.theme-editorial .hero-bg {
  width: calc(100% - 48px);
  max-width: 1240px;
  margin: 0 auto;
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-radius);
  /* The slides are shot on white and their edges fade out (styles.css
     mask) — into white they blend, into a dark card they'd show a harsh
     white-to-black ramp, so this stays white in dark mode too. */
  background: #fff;
}

body.theme-editorial .hero-slider-dots {
  bottom: 52px;
  gap: 0;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ed-bg) 80%, transparent);
  backdrop-filter: blur(8px);
}

/* Each dot is a 24x24 px tap target (WCAG 2.5.8 / Lighthouse
   target-size); the visible dot/pill is drawn by ::before inside it. */
body.theme-editorial .hero-slider-dots button {
  position: relative;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 0;
  background: none;
  transition: width 200ms ease;
}

body.theme-editorial .hero-slider-dots button::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background: var(--ed-line);
  transition: background 200ms ease;
}

body.theme-editorial .hero-slider-dots button.active {
  width: 38px;
  background: none;
}

body.theme-editorial .hero-slider-dots button.active::before {
  background: var(--ed-red);
}

/* --- Stats strip (block type "stats") ---
   A bordered row of big figures like the prototype's hero facts: one cell
   per figure, hairline dividers, 2x2 on phones. Right under the hero it
   reads as part of it, so the gap above is small there. */
body.theme-editorial .stats-block {
  padding: 72px 0;
  background: var(--ed-bg);
  color: var(--ed-ink);
}

body.theme-editorial .hero + .stats-block {
  padding-top: 0;
}

body.theme-editorial .stats-block h2 {
  margin-bottom: 28px;
}

body.theme-editorial .stats-strip {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-radius);
  background: var(--ed-bg);
  list-style: none;
  overflow: hidden;
}

/* One strip with hairline dividers, not four cards: undo the classic
   theme's per-stat card (styles.css). */
body.theme-editorial .stat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 30px 30px 26px;
  border-left: 1px solid var(--ed-line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  text-align: left;
}

body.theme-editorial .stat-value,
body.theme-editorial .stat-label {
  margin: 0;
}

body.theme-editorial .stat:first-child {
  border-left: 0;
}

body.theme-editorial .stat-value {
  color: var(--ed-ink);
  font-family: var(--ed-display);
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

body.theme-editorial .stat-label {
  color: var(--ed-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  body.theme-editorial .stats-block {
    padding: 48px 0;
  }

  body.theme-editorial .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row;
  }

  body.theme-editorial .stat {
    padding: 22px 20px 20px;
  }

  body.theme-editorial .stat:nth-child(odd) {
    border-left: 0;
  }

  body.theme-editorial .stat:nth-child(n + 3) {
    border-top: 1px solid var(--ed-line);
  }
}

/* --- Generic sections --- */
body.theme-editorial .richtext-block,
body.theme-editorial .item-grid-section,
body.theme-editorial .video-grid-section,
body.theme-editorial .gallery-section {
  padding: 88px 0;
  background: var(--ed-bg);
  color: var(--ed-ink);
}

body.theme-editorial .richtext-block.richtext-alt,
body.theme-editorial .richtext-block.richtext-has-extra,
body.theme-editorial .item-grid-section,
body.theme-editorial .gallery-section {
  background: var(--ed-surface);
}

body.theme-editorial .richtext-block .container,
body.theme-editorial .richtext-block.richtext-has-extra .container {
  max-width: 1288px;
}

/* Section titles: large serif, left-aligned, no centered underline. */
body.theme-editorial .richtext-block h2,
body.theme-editorial .richtext-block.richtext-has-extra h2,
body.theme-editorial .item-grid-section h2,
body.theme-editorial .video-grid-section h2,
body.theme-editorial .gallery-section h2 {
  max-width: 940px;
  margin-bottom: 28px;
  padding-bottom: 0;
  color: var(--ed-ink);
  font-family: var(--ed-serif);
  font-size: clamp(2.2rem, 4.4vw, 4rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-align: left;
}

body.theme-editorial .richtext-block h2::after,
body.theme-editorial .item-grid-section h2::after,
body.theme-editorial .video-grid-section h2::after,
body.theme-editorial .gallery-section h2::after {
  content: none;
}

/* richtext's optional subtitle sits ABOVE its title — the prototype's red
   "kicker" line. */
body.theme-editorial .richtext-subtitle,
body.theme-editorial .richtext-block.richtext-has-image .richtext-subtitle {
  margin-bottom: 14px;
  color: var(--ed-red);
  font-family: var(--ed-display);
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

body.theme-editorial .richtext-body,
body.theme-editorial .item-grid-section .ref-intro,
body.theme-editorial .video-grid-section .ref-intro {
  max-width: 860px;
}

body.theme-editorial .item-grid-section .ref-intro,
body.theme-editorial .video-grid-section .ref-intro,
body.theme-editorial .cta-block .cta-subtitle {
  margin: 0 0 8px;
  color: var(--ed-muted);
  font-size: 1.18rem;
  line-height: 1.65;
  text-align: left;
}

body.theme-editorial .richtext-body p,
body.theme-editorial .richtext-body ul,
body.theme-editorial .richtext-body ol {
  margin-bottom: 18px;
  color: var(--ed-muted);
  font-size: 1.12rem;
  line-height: 1.75;
  text-align: left;
}

body.theme-editorial .richtext-body strong {
  color: var(--ed-ink);
  font-weight: 700;
}

body.theme-editorial .richtext-body a {
  color: var(--ed-red);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

body.theme-editorial .richtext-body ul {
  margin-left: 0;
  padding-left: 0;
  list-style: none;
}

body.theme-editorial .richtext-body ul li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 22px;
}

body.theme-editorial .richtext-body ul li::before {
  content: '';
  position: absolute;
  top: 0.68em;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ed-red);
}

/* Multi-column richtext (e.g. "Paraméterek"): each admin-edited column
   becomes a card, like the prototype's parameter cards. */
body.theme-editorial .richtext-columns-2,
body.theme-editorial .richtext-columns-3 {
  max-width: none;
  gap: 16px;
}

body.theme-editorial .richtext-body-col {
  padding: 28px;
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-radius);
  background: var(--ed-bg);
}

body.theme-editorial .richtext-columns-2 .richtext-body-col p,
body.theme-editorial .richtext-columns-3 .richtext-body-col p {
  font-size: 1.02rem;
  line-height: 1.6;
}

body.theme-editorial .richtext-body-col > :last-child {
  margin-bottom: 0;
}

body.theme-editorial .richtext-image img {
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-radius);
  box-shadow: none;
}

/* The first block of a subpage acts as its page header — bigger title and
   a soft accent glow, like the prototype's service pages. */
body.theme-editorial .site-main > .section:first-child:not(.hero) {
  padding-top: 112px;
  background:
    radial-gradient(circle at 88% 0%, var(--ed-red-soft), transparent 36rem),
    var(--ed-bg);
}

body.theme-editorial .site-main > .section:first-child:not(.hero) h2 {
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 1;
}

/* A header block that's only a title (e.g. every reference subpage) —
   don't stack its full bottom padding on top of the next section's top
   padding. */
body.theme-editorial .site-main > .richtext-block:first-child:has(.richtext-body:empty) {
  padding-bottom: 40px;
}

body.theme-editorial .richtext-body:empty {
  display: none;
}

body.theme-editorial .site-main > .richtext-block:first-child:has(.richtext-body:empty) + .section {
  padding-top: 56px;
}

/* --- Item grid cards (Szolgáltatások / Referenciák) --- */
body.theme-editorial .item-grid {
  gap: 16px;
  margin-top: 40px;
}

body.theme-editorial .grid-item {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ed-line);
  border-radius: 20px;
  background: var(--ed-bg);
  color: var(--ed-ink);
  box-shadow: none;
  /* `translate` (not `transform`) for the hover lift, so it never fights
     the scroll-in reveal's `transform` (bottom of this file). */
  transition: border-color 160ms ease, box-shadow 160ms ease, translate 160ms ease;
}

body.theme-editorial .grid-item:hover,
body.theme-editorial .grid-item:focus-visible {
  border-color: var(--ed-red);
  box-shadow: var(--ed-shadow);
  translate: 0 -3px;
}

body.theme-editorial .grid-item-img-wrapper {
  aspect-ratio: 4 / 3;
  /* Product photos are shot on white — keep their backdrop white in dark
     mode too instead of a mismatched dark frame around a white photo. */
  background: #fff;
}

/* The whole image always shows, framed inside the card with a white
   margin (like the prototype's reference cards) — never cropped. */
body.theme-editorial .grid-item-img-wrapper,
body.theme-editorial .gallery-image-wrapper {
  padding: 16px 16px 0;
}

body.theme-editorial .grid-item-img-wrapper img {
  object-fit: contain;
  transition: transform 500ms ease;
}

body.theme-editorial .grid-item:hover .grid-item-img-wrapper img {
  transform: scale(1.02);
}

body.theme-editorial .grid-item-body {
  position: relative;
  flex: 1;
  padding: 17px 44px 18px 18px;
  background: transparent;
}

body.theme-editorial .grid-item-body::after {
  content: '↗';
  position: absolute;
  right: 18px;
  bottom: 17px;
  color: var(--ed-red);
  font-size: 0.95rem;
  line-height: 1;
}

body.theme-editorial .grid-item-body h3 {
  margin-bottom: 6px;
  color: var(--ed-ink);
  font-family: var(--ed-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

body.theme-editorial .grid-item-body h3 i {
  color: var(--ed-red);
}

body.theme-editorial .grid-item-excerpt {
  color: var(--ed-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* --- Gallery tiles (same card treatment) --- */
body.theme-editorial .gallery-grid {
  gap: 16px;
}

body.theme-editorial .gallery-tile {
  border: 1px solid var(--ed-line);
  border-radius: 20px;
  background: var(--ed-bg);
  box-shadow: none;
  color: var(--ed-ink);
  font-family: var(--ed-display);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body.theme-editorial .gallery-tile:hover,
body.theme-editorial .gallery-tile:focus-visible {
  border-color: var(--ed-red);
  box-shadow: var(--ed-shadow);
  transform: translateY(-3px);
}

body.theme-editorial .gallery-image-wrapper {
  background: #fff;
}

body.theme-editorial .gallery-tile:hover .gallery-image {
  transform: scale(1.02);
}

body.theme-editorial .gallery-caption {
  padding: 16px 18px 17px;
  background: transparent;
  color: var(--ed-ink);
  font-family: var(--ed-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

/* --- Videos --- */
body.theme-editorial .video-item {
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-radius);
  box-shadow: none;
}

body.theme-editorial .video-grid {
  gap: 16px;
}

/* Click-to-play thumbnail that stands in for a YouTube embed until it's
   clicked (app.js). */
body.theme-editorial .video-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
  font-family: var(--ed-display);
  text-align: left;
  cursor: pointer;
}

body.theme-editorial .video-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 250ms ease, transform 500ms ease;
}

body.theme-editorial .video-facade::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent 55%);
  pointer-events: none;
}

body.theme-editorial .video-facade-title {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 16px;
  z-index: 1;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

body.theme-editorial .video-facade-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--ed-red);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* The triangle. */
body.theme-editorial .video-facade-play::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 54%;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
  transform: translate(-50%, -50%);
}

body.theme-editorial .video-facade:hover img,
body.theme-editorial .video-facade:focus-visible img {
  opacity: 1;
  transform: scale(1.03);
}

body.theme-editorial .video-facade:hover .video-facade-play,
body.theme-editorial .video-facade:focus-visible .video-facade-play {
  transform: translate(-50%, -50%) scale(1.1);
}

/* --- CTA band: a bordered card with a faint accent wash --- */
body.theme-editorial .cta-block {
  padding: 0 0 88px;
  background: var(--ed-surface);
  text-align: left;
}

body.theme-editorial .cta-block .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  width: calc(100% - 48px);
  max-width: 1240px;
  padding: 32px 36px;
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-radius);
  background:
    linear-gradient(145deg, var(--ed-red-soft), transparent 48%),
    var(--ed-bg);
}

/* Only the CTA's own heading/subtitle stack to the left; the button stays
   on the right (or wraps below on narrow screens). */
body.theme-editorial .cta-block h2 {
  flex: 1 1 100%;
  margin: 0;
  color: var(--ed-ink);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

body.theme-editorial .cta-block .cta-subtitle {
  flex: 1 1 420px;
  margin: 0;
}

body.theme-editorial .cta-block .btn-tovabb {
  margin-top: 0;
}

/* A bare button (no heading/subtitle, e.g. the PDF download under
   "Paraméterek") would leave a mostly empty card — show just the button. */
body.theme-editorial .cta-block .container:not(:has(h2, .cta-subtitle)) {
  width: auto;
  max-width: 1288px;
  padding: 0 24px;
  border-radius: 0;
  border: 0;
  background: none;
}

/* A standalone CTA that's not following a surface-colored section. */
body.theme-editorial :is(.hero, .richtext-block:not(.richtext-alt):not(.richtext-has-extra), .video-grid-section) + .cta-block {
  background: var(--ed-bg);
}

/* --- Contact (footer) section: three cards on a surface band --- */
body.theme-editorial .footer {
  padding: 96px 0 0;
  border-top: 1px solid var(--ed-line);
  background: var(--ed-surface);
  color: var(--ed-ink);
}

body.theme-editorial .footer .container {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}

body.theme-editorial .footer-info,
body.theme-editorial .footer-map,
body.theme-editorial .contact-form {
  padding: 28px;
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-radius);
  background: var(--ed-bg);
}

body.theme-editorial .contact-form {
  background:
    linear-gradient(145deg, var(--ed-red-soft), transparent 48%),
    var(--ed-bg);
}

body.theme-editorial .footer h3,
body.theme-editorial .footer-info .opening-title {
  margin-bottom: 18px;
  color: var(--ed-ink);
  font-family: var(--ed-serif);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

body.theme-editorial .footer-info .opening-title {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--ed-line);
  font-size: 1.3rem;
}

body.theme-editorial .footer-info p {
  margin-bottom: 4px;
  color: var(--ed-muted);
  font-size: 0.98rem;
}

body.theme-editorial .footer-info .company-name {
  margin-bottom: 4px;
  color: var(--ed-ink);
  font-weight: 700;
}

body.theme-editorial .footer-info .label-text {
  margin-top: 18px;
  margin-bottom: 2px;
  color: var(--ed-muted-2);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

body.theme-editorial .footer-info a {
  color: var(--ed-ink);
}

body.theme-editorial .footer-info a:hover {
  color: var(--ed-red);
}

body.theme-editorial .footer-map a {
  border-radius: 16px;
  box-shadow: none;
}

body.theme-editorial .contact-form label {
  margin-bottom: 6px;
  color: var(--ed-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

body.theme-editorial .contact-form .form-group {
  margin-bottom: 14px;
}

body.theme-editorial .contact-form input,
body.theme-editorial .contact-form textarea {
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: var(--ed-surface);
  color: var(--ed-ink);
  font-family: var(--ed-display);
  font-size: 0.98rem;
}

body.theme-editorial .contact-form input:focus,
body.theme-editorial .contact-form textarea:focus {
  border-color: var(--ed-red);
  background: var(--ed-bg);
}

body.theme-editorial .contact-form .form-group-checkbox label {
  color: var(--ed-muted);
  font-size: 0.82rem;
  font-weight: 400;
}

body.theme-editorial .contact-form .form-group-checkbox a {
  color: var(--ed-red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.theme-editorial .form-flash {
  border-radius: 12px;
}

body.theme-editorial .form-flash-success {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
}

html[data-theme='dark'] body.theme-editorial .form-flash-success {
  color: #6ee7b7;
}

body.theme-editorial .form-flash-error {
  border-color: color-mix(in srgb, var(--ed-red) 35%, transparent);
  background: var(--ed-red-soft);
  color: var(--ed-red);
}

/* --- Contact section over an interactive map (footer--map: only when the
   map_coordinates setting is set — includes/layout-bottom.php; Leaflet is
   lazy-loaded by app.js). The map fills the whole section behind the
   cards; the info card sits left, the form right, and app.js pans the pin
   into the free gap between them. --- */
/* Map and cards share the first grid row (stacked in the same cell), the
   dark bottom strip gets its own row — so the map ends exactly where the
   strip starts and Leaflet's bottom controls/attribution stay visible. */
body.theme-editorial .footer.footer--map {
  display: grid;
  padding-top: 0;
  overflow: hidden;
}

body.theme-editorial .contact-map {
  position: relative;
  grid-area: 1 / 1;
  /* Own stacking context, so Leaflet's internal pane z-indexes (400+)
     can't climb over the cards. */
  z-index: 0;
  min-height: 100%;
  background: var(--ed-surface);
  font-family: var(--ed-display);
}

body.theme-editorial .footer--map .container {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1;
  width: 100%;
  padding-top: 120px;
  padding-bottom: 96px;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr) minmax(0, 440px);
  /* The empty middle column lets map drags/clicks through to the map. */
  pointer-events: none;
}

body.theme-editorial .footer--map .container > * {
  pointer-events: auto;
}

body.theme-editorial .footer--map .contact-form {
  grid-column: 3;
}

body.theme-editorial .footer--map .footer-info,
body.theme-editorial .footer--map .contact-form {
  background: color-mix(in srgb, var(--ed-bg) 90%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: var(--ed-shadow);
}

body.theme-editorial .footer--map .contact-form {
  background:
    linear-gradient(145deg, var(--ed-red-soft), transparent 48%),
    color-mix(in srgb, var(--ed-bg) 90%, transparent);
}

body.theme-editorial .footer--map .footer-bottom {
  grid-area: 2 / 1;
  margin-top: 0;
}

body.theme-editorial .map-open-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Standard (colorful) OSM tiles toned down to a calm grey basemap; in dark
   mode inverted into a dark one — CSS-only, so the light/dark toggle
   switches it instantly without reloading tiles. */
body.theme-editorial .contact-map .leaflet-tile-pane {
  filter: grayscale(1) contrast(0.88) brightness(1.06);
}

html[data-theme='dark'] body.theme-editorial .contact-map .leaflet-tile-pane {
  filter: grayscale(1) invert(1) contrast(0.82) brightness(0.78);
}

/* Leaflet chrome in the theme's colors. */
body.theme-editorial .contact-map .leaflet-control-attribution {
  border-radius: 8px 0 0 0;
  background: color-mix(in srgb, var(--ed-bg) 80%, transparent);
  color: var(--ed-muted);
  font-size: 0.66rem;
}

body.theme-editorial .contact-map .leaflet-control-attribution a {
  color: var(--ed-muted-2);
}

body.theme-editorial .contact-map .leaflet-bar {
  overflow: hidden;
  border: 1px solid var(--ed-line);
  border-radius: 12px;
  box-shadow: var(--ed-shadow);
}

body.theme-editorial .contact-map .leaflet-bar a {
  border-bottom-color: var(--ed-line);
  background: var(--ed-bg);
  color: var(--ed-ink);
}

body.theme-editorial .contact-map .leaflet-bar a:hover {
  background: var(--ed-surface);
  color: var(--ed-red);
}

/* The pin: a pulsing accent dot with a small label card above it.
   (.map-pin-icon is Leaflet's own zero-size marker box, anchored on the
   exact coordinate.) */
body.theme-editorial .map-pin-icon {
  background: none;
  border: 0;
}

body.theme-editorial .map-pin {
  position: absolute;
  left: 0;
  top: 0;
}

body.theme-editorial .map-pin-dot {
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  border: 3px solid var(--ed-bg);
  border-radius: 50%;
  background: var(--ed-red);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.theme-editorial .map-pin-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--ed-red);
  opacity: 0.35;
  animation: map-pin-pulse 2.2s ease-out infinite;
  z-index: -1;
}

@keyframes map-pin-pulse {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(3.2); opacity: 0; }
}

body.theme-editorial .map-pin-label {
  position: absolute;
  left: 0;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--ed-line);
  border-radius: 14px;
  background: var(--ed-bg);
  color: var(--ed-ink);
  font-family: var(--ed-display);
  white-space: nowrap;
  box-shadow: var(--ed-shadow);
  transform: translateX(-50%);
}

body.theme-editorial .map-pin-label strong {
  font-size: 0.9rem;
  font-weight: 700;
}

body.theme-editorial .map-pin-label small {
  color: var(--ed-muted);
  font-size: 0.76rem;
}

/* Little pointer under the label card, toward the dot. */
body.theme-editorial .map-pin-label::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 1px solid var(--ed-line);
  border-bottom: 1px solid var(--ed-line);
  background: var(--ed-bg);
  transform: translateX(-50%) rotate(45deg);
}

/* Full-bleed dark strip under the contact cards. */
body.theme-editorial .footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 96px;
  padding: 24px max(24px, calc((100% - 1240px) / 2));
  border-top: 0;
  background: var(--ed-footer);
  color: #a7a9b0;
  font-size: 0.8rem;
  text-align: left;
}

body.theme-editorial .footer-social {
  display: flex;
  gap: 8px;
}

body.theme-editorial .footer-social a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #a7a9b0;
  font-size: 0.85rem;
}

body.theme-editorial .footer-social a:hover {
  border-color: var(--ed-red);
  background: var(--ed-red);
  color: #fff;
}

/* --- Scroll-to-top, cookie banner --- */
body.theme-editorial .scroll-top {
  width: 46px;
  height: 46px;
  border: 1px solid var(--ed-line);
  background: color-mix(in srgb, var(--ed-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  color: var(--ed-ink);
  font-size: 15px;
  box-shadow: var(--ed-shadow);
}

body.theme-editorial .scroll-top:hover {
  border-color: var(--ed-red);
  background: var(--ed-red);
  color: #fff;
}

body.theme-editorial .cookie-consent {
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 22px;
  border: 1px solid var(--ed-line);
  border-radius: 20px;
  background: var(--ed-bg);
  color: var(--ed-ink);
  font-family: var(--ed-display);
  box-shadow: var(--ed-shadow);
}

/* Must out-rank the rule above (see the `display` note at the top and
   styles.css's own .cookie-consent[hidden]). */
body.theme-editorial .cookie-consent[hidden] {
  display: none;
}

body.theme-editorial .cookie-consent p {
  color: var(--ed-muted);
}

body.theme-editorial .cookie-consent a {
  color: var(--ed-red);
}

body.theme-editorial .cookie-consent-actions .btn-submit {
  min-height: 42px;
  padding: 0 20px;
  box-shadow: none;
}

body.theme-editorial .cookie-consent-reject {
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-radius-sm);
  color: var(--ed-ink);
  font-family: var(--ed-display);
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: none;
}

body.theme-editorial .cookie-consent-reject:hover {
  border-color: var(--ed-ink);
  opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  body.theme-editorial .footer .container {
    grid-template-columns: 1fr;
  }

  /* No room for a gap between side-by-side cards: the map becomes its own
     rounded block below the stacked cards. */
  body.theme-editorial .footer.footer--map {
    display: flex;
    flex-direction: column;
    padding-top: 64px;
  }

  body.theme-editorial .footer--map .container {
    order: 1;
    padding-top: 0;
    padding-bottom: 0;
  }

  body.theme-editorial .footer--map .contact-form {
    grid-column: auto;
  }

  body.theme-editorial .contact-map {
    position: relative;
    inset: auto;
    order: 2;
    width: calc(100% - 48px);
    max-width: 1240px;
    height: 340px;
    margin: 16px auto 0;
    overflow: hidden;
    border: 1px solid var(--ed-line);
    border-radius: var(--ed-radius);
  }

  body.theme-editorial .footer--map .footer-bottom {
    order: 3;
    margin-top: 64px;
  }

  body.theme-editorial .richtext-block,
  body.theme-editorial .item-grid-section,
  body.theme-editorial .video-grid-section,
  body.theme-editorial .gallery-section {
    padding: 64px 0;
  }

  body.theme-editorial .site-main > .section:first-child:not(.hero) {
    padding-top: 80px;
  }

  body.theme-editorial .cta-block {
    padding-bottom: 64px;
  }
}

@media (max-width: 768px) {
  /* backdrop-filter makes the navbar the containing block for
     position:fixed descendants, which would trap the full-screen mobile
     menu (styles.css) inside the 78px bar. */
  body.theme-editorial .navbar {
    background: var(--ed-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.theme-editorial .navbar .container {
    min-height: 68px;
    gap: 12px;
  }

  body.theme-editorial .navbar-logo img {
    height: 26px;
  }

  /* Mobile menu panel: opens BELOW the header (logo, dark-mode toggle,
     language switch and the close button stay visible), fades/slides in
     instead of popping. Deliberately overrides styles.css's display:none/
     flex toggle with an always-flex panel hidden via visibility/opacity —
     the hidden state is restated explicitly here (see the `display` note
     at the top of this file), so .active (app.js) still controls it. */
  body.theme-editorial .navbar-menu {
    display: flex;
    top: 68px;
    height: auto;
    bottom: 0;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: 12px 24px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 0;
    border-top: 1px solid var(--ed-line);
    border-radius: 0;
    background: var(--ed-bg);
    counter-reset: nav-item;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 260ms ease, transform 360ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 360ms;
  }

  body.theme-editorial .navbar-menu.active {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 260ms ease, transform 360ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
  }

  /* Editorial list: numbered index, big serif label, arrow, hairlines. */
  body.theme-editorial .navbar-menu > a {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 20px 2px;
    border-bottom: 1px solid var(--ed-line);
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--ed-ink);
    font-family: var(--ed-serif);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    counter-increment: nav-item;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 400ms ease, transform 500ms cubic-bezier(0.22, 1, 0.36, 1), color 160ms ease;
  }

  body.theme-editorial .navbar-menu.active > a {
    opacity: 1;
    transform: none;
    transition-delay: calc(80ms + var(--i, 0) * 55ms), calc(80ms + var(--i, 0) * 55ms), 0s;
  }

  body.theme-editorial .navbar-menu > a::before {
    content: counter(nav-item, decimal-leading-zero);
    min-width: 24px;
    color: var(--ed-muted);
    font-family: var(--ed-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
  }

  body.theme-editorial .navbar-menu > a::after,
  body.theme-editorial .navbar-menu > a.active::after {
    content: '→';
    position: static;
    width: auto;
    height: auto;
    margin-left: auto;
    background: none;
    color: var(--ed-muted);
    font-family: var(--ed-display);
    font-size: 1.1rem;
    transition: transform 200ms ease, color 160ms ease;
  }

  body.theme-editorial .navbar-menu > a:hover,
  body.theme-editorial .navbar-menu > a.active {
    background: none;
    box-shadow: none;
    color: var(--ed-red);
  }

  body.theme-editorial .navbar-menu > a:hover::after,
  body.theme-editorial .navbar-menu > a.active::after {
    color: var(--ed-red);
    transform: translateX(4px);
  }

  body.theme-editorial .mobile-menu-footer {
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding-top: 32px;
    opacity: 0;
    transition: opacity 400ms ease;
  }

  body.theme-editorial .navbar-menu.active .mobile-menu-footer {
    opacity: 1;
    transition-delay: 300ms;
  }

  body.theme-editorial .navbar-menu .mobile-menu-footer a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 20px;
    border: 1px solid var(--ed-line);
    border-radius: var(--ed-radius-sm);
    background: transparent;
    box-shadow: none;
    color: var(--ed-ink);
    font-family: var(--ed-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
  }

  body.theme-editorial .navbar-menu .mobile-menu-footer a.mobile-menu-call {
    border-color: var(--ed-red);
    background: var(--ed-red);
    color: #fff;
  }

  /* No page scrolling behind the open menu (app.js toggles .menu-open).
     The lock goes on <body>, not <html>: with html{overflow:hidden} the
     body's own overflow-x:hidden (styles.css) stops propagating to the
     viewport and turns <body> into a scroll container — the sticky navbar
     then sticks to that non-scrolling box and jumps back to the top of the
     document, i.e. off-screen when the page was scrolled (logo and close
     button unreachable). On <body> the overflow propagates to the viewport
     and the navbar stays put. */
  html.menu-open body {
    overflow: hidden;
  }

  body.theme-editorial .navbar-actions {
    gap: 8px;
    margin-left: auto;
  }

  body.theme-editorial .theme-toggle {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  body.theme-editorial .theme-toggle-label {
    display: none;
  }

  body.theme-editorial .hero {
    padding: 44px 0 28px;
  }

  body.theme-editorial .hero-content,
  body.theme-editorial .hero-content.hero-content-cta-only {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  body.theme-editorial .hero-content > :is(h1, .hero-subtitle, .hero-cta-card) {
    grid-column: 1;
    grid-row: auto;
  }

  body.theme-editorial .hero-content,
  body.theme-editorial .hero-content.hero-content-cta-only {
    margin-bottom: 28px;
  }

  /* styles.css's 3:2 mobile box is sized to fit the classic overlaid title
     — here the title sits above, so the box only needs to frame the wide
     (~1920x400-600) slides without a big empty white band around them. */
  body.theme-editorial .hero-bg {
    width: calc(100% - 32px);
    aspect-ratio: 16 / 5;
    max-height: none;
    border-radius: 18px;
  }

  /* .hero's 28px mobile bottom padding + a little inset into the card. */
  body.theme-editorial .hero-slider-dots {
    bottom: 36px;
  }

  body.theme-editorial .container {
    padding: 0 16px;
  }

  body.theme-editorial .cta-block .container,
  body.theme-editorial .contact-map {
    width: calc(100% - 32px);
  }

  body.theme-editorial .cta-block .container {
    padding: 24px;
  }

  body.theme-editorial .richtext-body-col,
  body.theme-editorial .footer-info,
  body.theme-editorial .footer-map,
  body.theme-editorial .contact-form {
    padding: 22px;
  }

  body.theme-editorial .footer-bottom {
    padding: 22px 16px;
  }
}

/* --- Scroll-in reveal (like the prototype's <Reveal>) --- Only content
   that starts below the first screen takes part: app.js marks it .reveal
   (hidden: 24px lower, transparent) and adds .is-visible as it scrolls
   into view, staggered via an inline transition-delay. Nothing is hidden
   up front by CSS, so with no JS or with prefers-reduced-motion
   everything simply shows — and content visible on load never waits for
   a script (that's what pushed Lighthouse's LCP to 13+ s). */
body.theme-editorial .reveal:not(.is-visible):not(.is-split) {
  opacity: 0;
  transform: translateY(24px);
}

/* The first screen (hero, or a subpage's header title) gets a pure-CSS
   entrance instead, running from the very first paint — no script to
   wait for. `translate` (not `transform`), so the kept end state doesn't
   override hover transforms (e.g. the hero CTA's lift). Must match
   ENTRANCE_SELECTOR in app.js, which leaves these alone. */
@media (prefers-reduced-motion: no-preference) {
  body.theme-editorial .site-main > .section:first-child :is(.hero-content > *, .hero-bg, .container > :is(h2, .richtext-subtitle, .ref-intro)) {
    animation: ed-entrance 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  body.theme-editorial .site-main > .section:first-child :is(.hero-content > :nth-child(2), .container > :nth-child(2)) {
    animation-delay: 120ms;
  }

  body.theme-editorial .site-main > .section:first-child :is(.hero-content > :nth-child(3), .container > :nth-child(3)) {
    animation-delay: 220ms;
  }

  body.theme-editorial .site-main > .section:first-child .hero-bg {
    animation-delay: 300ms;
  }
}

@keyframes ed-entrance {
  from { opacity: 0; translate: 0 28px; }
  to { opacity: 1; translate: 0 0; }
}

/* Titles split into words by app.js (.is-split) don't fade as a block:
   each word rises from behind its own mask, one after the other. The
   padding/negative margin widens each word's clip box so accents (Ü, Á)
   and descenders (g, y, j) aren't cut off. */
body.theme-editorial .split-word {
  display: inline-block;
  overflow: hidden;
  padding: 0.16em 0.04em 0.12em;
  margin: -0.16em -0.04em -0.12em;
  vertical-align: top;
}

body.theme-editorial .split-word > span {
  display: inline-block;
  transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--reveal-delay, 0ms) + var(--i, 0) * 55ms);
}

body.theme-editorial .reveal.is-split:not(.is-visible) .split-word > span {
  transform: translateY(115%);
}

/* Only while sliding in (app.js removes .is-revealing afterwards), so
   hover transitions go back to their own quick timings. Out-ranks the
   per-component `transition` rules above. */
body.theme-editorial .reveal.is-revealing {
  transition:
    opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===========================
   Motion extras — all decorative. The JS-driven ones (app.js: navbar
   pill/scroll state, hero glow, card spotlight) aren't wired up at all for
   reduced-motion visitors; the pure-CSS ones are wrapped in
   prefers-reduced-motion: no-preference below.
   =========================== */

/* --- Navbar: slims down on scroll + reading-progress line --- */
body.theme-editorial .navbar .container,
body.theme-editorial .navbar-logo img {
  transition: min-height 300ms ease, height 300ms ease;
}

body.theme-editorial .navbar.is-scrolled {
  box-shadow: 0 10px 30px rgba(14, 14, 14, 0.06);
}

@media (min-width: 769px) {
  /* The bar is sticky, i.e. still part of the page flow: shrinking it 14px
     would pull everything below up 14px, the browser's scroll anchoring
     would shift the scroll position to compensate — and that could cross
     the threshold again (a jittering loop). The margin takes over exactly
     the height the bar gives up, with the same easing, so the layout
     below never moves. */
  body.theme-editorial .navbar {
    transition: margin-bottom 300ms ease, box-shadow 300ms ease;
  }

  body.theme-editorial .navbar.is-scrolled {
    margin-bottom: 14px;
  }

  body.theme-editorial .navbar.is-scrolled .container {
    min-height: 64px;
  }

  body.theme-editorial .navbar.is-scrolled .navbar-logo img {
    height: 28px;
  }
}

body.theme-editorial .scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--ed-red);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

/* --- Sliding pill behind the hovered/current nav link (desktop) --- */
body.theme-editorial .nav-indicator {
  display: none;
}

@media (min-width: 769px) {
  body.theme-editorial .navbar-menu {
    position: relative;
  }

  body.theme-editorial .navbar-menu a {
    position: relative;
    z-index: 1;
  }

  body.theme-editorial .nav-indicator {
    display: block;
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 0;
    border-radius: 999px;
    background: var(--ed-bg);
    box-shadow: 0 1px 6px rgba(14, 14, 14, 0.08);
    opacity: 0;
    pointer-events: none;
  }

  /* Added a frame after the first placement, so the pill doesn't sweep in
     from the left edge on page load. */
  body.theme-editorial .nav-indicator.is-ready {
    transition:
      transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
      width 380ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 200ms ease;
  }

  /* The pill now provides the hover/active background. */
  body.theme-editorial .navbar-menu.has-indicator a:hover,
  body.theme-editorial .navbar-menu.has-indicator a.active {
    background: transparent;
    box-shadow: none;
  }
}

/* --- Hero: drifting grid, cursor-following glow, slow slide zoom ---
   app.js sets --hx/--hy on .hero itself; the glow is drawn by its ::after,
   so these MUST inherit (a non-inheriting registered property would leave
   the pseudo-element stuck on the initial value). Registered at all so
   the ::after's transition can ease between positions. */
@property --hx {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 72%;
}

@property --hy {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 28%;
}

body.theme-editorial .hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(560px circle at var(--hx) var(--hy), color-mix(in srgb, var(--color-accent) 11%, transparent), transparent 70%);
  transition: --hx 1.4s cubic-bezier(0.22, 1, 0.36, 1), --hy 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Above the glow layer. */
body.theme-editorial .hero-bg {
  z-index: 1;
}

/* --- Card spotlight: an accent ring that follows the cursor along the
   card's border (.spot is added by app.js, mouse devices only). --- */
body.theme-editorial .richtext-body-col,
body.theme-editorial .gallery-tile {
  position: relative;
}

body.theme-editorial .spot::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--ed-red), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

body.theme-editorial .spot:hover::before {
  opacity: 1;
}

/* The ring has to follow the same curve as the card's own 1px grey border,
   or the two drift apart at the rounded corners. Text columns: lay it
   exactly over the border (border box, same outer radius). */
body.theme-editorial .richtext-body-col.spot::before {
  inset: -1px;
}

/* Grid/gallery cards clip their content (overflow: hidden) to the inside
   of the border, so the ring can't sit on it: it traces the border's
   inner edge instead — radius = outer radius (20px) minus the 1px border. */
body.theme-editorial :is(.grid-item, .gallery-tile).spot::before {
  border-radius: 19px;
}

/* With the ring doing the highlighting, the hovered border itself only
   warms up slightly instead of turning fully red. */
body.theme-editorial .grid-item.spot:hover,
body.theme-editorial .gallery-tile.spot:hover {
  border-color: color-mix(in srgb, var(--ed-red) 30%, var(--ed-line));
}

body.theme-editorial .grid-item-body::after {
  transition: transform 250ms ease;
}

body.theme-editorial .grid-item:hover .grid-item-body::after {
  transform: translate(3px, -3px);
}

/* --- Buttons: on hover the label makes room and an arrow slides in on
   the right (→). The padding is only shifted
   from left to right, so the button's width never changes. A short press
   effect on click. --- */
body.theme-editorial :is(.btn-tovabb, .hero-cta-card, .btn-pdf, .contact-form .btn-submit) {
  --btn-px: 26px;
  position: relative;
  padding-inline: var(--btn-px);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease,
    transform 160ms ease, padding 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.theme-editorial .hero-cta-card {
  --btn-px: 28px;
}

body.theme-editorial :is(.btn-tovabb, .hero-cta-card, .btn-pdf, .contact-form .btn-submit)::after {
  content: '\2192';
  position: absolute;
  top: 50%;
  right: calc(var(--btn-px) - 10px);
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: translate(-8px, -50%);
  transition: opacity 200ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

body.theme-editorial :is(.btn-tovabb, .hero-cta-card, .btn-pdf, .contact-form .btn-submit):hover {
  padding-inline: calc(var(--btn-px) - 9px) calc(var(--btn-px) + 9px);
}

body.theme-editorial :is(.btn-tovabb, .hero-cta-card, .btn-pdf, .contact-form .btn-submit):hover::after {
  opacity: 1;
  transform: translate(0, -50%);
}

body.theme-editorial :is(.btn-tovabb, .hero-cta-card, .btn-pdf, .contact-form .btn-submit):active {
  transform: translateY(0) scale(0.97);
  transition-duration: 80ms;
}

body.theme-editorial .richtext-block h2,
body.theme-editorial .section h2 {
  text-wrap: balance;
}

@media (prefers-reduced-motion: no-preference) {
  /* Page-to-page navigation: the content cross-slides while the navbar
     stays put (cross-document View Transitions; browsers without support
     just navigate normally). */
  @view-transition {
    navigation: auto;
  }

  body.theme-editorial .navbar {
    view-transition-name: site-navbar;
  }

  ::view-transition-old(root) {
    animation: ed-page-out 220ms ease both;
  }

  ::view-transition-new(root) {
    animation: ed-page-in 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  body.theme-editorial .hero::before {
    animation: ed-grid-drift 26s linear infinite;
  }

  /* `scale` (not `transform`): .hero-slide is centered with a transform.
     Inactive slides rest at the end scale, so fading one out doesn't jump. */
  body.theme-editorial .hero-slide {
    scale: 1.05;
  }

  body.theme-editorial .hero-slide.active {
    animation: ed-kenburns 7s ease-out both;
  }

  body.theme-editorial .map-pin-dot {
    animation: ed-pin-drop 700ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }

  body.theme-editorial .map-pin-label {
    animation: ed-pin-label 500ms 450ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@keyframes ed-page-out {
  to { opacity: 0; transform: translateY(-10px); }
}

@keyframes ed-page-in {
  from { opacity: 0; transform: translateY(18px); }
}

@keyframes ed-grid-drift {
  to { background-position: 88px 88px, 88px 88px; }
}

@keyframes ed-kenburns {
  from { scale: 1; }
  to { scale: 1.05; }
}

@keyframes ed-pin-drop {
  from { opacity: 0; translate: 0 -46px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes ed-pin-label {
  from { opacity: 0; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-editorial .grid-item,
  body.theme-editorial .gallery-tile,
  body.theme-editorial .theme-toggle,
  body.theme-editorial :is(.btn-tovabb, .hero-cta-card, .btn-pdf, .btn-submit),
  body.theme-editorial :is(.btn-tovabb, .hero-cta-card, .btn-pdf, .btn-submit)::after {
    transition: none;
  }

  body.theme-editorial .grid-item:hover,
  body.theme-editorial .gallery-tile:hover,
  body.theme-editorial .theme-toggle:hover,
  body.theme-editorial :is(.btn-tovabb, .hero-cta-card, .btn-pdf, .btn-submit):hover {
    translate: none;
    transform: none;
  }
}
