/* Train shops and repair (SPEC 82). Linked only by the shop pages (ShopPages::CSS), after clubs.css, whose look they share (cards, lists, chips,
   the dark and light tokens). Every class here starts sp-. Colours are the site's own tokens only (app.css and clubs.css), so dark and light both
   follow the site. A picture slot with no file yet is a calm gradient keyed to the picture's family (sp-fam-0 to sp-fam-7), so a page looks
   designed before any art exists and the art swaps in by itself once the files are there. */

/* ---------- the gradients a missing picture falls back to ---------- */
.sp-fam-0 { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 34%, var(--kc-soft)), var(--kc-card) 70%); }
.sp-fam-1 { background: linear-gradient(135deg, color-mix(in srgb, var(--ok) 30%, var(--kc-soft)), var(--kc-card) 70%); }
.sp-fam-2 { background: linear-gradient(135deg, color-mix(in srgb, var(--warn) 34%, var(--kc-soft)), var(--kc-card) 70%); }
.sp-fam-3 { background: linear-gradient(135deg, color-mix(in srgb, var(--ctl) 38%, var(--kc-soft)), var(--kc-card) 70%); }
.sp-fam-4 { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 26%, var(--kc-card)), color-mix(in srgb, var(--ok) 22%, var(--kc-soft))); }
.sp-fam-5 { background: linear-gradient(160deg, color-mix(in srgb, var(--bad) 24%, var(--kc-card)), color-mix(in srgb, var(--warn) 24%, var(--kc-soft))); }
.sp-fam-6 { background: linear-gradient(200deg, color-mix(in srgb, var(--ok) 26%, var(--kc-card)), color-mix(in srgb, var(--ctl) 28%, var(--kc-soft))); }
.sp-fam-7 { background: linear-gradient(200deg, color-mix(in srgb, var(--warn) 28%, var(--kc-card)), color-mix(in srgb, var(--accent) 18%, var(--kc-soft))); }

/* ---------- the hero: large, with the one big search box ---------- */
.sp-hero { position: relative; overflow: hidden; border-radius: calc(var(--radius) * 1.6); border: 1px solid var(--kc-edge); margin: 0 0 1.1rem; padding: clamp(1.25rem, 4vw, 2.75rem) clamp(.9rem, 3vw, 2rem); min-height: 15rem; display: grid; align-items: center; box-shadow: var(--kc-shadow); }
/* a header picture: under a wash of the page's own card colour that is strongest on the left, where the words are, so the heading and the search box read in dark and in light */
.sp-hero-pic { position: absolute; inset: 0; z-index: 0; display: block; }
.sp-hero-pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.sp-hero-art::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--kc-card) 95%, transparent) 0%, color-mix(in srgb, var(--kc-card) 86%, transparent) 42%, color-mix(in srgb, var(--kc-card) 36%, transparent) 78%, color-mix(in srgb, var(--kc-card) 8%, transparent) 100%); }
.sp-hero-art::after { display: none; }
.sp-hero-art .sp-hero-panel { z-index: 2; }
.sp-hero::after { content: ""; position: absolute; right: -4rem; bottom: -5rem; width: 22rem; height: 22rem; border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, transparent); pointer-events: none; }
.sp-hero-panel { position: relative; z-index: 1; max-width: 42rem; width: 100%; }
.sp-hero .kc-k { color: var(--accent); }
.sp-hero h1 { margin: 0; font-size: clamp(1.7rem, 5vw, 2.7rem); line-height: 1.12; color: var(--kc-head); overflow-wrap: anywhere; }
.sp-hero .kc-lead { margin: .55rem 0 0; font-size: clamp(1rem, 2.4vw, 1.15rem); max-width: 34rem; }

/* the search form: the box on a row of its own, then how far, Find and Near me */
.sp-search { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .55rem; margin: 1.15rem 0 0; }
.sp-search #sp-q { grid-column: 1 / -1; min-height: 52px; font-size: 1.08rem; padding: 0 1rem; border-radius: 12px; }
.sp-search select { min-height: 44px; border-radius: 10px; min-width: 0; }
.sp-search .btn { min-height: 44px; }
.sp-search .kc-geo { display: inline-flex; align-items: center; gap: .4rem; }
.sp-hero .kc-near-hint { margin: .5rem 0 0; font-size: .85rem; color: var(--muted); }

/* ---------- the tab bar: plain links, one active ---------- */
.sp-tabs { margin: 0 0 1.3rem; border-bottom: 1px solid var(--kc-edge); }
.sp-tabs ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.sp-tab { display: inline-flex; align-items: center; min-height: 46px; padding: 0 1rem; white-space: nowrap; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 8px 8px 0 0; }
.sp-tab:hover, .sp-tab:focus-visible { color: var(--text); background: var(--kc-soft); }
.sp-tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); background: var(--kc-card); }

.sp-sec { margin: 0 0 1.4rem; }
.sp-chips { margin: 0 0 1.2rem; }

/* ---------- browse by country ---------- */
.sp-countries { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: .7rem; }
.sp-country { display: flex; align-items: center; gap: .75rem; min-height: 64px; padding: .7rem 1rem; border-radius: var(--radius); background: var(--kc-card); border: 1px solid var(--kc-edge); color: var(--text); text-decoration: none; box-shadow: var(--kc-shadow); }
.sp-country:hover, .sp-country:focus-visible { border-color: var(--accent); }
.sp-country-name { font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sp-country .kc-n { color: var(--muted); font-size: .88rem; white-space: nowrap; }

/* ---------- a list of shops: the square picture, the words ---------- */
.sp-list { gap: .75rem; }
/* A shop row is a card with its picture flush to the edge (Jamie 2026-11-15: "out to the edge"). Wide lists: the picture fills the left
   side top to bottom, 18 to 20rem wide, and its 16:9 shape sets the row's height; the words are held to that height (one name line, one
   place line, two lines about the shop, one line of pills that fades out at the end), so the picture is never stretched or cropped into its
   lettering. Narrow lists (a phone, or a side column on a wide screen: a container query, so the list's own width decides) stack the
   picture full width over the words, where the name on it reads largest. Same drawn files: the 750-wide phone picture is the sharp copy. */
.sp-list { container-type: inline-size; }
.sp-row { grid-template-columns: clamp(18rem, 32%, 20rem) minmax(0, 1fr); gap: 0; padding: 0; align-items: center; overflow: hidden; }
.sp-row .kc-thumb { border-radius: 0; height: 100%; align-self: stretch; }
.sp-row .kc-row-text { padding: .75rem 1.15rem; }
.sp-row .kc-name { display: block; margin-right: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-row .kc-where { margin: .1rem 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-row .sp-line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.sp-row .sp-pills { flex-wrap: nowrap; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
.sp-row .sp-pills > * { flex: none; }
@container (max-width: 40rem) {
  .sp-row { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .sp-row .kc-thumb { height: auto; }
  .sp-row .kc-row-text { padding: .7rem .9rem .85rem; }
  .sp-row .kc-name { white-space: normal; }
  .sp-row .sp-line { -webkit-line-clamp: 3; line-clamp: 3; }
  .sp-row .sp-pills { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; }
}
.sp-thumb-plain { display: grid; place-items: center; }
.sp-thumb-plain span { font-size: 1.8rem; font-weight: 800; color: var(--kc-head); opacity: .7; }
.sp-line { margin: .25rem 0 0; font-size: .95rem; color: var(--muted); }
.sp-pills { margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.sp-pills .kc-tag { margin-right: 0; }
.sp-empty { display: flex; align-items: center; gap: 1rem; padding: 1.2rem; border-radius: var(--radius); background: var(--kc-card); border: 1px dashed var(--kc-edge); }
.sp-empty p { margin: 0; color: var(--muted); }
.sp-empty-art { flex: none; width: 4rem; height: 4rem; border-radius: 12px; border: 1px solid var(--kc-edge); }

/* ---------- a shop's page ---------- */
.sp-banner { position: relative; overflow: hidden; border-radius: calc(var(--radius) * 1.6); border: 1px solid var(--kc-edge); margin: 0 0 1rem; min-height: 13rem; display: grid; align-items: end; box-shadow: var(--kc-shadow); }
.sp-banner-pic { position: absolute; inset: 0; display: block; }
.sp-banner-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sp-banner-done { display: block; min-height: 0; }
.sp-banner-done .sp-banner-pic { position: static; }
.sp-banner-done .sp-banner-pic img { height: auto; }
.sp-banner-panel { position: relative; z-index: 1; margin: 1.5rem 1rem 1rem; padding: 1rem 1.2rem 1.1rem; max-width: 40rem; border-radius: 14px; background: color-mix(in srgb, var(--kc-card) 90%, transparent); border: 1px solid var(--kc-edge); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sp-banner-done .sp-banner-panel { margin: 0; max-width: none; border-radius: 0; border: 0; border-top: 1px solid var(--kc-edge); background: var(--kc-card); }
.sp-banner h1, .sp-bname { margin: 0; font-size: clamp(1.5rem, 4.4vw, 2.3rem); line-height: 1.15; color: var(--kc-head); overflow-wrap: anywhere; font-weight: 750; }
.sp-tags { margin: 0 0 .45rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.sp-tags .kc-tag { margin-right: 0; }
.sp-place { display: flex; align-items: center; gap: .45rem; margin: .4rem 0 0; font-size: 1.05rem; }
.sp-aka { margin: .3rem 0 0; font-size: .9rem; color: var(--muted); }
.sp-actions { margin: 0 0 1.2rem; }
.sp-actions .btn { min-height: 46px; display: inline-flex; align-items: center; }
.sp-cols > .kc-card { margin: .5rem 0; }   /* the write-up and the sources take the full width; the facts sit between them in two columns */
.sp-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; align-items: start; margin: .5rem 0; }   /* Hours on the left, the short boxes stacked on the right: no gaps */
.sp-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.sp-col > .kc-card { margin: 0; }
.sp-hours { width: 100%; border-collapse: collapse; }
.sp-hours th, .sp-hours td { padding: .35rem 0; text-align: left; border-bottom: 1px solid var(--kc-edge); font-weight: 500; }
.sp-hours th { color: var(--muted); width: 45%; }
.sp-hours tr:last-child th, .sp-hours tr:last-child td { border-bottom: 0; }
.sp-svc { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.sp-svc li { padding: .15rem .7rem; border-radius: 999px; border: 1px solid var(--kc-edge); background: var(--kc-soft); font-size: .92rem; }
.sp-sources ul { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .9rem; }
.sp-cross ul { margin: 0; padding-left: 1.1rem; }
.sp-closed { text-align: left; }
.sp-closed h1 { margin: 0 0 .3rem; }
.sp-missing { background: var(--kc-card); }

/* pictures that sit in cards and states */
.sp-empty-has { padding: .8rem; }
.sp-empty-pic { flex: none; display: block; width: min(11rem, 38%); aspect-ratio: 3 / 2; height: auto; object-fit: cover; border-radius: 12px; border: 1px solid var(--kc-edge); }
.sp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); gap: 1.25rem; align-items: center; }
.sp-split-text .kc-h { margin-top: 0; }
.sp-split-pic { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; border: 1px solid var(--kc-edge); }
.sp-form-card { display: flow-root; }
.sp-side { float: right; display: block; width: min(15rem, 38%); height: auto; aspect-ratio: 3 / 2; object-fit: cover; margin: 0 0 1rem 1.25rem; border-radius: 12px; border: 1px solid var(--kc-edge); }
.sp-how .kc-h { margin-top: 0; }
.sp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.sp-step { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); background: var(--kc-card); border: 1px solid var(--kc-edge); box-shadow: var(--kc-shadow); }
.sp-step-pic { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.sp-step h3 { margin: .9rem 1.1rem .25rem; font-size: 1.05rem; color: var(--kc-head); }
.sp-step p { margin: 0 1.1rem 1.1rem; color: var(--muted); font-size: .95rem; }
.sp-promises { margin: 1rem 0 0; padding-left: 1.2rem; max-width: 46rem; color: var(--muted); }
.sp-promises li { margin: .3rem 0; }

/* the faded paper map behind browse-by-country (the cards on it keep their own solid background; the class is added only when the picture file exists) */
.sp-paper { padding: 1.1rem clamp(.8rem, 2vw, 1.4rem) 1.3rem; border-radius: calc(var(--radius) * 1.4); border: 1px solid var(--kc-edge);
  background: linear-gradient(color-mix(in srgb, var(--kc-card) 90%, transparent), color-mix(in srgb, var(--kc-card) 90%, transparent)), url(/assets/shops/site/shops-c26-1-960.webp) center / cover; }
:root[data-theme="light"] .sp-paper { background: linear-gradient(color-mix(in srgb, var(--kc-card) 40%, transparent), color-mix(in srgb, var(--kc-card) 40%, transparent)), url(/assets/shops/site/shops-c26-1-960.webp) center / cover; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .sp-paper { background: linear-gradient(color-mix(in srgb, var(--kc-card) 40%, transparent), color-mix(in srgb, var(--kc-card) 40%, transparent)), url(/assets/shops/site/shops-c26-1-960.webp) center / cover; }
}
.sp-paper .kc-h { margin-top: 0; }

/* ---------- phone ---------- */
@media (max-width: 640px) {
  /* the phone crop shows whole above the words instead of under them */
  .sp-hero-art { padding: 0; display: block; }
  .sp-hero-art::before { display: none; }
  .sp-hero-pic { position: relative; inset: auto; aspect-ratio: 750 / 420; }
  .sp-hero-art .sp-hero-panel { padding: 1rem .9rem 1.2rem; }
  .sp-split { grid-template-columns: minmax(0, 1fr); }
  .sp-steps { grid-template-columns: minmax(0, 1fr); }
  .sp-side { float: none; width: 100%; max-height: 9rem; margin: 0 0 1rem; }
}
@media (max-width: 720px) {
  .sp-facts { grid-template-columns: minmax(0, 1fr); }
  .sp-hero { min-height: 0; padding: 1.2rem .9rem; }
  .sp-search { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sp-search #sp-q { grid-column: 1 / -1; }
  .sp-search select { grid-column: 1 / -1; }
  .sp-search .btn, .sp-search .kc-geo { justify-content: center; }
  .sp-cols { grid-template-columns: minmax(0, 1fr); }
  .sp-banner { min-height: 11rem; }
  .sp-banner-panel { margin: 1rem .6rem .6rem; padding: .8rem .9rem; }
  .sp-tab { padding: 0 .8rem; }
}
@media (prefers-reduced-motion: reduce) { .sp-tab, .sp-country { transition: none; } }

.sh-nowrap { white-space: nowrap; }

/* ---------- phase 2: claims, the owner's panel, Add a shop, the window sticker ---------- */
.sp-runby { background: color-mix(in srgb, var(--ok) 18%, var(--kc-card)); border-color: color-mix(in srgb, var(--ok) 50%, var(--kc-edge)); }
.sp-claim, .sp-manage, .sp-claim-note { margin: 1rem 0; }
.sp-claim .kc-actions, .sp-manage .kc-actions { margin-top: .75rem; }
.sp-hours-edit th { width: 28%; }
.sp-hours-edit td { padding-right: .5rem; }
.sp-hours-edit input[type=time] { width: 100%; max-width: 9rem; }
.sp-check { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.sp-check .check { margin: 0; }
.sp-snippet { display: block; padding: .7rem .8rem; overflow-wrap: anywhere; user-select: all; border: 1px solid var(--kc-edge); border-radius: var(--radius); background: var(--kc-soft); }
.sp-from { margin: .5rem 0 0; }
.sp-add { display: grid; gap: 1rem; }
@media (max-width: 720px) { .sp-hours-edit th { width: 32%; } .sp-hours-edit input[type=time] { max-width: 100%; } }
/* the window sticker reuses the club flyer's sheet (clubs.css, light whatever the theme, for print) */
.kf-listed { margin: 0 0 .12in; font-size: 17pt; font-weight: 800; letter-spacing: .03em; color: #9a5b12; text-transform: uppercase; }
.kf-pillars-one { margin: 0; font-size: 11pt; color: #2b2721; }
.sp-nudge .kc-actions { margin: .5rem 0 0; }

/* ---------- the repair bench status (a manager's own word, shown while fresh) ---------- */
.sp-bench { margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
.sp-bench .kc-tag { margin-right: 0; }
.sp-bench-on { background: color-mix(in srgb, var(--ok) 18%, var(--kc-card)); border-color: color-mix(in srgb, var(--ok) 50%, var(--kc-edge)); }
.sp-pills .sp-bench-tag { max-width: 100%; }
.sp-bench-panel { display: grid; gap: .6rem; }
.sp-bench-panel .check { margin: 0; }
.sp-bench-panel input[type=number] { width: 6rem; }
.sp-bench-still { margin: .75rem 0 0; }
.sp-weeks { display: block; margin: .1rem 0 .3rem 1.7rem; }

/* ---------- 82.16: listed, not yet confirmed (a street address from the shop's own site, no dated sign of life in a year) ---------- */
.sp-unconf { background: color-mix(in srgb, var(--warn) 16%, var(--kc-card)); border-color: color-mix(in srgb, var(--warn) 50%, var(--kc-edge)); }
.sp-unconf-note { margin: 1rem 0; border-left: 4px solid var(--warn); }
.sp-unconf-note p { margin: .4rem 0 0; }
