/* BOLV Kartenarchiv — Direction C design system */

:root {
  --red:        #a8281e;
  --red-bright: #d23a2c;
  --red-dark:   #771910;
  --red-tint:   #f3d7d2;

  --bg:         #f6f2e8;
  --surface:    #ede7d6;
  --ink:        #1a1612;
  --ink-soft:   #5a534a;
  --ink-mute:   #8a8378;
  --rule:       #dcd4c2;
  --white:      #ffffff;
  --header-fg:  #f6f2e8;

  --mono: 'Roboto Mono', monospace;

  --container: 1200px;

  --r-1: 2px;
  --r-2: 4px;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Work Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ─── Layout ──────────────────────────────────────────────────── */

main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 32px 64px;
}

/* ─── Site header (dark ink chrome) ──────────────────────────── */

.site-header {
  background: var(--ink);
  color: var(--header-fg);
}
.site-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--header-fg);
}
.site-brand:hover { text-decoration: none; color: var(--header-fg); }
.site-brand img {
  height: 36px;
  width: auto;
  display: block;
}
.site-brand-text {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.site-brand-ctx {
  font-weight: 500;
  opacity: 0.6;
}
.site-admin-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--header-fg) 15%, transparent);
  color: color-mix(in oklab, var(--header-fg) 65%, transparent);
  margin-left: 7px;
  vertical-align: middle;
}

.site-nav {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li { float: none; }
.site-nav a {
  color: var(--header-fg);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 0;
  background: transparent;
  display: inline-block;
  transition: color 120ms;
}
.site-nav a:hover {
  color: var(--red-bright);
  background: transparent;
  text-decoration: none;
}
.site-nav a.active {
  color: var(--red-bright);
  font-weight: 600;
}

/* ─── Typography ─────────────────────────────────────────────── */

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
h1 { font-size: 40px; line-height: 1.1; margin-bottom: 24px; }
h2 { font-size: 28px; line-height: 1.2; letter-spacing: -0.015em; font-weight: 700; margin: 32px 0 16px; }
h3 { font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; margin: 24px 0 12px; }
h4 { font-size: 16px; line-height: 1.3; letter-spacing: 0; font-weight: 600; margin: 20px 0 10px; }

p { margin: 0 0 16px; line-height: 1.6; color: var(--ink-soft); }
strong, b { color: var(--ink); font-weight: 600; }

/* Mono kicker label */
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  display: block;
  margin-bottom: 14px;
}

/* Lead paragraph under the kicker on list pages */
.intro {
  max-width: 60ch;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

/* ─── Links ──────────────────────────────────────────────────── */

a {
  color: var(--red);
  text-decoration: none;
  transition: color 120ms;
}
a:hover {
  color: var(--red-dark);
  text-decoration: underline;
}

/* ─── Buttons & form fields ──────────────────────────────────── */

button,
input[type="submit"],
input[type="button"],
.btn {
  background: var(--red);
  color: var(--white);
  border: 1px solid var(--red);
  border-radius: var(--r-2);
  padding: 10px 18px;
  font: 600 14px/1.2 'Work Sans', sans-serif;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
  display: inline-block;
}
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.btn:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
  text-decoration: none;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="search"],
input[type="password"],
input[type="file"],
textarea,
select {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 10px 14px;
  font: 400 14px/1.4 'Work Sans', sans-serif;
  transition: border-color 120ms;
  min-width: 240px;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--ink);
}

/* ─── Search bar above lists ─────────────────────────────────── */

.search-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.search-input-wrap {
  position: relative;
  flex: 0 1 320px;
  min-width: 0;
}
.search-input-wrap input {
  width: 100%;
  padding-right: 32px;
}
/* Hide native WebKit clear button — we render our own for cross-browser parity */
.search-input-wrap input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
  border-radius: var(--r-2);
  display: none;
}
.search-clear:hover {
  color: var(--ink);
  background: var(--surface);
}
.search-bar .hint {
  color: var(--ink-soft);
  font-size: 13px;
  font-style: normal;
}

/* ─── Tables (list view) ─────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  overflow: hidden;
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
}
thead {
  background: var(--ink);
  color: var(--white);
}
thead th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  border: none;
  white-space: nowrap;
}
thead th[data-sort-key] {
  cursor: pointer;
  user-select: none;
}
.sort-ind {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  margin-left: 6px;
  font-size: 10px;
  line-height: 0.9;
  position: relative;
  top: -1px;
}
.sort-ind::before { content: "▲"; opacity: 0.4; }
.sort-ind::after  { content: "▼"; opacity: 0.4; }
thead th[data-sort-key]:not([aria-sort]):hover .sort-ind::before,
thead th[data-sort-key]:not([aria-sort]):hover .sort-ind::after { opacity: 0.7; }
thead th[aria-sort="ascending"]  .sort-ind::before { opacity: 1; }
thead th[aria-sort="ascending"]  .sort-ind::after  { opacity: 0.18; }
thead th[aria-sort="descending"] .sort-ind::before { opacity: 0.18; }
thead th[aria-sort="descending"] .sort-ind::after  { opacity: 1; }
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
  color: var(--ink);
}
tbody tr:last-child td { border-bottom: none; }
tbody td a { color: var(--red); font-weight: 500; }
tbody tr:nth-child(even) { background: var(--surface); }
tbody tr:hover { background: var(--red-tint); }
tbody tr.row-link { cursor: pointer; }
tbody td img {
  vertical-align: middle;
  margin-right: 6px;
}

/* ─── Detail-page metadata table (key/value) ────────────────── */

.meta-table {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  overflow: hidden;
  margin-bottom: 24px;
}
.meta-table thead { display: none; }
.meta-table tbody tr {
  background: transparent !important;
  border-bottom: 1px solid var(--rule);
}
.meta-table tbody tr:last-child { border-bottom: none; }
.meta-table tbody tr:hover { background: transparent !important; }
.meta-table tbody td {
  padding: 14px 18px;
  border-bottom: none;
}
.meta-table tbody td:first-child {
  width: 220px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.meta-table tbody td:last-child {
  font-weight: 500;
  color: var(--ink);
}

/* ─── Cards ──────────────────────────────────────────────────── */

.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 24px;
  margin-bottom: 24px;
}

/* ─── Version chips (detail page) ─────────────────────────── */

.versions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}
.versions li {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 6px 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.versions li.current {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
  font-weight: 500;
}
.versions li a {
  color: inherit;
  text-decoration: none;
  display: block;
  margin: -6px -12px;
  padding: 6px 12px;
}
.versions li:has(a):hover {
  background: var(--red-tint);
  border-color: var(--red);
}

/* ─── Iframes (map embeds) ───────────────────────────────────── */

iframe {
  display: block;
  border: 0;
  width: 100%;
  border-radius: var(--r-2);
  background: var(--surface);
}
.detail-map iframe {
  height: 50vh;
  margin-bottom: 24px;
}

/* ─── Elevation-map hero (detail.php / admin/edit.php) ───────── */

.elevation-hero {
  background-color: var(--ink);
  background-image: -webkit-image-set(var(--elev-1x) 1x, var(--elev-2x) 2x);
  background-image: image-set(var(--elev-1x) 1x, var(--elev-2x) 2x);
  background-size: cover;
  background-position: center;
  color: var(--white);
}
.elevation-hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 32px 48px;
}
.elevation-hero .kicker      { color: rgba(255,255,255,0.72); }
.elevation-hero h1           { color: var(--white); }
.elevation-hero .versions a  { color: var(--white); }
.elevation-hero .versions a:hover { color: var(--red-bright); }
.elevation-hero .versions .current { color: rgba(255,255,255,0.72); }
.elevation-hero .detail-map { transition: opacity 0.25s ease; }
.elevation-hero .detail-map iframe { border: 1px solid rgba(255,255,255,0.18); margin-bottom: 0; }
.elevation-hero.is-revealed .detail-map {
  opacity: 0.1;
  pointer-events: none;
}

.elevation-reveal-row {
  margin-top: 12px;
  text-align: right;
}
.elevation-reveal-toggle {
  background: transparent;
  border: 0;
  color: var(--white);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 0;
}
.elevation-reveal-toggle:hover {
  background: transparent;
  text-decoration: underline;
}
.elevation-reveal-toggle .elevation-reveal-hide { display: none; }
.elevation-hero.is-revealed .elevation-reveal-toggle .elevation-reveal-show { display: none; }
.elevation-hero.is-revealed .elevation-reveal-toggle .elevation-reveal-hide { display: inline; }

/* Full-bleed map page — let the iframe fill available space below the header */
body.map-page {
  overflow: hidden;
}
body.map-page .map-fill {
  width: 100%;
  height: calc(100vh - 110px); /* leaves room for utility bar + nav */
}
body.map-page .map-fill iframe {
  height: 100%;
  border-radius: 0;
}

/* ─── Forms (admin) ──────────────────────────────────────────── */

.form-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px 16px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 24px 28px;
  margin-bottom: 24px;
  max-width: 760px;
}
.form-grid label,
.form-grid .label {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid input[type="file"] {
  width: 100%;
  min-width: 0;
}
.form-grid .hint {
  grid-column: 2;
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
  margin-top: -4px;
  margin-bottom: 4px;
}
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* ─── admin/edit.php layout — form + JPG preview side-by-side ─ */

.edit-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.edit-layout .form-grid {
  flex: 0 1 760px;
  margin-bottom: 0;
}
.jpg-preview {
  flex: 1 1 0;
  min-width: 240px;
}
.jpg-preview a {
  display: block;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
}
.jpg-preview a img {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 200ms;
}
.jpg-preview a::after {
  content: "In neuem Tab öffnen ↗";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 22, 18, 0.65);
  color: var(--white);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 200ms;
}
.jpg-preview a:hover::after { opacity: 1; }
.jpg-preview a:hover img    { filter: brightness(0.7); }
.jpg-placeholder {
  border: 1px dashed var(--rule);
  border-radius: var(--r-2);
  padding: 40px 16px;
  text-align: center;
  color: var(--ink-mute);
  font-style: italic;
  font-size: 13px;
}
.jpg-preview .hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
}

/* ─── Coordinate picker (admin forms) ───────────────────────── */

.coord-picker {
  grid-column: 1 / -1;
  margin-top: 8px;
}
.coord-picker .hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
}

.coord-search {
  position: relative;
  margin-bottom: 10px;
}
.coord-search input {
  width: 100%;
  padding-left: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235a534a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
  background-repeat: no-repeat;
  background-position: 10px center;
}
#coord-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-height: 280px;
  overflow-y: auto;
  z-index: 500;
}
#coord-search-results li {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
#coord-search-results li:hover {
  background: var(--surface);
  color: var(--red);
}

#coord-picker-map {
  height: 460px;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  background: var(--surface);
  overflow: hidden;
}
#coord-picker-map .ol-attribution { font-size: 11px; }

/* ─── Info page (legend + club links) ───────────────────────── */

.legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  color: var(--ink);
}
.legend-row img {
  width: 24px;
  height: 24px;
  display: block;
}

.club-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* Edge-to-edge rows: zero the card's own padding so the row hover
   highlight spans the full width and there's no whitespace above/below
   the first/last item. overflow: hidden clips highlights to the
   rounded corners. */
.card.club-links {
  padding: 0;
  overflow: hidden;
}
.club-links a {
  display: block;
  padding: 12px 24px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-weight: 500;
  transition: color 120ms, background 120ms;
}
.club-links a:hover,
.club-links a.is-highlighted {
  color: var(--red);
  background: var(--red-tint);
  text-decoration: none;
}
.club-links a:last-child { border-bottom: none; }
.club-links a .assoc {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.club-links a:hover .assoc,
.club-links a.is-highlighted .assoc { color: var(--red); }

/* ─── Clubs layout (Info page) — list + map ──────────────────── */

.clubs-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.clubs-layout .card.club-links {
  flex: 1 1 250px;
  min-width: 0;
}
.map-widget {
  flex: 0 1 500px;
  position: relative;
  align-self: flex-start;
}
/* Radius on the img (not the widget) so circle tooltips that pop above
   the top edge aren't clipped. */
.map-widget img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-2);
  border: 1px solid var(--rule);
}

.club-circle {
  position: absolute;
  border-radius: 50%;
  aspect-ratio: 1;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, transform 120ms;
  border: 1.5px solid transparent;
  box-sizing: border-box;
}
.club-circle.bolv {
  background: rgba(168, 40, 30, 0.30);
  border-color: rgba(168, 40, 30, 0.6);
}
.club-circle.skolv {
  background: rgba(46, 42, 36, 0.30);
  border-color: rgba(46, 42, 36, 0.6);
}
.club-circle:hover,
.club-circle.is-highlighted {
  background: rgba(168, 40, 30, 0.55);
  border-color: var(--red);
}
.club-circle.skolv:hover,
.club-circle.skolv.is-highlighted {
  background: rgba(46, 42, 36, 0.55);
  border-color: var(--ink);
}

.club-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--white);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border-radius: var(--r-2);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms;
  z-index: 2;
}
.club-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--ink);
}
.club-circle:hover .club-tooltip {
  opacity: 1;
}

/* ─── Footer ─────────────────────────────────────────────────── */

.site-footer {
  background: var(--ink);
  color: #b8af9a;
  margin-top: 64px;
  padding: 44px 40px 32px;
  border-top: 1px solid #2a241c;
  display: grid;
  gap: 36px;
}
.site-footer-top {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 56px;
  align-items: start;
}
.site-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.site-footer-logo {
  width: 110px;
  height: auto;
  display: block;
}
.site-footer-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #968d7d;
  line-height: 1.6;
  max-width: 260px;
}
.site-footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 48px;
  justify-content: end;
}
.site-footer-col h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #968d7d;
  margin: 0 0 12px;
  font-weight: 600;
}
.site-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.site-footer-col a {
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
  color: #ece5d2;
  text-decoration: none;
  line-height: 1.4;
  font-weight: 500;
}
.site-footer-col a:hover { color: var(--red); }
.site-footer-bot {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding-top: 22px;
  border-top: 1px solid #2a241c;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #968d7d;
}
.site-footer-bot a { color: #b8af9a; text-decoration: none; }
.site-footer-bot a:hover { color: var(--red); }
.site-footer-bot .right { display: flex; gap: 18px; flex-wrap: wrap; }

/* ─── Back-to-top button (list pages) ───────────────────────── */
.totop {
  position: fixed;
  right: 32px;
  bottom: 32px;
  width: 50px;
  height: 50px;
  padding: 0;
  background: var(--ink);
  color: var(--header-fg);
  border: none;
  border-radius: 0;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  transform: translateX(120px);
  transition: transform 0.4s ease, opacity 0.4s ease, background 120ms;
  pointer-events: none;
}
.totop.is-visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.totop:hover { background: var(--red); }
.totop:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.totop svg { width: 22px; height: 22px; display: block; }

/* ─── Bootstrap popover overrides (map page) ────────────────── */
.popover { min-width: 300px; }

/* ─── Mobile (≤ 720px) ───────────────────────────────────────── */

@media (max-width: 720px) {
  html, body { overflow-x: hidden; }

  main {
    padding: 24px 16px 40px;
  }

  .elevation-hero-inner {
    padding: 24px 16px 32px;
  }

  /* Site header — stack brand over nav */
  .site-header-inner {
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .site-brand img { height: 28px; }
  .site-brand-text { font-size: 16px; }
  .site-nav {
    gap: 20px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .site-nav a { font-size: 13px; }

  /* Typography scale-down */
  h1 { font-size: 28px; line-height: 1.15; margin-bottom: 18px; }
  h2 { font-size: 22px; margin-top: 24px; }
  h3 { font-size: 18px; margin-top: 20px; }

  /* Search bar */
  .search-bar { gap: 8px; }
  .search-bar input { flex: 1 1 100%; min-width: 0; }
  .search-bar .hint { display: none; }

  /* Tighter back-to-top placement on phones */
  .totop { right: 16px; bottom: 16px; width: 44px; height: 44px; }
  .totop svg { width: 18px; height: 18px; }

  /* Public list table → card-per-row layout
     Admin list (rows without .row-link) keeps a scrollable table. */
  table { font-size: 13px; }
  table:has(tr.row-link) {
    display: block;
    border: none;
    background: transparent;
  }
  table:has(tr.row-link) thead { display: none; }
  table:has(tr.row-link) tbody { display: block; }
  tr.row-link {
    display: block;
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--r-2);
    padding: 14px 16px;
    margin-bottom: 8px;
    line-height: 1.4;
  }
  tr.row-link:nth-child(even) { background: var(--white); }
  tr.row-link:hover { background: var(--red-tint); }
  tr.row-link td {
    display: block;
    padding: 0;
    border: none;
  }
  /* SOLV-Nr → small mono kicker, prefixed via ::before */
  tr.row-link td:nth-child(1) {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 4px;
  }
  tr.row-link td:nth-child(1)::before { content: 'SOLV-Nr '; }
  /* Name → bold heading */
  tr.row-link td:nth-child(2) {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink);
  }
  tr.row-link td:nth-child(2) a { color: var(--ink); }
  tr.row-link td:nth-child(2) a:hover { color: var(--red); }
  /* Jahr / Verein / Typ → inline meta line */
  tr.row-link td:nth-child(3),
  tr.row-link td:nth-child(4),
  tr.row-link td:nth-child(5) {
    display: inline;
    font-size: 13px;
    color: var(--ink-soft);
  }
  tr.row-link td:nth-child(3)::after,
  tr.row-link td:nth-child(4)::after {
    content: ' · ';
    color: var(--ink-mute);
  }
  tr.row-link td:nth-child(5) img {
    height: 14px;
    width: auto;
    vertical-align: -2px;
    margin-right: 2px;
  }

  /* Long unbreakable names should wrap inside their card */
  tr.row-link td:nth-child(2) {
    overflow-wrap: anywhere;
  }

  /* Detail metadata table → stack label above value */
  .meta-table tbody tr {
    display: block;
    padding: 12px 16px;
  }
  .meta-table tbody td {
    display: block;
    width: auto !important;
    padding: 0 !important;
  }
  .meta-table tbody td:first-child {
    margin-bottom: 4px;
  }

  /* Map iframe in detail page — keep contained */
  .detail-map iframe { height: 40vh; }

  /* Map full-page — recompute height for taller mobile header */
  body.map-page .map-fill { height: calc(100vh - 150px); }

  /* Form grid → single column */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 8px 0;
    padding: 16px;
  }
  .form-grid .label { margin-top: 8px; }
  .form-grid .hint { grid-column: 1; }
  .form-grid .form-actions { flex-wrap: wrap; }

  /* Footer — stack */
  .site-footer { margin-top: 40px; padding: 32px 16px 24px; gap: 24px; }
  .site-footer-top {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .site-footer-nav { grid-template-columns: 1fr 1fr; justify-content: start; gap: 20px 24px; }
  .site-footer-bot {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Info page legend rows — keep readable */
  .legend-row { gap: 10px; }
  .card { padding: 18px; }

  /* Hide the bern.jpg map widget on mobile — list only */
  .clubs-layout { display: block; }
  .map-widget { display: none; }

  /* admin/edit.php — stack form and JPG preview */
  .edit-layout { display: block; }
  .jpg-preview { margin-top: 24px; }
}
