/* thenex runclub – Fotogalerie. Farben und Schriften wie auf thenex-sport.com */
@font-face {
  font-family: 'lazydog';
  src: url('/static/fonts/lazydog.otf') format('opentype');
  font-display: swap;
}

:root {
  --black: #000;
  --ink: #fff;
  --yellow: #e6f019;
  --grey: #a0a5a0;
  --line: rgba(255, 255, 255, 0.16);
  --soft: #141414;
  --display: 'lazydog', 'Arial Rounded MT Bold', 'Helvetica Neue', Arial, sans-serif;
  --label: 'anton', 'Impact', 'Arial Narrow', sans-serif;
  --body: 'mencken-std', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --pad: clamp(4px, 1.6vw, 20px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html.noscroll { overflow: hidden; }
body { margin: 0; background: var(--black); color: var(--ink); font: 400 17px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Beschriftungen im Stil der Website: Anton, Großbuchstaben */
.label { font-family: var(--label); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 0; border-radius: 999px; background: var(--yellow); color: var(--black); font: 400 17px/1 var(--label); text-transform: uppercase; letter-spacing: 0.03em; text-decoration: none; transition: background 0.15s, color 0.15s, transform 0.15s; }
.btn:hover { background: #fff; }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); background: transparent; }
.btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.btn small { font-family: var(--body); font-size: 13px; text-transform: none; letter-spacing: 0; opacity: 0.7; }
.ibtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); }
.ibtn:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- Titelbild („Bold“) ---------- */
@property --shade-t { syntax: '<number>'; inherits: true; initial-value: 0.34; }
@property --shade-b { syntax: '<number>'; inherits: true; initial-value: 0.6; }
@property --shade-m { syntax: '<number>'; inherits: true; initial-value: 0.3; }

.hero {
  --x: max(16px, 3.4cqw);
  --bar: clamp(8px, 1.1cqh, 14px);
  container: hero / size;
  position: relative;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--black);
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; z-index: -2; }
.hero-img.empty { background: radial-gradient(ellipse at 70% 30%, #2a2a2a, #000 70%); }
.hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; transition: --shade-t 0.6s, --shade-b 0.6s;
  background: linear-gradient(180deg, rgba(0, 0, 0, max(0.35, var(--shade-t))) 0%, rgba(0, 0, 0, 0) 24%, rgba(0, 0, 0, 0) 36%, rgba(0, 0, 0, max(0.7, var(--shade-b))) 100%); }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: var(--bar); background: var(--yellow); }
.hero-logo { position: absolute; top: max(16px, 3cqh); left: var(--x); line-height: 0; transition: transform 0.3s; }
.hero-logo img { width: clamp(76px, 7.4cqw, 128px); height: auto; display: block; }
.hero-logo:hover { transform: rotate(-8deg); }
.hero-tag { position: absolute; top: max(16px, 3cqh); right: var(--x); margin: 0; padding-top: clamp(10px, 1.6cqw, 24px); color: var(--yellow); font: 400 clamp(17px, 1.5cqw, 24px)/1.05 var(--label); text-transform: uppercase; text-align: right; }

.hero-inner { padding: 0 var(--x) calc(var(--bar) + clamp(22px, 4.6cqh, 56px)); }
/* Lazydog: verspielte Schrift der Website. Zeilenhöhe knapp, aber Platz für Umlaute */
.hero-title { --size: clamp(64px, 12.5cqw, 250px); margin: 0 0 clamp(18px, 3.6cqh, 44px) -0.03em; font: 400 var(--size)/0.9 var(--display); text-transform: uppercase; letter-spacing: 0.01em; text-wrap: balance; overflow-wrap: break-word; padding-top: 0.08em; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25); }
.hero-num, .hero-name { display: block; }
.hero-num { color: var(--yellow); }
.hero[data-len='m'] .hero-title { --size: clamp(52px, 9.6cqw, 200px); }
.hero[data-len='l'] .hero-title { --size: clamp(44px, 7.8cqw, 170px); }
.hero[data-len='xl'] .hero-title { --size: clamp(38px, 6.2cqw, 140px); }

.hero-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px clamp(14px, 1.8cqw, 32px); }
.hero-meta { margin: 0; font: 400 clamp(17px, 1.3cqw, 21px)/1 var(--label); text-transform: uppercase; letter-spacing: 0.03em; color: rgba(255, 255, 255, 0.85); }
.hero-btn { display: inline-flex; align-items: center; gap: 10px; border: 0; padding: 15px 22px 15px 24px; background: #fff; color: var(--black); font: 400 clamp(17px, 1.3cqw, 21px)/1 var(--label); text-transform: uppercase; letter-spacing: 0.03em; transition: background 0.2s; }
.hero-btn:hover { background: var(--yellow); }
.hero-btn svg { width: 19px; height: 19px; stroke-width: 2.4; animation: nudge 2.4s ease-in-out infinite; }

/* Datums-Auswahl: gelber Chip mit Pfeilen für älter / neuer */
.runpick { display: flex; align-items: stretch; background: var(--yellow); color: var(--black); }
.runpick-step { display: flex; align-items: center; justify-content: center; width: 46px; color: var(--black); transition: background 0.15s; }
.runpick-step svg { width: 20px; height: 20px; stroke-width: 2.6; }
.runpick-step:not(.off):hover { background: rgba(0, 0, 0, 0.12); }
.runpick-step.off { opacity: 0.28; pointer-events: none; }
.runpick-select { position: relative; display: flex; align-items: center; border-left: 1.5px solid rgba(0, 0, 0, 0.18); border-right: 1.5px solid rgba(0, 0, 0, 0.18); }
/* Sichtbar ist nur das Datum; die (unsichtbare) Auswahlliste liegt darüber und öffnet die Liste aller Läufe */
.runpick-label { padding: 15px 46px 15px 16px; font: 400 clamp(17px, 1.3cqw, 21px)/1 var(--label); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.runpick-select select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; appearance: none; -webkit-appearance: none; border: 0; cursor: pointer; font-size: 16px; }
.runpick-select:hover { background: rgba(0, 0, 0, 0.08); }
.runpick-select:has(select:focus-visible) { outline: 2px solid var(--black); outline-offset: -5px; }
.runpick-select select option { background: #fff; color: #000; }
.runpick-select svg { position: absolute; right: 14px; pointer-events: none; width: 18px; height: 18px; stroke-width: 2.6; }

.m-only { display: none; }

/* ---------- Handy ---------- */
@media (max-width: 760px) {
  /* Cover etwas niedriger: die Galerie schaut unten hervor (lädt zum Scrollen ein),
     und die schwebende Browser-Leiste (Safari) verdeckt keine Bedienelemente */
  .hero { height: 86svh; min-height: 560px; }
  /* Foto oben, Text darunter auf Schwarz: die Gruppe auf dem Titelbild bleibt frei sichtbar */
  .hero-img { height: 64%; }
  .hero-shade { background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 46%, #000 64%, #000 100%); }
}
@container hero (max-width: 760px) {
  .hero-logo img { width: 72px; }
  .hero-tag { font-size: 17px; padding-top: 6px; }
  .hero-inner { padding-bottom: calc(var(--bar) + 18px); }
  .hero-title { margin-bottom: 18px; }
  /* „122.“ groß und gelb, „Thenex Runclub“ in einer Zeile über die ganze Breite */
  .hero-num { font-size: clamp(60px, 22cqw, 120px); line-height: 0.95; }
  .hero-name { font-size: min(var(--size), calc((100cqw - 2 * var(--x)) / (var(--chars, 10) * 0.69))); white-space: nowrap; }
  .hero-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'pick' 'btn'; gap: 10px; }
  .runpick { grid-area: pick; width: 100%; }
  .runpick-step { width: 54px; }
  .runpick-select { min-width: 0; flex: 1; justify-content: center; }
  .runpick-label { padding: 17px 40px 17px 12px; }
  .hero-meta { display: none; }
  .hero-btn { grid-area: btn; width: 100%; justify-content: center; padding: 17px 20px; }
  .m-only { display: inline; }
  .hero-title { --size: clamp(54px, 17cqw, 130px); }
  .hero[data-len='m'] .hero-title { --size: clamp(46px, 13.5cqw, 110px); }
  .hero[data-len='l'] .hero-title { --size: clamp(40px, 11cqw, 90px); }
  .hero[data-len='xl'] .hero-title { --size: clamp(34px, 9cqw, 74px); }
}
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ---------- Leiste über dem Raster ---------- */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 8px max(12px, var(--pad)); background: rgba(0, 0, 0, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar-logo { line-height: 0; flex: none; }
.bar-logo img { width: 46px; height: 46px; }
.bar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bar-title b { font: 400 21px/1 var(--display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 2px; }
.bar-title span { font: 400 14px/1 var(--label); text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey); }
@media (max-width: 560px) {
  .bar { gap: 10px; min-height: 60px; }
  .bar-logo img { width: 38px; height: 38px; }
  .bar-title b { font-size: 18px; }
  .bar .btn { padding: 11px 14px; }
  .bar .btn small { display: none; }
}

/* Reiter für Subgalerien („Alle“, „Matthias“, „Julian“) */
.bar { flex-wrap: wrap; row-gap: 0; }
.tabs { flex-basis: 100%; display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; margin-top: 6px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; background: none; padding: 10px 0 9px; font: 400 17px/1 var(--label); text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey); border-bottom: 3px solid transparent; transition: color 0.15s, border-color 0.15s; }
.tabs button span { margin-left: 5px; font-family: var(--body); font-size: 13px; letter-spacing: 0; opacity: 0.8; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed='true'] { color: var(--ink); border-bottom-color: var(--yellow); }

/* ---------- Raster ---------- */
.grid { padding: var(--pad); min-height: 60vh; }
.vgrid { position: relative; }
.row-j { display: flex; position: absolute; left: 0; right: 0; }
.tile { position: relative; margin: 0; overflow: hidden; cursor: zoom-in; flex: none; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease, opacity 0.4s; }
.tile:hover img { transform: scale(1.03); }
.tile::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 0 var(--yellow); transition: box-shadow 0.15s; pointer-events: none; }
.tile:hover::after { box-shadow: inset 0 0 0 4px var(--yellow); }
.empty { text-align: center; color: var(--grey); padding: 80px 16px; }

/* ---------- Vollbild ---------- */
.lb { position: fixed; inset: 0; z-index: 20; background: #000; display: none; flex-direction: column; }
.lb.open { display: flex; }
.lb:focus { outline: none; }
.lb-top { display: flex; align-items: center; gap: 10px; padding: 8px max(8px, var(--pad)); padding-top: max(8px, env(safe-area-inset-top)); min-height: 62px; }
.lb-count { flex: 1; font: 400 17px/1 var(--label); letter-spacing: 0.04em; color: var(--grey); }
.lb-count b { color: var(--ink); font-weight: 400; }
.lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 64px 20px; padding-bottom: max(20px, env(safe-area-inset-bottom)); touch-action: pan-y pinch-zoom; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; display: block; }
.lb-nav { position: absolute; top: 0; bottom: 20px; width: 64px; border: 0; background: none; color: var(--grey); display: flex; align-items: center; justify-content: center; }
.lb-nav:hover { color: var(--yellow); }
.lb-nav svg { width: 34px; height: 34px; stroke-width: 1.6; }
.lb-nav.prev { left: 0; }
.lb-nav.next { right: 0; }
.lb-hint { text-align: center; margin: 0; padding: 0 16px 14px; font-size: 13px; color: var(--grey); }
@media (max-width: 760px) {
  .lb-stage { padding: 0 0 12px; }
  .lb-nav { display: none; }
}
@media (hover: hover) { .lb-hint { display: none; } }

/* Dialog */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.7); display: grid; place-items: center; padding: 16px; }
.modal-box { width: min(440px, 100%); background: #111; border: 1px solid var(--line); padding: 28px 24px 22px; }
.modal-box:focus { outline: none; }
.modal-box h2 { margin: 0 0 8px; font: 400 30px/1 var(--display); text-transform: uppercase; }
.modal-box p { margin: 8px 0; color: rgba(255, 255, 255, 0.85); }
.modal-box .small { font-size: 14px; color: var(--grey); }
.parts { display: grid; gap: 8px; margin: 18px 0 6px; }
.parts .btn { justify-content: space-between; }
.parts .btn.done { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--yellow); }
.modal-close { display: flex; justify-content: flex-end; margin-top: 10px; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 40; background: var(--yellow); color: var(--black); padding: 12px 20px; font: 400 16px/1.2 var(--label); text-transform: uppercase; letter-spacing: 0.03em; transition: 0.25s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Fußzeile ---------- */
.foot { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 64px 20px 56px; text-align: center; border-top: 1px solid var(--line); margin-top: 40px; }
.foot-logo img { width: clamp(150px, 22vw, 210px); height: auto; display: block; transition: transform 0.3s; }
.foot-logo:hover img { transform: rotate(-3deg); }
.foot-note { max-width: 46ch; margin: 0; font-size: 15px; color: var(--grey); }
.foot-note a { color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; font: 400 15px/1 var(--label); text-transform: uppercase; letter-spacing: 0.04em; }
.foot-links a { text-decoration: none; color: var(--grey); }
.foot-links a:hover { color: var(--yellow); }

/* ---------- Einzelseiten (leer, nicht gefunden) ---------- */
.center-page { min-height: 100svh; display: grid; place-items: center; padding: 20px; }
.card { width: min(460px, 100%); text-align: center; }
.card-logo img { width: 120px; height: 120px; }
.card h1 { margin: 24px 0 10px; font: 400 clamp(40px, 9vw, 60px)/0.95 var(--display); text-transform: uppercase; }
.card p { color: rgba(255, 255, 255, 0.8); margin: 0 0 24px; }

@media (prefers-reduced-motion: reduce) {
  .hero-btn svg { animation: none; }
  .tile img, .hero-logo, .foot-logo img { transition: none; }
}
