/*
Theme Name: Blutenburglauf
Theme URI: https://blutenburglauf.de
Author: Rotary Club München-Blutenburg
Description: Block-Theme für den Blutenburglauf – Benefizlauf des Rotary Club München-Blutenburg. Eigener Rahmen (Kopf- und Fußbereich), Inhalte über Blöcke und Vorlagen.
Version: 1.3.1
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blutenburglauf
Tags: blog, one-column, custom-colors, custom-logo, custom-menu, block-patterns, full-site-editing
*/

/* ---------- Base ----------
   The reference design is authored against `* { box-sizing: border-box }`.
   Without it every `max-width: 1320px` shell ends up 1320 + 96 padding wide
   and the content inside no longer lines up column-to-column between
   sections. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  /* Height of the sticky header. Enforced by .bbl-header__inner's min-height,
     so this value cannot drift away from the real thing. */
  --bbl-header-h: 87px;
}

/* ---------- First screen ----------
   The hero and the sponsor strip together fill exactly one screen, so the
   sponsors are visible without scrolling. The hero takes whatever is left
   after the strip, which means the strip can grow - more sponsors, or rows
   wrapping on a narrower window - without ever being cut off at the fold.
   svh rather than vh so mobile browser chrome does not push it under. */
.bbl-fold {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--bbl-header-h));
  min-height: calc(100svh - var(--bbl-header-h));
}
.bbl-fold > * { width: 100%; max-width: none; margin-inline: 0; }
.bbl-fold > .bbl-hero { flex: 1 1 auto; }
.bbl-fold > .bbl-sponsors { flex: 0 0 auto; }

/* ---------- Frame: sticky header ---------- */
.bbl-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--wp--preset--color--white);
  border-bottom: 1px solid rgba(26, 58, 130, .1);
}
.bbl-header .wp-block-navigation a { text-decoration: none; font-weight: 600; }
.bbl-header .wp-block-navigation .current-menu-item > a { position: relative; }
.bbl-header .wp-block-navigation .current-menu-item > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 3px; background: var(--wp--preset--color--yellow); border-radius: 2px;
}
.bbl-logo img { height: 56px; width: auto; display: block; }

/* ---------- Pills ---------- */
.bbl-pill > a, a.bbl-pill {
  display: inline-block; border-radius: 999px; text-decoration: none;
  font-weight: 700; padding: 18px 30px; white-space: nowrap;
}
.bbl-pill--yellow > a { background: var(--wp--preset--color--yellow); color: var(--wp--preset--color--navy); }
.bbl-pill--yellow > a:hover { background: var(--wp--preset--color--white); }
.bbl-pill--ghost > a {
  color: var(--wp--preset--color--white); border: 1.5px solid rgba(255, 255, 255, .6); padding: 17px 28px;
}
.bbl-pill--ghost > a:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Hero ---------- */
/* Core gives every cover block 1em of padding - 17px at our base size. The
   hero's own shell supplies the padding, and while the shell's max-width binds
   that 17px is absorbed by the centring; below about 1350px it is not, and the
   hero's content sits 17px right of every other section. */
.bbl-hero { position: relative; min-height: 380px; overflow: hidden; padding: 0; }
.bbl-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(26,58,130,.75) 0%, rgba(26,58,130,.15) 30%,
                                      rgba(26,58,130,.35) 55%, rgba(26,58,130,.96) 100%);
}
/* The class is repeated to outweigh core's
   `.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container`
   rule (specificity 0,4,0), which is what sets width:auto. */
.wp-block-cover.bbl-hero.bbl-hero.has-custom-content-position > .wp-block-cover__inner-container { position: relative; z-index: 1; }
.bbl-hero .bbl-hero__year { display: block; color: var(--wp--preset--color--yellow); }
.bbl-hero .bbl-hero__kicker { display: block; margin-bottom: .35em; font-size: clamp(18px, 2.4vw, 28px); font-weight: 600; line-height: 1.1; }

/* The headline is sized against the viewport's height as well as its width,
   as the reference design does. The width-only preset kept it at full size on
   a short window, where the hero could then never shrink below its own text
   and the sponsor strip was pushed under the fold. */
.bbl-hero h1 {
  font-size: clamp(52px, min(11vw, 15vh), 168px);
  line-height: .82;
}

/* On a short window the hero cannot shrink below its own content, so the
   content itself has to give way for the sponsor strip to clear the fold.
   First the hero's chrome... */
@media (max-height: 800px) {
  .bbl-hero__bottom { margin-top: 14px; }
}

/* ...then, on a genuinely short window such as a 1366x768 laptop, the lead
   paragraph and a smaller headline. The design already drops the lead below
   980px wide, so this is the same trade in the other axis: the date, the
   buttons and the sponsors matter more than the sentence. */
@media (max-height: 760px) {
  .bbl-hero h1 { font-size: clamp(44px, min(9vw, 13vh), 120px); }
  .bbl-hero__lead { display: none; }
}

/* ...and on the shortest windows (a 1366x768 laptop with browser chrome, about
   660px) one step smaller still: there the hero is already at its minimum and
   every pixel of headline is a pixel of sponsor strip under the fold. The
   hero's 380px floor gives way too; its content needs about 290px here. */
@media (max-height: 680px) {
  .bbl-hero { min-height: 320px; }
  .bbl-hero h1 { font-size: clamp(44px, min(9vw, 11.5vh), 120px); }
}

/* ---------- Badges ---------- */
.bbl-badge {
  display: inline-block; font-size: 14px; font-weight: 600; line-height: 1;
  letter-spacing: .08em; text-transform: uppercase; padding: 8px 12px; border-radius: 4px;
}
.bbl-badge--yellow { background: var(--wp--preset--color--yellow); color: var(--wp--preset--color--navy); }
.bbl-badge--outline { border: 1px solid rgba(255, 255, 255, .5); color: var(--wp--preset--color--white); padding: 7px 12px; }

/* ---------- Eyebrow ---------- */
.bbl-eyebrow {
  font-weight: 700; font-size: 13px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--wp--preset--color--muted);
}

/* ---------- Race cards ---------- */
.bbl-races { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.bbl-race {
  background: var(--wp--preset--color--white); border: 1px solid rgba(26, 58, 130, .1);
  border-radius: 18px; padding: 28px 26px; min-height: 330px;
  display: flex; flex-direction: column; gap: 18px;
}
.bbl-race:hover { border-color: var(--wp--preset--color--navy); }
.bbl-race__top { display: flex; justify-content: space-between; align-items: center; }
.bbl-race__time {
  font-weight: 700; font-size: 15px; line-height: 1;
  background: var(--wp--preset--color--navy); color: var(--wp--preset--color--white);
  padding: 8px 11px; border-radius: 6px;
}
.bbl-race__age { font-size: 14px; font-weight: 600; color: var(--wp--preset--color--muted); }
.bbl-race__num {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800; font-size: 96px; line-height: .85; letter-spacing: -.01em;
}
.bbl-race__unit { font-size: 40px; margin-left: 4px; }
.bbl-race__name { font-weight: 700; font-size: 21px; }
.bbl-race__fee {
  margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(26, 58, 130, .12);
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 15px; color: var(--wp--preset--color--muted);
}
.bbl-race__fee strong { color: var(--wp--preset--color--navy); font-size: 16px; }

/* ---------- Facts strip ---------- */
.bbl-facts { background: var(--wp--preset--color--yellow); }
.bbl-facts__inner {
  max-width: 1320px; margin: 0 auto; padding: 22px clamp(20px, 4vw, 48px);
  display: flex; flex-wrap: wrap; gap: 14px 40px; font-weight: 600; font-size: 17px;
}

/* ---------- Sponsors ---------- */
.bbl-sponsors { background: var(--wp--preset--color--white); border-bottom: 1px solid rgba(26, 58, 130, .1); }
.bbl-sponsors__row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px;
}
/* Height is set per logo in inc/data.php; the cap stops any one mark
   from taking the whole row on narrow screens. */
.bbl-sponsors__row img { width: auto; max-width: 180px; object-fit: contain; display: block; }

/* The sponsors on the left, the organiser in its own column on the right. */
.bbl-sponsors__list {
  flex: 1 1 600px; min-width: 0;
  display: flex; flex-direction: column; gap: 12px;
  padding-right: clamp(0px, 3vw, 36px);
}
.bbl-sponsors__organizer {
  flex: 0 0 auto;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding-left: clamp(0px, 3vw, 36px);
  border-left: 1.5px solid rgba(26, 58, 130, .15);
}
.bbl-sponsors .bbl-eyebrow { margin: 0; }
.bbl-sponsors__organizer img { height: 64px; width: auto; display: block; }
/* Narrower or short windows: the organiser column takes width from the logos,
   the first row wraps, and the strip grows past the fold (1366x660, 1024x700,
   980x700 were all pushed under it at full size). A smaller organiser and
   tighter gaps keep the rows as they were. */
@media (max-width: 1199px), (max-height: 720px) {
  .bbl-sponsors__list { padding-right: 20px; }
  .bbl-sponsors__organizer { padding-left: 20px; gap: 8px; }
  .bbl-sponsors__organizer img { height: 40px; }
  .bbl-sponsors__row { column-gap: 20px; }
}
/* Below the burger breakpoint the two columns no longer fit side by side, so
   the organiser drops under the logos with a rule above instead of beside. */
@media (max-width: 979px) {
  .bbl-sponsors__list { padding-right: 0; }
  .bbl-sponsors__organizer {
    flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start;
    gap: 8px 18px; padding: 14px 0 0; border-left: 0; border-top: 1.5px solid rgba(26, 58, 130, .15);
  }
  .bbl-sponsors__organizer img { height: 48px; }
}

/* ---------- Charity ---------- */
.bbl-huge {
  font-family: var(--wp--preset--font-family--display); font-weight: 800;
  font-size: clamp(120px, 16vw, 220px); line-height: .8; color: var(--wp--preset--color--yellow);
}
.bbl-year-row {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 18px; align-items: baseline;
  padding: 18px 0; border-top: 1px solid rgba(255, 255, 255, .15);
}
.bbl-year-row__year,
.bbl-year-row__amount { font-family: var(--wp--preset--font-family--display); font-weight: 700; line-height: 1; }
.bbl-year-row__year { font-size: 22px; color: rgba(255, 255, 255, .7); }
.bbl-year-row__amount { font-size: 26px; }

/* ---------- Good to know ---------- */
.bbl-facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px 28px; }
.bbl-fact__title { font-weight: 700; font-size: 19px; margin-bottom: 8px; }
.bbl-fact__body { font-size: 16px; line-height: 1.5; color: var(--wp--preset--color--muted); }

/* ---------- Footer ---------- */
.bbl-footer { background: var(--wp--preset--color--navy); color: var(--wp--preset--color--white); margin-top: auto; }
.bbl-footer a { color: var(--wp--preset--color--white); text-decoration: none; }
.bbl-footer a:hover { color: var(--wp--preset--color--yellow); }
.bbl-footer .bbl-eyebrow { color: var(--wp--preset--color--yellow); }

/* ---------- Layout helper ---------- */
.bbl-shell { min-height: 100vh; display: flex; flex-direction: column; }

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

/* ---------- Shared inner width ---------- */
.bbl-header__inner,
.bbl-footer__inner,
.bbl-footer__legal,
.bbl-sponsors__inner {
  max-width: 1320px; margin-left: auto; margin-right: auto;
  padding-left: clamp(20px, 4vw, 48px); padding-right: clamp(20px, 4vw, 48px);
}
/* Pinned so --bbl-header-h below stays true: 58 + 2x14 padding + 1px border. */
.bbl-header__inner { padding-top: 14px; padding-bottom: 14px; min-height: 58px; }
.bbl-sponsors__inner { padding-top: 16px; padding-bottom: 18px; display: flex; flex-wrap: wrap; align-items: stretch; gap: 16px 0; }
.bbl-footer__legal {
  padding-top: 22px; padding-bottom: 32px;
  border-top: 1px solid rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .6);
}
.bbl-footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bbl-footer__links li { font-size: 16px; }

/* ---------- Section head (heading + side link) ---------- */
.bbl-section-head { margin-bottom: 44px; gap: 20px; }
.bbl-section-head p { margin: 0; font-weight: 600; font-size: 17px; }
.bbl-heading--sm { font-size: clamp(40px, 4.5vw, 64px) !important; }

/* ---------- Hero internals ---------- */
/* A cover with a custom content position sets the inner container to
   width:auto, so it shrink-wraps to the headline instead of holding the
   1320px column. Restore the column so the lead text and the buttons land on
   the same edges as every other section. */
/* The class is repeated to outweigh core's
   `.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container`
   rule (specificity 0,4,0), which is what sets width:auto. */
.wp-block-cover.bbl-hero.bbl-hero.has-custom-content-position > .wp-block-cover__inner-container {
  width: 100%; max-width: 1320px; margin-inline: auto;
  padding: 32px clamp(20px, 4vw, 48px) clamp(24px, 3vw, 48px);
}
/* The short-window padding steps (see "First screen" above) live here, after
   the base rule: written up there, this rule's equal specificity overrode
   them and the hero never got the room back. */
@media (max-height: 800px) {
  .wp-block-cover.bbl-hero.bbl-hero.has-custom-content-position > .wp-block-cover__inner-container { padding-top: 20px; padding-bottom: 20px; }
}
@media (max-height: 760px) {
  .wp-block-cover.bbl-hero.bbl-hero.has-custom-content-position > .wp-block-cover__inner-container { padding-top: 16px; padding-bottom: 16px; }
}
.bbl-hero__bottom { margin-top: clamp(16px, 3vh, 32px); gap: 16px 28px; }
.bbl-hero__lead { max-width: 520px; margin: 0; line-height: 1.45; text-wrap: pretty; }
@media (max-width: 979px) { .bbl-hero__lead { display: none; } }

/* ---------- Jubilee (10 Jahre, 2027) ----------
   Two marks, both switched on and off in bbl_jubilee(): a badge beside the
   logo, and a large outlined 10 on the right of the home hero. */
.bbl-jubilee-badge {
  display: flex; align-items: center; gap: 10px;
  padding-left: 16px; border-left: 1.5px solid rgba(26, 58, 130, .18);
  color: var(--wp--preset--color--navy);
}
.bbl-jubilee-badge__num {
  font-family: var(--wp--preset--font-family--display); font-weight: 800;
  font-size: 44px; line-height: .8;
  color: var(--wp--preset--color--yellow); -webkit-text-stroke: 1.5px var(--wp--preset--color--navy);
}
.bbl-jubilee-badge__labels { display: flex; flex-direction: column; gap: 2px; }
.bbl-jubilee-badge__jahre {
  font-family: var(--wp--preset--font-family--display); font-weight: 800;
  font-size: 15px; line-height: 1; letter-spacing: .06em; text-transform: uppercase;
}
.bbl-jubilee-badge__year {
  font-weight: 700; font-size: 11px; line-height: 1.1; letter-spacing: .12em;
  text-transform: uppercase; color: var(--wp--preset--color--muted);
}
/* Once the menu collapses into the burger (980px, see the navigation rules
   below) the header keeps the jubilee badge and drops the Anmelden/Ergebnisse
   button; the burger overlay carries it instead, as .bbl-nav-cta. */
.bbl-header .bbl-nav-cta { display: none; }
@media (max-width: 979px) {
  .bbl-header .bbl-header__cta { display: none; }
  .bbl-header .is-menu-open .bbl-nav-cta { display: flex; }
  /* Specific enough to beat core's overlay rule, which zeroes link padding. */
  .bbl-header .wp-block-navigation__responsive-container.is-menu-open .bbl-nav-cta .wp-block-navigation-item__content {
    margin-top: 12px; padding: 14px 28px; border-radius: 999px; font-weight: 700;
    background: var(--wp--preset--color--yellow); color: var(--wp--preset--color--navy);
  }
}
/* On a phone logo, badge with its labels and burger fit on one row - which
   the fold maths depends on - with a smaller logo and badge. */
@media (max-width: 599px) {
  .bbl-header .bbl-header__brand { gap: 10px; }
  .bbl-header__brand .bbl-logo img { height: 44px; }
  .bbl-jubilee-badge { padding-left: 10px; gap: 8px; }
  .bbl-jubilee-badge__num { font-size: 36px; }
}

/* The hero's content box is stretched to the hero's full height (content
   still sits at the bottom) so the 10 can be centred on the hero itself. */
.wp-block-cover.bbl-hero.bbl-hero.has-custom-content-position > .wp-block-cover__inner-container {
  align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end;
}
/* Core's constrained layout centres every child with !important auto margins,
   which in a flex column shrinks each one to its content and centres it.
   Full width puts them back on the left edge. */
.bbl-hero .wp-block-cover__inner-container > :not(.bbl-hero__jubilee) { position: relative; z-index: 1; width: 100%; }
/* Anchored to sit just above the button row rather than centred as in the
   design: centred, it ran into the buttons on any laptop screen shorter than
   about 850px. The offset is the hero's bottom padding, the 63px pill and a
   20px gap - the buttons are bottom-aligned in their row, so a lead paragraph
   wrapping beside them does not move them.

   --bbl-jb is the size of the 10. Besides its share of the width it is capped
   by the window height: the hero is roughly 100vh minus the header and the
   sponsor strip, and the whole mark (about 1.1x that size plus 40px of label)
   has to fit between the buttons and the hero's top edge. The 470px leaves
   room for a sponsor strip that wraps to an extra row on narrower laptops. */
.bbl-hero__jubilee {
  --bbl-jb: clamp(120px, min(24vw, calc(91vh - 470px)), 360px);
  position: absolute; z-index: 0; right: clamp(20px, 4vw, 48px);
  bottom: calc(clamp(24px, 3vw, 48px) + 63px + 20px); margin: 0;
  display: flex; flex-direction: column; align-items: flex-end;
  font-family: var(--wp--preset--font-family--display); font-weight: 800;
  text-transform: uppercase; pointer-events: none;
}
@media (max-height: 800px) { .bbl-hero__jubilee { bottom: calc(20px + 63px + 20px); } }
@media (max-height: 760px) { .bbl-hero__jubilee { bottom: calc(16px + 63px + 20px); } }
.bbl-hero__jubilee-num {
  font-size: var(--bbl-jb); line-height: .8; letter-spacing: -.02em;
  color: transparent; -webkit-text-stroke: 6px var(--wp--preset--color--yellow);
}
.bbl-hero__jubilee-jahre {
  margin-top: 4px; font-size: calc(var(--bbl-jb) * .355); line-height: .85;
  color: var(--wp--preset--color--yellow); letter-spacing: .01em;
}
.bbl-hero__jubilee-label {
  margin-top: 12px; font-size: 24px; line-height: 1; letter-spacing: .06em;
  color: var(--wp--preset--color--white); white-space: nowrap;
}
/* Below the burger breakpoint there is no free half of the hero to centre it
   in - the date fills the width and floating the 10 over it collides with the
   badges. So it becomes a smaller block in the empty space beside the date. */
@media (max-width: 979px) {
  .wp-block-cover.bbl-hero.bbl-hero.has-custom-content-position > .wp-block-cover__inner-container {
    display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-content: end;
  }
  .bbl-hero__badges, .bbl-hero__bottom { grid-column: 1 / -1; }
  .bbl-hero__badges { grid-row: 1; }
  .bbl-hero .wp-block-cover__inner-container > h1 { grid-column: 1; grid-row: 2; }
  .bbl-hero__bottom { grid-row: 3; }
  .bbl-hero__jubilee {
    --bbl-jb: clamp(64px, 17vw, 140px);
    position: static; grid-column: 2; grid-row: 2; align-self: end;
    margin-block: 0 !important;
  }
  .bbl-hero__jubilee-num { -webkit-text-stroke-width: 3px; }
  .bbl-hero__jubilee-jahre { margin-top: 2px; }
  .bbl-hero__jubilee-label { margin-top: 6px; font-size: clamp(10px, 2.6vw, 15px); }
}

/* ---------- Charity ---------- */
.bbl-charity__claim { max-width: 520px; line-height: 1.12; }
.bbl-focus-card { border-radius: 18px; padding: 28px; margin-bottom: 22px; }
.bbl-focus-card p { font-size: 17px; line-height: 1.5; color: rgba(255, 255, 255, .85); }
.bbl-link-yellow a { color: var(--wp--preset--color--yellow); font-weight: 700; font-size: 17px; }
.bbl-charity-cards { display: grid; gap: 18px; }
.bbl-charity-card { border-top: 1px solid rgba(26, 58, 130, .15); padding-top: 18px; }
.bbl-charity-card__head { display: flex; justify-content: space-between; align-items: baseline; }
.bbl-charity-card .bbl-year-row__year { color: var(--wp--preset--color--muted); }
.bbl-charity-card .bbl-year-row__amount { color: var(--wp--preset--color--navy); }

/* ---------- Sub-page hero ----------
   Title and intro share one 1320px shell with the same padding as every other
   section, so their text starts on the site's column. Relying on the block
   layout to place them instead put the two at different left edges once the
   window was wider than the column. */
/* The band itself picks up the root padding once it is pulled full-bleed, which
   would land on top of the inner shell's own padding and inset the title twice. */
.bbl-subhero { padding: 0; }
.bbl-subhero__inner {
  max-width: 1320px; margin-inline: auto;
  padding: clamp(56px, 6vw, 88px) clamp(20px, 4vw, 48px) clamp(48px, 6vw, 80px);
}
/* A 64px floor broke long words mid-letter on a phone ("INFORMATIONE / N").
   44px fits every one-word title down to 360px; the few longer than that
   (Datenschutzerklärung) hyphenate at a real syllable instead - <html lang="de">
   gives the browser the German dictionary. */
.bbl-subhero h1 {
  margin: 0;
  font-size: clamp(44px, 9vw, 140px);
  line-height: .86;
  overflow-wrap: normal;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.bbl-subhero__intro {
  margin: 24px 0 0;
  max-width: 620px;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
  color: rgba(255, 255, 255, .88);
  text-wrap: pretty;
}
.bbl-subhero__intro p { margin: 0; }

/* ---------- Photo galleries (Tiled Gallery plugin) ----------
   The plugin lays its grid out in fixed pixels for 640px (see
   bbl_content_width). Centred in the wide column it reads as a deliberate
   block rather than one that stopped short; assets/js/tiled-gallery-fit.js
   scales it down on narrower screens. */
.tiled-gallery .gallery-row { margin-inline: auto; }

/* ---------- Race table / detail ---------- */
.bbl-race-table table { width: 100%; border-collapse: collapse; }
.bbl-race-table th, .bbl-race-table td {
  text-align: left; padding: 14px 12px 14px 0; border-bottom: 1px solid rgba(26, 58, 130, .12); font-size: 16px;
}
.bbl-race-table th {
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--muted);
}
.bbl-race-detail { display: grid; gap: 28px; }
.bbl-race-detail__item {
  display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 28px; align-items: start;
  padding-top: 28px; border-top: 1px solid rgba(26, 58, 130, .12);
}
.bbl-race-detail__item h3 { margin: 0 0 8px; }
.bbl-race-detail__meta { color: var(--wp--preset--color--muted); font-size: 15px; margin: 0 0 10px; }
@media (max-width: 599px) { .bbl-race-detail__item { grid-template-columns: 1fr; gap: 12px; } }

/* ---------- Map ----------
   The Anfahrt plan is a wide 2:1 image, so it keeps its own aspect ratio
   rather than being cropped into a fixed-height box. */
.bbl-map { margin: 0; }
.bbl-map img {
  display: block; width: 100%; height: auto;
  border-radius: 18px; border: 1px solid rgba(26, 58, 130, .12);
}
.bbl-map figcaption {
  margin-top: 12px; font-size: 15px; line-height: 1.45;
  color: var(--wp--preset--color--muted); text-align: left;
}

/* ---------- Placeholders ---------- */
/* Four photos, as in the design: columns of at least 240px, 240px rows. The
   images are cut 5:4 and fill their tile; on a phone they stack two by two. */
.bbl-photo-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  grid-auto-rows: 240px;
}
.bbl-photo-grid a { display: block; border-radius: 14px; overflow: hidden; }
.bbl-photo-grid img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s ease;
}
.bbl-photo-grid a:hover img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .bbl-photo-grid img { transition: none; } }
@media (max-width: 599px) {
  .bbl-photo-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; gap: 10px; }
}

/* ---------- Root rhythm ----------
   WordPress puts a 24px block gap between the top-level header / main / footer.
   Our sections carry their own padding and several are full-bleed, so that gap
   shows up as a stripe of page background. Zero it at the root only. */
.wp-site-blocks > main,
.wp-site-blocks > .wp-block-template-part { margin-block-start: 0; }

/* ---------- Display type opt-in ----------
   h3/h4 default to the body font, because on content pages they are ordinary
   subheadings. Where a heading is meant as display type (the charity focus
   card, for instance) it asks for it explicitly. */
.bbl-display {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700; line-height: 1.05;
  text-transform: uppercase; letter-spacing: -0.01em;
}

/* ---------- Headings inside page content ----------
   The pages carried over from the old site use heading levels as styling, not
   as structure: /informationen alone has 14 <h1> elements for its sub-sections
   and <h6> for table column labels. Sized by level alone those render at 121px
   and 10px. Inside post content we therefore size headings by role rather than
   by level, so legacy markup stays readable. Anything the editor sets
   explicitly still wins, because preset font sizes carry !important.
   The real fix is demoting those h1s in the content itself. */
.wp-block-post-content :is(h1, h2) {
  font-size: var(--wp--preset--font-size--subsection);
  line-height: .95;
  margin-block: 1.4em .5em;
  /* "Unterhaltungsprogramm" on Informationen is wider than a phone screen at
     this size and scrolled the whole page sideways; break it at a syllable. */
  -webkit-hyphens: auto;
  hyphens: auto;
}
.wp-block-post-content :is(h3, h4) {
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--subheading);
  font-weight: 700; line-height: 1.25;
  text-transform: none; letter-spacing: normal;
  margin-block: 1.6em .4em;
}
.wp-block-post-content :is(h5, h6) {
  font-family: var(--wp--preset--font-family--body);
  font-size: 13px; font-weight: 700; line-height: 1.3;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--wp--preset--color--muted);
  margin-block: 1.6em .4em;
}
/* Legacy tables (start times, fees) came from the old theme unstyled. */
.wp-block-post-content table { width: 100%; border-collapse: collapse; }
.wp-block-post-content :is(td, th) {
  text-align: left; padding: 12px 12px 12px 0;
  border-bottom: 1px solid rgba(26, 58, 130, .12); vertical-align: top;
}

/* ---------- Sponsor links ----------
   Logos carry the sponsor's own link where the old site had one. The hover
   lift is subtle on purpose: these are credits, not calls to action. */
.bbl-sponsor-link { display: block; line-height: 0; text-decoration: none; border: 0; }
.bbl-sponsor-link img { transition: opacity .15s ease; }
.bbl-sponsor-link:hover img,
.bbl-sponsor-link:focus-visible img { opacity: .6; }
.bbl-sponsor-link:focus-visible {
  outline: 2px solid var(--wp--preset--color--yellow); outline-offset: 6px; border-radius: 2px;
}

/* ---------- Footer column spacing ----------
   The column label needs to read as a heading for the links under it, so it
   sits further from the first link than the links sit from each other. */
.bbl-footer .bbl-eyebrow { margin: 0 0 18px; }
.bbl-footer__links { gap: 12px; }

/* ---------- Navigation breakpoint ----------
   Core collapses the navigation into its overlay at 600px. The reference
   design switches to the burger at 980px, and below that the inline menu
   wraps the header onto a second row - which both looks wrong and breaks the
   fold maths above, since --bbl-header-h then under-counts. Move core's
   switch up to 980px. */
@media (min-width: 600px) and (max-width: 979px) {
  .bbl-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: flex;
  }
  .bbl-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    display: none;
  }
}
