/*
Theme Name: SV Wildflecken 1934
Theme URI: https://sv-wildflecken.de
Author: SV Wildflecken 1934 e.V.
Description: Modernes Block-Theme für den SV Wildflecken 1934 e.V. — Vereinsfarben Rot/Weiß/Schwarz, Original-Wappen, Dunkel-/Hell-Umschalter. Selbst gehostete Schriften (DSGVO). Kein Build-Schritt.
Version: 1.0.17
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: svwildflecken
*/

/* ===== Color schemes (dark default, light via toggle) ===== */
:root,
:root[data-theme="dark"] {
  color-scheme: dark; /* native controls incl. <select> option popup render dark */
  --c-bg:#16161a; --c-surface:#1d1e24; --c-surface-2:#22232a;
  --c-text:#f5f6f7; --c-muted:#b9bac4; --c-border:#2d2e36;
  --c-accent:#e2001a; --c-accent-strong:#b3001a;
  --shadow:0 24px 50px -30px rgba(0,0,0,.7);
  --header-bg:rgba(22,22,26,.9);
}
:root[data-theme="light"] {
  color-scheme: light;
  --c-bg:#ffffff; --c-surface:#ffffff; --c-surface-2:#f6f4f3;
  --c-text:#17161a; --c-muted:#56514b; --c-border:#e7e3e1;
  --c-accent:#cc0a1c; --c-accent-strong:#9b0014;
  --shadow:0 24px 50px -34px rgba(23,22,26,.4);
  --header-bg:rgba(255,255,255,.9);
}

/* ===== Base ===== */
html{scroll-behavior:smooth}
body{background:var(--c-bg);color:var(--c-text);-webkit-font-smoothing:antialiased;
  transition:background-color .25s ease,color .25s ease}
a{color:var(--c-accent)}
.wp-site-blocks{overflow-clip-margin:content-box}
:where(.wp-block-group){background-color:transparent}
/* overflow guards: media never exceeds its box; flex/grid kids may shrink */
:where(img,svg,video){max-width:100%}
:where(.wp-block-columns,.wp-block-column){min-width:0}
body{overflow-x:hidden}

/* uppercase display eyebrow */
.eyebrow{font-family:var(--wp--preset--font-family--display);text-transform:uppercase;
  letter-spacing:.16em;font-weight:700;color:var(--c-accent);font-size:.85rem}

/* ===== Header ===== */
.site-header{position:sticky;top:0;z-index:60;background:var(--header-bg);
  backdrop-filter:blur(8px);border-bottom:1px solid var(--c-border)}
.site-header > .wp-block-group{min-height:74px}
.brand-lockup{display:flex;align-items:center;gap:12px;text-decoration:none}
.brand-lockup img{height:48px;width:auto;display:block}
.brand-lockup .brand-name{font-family:var(--wp--preset--font-family--display);font-weight:700;
  text-transform:uppercase;font-size:1.2rem;line-height:1;color:var(--c-text)}
.brand-lockup .brand-sub{display:block;font-size:.62rem;letter-spacing:.2em;text-transform:uppercase;
  color:var(--c-muted);font-weight:600;font-family:var(--wp--preset--font-family--body)}
/* tight type: eight items must fit next to crest and the two icon buttons. The budget
   is the 1200px CONTENT width, not the viewport — a wider screen buys nothing, since
   the header group is capped there. 206 (crest) + nav + 108 (toggle + join) + 48
   (gaps) must stay under it. Re-measure before adding a ninth entry. Dropping the
   wide "Mitglied werden" button for an icon freed ~190px, spent on larger type. */
.site-header .wp-block-navigation{font-family:var(--wp--preset--font-family--display);
  text-transform:uppercase;letter-spacing:.05em;font-size:1rem;gap:1rem}
.site-header .wp-block-navigation a{color:var(--c-muted)}
.site-header .wp-block-navigation a:hover{color:var(--c-text);text-decoration:none}

/* dark/light toggle button */
.theme-toggle{display:inline-grid;place-items:center;width:42px;height:42px;border-radius:50%;
  border:1px solid var(--c-border);background:var(--c-surface);color:var(--c-text);cursor:pointer;
  transition:.2s;flex:none}
.theme-toggle:hover{border-color:var(--c-accent);color:var(--c-accent)}
.theme-toggle svg{width:20px;height:20px;fill:currentColor}
.theme-toggle .i-sun{display:none}
.theme-toggle .i-moon{display:block}
:root[data-theme="light"] .theme-toggle .i-sun{display:block}
:root[data-theme="light"] .theme-toggle .i-moon{display:none}

/* The two icon buttons are one cluster, not two loose controls — tighter than the
   theme's default block gap so they read as a single section next to the nav. */
.site-header .header-actions{gap:.5rem}

/* "Mitglied werden" as an icon button, same 42px round shape as the toggle — so the
   header carries exactly two treatments: text for destinations, icons for actions.
   Kept filled red: it is the club's main conversion path, so it keeps its prominence
   through colour rather than width. Label via title/aria-label (tooltips don't exist
   on touch — the footer carries a spelled-out link for that reason). */
.join-btn{display:inline-grid;place-items:center;width:42px;height:42px;border-radius:50%;
  border:1px solid var(--c-accent);background:var(--c-accent);color:#fff;cursor:pointer;
  transition:.2s;flex:none}
.join-btn:hover{background:var(--c-accent-strong);border-color:var(--c-accent-strong);color:#fff}
.join-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round}

/* ===== Mobile nav overlay (hamburger) ===== */
/* The header uses backdrop-filter, which makes it the containing block for the
   position:fixed overlay — so the overlay shrinks to the header's height. Drop
   the filter while the menu is open so the overlay fills the whole viewport. */
.site-header:has(.wp-block-navigation__responsive-container.is-menu-open){backdrop-filter:none}
/* Beat core's (0,5,0) white default; flips with the theme via --c-bg. */
.site-header .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay){background-color:var(--c-bg)}
.site-header .wp-block-navigation__responsive-container.is-menu-open{padding:6rem 1.6rem 2rem}
.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content{width:100%}
.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container{
  flex-direction:column;align-items:stretch;gap:0;width:100%}
.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item{
  width:100%;border-bottom:1px solid var(--c-border)}
.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content{
  display:block;width:100%;padding:1rem 0;color:var(--c-text);
  font-family:var(--wp--preset--font-family--display);text-transform:uppercase;
  font-size:1.5rem;letter-spacing:.04em}
.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover{color:var(--c-accent)}
.site-header .wp-block-navigation__responsive-container-close{color:var(--c-text);top:1.4rem;right:1.2rem}
.site-header .wp-block-navigation__responsive-container-close:hover{color:var(--c-accent)}

/* ===== Hero ===== */
.hero{position:relative;overflow:hidden;background:
  linear-gradient(120deg,var(--c-bg) 40%,var(--c-surface))}
.hero:after{content:"1934";position:absolute;right:-2%;bottom:-8%;pointer-events:none;
  font-family:var(--wp--preset--font-family--display);font-weight:700;font-size:24vw;
  color:var(--c-text);opacity:.04;letter-spacing:-.02em;line-height:1}
/* Flush-left vertical accent bar — sits in the page gutter, never crosses the
   headline (the old skewed bar slashed through the text at every width). */
.hero .hero-stripe{position:absolute;top:0;bottom:0;left:0;width:6px;background:var(--c-accent)}
.hero h1{font-size:var(--wp--preset--font-size--xx-large)}
.hero .outline{-webkit-text-stroke:2px var(--c-accent);color:transparent}
/* Glow follows the crest's outline (drop-shadow traces the alpha silhouette) */
.hero .crest-hero img{animation:crest-glow 4s ease-in-out infinite}
@keyframes crest-glow{
  0%,100%{filter:drop-shadow(0 0 8px rgba(226,0,26,.6)) drop-shadow(0 0 24px rgba(226,0,26,.45)) drop-shadow(0 0 52px rgba(226,0,26,.3))}
  50%{filter:drop-shadow(0 0 12px rgba(226,0,26,.8)) drop-shadow(0 0 36px rgba(226,0,26,.6)) drop-shadow(0 0 76px rgba(226,0,26,.45))}
}
@media (prefers-reduced-motion:reduce){.hero .crest-hero img{animation:none;filter:drop-shadow(0 0 16px rgba(226,0,26,.6)) drop-shadow(0 0 44px rgba(226,0,26,.45))}}

/* ===== Section headings ===== */
.section-head h2 b,.section-head h2 strong{color:var(--c-accent)}

/* ===== Department cards ===== */
.dept-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.dept-card{display:flex;flex-direction:row;align-items:center;gap:14px;
  padding:16px 18px;background:var(--c-surface);border:1px solid var(--c-border);
  text-decoration:none;color:var(--c-text);position:relative;overflow:hidden;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.dept-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--c-accent);
  transform:scaleY(0);transform-origin:top;transition:transform .18s ease}
.dept-card:hover{transform:translateY(-3px);box-shadow:var(--shadow);border-color:var(--c-accent)}
.dept-card:hover:before{transform:scaleY(1)}
/* consistent red icon badge with a flat white sport icon */
.dept-card .dept-ic{display:grid;place-items:center;width:46px;height:46px;flex:none;
  border-radius:10px;color:#fff;background:var(--c-accent)}
.dept-card .dept-ic svg{width:24px;height:24px;display:block}
/* text block: tight, consistent name/meta stack (the markup <br> is neutralised) */
.dept-card .dept-ic + span{display:flex;flex-direction:column;gap:1px;min-width:0}
.dept-card br{display:none}
.dept-card .dept-name{font-family:var(--wp--preset--font-family--display);
  text-transform:uppercase;font-size:1.18rem;font-weight:700;line-height:1.15;color:var(--c-text)}
/* same secondary token as the rest of the site, for consistency */
.dept-card .dept-meta{color:var(--c-muted);font-size:.95rem;line-height:1.3}

/* ===== Ruhende (dormant) departments ===== */
/* Same card design, just listed rather than linked: it is a div, not an <a>. */
.dept-card.is-dormant{cursor:default}
.dept-card.is-dormant:hover{transform:none;box-shadow:none;border-color:var(--c-border)}
.dept-card.is-dormant:hover:before{transform:scaleY(0)}
.dept-card .dept-inactive{color:var(--c-accent);font-size:.8rem;font-weight:600;
  text-transform:uppercase;letter-spacing:.04em;line-height:1.4;margin-top:3px}

/* ===== Headings: hyphenate long German compounds ===== */
/* Core sets word-break:break-word on post titles, which cuts a word at any letter
   ("JAHRESHAUPTVER / SAMMLUNG"). Hyphenate properly instead (html lang="de"), only words
   of 12+ letters; overflow-wrap stays as the last resort for words that still don't fit. */
h1,h2,h3,h4,.wp-block-post-title{hyphens:auto;-webkit-hyphens:auto;hyphenate-limit-chars:12 5 5;overflow-wrap:break-word}
:root .wp-block-post-title{word-break:normal}
/* H1 size lives in theme.json. News titles run to 120 chars, so it is kept moderate for
   every title; only the homepage hero keeps the poster size (has-xx-large-font-size). */
h1:not(.has-xx-large-font-size){text-wrap:balance}

/* ===== Page frame (#24) ===== */
/* Every page uses one frame (theme.json contentSize = wideSize = the header's width), so
   titles and blocks start at the logo's left edge. Running text keeps a readable measure
   but stays left-aligned in that frame rather than centring in a narrower column.
   The training table is data, not prose: it spans the frame like the contact
   cards and photos next to it on a department page.
   !important is needed to beat core's `margin-left:auto !important` on constrained children. */
:root{--measure:780px}
.is-layout-constrained > :is(p, ul, ol, h2, h3, h4, h5, h6, blockquote, table, .wp-block-table, .wp-block-quote, figure.wp-block-image):not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.has-text-align-center):not(.has-text-align-right):not(.training-times){
  max-width:var(--measure);
  margin-left:max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important;
  margin-right:auto !important}

/* ===== News teaser (query loop) ===== */
.news-band{background:var(--c-surface-2)}
.post-cards{gap:18px}
/* min-width:0 + anywhere: one long link in an excerpt must not widen the grid column,
   and with it the whole page, on a phone. */
.post-cards .wp-block-post{min-width:0;background:var(--c-surface);border:1px solid var(--c-border);transition:.2s}
.post-cards .wp-block-post-excerpt{overflow-wrap:anywhere}
.post-cards .wp-block-post:hover{border-color:var(--c-accent)}
.post-cards .wp-block-post-featured-image{margin:0}
/* Crop anchored high: most photos show people, and a centered crop cuts off heads. */
.post-cards .wp-block-post-featured-image img{aspect-ratio:16/10;object-fit:cover;object-position:50% 25%;width:100%}
/* Article view: whole image, never upscaled — archived photos are mostly <800px wide. */
.post-hero img{width:auto;max-width:100%;height:auto}
.post-cards .post-pad{padding:22px}
.post-cards .wp-block-post-date{font-family:var(--wp--preset--font-family--display);letter-spacing:.08em;
  color:var(--c-accent);font-size:.95rem;text-transform:uppercase}
.post-cards .wp-block-post-title{font-family:var(--wp--preset--font-family--display);text-transform:uppercase;
  font-size:1.5rem;line-height:1.1;margin:.35em 0 .45em}
/* inline: core's inline-block sizes the link to its longest word, e.g.
   "Oberbach/Wildflecken/Riedenberg", which then sticks out of the card on a phone. */
.post-cards .wp-block-post-title{overflow-wrap:anywhere}
.post-cards .wp-block-post-title a{display:inline;color:var(--c-text)}
/* The whole card opens the article: the title link is stretched over it, so new tabs
   and the keyboard keep working. Nothing between it and the card may be positioned;
   only the category links stay clickable on top. */
.post-cards .wp-block-post{position:relative}
.post-cards .wp-block-post .post-pad,
.post-cards .wp-block-post .wp-block-post-featured-image,
.post-cards .wp-block-post .wp-block-post-title{position:static}
.post-cards .wp-block-post-title a::after{content:"";position:absolute;inset:0}
.post-cards .wp-block-post-title a:focus-visible{outline:none}
.post-cards .wp-block-post-title a:focus-visible::after{outline:2px solid var(--c-accent);outline-offset:2px}
.post-cards .post-cat{position:relative;z-index:1}
.post-cards .wp-block-post-excerpt{color:var(--c-muted);font-size:1.02rem;line-height:1.55}
.post-cards .wp-block-post-excerpt__more-link{display:inline-block;margin-top:.5em;
  font-weight:600;color:var(--c-accent)}

/* Angepinnte Beiträge („Oben gehalten“, solange das Datum nicht abgelaufen ist) */
.pin-badge{display:inline-block;margin:0 0 .5em;padding:3px 9px;
  font-family:var(--wp--preset--font-family--display);text-transform:uppercase;
  letter-spacing:.14em;font-size:.72rem;font-weight:700;
  background:var(--c-accent);color:#fff}
.post-cards .wp-block-post.is-pinned{border-color:var(--c-accent)}

/* Category behind the date (issue #31) — on the cards and on the article */
.post-cats{color:var(--c-muted)}
.post-cat{color:var(--c-text);text-decoration:none}
.post-cat:hover{color:var(--c-accent)}

/* Article: the way back to the listing (#62). Sticky at the screen bottom from the
   start; as the last child of <main> it comes to rest above the footer. The bar lets
   clicks through, so only the button itself covers the article. */
.news-back-bar{position:sticky;bottom:max(16px,env(safe-area-inset-bottom));z-index:40;
  margin-top:3rem;pointer-events:none}
.news-back{margin:0}
.news-back a{display:inline-flex;align-items:center;gap:.4rem;height:42px;padding:0 1.15rem;
  pointer-events:auto;box-shadow:0 6px 20px rgba(0,0,0,.45);
  background:var(--c-accent);color:#fff;border-radius:2px;text-decoration:none;
  font-family:var(--wp--preset--font-family--display);font-weight:600;font-size:1.05rem;
  letter-spacing:.03em;transition:background-color .2s ease}
.news-back a:hover{background:var(--c-accent-strong);color:#fff}
.news-back a:focus-visible{outline:2px solid var(--c-accent);outline-offset:2px}

/* ===== Facts ===== */
.facts{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--c-border)}
.facts > *{padding:32px 18px;text-align:center;border-right:1px solid var(--c-border)}
.facts > *:last-child{border-right:0}
.facts .fact-num{font-family:var(--wp--preset--font-family--display);font-size:3.4rem;line-height:.9;font-weight:700}
.facts .fact-num em{font-style:normal;color:var(--c-accent)}
.facts .fact-num .fact-approx{font-size:1.4rem;vertical-align:.5em;margin-right:.18em}
.facts .fact-label{font-size:.76rem;letter-spacing:.18em;text-transform:uppercase;color:var(--c-muted);margin-top:6px}

/* ===== CTA band ===== */
.cta-band{position:relative;overflow:hidden;background:var(--c-accent);color:#fff;text-align:center}
.cta-band:before{content:"";position:absolute;inset:0;
  background:repeating-linear-gradient(-20deg,rgba(0,0,0,.06) 0 30px,transparent 30px 60px)}
.cta-band > *{position:relative}
.cta-band h2{color:#fff}
.cta-band p{color:rgba(255,255,255,.92)}
.cta-band .wp-block-button.is-style-outline .wp-block-button__link{border-color:rgba(255,255,255,.6);color:#fff;background:transparent}
.cta-band .wp-block-button:not(.is-style-outline) .wp-block-button__link{background:var(--c-bg);color:var(--c-text)}

/* ===== Training times table (department pages) ===== */
.training-times{width:100%;border-collapse:collapse;background:var(--c-surface);border:1px solid var(--c-border)}
.training-times th,.training-times td{padding:12px 16px;text-align:left;border-bottom:1px solid var(--c-border)}
.training-times th{font-family:var(--wp--preset--font-family--display);text-transform:uppercase;
  letter-spacing:.04em;font-size:.82rem;color:var(--c-muted)}
.training-times tr:last-child td{border-bottom:0}

/* ===== Image slider (inc/image-slider.php, #44): department photos + post galleries ===== */
/* Each photo whole (contain), so nobody is cut off; the rest of the frame is a panel
   in club colours. Base = no script: a row to swipe through. With the script
   (.is-enhanced) the slides stack and change with a page turn. */
.image-slider{position:relative;margin-bottom:2rem}  /* top: the theme's block gap */
.image-slider__stage{display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;
  height:max(240px, min(56vw, 600px, 62vh))}
.image-slider__slide{position:relative;flex:0 0 100%;margin:0;overflow:hidden;
  border-radius:3px;scroll-snap-align:start;
  /* The panel, as clubs do on their graphics: dark ground, red pinstripes at the
     divider's 18° slant, a red glow from two corners. It sits on the slide, not
     on the photo, so it stays put during a turn and runs on across the divider. */
  background:
    repeating-linear-gradient(108deg, transparent 0 26px,
      color-mix(in srgb, var(--c-accent) 18%, transparent) 26px 28px),
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--c-accent) 30%, transparent), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--c-accent) 22%, transparent), transparent 60%),
    #121014}
.image-slider__item{position:relative;display:block;width:100%;height:100%}
.image-slider__img{display:block;width:100%;height:100%;object-fit:contain}

/* pan-y: a horizontal swipe goes to the script, vertical still scrolls the page;
   no native image drag, which would swallow the swipe. The stage clips the
   divider, which is taller than the stage and must not reach over the title. */
.image-slider.is-enhanced .image-slider__stage{display:block;position:relative;overflow:hidden;
  border-radius:3px;touch-action:pan-y}
.image-slider.is-enhanced .image-slider__item,
.image-slider.is-enhanced .image-slider__img{-webkit-user-drag:none;user-select:none}
.image-slider.is-enhanced .image-slider__slide{position:absolute;inset:0;border-radius:0;visibility:hidden}
.image-slider.is-enhanced .image-slider__slide.is-active{visibility:visible}
/* During a turn the incoming photo lies on top; the script clips it along the
   divider and shifts both photos a little, like a page pulled over another. */
.image-slider.is-enhanced .image-slider__slide.is-entering{visibility:visible;z-index:1}

/* The divider: a slanted bar riding the edge between the two photos, in the
   panel's style — dark ground, red pinstripes along it (the bar is skewed, so
   vertical stripes inside it run at its slant), a solid red centre line and a red
   glow. Its slant must match the clip in assets/image-slider.js (SLANT). */
.image-slider__seam{position:absolute;top:-10%;bottom:-10%;left:0;width:34px;z-index:2;
  display:none;pointer-events:none;transform-origin:50% 50%;
  background:
    linear-gradient(90deg, transparent 15px, var(--c-accent) 15px 19px, transparent 19px),
    repeating-linear-gradient(90deg, transparent 0 5px,
      color-mix(in srgb, var(--c-accent) 45%, transparent) 5px 7px),
    #121014;
  box-shadow:0 0 26px color-mix(in srgb, var(--c-accent) 35%, transparent), 0 0 14px rgba(0,0,0,.7)}
.image-slider.is-turning .image-slider__seam{display:block}

/* Gallery flavour (galleries in posts): the photo area has a fixed height and the
   caption sits under it inside the slide, so it turns with its photo. The script
   passes the current caption's height (--caption-h, 0 without one); the frame
   grows or shrinks to it, so a caption slides open and an uncaptioned photo ends
   flush with the frame. The photo area itself never jumps. */
.image-slider--gallery{--photo-h:max(260px, min(62vw, 620px, 66vh))}
.image-slider--gallery .image-slider__stage{height:auto}
.image-slider--gallery.is-enhanced .image-slider__stage{height:calc(var(--photo-h) + var(--caption-h, 0px));
  transition:height .45s ease}
@media (prefers-reduced-motion: reduce){
  .image-slider--gallery.is-enhanced .image-slider__stage{transition:none}
}
.image-slider--gallery .image-slider__slide{display:flex;flex-direction:column}
.image-slider--gallery .image-slider__item{flex:none;height:var(--photo-h)}
/* The slider as one framed card: photo on the club panel, caption below on the
   page's surface colour (follows dark / light), the frame's own line between them. */
.image-slider--gallery .image-slider__stage{border:1px solid var(--c-border);border-radius:4px}
.image-slider--gallery .image-slider__caption{flex:1 0 auto;margin:0;padding:.8rem 1.1rem .9rem;
  background:var(--c-surface);border-top:1px solid var(--c-border);color:var(--c-muted);
  font-size:.92rem;line-height:1.5;text-align:left}
.image-slider--gallery .image-slider__caption b,
.image-slider--gallery .image-slider__caption strong{display:inline-block;margin-bottom:.15rem;
  color:var(--c-text)}

/* Controls on the photo (added by the script): prev / next at the photo's vertical
   centre, the counter in its top-right corner. Dark and translucent, so they read
   on any photo; red on hover / focus like the club buttons. */
.image-slider__btn{position:absolute;z-index:3;top:calc(var(--photo-h, 50%) / 2);
  transform:translateY(-50%);display:grid;place-items:center;width:46px;height:46px;padding:0;
  border:0;border-radius:50%;background:rgba(18,16,20,.62);color:#fff;cursor:pointer;
  box-shadow:0 2px 10px rgba(0,0,0,.35);transition:background-color .2s}
.image-slider__btn--prev{left:14px}
.image-slider__btn--next{right:14px}
.image-slider__btn:hover,.image-slider__btn:focus-visible{background:var(--c-accent)}
.image-slider__btn:focus-visible{outline:2px solid #fff;outline-offset:2px}
.image-slider__count{position:absolute;z-index:3;top:12px;right:12px;padding:.2rem .65rem;
  border-radius:999px;background:rgba(18,16,20,.62);color:#fff;font-size:.85rem;
  font-variant-numeric:tabular-nums;pointer-events:none}
@media (max-width:600px){
  .image-slider__btn{width:40px;height:40px}
  .image-slider__btn--prev{left:8px}
  .image-slider__btn--next{right:8px}
}
.image-slider__title{margin-top:.5rem}

/* Department pages render training times + contacts in their own group after the
   post content (templates/single-abteilung.html). Core zeroes a first child's top
   margin, so give the leading heading back the gap it has inside .entry-content. */
.entry-content.dept-details > h2:first-child{margin-top:1.6em}

/* ===== Footer ===== */
.site-footer{background:#101013;color:#bcbcc6;border-top:3px solid var(--c-accent)}
:root[data-theme="light"] .site-footer{background:#17161a}
.site-footer a{color:#d2d2d9}.site-footer a:hover{color:#fff;text-decoration:none}
.site-footer h2,.site-footer h3,.site-footer h4,.site-footer .brand-name{color:#fff}
.site-footer img{height:54px;width:auto}
.site-footer .wp-block-list{font-size:1rem;line-height:1.9}
.footer-bottom{border-top:1px solid #2a2b31;color:#9696a0;font-size:.88rem}

/* ===== Generic content width tweaks ===== */
.entry-content{font-size:1.06rem}
.entry-content h2{margin-top:1.6em}

/* ===== Image captions (#44) ===== */
/* Core's caption grey is meant for a light page; use the theme's muted text.
   Left-aligned like the running text (#24), not core's centred default. */
.wp-element-caption,.wp-block-image figcaption{color:var(--c-muted);font-size:.9rem;
  line-height:1.45;margin-top:.5em;text-align:left}
/* Editor: the empty caption field must be findable on the dark canvas. */
.wp-block-image figcaption[contenteditable="true"]{outline:1px dashed var(--c-border);
  outline-offset:2px;padding:.2em .4em}
.wp-block-image figcaption [data-rich-text-placeholder]::after{color:var(--c-muted);opacity:1}

/* ===== Fluent Forms — match the club button + theme the fields ===== */
/* Submit button = the club's primary (red) button. !important because the
   plugin sets its blue default with high-specificity/inline styles. */
.fluentform .ff-btn-submit,
.fluentform button.ff-btn-submit{
  background:var(--c-accent) !important;color:#fff !important;
  border:0 !important;border-radius:2px !important;box-shadow:none !important;
  font-family:var(--wp--preset--font-family--display);font-weight:700;
  text-transform:uppercase;letter-spacing:.05em;
  padding:.85rem 1.8rem !important;cursor:pointer;transition:background-color .2s ease}
.fluentform .ff-btn-submit:hover,
.fluentform button.ff-btn-submit:hover{background:var(--c-accent-strong) !important}
/* Inputs/labels follow the theme (flip in light mode via the vars) */
.fluentform .ff-el-form-control{
  background:var(--c-surface);border:1px solid var(--c-border);
  color:var(--c-text);border-radius:2px}
.fluentform .ff-el-form-control:focus{border-color:var(--c-accent);outline:none}
.fluentform .ff-el-form-control::placeholder{color:var(--c-muted)}
.fluentform label,.fluentform .ff-el-input--label label{color:var(--c-text)}
/* Recipient dropdown: strip the native widget (macOS ignores background-color on
   an appearance:auto <select>) so it honours the theme, add our own caret. The
   option popup itself follows `color-scheme` set on :root. */
.fluentform select.ff-el-form-control{
  -webkit-appearance:none;-moz-appearance:none;appearance:none;
  background-color:var(--c-surface);color:var(--c-text);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right .9rem center;background-size:12px;
  padding:.7rem 2.2rem .7rem .9rem;cursor:pointer}
.fluentform select.ff-el-form-control option{background:var(--c-surface);color:var(--c-text)}

/* Department page → "write via the contact form" call to action (red button) */
.dept-contact-btn{display:inline-block;background:var(--c-accent);color:#fff;
  font-family:var(--wp--preset--font-family--display);font-weight:700;
  text-transform:uppercase;letter-spacing:.05em;text-decoration:none;
  padding:.7rem 1.4rem;border-radius:2px;transition:background-color .2s ease}
.dept-contact-btn:hover{background:var(--c-accent-strong);color:#fff}

/* ===== Contact-person profile cards (department pages, issue #5) ===== */
/* Clicking the name folds open a small profile card — <details>, no JS.
   Rows appear only when filled in (inc/departments.php). */
/* no margin-top here — the theme's block gap must keep spacing it like any block */
.person-cards{display:flex;flex-direction:column;gap:.6rem;margin-bottom:1.4rem}
.person-card{background:var(--c-surface);border:1px solid var(--c-border);border-radius:3px;
  transition:border-color .2s ease}
.person-card[open],.person-card:hover{border-color:var(--c-accent)}
.person-card summary{list-style:none;cursor:pointer;display:flex;align-items:baseline;
  flex-wrap:wrap;gap:.2rem .8rem;padding:.8rem 1.1rem}
.person-card summary::-webkit-details-marker{display:none}
.person-card summary::after{content:"▾";margin-left:auto;color:var(--c-muted);font-size:.8em}
.person-card[open] summary::after{content:"▴"}
.person-name{font-family:var(--wp--preset--font-family--display);font-weight:600;
  font-size:1.12rem;line-height:1.25}
.person-card summary:hover .person-name{color:var(--c-accent)}
.person-role{color:var(--c-muted);font-size:.92rem}
.person-body{display:flex;gap:1.2rem;align-items:flex-start;
  padding:.9rem 1.1rem 1rem;border-top:1px solid var(--c-border)}
.person-photo{flex:0 0 92px;width:92px;height:92px;object-fit:cover;border-radius:3px;
  border:1px solid var(--c-border)}
.person-fields{flex:1 1 auto;min-width:0;margin:0}
.person-row{display:flex;gap:1rem;padding:.4rem 0}
.person-row + .person-row{border-top:1px solid var(--c-border)}
.person-row dt{flex:0 0 8rem;font-family:var(--wp--preset--font-family--display);
  text-transform:uppercase;letter-spacing:.1em;font-size:.76rem;font-weight:700;
  color:var(--c-muted);padding-top:.2em}
.person-row dd{margin:0;color:var(--c-text)}

/* ===== Veranstaltungen (Terminkalender) ===== */
.event-month{font-family:var(--wp--preset--font-family--display);text-transform:uppercase;
  letter-spacing:.06em;font-size:1.15rem;margin:2.4rem 0 0;padding-bottom:.5rem;
  border-bottom:2px solid var(--c-accent)}
.event-month:first-child{margin-top:1.5rem}
.event-rows{list-style:none;margin:0;padding:0}
.event-row{display:flex;gap:1.5rem;align-items:baseline;
  padding:1rem 0;border-bottom:1px solid var(--c-border)}
/* fixed gutter keeps every title on the same left edge, like the legacy table */
.event-when{flex:0 0 7.5rem;display:flex;flex-direction:column;gap:2px}
.event-day{font-family:var(--wp--preset--font-family--display);font-weight:700;
  font-size:1.05rem;color:var(--c-text);text-transform:capitalize}
.event-time{font-size:.86rem;color:var(--c-accent);font-weight:600;letter-spacing:.04em}
.event-what{min-width:0}
.event-title{font-family:var(--wp--preset--font-family--display);font-weight:600;
  font-size:1.2rem;line-height:1.25;color:var(--c-text);text-decoration:none}
.event-title:hover{color:var(--c-accent)}
.event-meta{margin:.3em 0 0;color:var(--c-muted);font-size:.95rem;line-height:1.45}
.event-empty{color:var(--c-muted)}

/* View bar: upcoming events + yearly archive (issue #8). No top margin of its own: the
   layout's block gap spaces it from the title like the first block on every other page. */
.event-views{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin-bottom:.5rem;
  padding-bottom:1.2rem;border-bottom:1px solid var(--c-border)}
.event-view{font-family:var(--wp--preset--font-family--display);font-weight:600;
  font-size:.95rem;letter-spacing:.03em;text-decoration:none;color:var(--c-text);
  padding:.4rem .95rem;border:1px solid var(--c-border);border-radius:2px;
  transition:border-color .2s ease,color .2s ease,background-color .2s ease}
.event-view:hover{border-color:var(--c-accent);color:var(--c-accent)}
.event-view.is-active{background:var(--c-accent);border-color:var(--c-accent);color:#fff}

/* Vergangene Jahre wachsen unbegrenzt → hinter ein Archiv-Aufklappmenü (kein JS) */
.event-archive{position:relative}
summary.event-view{list-style:none;cursor:pointer}
summary.event-view::-webkit-details-marker{display:none}
summary.event-view::after{content:"▾";margin-left:.45em;font-size:.75em;vertical-align:.06em}
.event-archive[open] > summary.event-view::after{content:"▴"}
.event-archive-list{position:absolute;top:calc(100% + .4rem);left:0;z-index:20;
  display:flex;flex-direction:column;min-width:6.5rem;padding:.3rem;gap:.1rem;
  background:var(--c-surface);border:1px solid var(--c-border);border-radius:2px;
  box-shadow:0 10px 30px rgba(0,0,0,.3)}
.event-archive-year{font-family:var(--wp--preset--font-family--display);font-weight:600;
  font-size:.92rem;text-decoration:none;color:var(--c-text);padding:.35rem .7rem;
  border-radius:2px;transition:background-color .15s ease,color .15s ease}
.event-archive-year:hover{background:var(--c-accent);color:#fff}
.event-archive-year.is-active{color:var(--c-accent)}

/* News bar (#62): page title left, topic menu and "Nach oben" right, on one line.
   The bar keeps one height and sticks with its spare top part above the screen, so
   only its 52px row stays visible. .is-large (script, page top) enlarges the title
   with transforms: no layout change, so the page cannot jitter at the threshold.
   It is a direct child of .wp-site-blocks because sticky only travels in its parent. */
.news-bar{--bar-spare:58px;--title-scale:2.2;position:sticky;top:calc(var(--bar-spare) * -1);
  z-index:55;margin-block-start:0 !important;padding-top:var(--bar-spare);
  background:var(--header-bg);backdrop-filter:blur(8px);border-bottom:1px solid var(--c-border)}
.news-bar__inner{height:52px;gap:.5rem}
.news-bar h1{margin:0;font-size:1.5rem;line-height:1;white-space:nowrap;hyphens:none;
  -webkit-hyphens:none;transform-origin:left center}
.news-bar__actions{position:relative;flex:none;gap:.4rem}
/* one height for the <summary> and the <button>, whose default line-heights differ */
.news-bar__actions .event-view{box-sizing:border-box;height:40px;line-height:26px}
.news-bar.is-large h1{transform:translateY(calc(var(--bar-spare) / -2)) scale(var(--title-scale))}
.news-bar.is-large .news-bar__actions{transform:translateY(calc(var(--bar-spare) / -2))}
.news-bar.is-ready h1,.news-bar.is-ready .news-bar__actions{transition:transform .25s ease}
@media (prefers-reduced-motion:reduce){
  .news-bar.is-ready h1,.news-bar.is-ready .news-bar__actions{transition:none}
}
.news-bar + main{padding-top:var(--wp--preset--spacing--40) !important}
.news-bar + main .wp-block-query{margin-top:0 !important}
.news-filter{margin:0;padding:0;border:0;min-width:0}
.news-filter .event-archive{position:static}
.news-filter summary{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:46vw}
.news-filter .event-archive-list{top:calc(100% + .4rem);left:auto;right:0;min-width:13rem;
  max-height:calc(100vh - 80px);overflow-y:auto}
.news-filter .event-archive-year{white-space:nowrap}
/* "Nach oben" floats bottom right, in thumb reach, level with "Zurück" and clear of the rail. */
.news-top{position:fixed;z-index:45;right:max(82px,calc((100vw - 1200px) / 2));
  bottom:max(16px,env(safe-area-inset-bottom));display:inline-flex;align-items:center;justify-content:center;
  gap:.4rem;box-sizing:border-box;height:42px;padding:0 1.15rem;border:0;border-radius:2px;cursor:pointer;
  box-shadow:0 6px 20px rgba(0,0,0,.45);background:var(--c-accent);color:#fff;white-space:nowrap;
  font-family:var(--wp--preset--font-family--display);font-weight:600;font-size:1.05rem;letter-spacing:.03em;
  transition:background-color .2s ease}
/* Mouse only: after a tap, touch browsers keep :hover and the button would stay dark red. */
@media(hover:hover){.news-top:hover{background:var(--c-accent-strong)}}
.news-top[hidden]{display:none}
.news-hits .news-back-bar{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.news-hits .news-top{position:static;pointer-events:auto}
.news-top:focus-visible,.news-filter summary:focus-visible{outline:2px solid var(--c-accent);outline-offset:1px}
@media(max-width:600px){
  .news-bar{--bar-spare:36px;--title-scale:1.55}
  /* title, search and topic menu must share one line down to 320px */
  .news-bar h1{font-size:1.25rem}
  .news-bar__actions .event-view{padding-left:.55rem;padding-right:.55rem}
  .news-filter summary{max-width:32vw}
  .news-top{right:36px}
  .news-filter .event-archive-list{width:calc(100vw - 40px);min-width:0;
    display:grid;grid-template-columns:1fr 1fr;padding:.4rem}
  .news-filter .event-archive-year{padding:.7rem .7rem;font-size:1rem;white-space:normal}
}

/* ===== News timeline (#62) ===== */
/* A dotted rail at the screen edge, one equal band per year. Dot size follows the
   year's article count. The marker is a larger red dot on the line, its ring in the
   page colour so it stands clear of the year dots it passes. */
.news-timeline{position:fixed;z-index:50;top:64px;bottom:18px;right:8px;width:66px;
  touch-action:none;user-select:none;-webkit-user-select:none;cursor:pointer;
  transition:opacity .2s ease,visibility .2s}
.news-timeline.is-away{opacity:0;visibility:hidden}
.news-timeline::before{content:"";position:absolute;top:0;bottom:0;right:11px;width:3px;
  background:radial-gradient(circle,color-mix(in srgb,var(--c-muted) 55%,transparent) 1.2px,transparent 1.5px) 0 0/3px 8px repeat-y}
.news-timeline__years{position:relative;display:flex;flex-direction:column;height:100%;
  margin:0;padding:0;list-style:none}
.news-timeline__years li{flex:1 1 0;min-height:0}
.news-timeline__years a{display:flex;align-items:flex-start;justify-content:flex-end;gap:7px;
  height:100%;color:var(--c-muted);text-decoration:none;line-height:1;
  font-family:var(--wp--preset--font-family--display);font-size:.78rem;
  font-variant-numeric:tabular-nums}
.news-timeline__years a::after{content:"";flex:none;width:var(--dot);height:var(--dot);
  margin-right:calc(12.5px - var(--dot) / 2);border-radius:50%;background:var(--c-muted)}
.news-timeline__years a:hover{color:var(--c-text)}
.news-timeline__years a:focus-visible{outline:2px solid var(--c-accent);outline-offset:1px;color:var(--c-text)}
.news-timeline__thumb{position:absolute;right:5.5px;top:calc(var(--pos,0) * 100%);width:14px;height:14px;
  border-radius:50%;background:var(--c-accent);box-shadow:0 0 0 3px var(--c-bg);
  transform:translateY(-50%);pointer-events:none}
.news-timeline__thumb span{position:absolute;right:26px;top:50%;padding:.42rem 1.15rem .38rem .95rem;
  background:var(--c-accent);color:#fff;white-space:nowrap;
  font-family:var(--wp--preset--font-family--display);font-weight:700;font-size:1.05rem;
  line-height:1;text-transform:uppercase;letter-spacing:.04em;
  clip-path:polygon(9px 0,100% 0,calc(100% - 9px) 100%,0 100%);
  transform:translateY(-50%);opacity:0;transition:opacity .15s ease}
.news-timeline:hover .news-timeline__thumb span,
.news-timeline.is-scrolling .news-timeline__thumb span,
.news-timeline.is-dragging .news-timeline__thumb span{opacity:1}
@media (prefers-reduced-motion:reduce){
  .news-timeline,.news-timeline__thumb,.news-timeline__thumb span{transition:none}
}
@media (max-height:520px){
  .news-timeline__years li:nth-child(even) span{visibility:hidden}
}

.wp-block-query.has-timeline .wp-block-query-pagination{display:none}
.wp-block-query[aria-busy="true"] .post-cards{opacity:.45}
/* The script holds the position itself. Anchoring must be off for the whole page:
   with only the list excluded, the browser anchors to the footer and every appended
   batch of cards drags the page down with it. */
html:has(.has-timeline){overflow-anchor:none}
/* The rail is this page's scrollbar. The native one only knows the cards loaded so
   far, so it would jump on every load and contradict the rail. Set only with the
   script running: without it the rail cannot follow the scroll position. */
html:has(.has-timeline){scrollbar-width:none}
html:has(.has-timeline)::-webkit-scrollbar{display:none}
.post-cards > .news-month{grid-column:1/-1;margin:1.6rem 0 -.2rem;padding:0 0 .5rem;
  border-bottom:2px solid var(--c-accent);list-style:none}
.post-cards > .news-month:first-child{margin-top:0}
.news-month h2{margin:0;font-family:var(--wp--preset--font-family--display);
  font-size:1.5rem;line-height:1.1;text-transform:uppercase;letter-spacing:.03em}
.news-more{display:block;margin:2rem auto 0;padding:.75rem 1.5rem;cursor:pointer;
  background:transparent;color:var(--c-text);border:1px solid var(--c-border);border-radius:2px;
  font-family:var(--wp--preset--font-family--display);font-weight:600;font-size:1rem}
.news-more:hover,.news-more:focus-visible{border-color:var(--c-accent);color:var(--c-accent)}
/* keep cards clear of the rail wherever the page margin is too narrow for it */
@media(max-width:1400px){
  main:has(.news-timeline) .wp-block-query{padding-right:66px}
}
@media(max-width:600px){
  /* The line hugs the screen edge so cards keep nearly the full width. The rail stays
     30px wide as a touch target and may overlap the card edge, being transparent. */
  main:has(.news-timeline) .wp-block-query{padding-right:6px}
  .news-timeline{top:64px;right:0;width:30px}
  .news-timeline::before{right:7.5px}
  .news-timeline__years a::after{margin-right:calc(9px - var(--dot) / 2)}
  .news-timeline__thumb{right:2px}
  .news-timeline__years span{display:none}
  .news-timeline.is-dragging{width:96px}
  .news-timeline.is-dragging .news-timeline__years span{display:inline;padding:1px 3px;
    background:var(--c-bg)}
}

/* single event: Wann / Wo / Organisator */
.event-details{background:var(--c-surface);border:1px solid var(--c-border);
  padding:1.4rem 1.6rem;margin:0 0 2rem}
.event-detail{display:flex;gap:1rem;padding:.45rem 0}
.event-detail + .event-detail{border-top:1px solid var(--c-border)}
.event-detail-label{flex:0 0 8rem;font-family:var(--wp--preset--font-family--display);
  text-transform:uppercase;letter-spacing:.1em;font-size:.76rem;font-weight:700;
  color:var(--c-muted);padding-top:.2em}
.event-detail-value{color:var(--c-text)}

/* ===== Downloads (Formulare & Dokumente, Issue #10) ===== */
.download-group{font-family:var(--wp--preset--font-family--display);text-transform:uppercase;
  letter-spacing:.06em;font-size:1.15rem;margin:2.4rem 0 .8rem;padding-bottom:.5rem;
  border-bottom:2px solid var(--c-accent)}
.download-group:first-child{margin-top:0}
.download-rows{list-style:none;margin:0 0 1rem;padding:0}
.download-row{margin:0 0 .6rem}
/* ganze Zeile ist der Link — Icon links, Titel/Beschreibung mittig, Format rechts */
.download-link{display:flex;align-items:center;gap:1rem;text-decoration:none;color:var(--c-text);
  background:var(--c-surface);border:1px solid var(--c-border);border-radius:3px;
  padding:.9rem 1.1rem;transition:border-color .2s ease,background-color .2s ease}
.download-link:hover{border-color:var(--c-accent);background:var(--c-surface-2)}
.download-icon{flex:0 0 auto;width:26px;height:26px;color:var(--c-accent)}
.download-body{min-width:0;flex:1 1 auto;display:flex;flex-direction:column;gap:2px}
.download-title{font-family:var(--wp--preset--font-family--display);font-weight:600;
  font-size:1.12rem;line-height:1.25}
.download-link:hover .download-title{color:var(--c-accent)}
.download-desc{color:var(--c-muted);font-size:.95rem;line-height:1.45}
.download-meta{flex:0 0 auto;font-family:var(--wp--preset--font-family--display);font-weight:600;
  font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--c-muted);
  white-space:nowrap;padding:.2rem .55rem;border:1px solid var(--c-border);border-radius:2px}
.download-empty{color:var(--c-muted)}

/* ===== Gästebuch (Issue #12) ===== */
.gb-notice{padding:.8rem 1.1rem;border-radius:3px;border:1px solid var(--c-border);
  background:var(--c-surface);font-weight:600}
.gb-notice--ok{border-color:#2e7d32;color:#4caf50}
.gb-notice--error{border-color:var(--c-accent);color:var(--c-accent)}
.gb-empty{color:var(--c-muted)}
.gb-entries{display:flex;flex-direction:column;gap:.6rem;margin:1.4rem 0}
.gb > :first-child{margin-top:0}
.gb-entry{background:var(--c-surface);border:1px solid var(--c-border);border-radius:3px;
  padding:.9rem 1.1rem}
.gb-entry-head{display:flex;align-items:baseline;flex-wrap:wrap;gap:.2rem .8rem}
.gb-entry-name{font-family:var(--wp--preset--font-family--display);font-weight:600;
  font-size:1.12rem;line-height:1.25}
.gb-entry-date{margin-left:auto;color:var(--c-muted);font-size:.86rem}
.gb-entry-text{margin:.5em 0 0;color:var(--c-text);line-height:1.55}
.gb-pagination{display:flex;align-items:center;gap:1.2rem;margin:0 0 1.4rem;
  font-family:var(--wp--preset--font-family--display);font-weight:600;font-size:.95rem}
.gb-page-info{color:var(--c-muted)}
/* form fields follow the theme, same recipe as the Fluent Forms overrides */
.gb-form{margin-top:2.4rem;padding-top:1.6rem;border-top:2px solid var(--c-accent)}
.gb-form h2{margin:0 0 1.2rem}
.gb-form label{display:block;margin-bottom:.3rem;color:var(--c-text)}
.gb-form input[type=text],.gb-form textarea{width:100%;padding:.7rem .9rem;
  background:var(--c-surface);border:1px solid var(--c-border);
  color:var(--c-text);border-radius:2px;font:inherit}
.gb-form input[type=text]:focus,.gb-form textarea:focus{border-color:var(--c-accent);outline:none}
.gb-consent label,.gb-moderation-hint{display:block;color:var(--c-muted);
  font-size:.92rem;line-height:1.5}
.gb-consent input{margin-right:.45rem}
/* honeypot: visually hidden, still fillable by bots (never display:none) */
.gb-hp{position:absolute !important;left:-9999px;width:1px;height:1px;overflow:hidden}
.gb-submit{display:inline-block;background:var(--c-accent);color:#fff;border:0;cursor:pointer;
  font-family:var(--wp--preset--font-family--display);font-weight:700;
  text-transform:uppercase;letter-spacing:.05em;
  padding:.85rem 1.8rem;border-radius:2px;transition:background-color .2s ease}
.gb-submit:hover{background:var(--c-accent-strong)}

/* Phones: both floating buttons keep their labels on one line down to 320px, and sit
   higher, clear of the browser's bottom bar and the home indicator. */
@media(max-width:600px){
  .news-back-bar,.news-top{bottom:calc(24px + env(safe-area-inset-bottom,0px))}
}
@media(max-width:460px){
  .news-top,.news-hits .news-back a{padding:0 .7rem;font-size:.95rem;gap:.3rem}
}
@media(max-width:350px){
  .news-bar h1{font-size:1.1rem}
}
/* Large screens: the timeline's year labels get a notch more type. */
@media(min-width:1200px){
  .news-timeline__years a{font-size:.94rem}
}

/* ===== News search (#43): one field in the news bar ===== */
/* Collapsed to its icon; opens on focus and stays open while it holds text. */
.news-search{display:flex;align-items:center;box-sizing:border-box;height:40px;margin:0;flex:none;
  border:1px solid var(--c-border);border-radius:2px;background:var(--c-surface);color:var(--c-text);transition:border-color .2s ease}
.news-search:hover,.news-search:focus-within{border-color:var(--c-accent)}
.news-search label{display:grid;place-items:center;width:38px;height:100%;flex:none;cursor:pointer}
.news-search svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.news-search input[type=search]{box-sizing:border-box;width:0;min-width:0;padding:0;border:0;outline:0;background:transparent;
  color:var(--c-text);font:inherit;font-size:1rem;transition:width .2s ease}
.news-search:focus-within input[type=search],.news-search.has-query input[type=search]{width:15rem;padding-right:.6rem}
.news-search.is-loading svg{color:var(--c-accent)}
.wp-block-query[hidden],.news-timeline[hidden]{display:none}
/* Result area: titles under year and month headings, clear of the rail. */
.search-summary{margin:0 0 1.2rem;color:var(--c-muted)}
.search-summary strong{color:var(--c-text)}
.news-hits__none{color:var(--c-muted)}
.news-hits__list{list-style:none;margin:0;padding:0}
.news-hits__year{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;margin:2.2rem 0 0;
  padding-bottom:.45rem;border-bottom:2px solid var(--c-accent);scroll-margin-top:70px}
.news-hits__year:first-child{margin-top:0}
.news-hits__year h2{margin:0;font-family:var(--wp--preset--font-family--display);font-size:1.7rem;line-height:1.1}
.news-hits__year span{color:var(--c-muted);font-size:.9rem;white-space:nowrap}
.news-hits__month h3{margin:1.1rem 0 .2rem;color:var(--c-muted);font-family:var(--wp--preset--font-family--display);
  font-size:.95rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
.news-hit a{display:grid;grid-template-columns:5rem minmax(0,1fr);gap:.8rem;padding:.42rem .5rem;border-radius:2px;
  color:var(--c-text);text-decoration:none;line-height:1.35}
.news-hit a:hover,.news-hit a:focus-visible{background:var(--c-surface);color:var(--c-accent)}
.news-hit time{color:var(--c-muted);font-size:.9rem;font-variant-numeric:tabular-nums;white-space:nowrap;padding-top:.08rem}
a:hover .news-hit__preview,a:focus-visible .news-hit__preview{color:var(--c-text)}
.news-hit__text{display:flex;flex-direction:column;gap:.1rem;min-width:0}
/* Long slash-joined team names must wrap: one overflowing row widens the phone's layout
   viewport, which pushes everything fixed or sticky off the screen. */
.news-hit__title,.news-hit__preview{overflow-wrap:anywhere}
.news-hits .news-back a{white-space:nowrap}
.news-hit__preview{color:var(--c-muted);font-size:.9rem;line-height:1.4;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.news-hit mark{background:color-mix(in srgb,var(--c-accent) 30%,transparent);color:inherit;
  border-radius:2px;padding:0 .1em}
.search-mark{background:var(--c-accent);color:#fff;border-radius:2px;padding:0 .1em}
@media(max-width:1400px){.news-hits{padding-right:66px}}
@media(max-width:600px){
  .news-hits{padding-right:26px}
  .news-hit a{grid-template-columns:4.1rem minmax(0,1fr);gap:.5rem;padding-left:0;padding-right:0}
  .news-hit__preview{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
}
@media (prefers-reduced-motion:reduce){.news-search input[type=search]{transition:none}}
/* Phone: the open field takes the title's place. */
@media(max-width:600px){
  .news-bar:has(.news-search:focus-within) h1,.news-bar:has(.news-search.has-query) h1{display:none}
  .news-bar__actions:has(.news-search:focus-within),.news-bar__actions:has(.news-search.has-query){flex:1;min-width:0}
  .news-search:focus-within,.news-search.has-query{flex:1;min-width:0}
  .news-search:focus-within input[type=search],.news-search.has-query input[type=search]{width:100%}
}

/* ===== Responsive ===== */
/* Hamburger below 1250px instead of core's 600px default (overlayMenu:"mobile").
   Eight menu items need ~1135px next to crest and the two icon buttons (incl. the
   flex block gaps) — below that the last item wraps into a second line. Both icon
   buttons stay at every width; unlike the wide CTA button they replaced, they no
   longer have to be hidden on small screens. */
@media(max-width:1249px){
  .site-header .wp-block-navigation__responsive-container-open{display:flex}
  .site-header .wp-block-navigation__responsive-container:not(.is-menu-open){display:none}
}
@media(max-width:900px){
  .dept-grid{grid-template-columns:1fr 1fr}
  .facts{grid-template-columns:1fr 1fr}
  .facts > *{border-bottom:1px solid var(--c-border)}
  .facts > *:nth-child(even){border-right:0}
  .hero:after{font-size:30vw}
}
/* tablets & phones: news cards must not stay 3-up */
@media(max-width:781px){
  .post-cards{grid-template-columns:1fr 1fr !important}
}
@media(max-width:600px){
  /* tighten the vertical rhythm site-wide */
  :root{
    --wp--preset--spacing--80:3rem;
    --wp--preset--spacing--60:2.5rem;
    --wp--preset--spacing--40:1.5rem;
    --wp--preset--spacing--20:.9rem;
  }
  /* single-column grids */
  .dept-grid{grid-template-columns:1fr;gap:10px}
  .facts{grid-template-columns:1fr}
  .facts > *{border-right:0}
  .post-cards{grid-template-columns:1fr !important}

  /* department cards: compact horizontal rows (icon left, text right) instead
     of tall column tiles with dead space */
  .dept-card{flex-direction:row;align-items:center;justify-content:flex-start;
    gap:14px;padding:14px 16px}
  .dept-card .dept-ic{width:42px;height:42px}
  .dept-card .dept-ic svg{width:22px;height:22px}
  .dept-card .dept-name{font-size:1.12rem;margin-bottom:2px}

  /* header: declutter — drop the subline, shrink crest (icon buttons stay) */
  .site-header > .wp-block-group{min-height:62px}
  .brand-lockup img{height:38px}
  .brand-lockup .brand-name{font-size:1.05rem}
  .brand-lockup .brand-sub{display:none}
  .site-header .wp-block-navigation{gap:1rem}

  /* hero: calmer on small screens (stripe already hidden ≤900) */
  .hero .crest-hero img{max-width:160px}

  /* CTA band + training tables: tighter */
  .cta-band{padding-left:1.2rem !important;padding-right:1.2rem !important}
  .training-times th,.training-times td{padding:9px 10px;font-size:.92rem}

  /* events: the date gutter costs too much width — stack it above the title,
     with day and time side by side on one line */
  .event-row{flex-direction:column;gap:.35rem}
  .event-when{flex:none;flex-direction:row;align-items:baseline;gap:.6rem}
  .event-title{font-size:1.08rem}
  .event-details{padding:1.1rem 1.2rem}
  .event-detail{flex-direction:column;gap:.15rem}
  .event-detail-label{flex:none;padding-top:0}

  /* profile cards: stack label over value, photo above the fields */
  .person-body{flex-direction:column;gap:.8rem}
  .person-row{flex-direction:column;gap:.15rem}
  .person-row dt{flex:none;padding-top:0}

  /* downloads: the format badge drops below the title instead of crowding it */
  .download-link{flex-wrap:wrap;gap:.5rem .8rem;padding:.8rem .9rem}
  .download-meta{order:3;margin-left:calc(26px + .8rem)}
  .download-title{font-size:1.05rem}
}
