/* ==========================================================================
   FAHRSCHUL-KARTE — one school, in the directory (/fahrschulen) and as the
   sample on the landing page (#verzeichnis). Black surface, white stars
   (amber means "geplant" on these pages), slate place line. Prefix `sd-`.
   ========================================================================== */
:root { --sd-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.9 6.1 6.7.8-4.9 4.6 1.3 6.6L12 17.4l-5.9 3.3 1.3-6.6-4.9-4.6 6.7-.8z'/%3E%3C/svg%3E"); }

.sd-card { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: start; height: 100%; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left; transition: border-color var(--d-base) ease, transform var(--d-slow) var(--ease-out); }
.sd-logo { display: grid; place-items: center; width: 56px; height: 56px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-sunken); color: var(--ink-muted); font-size: 17px; font-weight: var(--w-semi); }
.sd-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sd-place { display: flex; align-items: center; gap: 6px; min-height: 18px; padding-right: 26px; color: var(--ln-slate); font-size: var(--t-sm); }
.sd-place > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-place .ln-i { --ln-i: 13px; }
.sd-dist:not(:empty)::before { content: "·"; margin-right: 6px; }
.sd-dist { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.sd-name { margin-top: 4px; padding-right: 20px; font-size: 17px; font-weight: var(--w-semi); line-height: 1.3; letter-spacing: -0.015em; }
.sd-name a { color: var(--ink); }
.sd-name a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; } /* the whole card is the link */
.sd-name a:focus-visible { outline: none; } /* the card draws the ring (below) */
.sd-tagline { display: -webkit-box; margin-top: 6px; overflow: hidden; color: var(--ink-muted); font-size: var(--t-md); line-height: 1.5; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sd-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.sd-rating { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); font-size: var(--t-sm); }
.sd-rating strong { color: var(--ink); font-weight: var(--w-semi); font-variant-numeric: tabular-nums; }
.sd-rating.is-quiet { color: var(--ink-faint); }
.sd-stars { --s: 14px; position: relative; display: inline-block; width: calc(var(--s) * 5); height: var(--s); background: var(--line-strong); -webkit-mask: var(--sd-star) 0 0 / var(--s) var(--s) repeat-x; mask: var(--sd-star) 0 0 / var(--s) var(--s) repeat-x; }
.sd-stars::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--r, 0) / 5 * 100%); background: var(--ink); }
.sd-classes { display: flex; flex: 1 0 100%; flex-wrap: wrap; gap: 3px; margin: 0; padding: 0; list-style: none; } /* always its own line: every card has the same rhythm */
.sd-classes li { padding: 3px 5px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink-muted); font: 600 11px/1 var(--font-mono); transition: border-color var(--d-fast) ease, color var(--d-fast) ease; }
.sd-classes li.is-match { border-color: var(--ink); color: var(--ink); }
/* Top right, like the help centre's cards (.hc-card-go): the facts below get the full width. */
.sd-go { --ln-i: 17px; position: absolute; top: 19px; right: 18px; color: var(--ink-faint); transition: transform var(--d-slow) var(--ease-out), color var(--d-fast) ease; }
.sd-card:has(a:focus-visible) { outline: 2px solid var(--line-focus); outline-offset: 2px; }
.sd-card:has(a:focus-visible) .sd-go { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .sd-card:has(.sd-name a):hover { border-color: var(--line-strong); }
  .sd-card:has(.sd-name a):hover .sd-go { color: var(--ink); }
}
/* Movement only for those who want it. (A reduced-motion `.sd-card:hover {
   transform: none }` would lose to the :has() selectors, so the moves are
   gated on the preference instead of being taken back afterwards.) */
@media (prefers-reduced-motion: no-preference) {
  .sd-card:has(a:active) { transform: scale(.99); transition-duration: 120ms; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .sd-card:has(.sd-name a):hover { transform: translateY(-2px); }
  .sd-card:has(.sd-name a):hover .sd-go { transform: translateX(3px); }
}
@media (max-width: 640px) {
  .sd-card { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .sd-go { top: 17px; right: 16px; }
  .sd-logo { width: 48px; height: 48px; border-radius: 12px; }
  .sd-tagline { display: none; }
}
