/* ==========================================================================
   FAHRSCHULPORTAL: DIE SEITE EINER FAHRSCHULE (/fahrschule/<adresse>)
   ==========================================================================

   After /styles.css, /brand.css, /landing.css and /legal.css — the frame,
   the hero light and the crumbs are the text pages'. This file is the page
   of one school (src/lib/school-page-render.js):

     .sp-hero     logo, name, the one line, stars, the sign-up button —
                  over the school's photo when it has one, otherwise over
                  the ruled paper of the other pages;
     .sp-layout   the long column (Über uns, Klassen, Preise, Bewertungen)
                  and beside it the facts a visitor looks for first
                  (Anmelden, Kontakt, Bürozeiten), which stay in view.

   No accent: the school's dashboard colour stays in the dashboard. Stars
   are white on black like everything else (amber means "geplant" here).
   Prefix `sp-` (school page).
   ========================================================================== */

[data-i="eye"] { --m: url("/app/vendor/lucide/eye.svg"); }
[data-i="star"] { --m: url("/app/vendor/lucide/star.svg"); }
[data-i="reply"] { --m: url("/app/vendor/lucide/reply.svg"); }
[data-i="message-square-quote"] { --m: url("/app/vendor/lucide/message-square-quote.svg"); }
[data-i="user-round"] { --m: url("/app/vendor/lucide/user-round.svg"); }
[data-i="globe"] { --m: url("/app/vendor/lucide/globe.svg"); }
[data-i="info"] { --m: url("/app/vendor/lucide/info.svg"); }
[data-i="map-pin"] { --m: url("/app/vendor/lucide/map-pin.svg"); }

.sp-hero, .sp-tabs, .sp-layout { --sp-side: 340px; --sp-max: 1120px; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.sp-hero { position: relative; padding: 56px 0 36px; }
.sp-hero-in { position: relative; width: min(100% - var(--ln-gut) * 2, var(--sp-max)); margin: 0 auto; }
.js .sp-hero-in > * { animation: ln-enter 800ms var(--ease-out) both; }
.js .sp-hero-in > :nth-child(2) { animation-delay: 50ms; }
.js .sp-hero-in > :nth-child(3) { animation-delay: 100ms; }
.js .sp-hero-in > :nth-child(4) { animation-delay: 150ms; }
.js .sp-hero-in > :nth-child(5) { animation-delay: 200ms; }
.js .sp-hero-in > :nth-child(6) { animation-delay: 250ms; }

/* The photo: behind the hero, darkened towards the text and fading into the
   page — light added on black, never a lifted surface. */
.sp-cover { position: absolute; inset: calc(var(--ln-header) * -1) 0 -40px; overflow: hidden; pointer-events: none; }
.sp-cover img { width: 100%; height: 100%; object-fit: cover; opacity: .42; filter: saturate(.85); }
.sp-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--canvas) 0%, rgb(10 11 13 / .78) 42%, rgb(10 11 13 / .35) 100%),
    linear-gradient(0deg, var(--canvas) 0%, transparent 55%);
}
.sp-hero.has-cover { padding-top: 96px; padding-bottom: 56px; }

.sp-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-muted);
  font-size: var(--t-md);
}
.sp-preview .ln-i { --ln-i: 16px; color: var(--ink); }
.sp-preview strong { color: var(--ink); font-weight: var(--w-semi); }
.sp-preview a { margin-left: auto; color: var(--ink); font-weight: var(--w-medium); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

.sp-id { display: flex; align-items: center; gap: 20px; }
.sp-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  font-size: 26px;
  font-weight: var(--w-semi);
  letter-spacing: -0.02em;
}
.sp-logo img { width: 100%; height: 100%; padding: 10px; object-fit: contain; }
.sp-id-text { min-width: 0; }
.sp-kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--ln-slate); font-size: var(--t-md); font-weight: var(--w-medium); }
.sp-kicker .ln-i { --ln-i: 15px; }
.sp-id .pg-title { overflow-wrap: anywhere; }
.sp-lead { max-width: 62ch; margin-top: 20px; }

.sp-hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.sp-fact {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(var(--ln-tint) / 0.02);
  color: var(--ink-muted);
  font-size: var(--t-md);
  transition: border-color var(--d-fast) ease, color var(--d-fast) ease;
}
.sp-fact strong { color: var(--ink); font-weight: var(--w-semi); }
.sp-fact .ln-i { --ln-i: 15px; }
.sp-fact.is-quiet { color: var(--ink-faint); }
@media (hover: hover) and (pointer: fine) { a.sp-fact:hover { border-color: var(--line-strong); color: var(--ink); } }

.sp-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.sp-hero-actions:empty { display: none; }

/* ── Stars ────────────────────────────────────────────────────────────── */
.sp-stars { --s: 16px; position: relative; display: inline-block; flex: none; width: calc(var(--s) * 5 + 4px); height: var(--s); line-height: 0; }
.sp-stars.is-sm { --s: 14px; }
.sp-stars.is-lg { --s: 22px; }
.sp-stars-row { position: absolute; inset: 0 auto 0 0; display: flex; gap: 1px; overflow: hidden; white-space: nowrap; color: var(--line-strong); }
.sp-stars-row.is-on { color: var(--ink); }
.sp-stars svg { flex: none; width: var(--s); height: var(--s); fill: currentColor; }

/* ── The in-page tabs ─────────────────────────────────────────────────── */
.sp-tabs { position: sticky; top: var(--ln-header); z-index: 20; border-block: 1px solid var(--line); background: var(--canvas); }
.sp-tabs-in { display: flex; gap: 2px; width: min(100% - var(--ln-gut) * 2, var(--sp-max)); margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.sp-tabs-in::-webkit-scrollbar { display: none; }
.sp-tabs a { display: inline-flex; flex: none; align-items: center; gap: 7px; height: 46px; padding: 0 12px; color: var(--ink-muted); font-size: var(--t-md); font-weight: var(--w-medium); transition: color var(--d-fast) ease; }
.sp-tabs a span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgb(var(--ln-tint) / 0.08); color: var(--ink); font-size: var(--t-xs); }
@media (hover: hover) and (pointer: fine) { .sp-tabs a:hover { color: var(--ink); } }

/* ── Layout ───────────────────────────────────────────────────────────── */
.sp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sp-side);
  gap: 56px;
  width: min(100% - var(--ln-gut) * 2, var(--sp-max));
  margin: 48px auto 0;
  padding-bottom: 0; /* the footer's margin (.sf, landing.css) is the space below, as on every public page */
}
.sp-main { display: grid; gap: 64px; min-width: 0; align-content: start; }
.sp-sec { scroll-margin-top: calc(var(--ln-header) + 64px); }
.sp-sec > h2 { margin-bottom: 20px; color: var(--ink); font-size: clamp(22px, 2.2vw, 28px); font-weight: var(--w-semi); line-height: 1.2; letter-spacing: -0.03em; }

.sp-prose { color: var(--ink-muted); font-size: 16px; line-height: 1.7; }
.sp-prose p { margin: 0 0 14px; }
.sp-prose p:last-child { margin-bottom: 0; }

.sp-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.sp-highlights li { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font-size: var(--t-md); line-height: 1.45; }
.sp-highlights .ln-i { --ln-i: 17px; margin-top: 1px; color: var(--ink-muted); }

/* ── Classes ──────────────────────────────────────────────────────────── */
.sp-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.sp-classes li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.sp-class-key { display: grid; place-items: center; flex: none; min-width: 54px; height: 36px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); font: 600 14px/1 var(--font-mono); }
.sp-class-text { display: grid; gap: 2px; min-width: 0; }
.sp-class-text strong { color: var(--ink); font-size: var(--t-md); font-weight: var(--w-medium); line-height: 1.35; }
.sp-class-text small { color: var(--ink-faint); font-size: var(--t-sm); }

/* ── Prices ───────────────────────────────────────────────────────────── */
.sp-prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sp-price-group { padding: 18px 20px 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.sp-price-group h3 { margin-bottom: 6px; color: var(--ink-faint); font-size: var(--t-sm); font-weight: var(--w-semi); letter-spacing: .04em; text-transform: uppercase; }
.sp-price-group table { width: 100%; border-collapse: collapse; }
.sp-price-group th, .sp-price-group td { padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--t-md); text-align: left; vertical-align: baseline; }
.sp-price-group tr:last-child th, .sp-price-group tr:last-child td { border-bottom: 0; }
.sp-price-group th { color: var(--ink); font-weight: var(--w-normal); }
.sp-price-group th small { margin-left: 8px; color: var(--ink-faint); font-size: var(--t-sm); }
.sp-price-group td { color: var(--ink); font-family: var(--font-mono); font-weight: var(--w-medium); text-align: right; white-space: nowrap; }

.sp-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; color: var(--ink-faint); font-size: var(--t-base); line-height: 1.55; }
.sp-note .ln-i { --ln-i: 14px; margin-top: 3px; }

/* ── Reviews ──────────────────────────────────────────────────────────── */
.sp-score { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 40px; padding: 24px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.sp-score-main { display: grid; justify-items: start; gap: 8px; }
.sp-score-main strong { color: var(--ink); font-size: 56px; font-weight: var(--w-semi); line-height: .9; letter-spacing: -0.05em; }
.sp-score-main > span:last-child { color: var(--ink-faint); font-size: var(--t-md); }
.sp-bars { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.sp-bars li { display: grid; grid-template-columns: 12px minmax(0, 1fr) 28px; align-items: center; gap: 10px; color: var(--ink-faint); font: 500 var(--t-sm)/1 var(--font-mono); }
.sp-bar { position: relative; height: 6px; overflow: hidden; border-radius: 3px; background: rgb(var(--ln-tint) / 0.07); }
.sp-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--ink); }
.sp-bar-n { text-align: right; }

.sp-reviews { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.sp-review { padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.sp-review-head { display: flex; align-items: center; gap: 12px; }
.sp-avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: rgb(var(--ln-tint) / 0.08); color: var(--ink); font-size: var(--t-md); font-weight: var(--w-semi); }
.sp-avatar .ln-i { --ln-i: 16px; color: var(--ink-muted); }
.sp-review-who { display: grid; gap: 2px; min-width: 0; margin-right: auto; }
.sp-review-who strong { color: var(--ink); font-size: var(--t-md); font-weight: var(--w-semi); }
.sp-review-who span { color: var(--ink-faint); font-size: var(--t-sm); }
.sp-review-text { margin-top: 14px; color: var(--ink-muted); font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.sp-review-text p { margin: 0 0 10px; }
.sp-review-text p:last-child { margin: 0; }
.sp-reply { margin-top: 16px; padding: 14px 16px; border-left: 2px solid var(--line-strong); border-radius: 0 12px 12px 0; background: rgb(var(--ln-tint) / 0.03); color: var(--ink-muted); font-size: var(--t-md); line-height: 1.6; }
.sp-reply p { margin: 0 0 8px; }
.sp-reply p:last-child { margin: 0; }
.sp-reply-h { display: flex; align-items: center; gap: 7px; color: var(--ink); font-weight: var(--w-semi); }
.sp-reply-h .ln-i { --ln-i: 14px; }

.sp-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 16px; color: var(--ink-faint); font-size: var(--t-base); }
.sp-pager > :last-child { justify-self: end; }

.sp-empty { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px; border: 1px dashed var(--line-strong); border-radius: 16px; color: var(--ink-muted); font-size: var(--t-md); line-height: 1.6; }
.sp-empty .ln-i { --ln-i: 22px; flex: none; color: var(--ink); }
.sp-empty strong { color: var(--ink); }

.sp-own { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink-muted); font-size: var(--t-md); }
.sp-own strong { color: var(--ink); }

.sp-disclosure { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; color: var(--ink-faint); font-size: var(--t-base); line-height: 1.6; }
.sp-disclosure .ln-i { --ln-i: 15px; flex: none; margin-top: 3px; }
.sp-disclosure strong { color: var(--ink-muted); font-weight: var(--w-semi); }

/* ── Side ─────────────────────────────────────────────────────────────── */
.sp-side { position: sticky; top: calc(var(--ln-header) + 70px); align-self: start; display: grid; gap: 12px; }
.sp-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); scroll-margin-top: calc(var(--ln-header) + 64px); }
.sp-card h2 { margin-bottom: 14px; color: var(--ink); font-size: 16px; font-weight: var(--w-semi); letter-spacing: -0.01em; }
.sp-card p { color: var(--ink-muted); font-size: var(--t-md); line-height: 1.55; }
.sp-card.is-quiet { background: transparent; }
.sp-card-cta { border-color: var(--line-strong); background: linear-gradient(180deg, rgb(var(--ln-tint) / 0.05), transparent 70%), var(--surface); }
.sp-card-cta .btn { width: 100%; margin-top: 16px; justify-content: center; }
.sp-card-note { margin-top: 10px; color: var(--ink-faint) !important; font-size: var(--t-base) !important; }

.sp-contact { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.sp-contact li { display: flex; align-items: flex-start; gap: 11px; color: var(--ink); font-size: var(--t-md); line-height: 1.5; overflow-wrap: anywhere; }
.sp-contact .ln-i { --ln-i: 16px; flex: none; margin-top: 2px; color: var(--ink-faint); }
.sp-contact address { font-style: normal; }
.sp-contact a:not(.sp-link) { color: var(--ink); transition: color var(--d-fast) ease; }
.sp-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--ink-muted); font-size: var(--t-base); font-weight: var(--w-medium); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.sp-card > .sp-link { margin-top: 12px; }
.sp-link .ln-i { --ln-i: 14px; }

.sp-hours { display: grid; gap: 0; margin: 0; }
.sp-hours > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--t-md); }
.sp-hours > div:last-child { border-bottom: 0; }
.sp-hours dt { color: var(--ink-muted); }
.sp-hours dd { margin: 0; color: var(--ink); font-family: var(--font-mono); font-size: var(--t-base); text-align: right; }

/* ── Narrow ───────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .sp-layout { grid-template-columns: minmax(0, 1fr); gap: 48px; max-width: 720px; }
  .sp-side { position: static; grid-row: 1; }
  .sp-card.is-quiet { display: none; }
  .sp-tabs-in, .sp-hero-in { max-width: 720px; }
}
@media (max-width: 640px) {
  .sp-hero { padding-top: 32px; }
  .sp-hero.has-cover { padding-top: 56px; }
  .sp-id { align-items: flex-start; gap: 14px; }
  .sp-logo { width: 60px; height: 60px; border-radius: 15px; font-size: 20px; }
  .sp-hero-actions .btn { flex: 1 1 100%; justify-content: center; }
  .sp-highlights, .sp-prices { grid-template-columns: minmax(0, 1fr); }
  .sp-score { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px; }
  .sp-review { padding: 16px; }
  .sp-review-head { flex-wrap: wrap; }
  /* The name fills the first line, so the stars wrap below it at their own width:
     a full-width box would stretch the lit row's % width and light all five. */
  .sp-review-head .sp-review-who { flex: 1 1 calc(100% - 48px); }
  .sp-review-head .sp-stars { order: 3; margin-left: 48px; }
  .sp-preview a { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .js .sp-hero-in > * { animation: none; }
}
