/* Autotechnik Pölzl – Kfz-Werkstätte, Haslach bei Gleinstätten
   Colours from their building: yellow front and sign lettering, anthracite
   doors and roof. Signature: the yellow-and-black hazard band.
   One stylesheet, system fonts. */

/* --- tokens ---------------------------------------------------------------- */
:root {
  --gelb: #f0c020;
  --anthrazit: #2b2f33;
  --anthrazit-tief: #191b1d;
  --tinte: #17191b;
  --tinte-weich: #55504a;
  --papier: #f3f0e9;
  --papier-dunkel: #e6dfcd;
  --linie: #c9c2b0;
  --hell: #e9e4d8;
  --weiss: #ffffff;

  --serif: "Charter", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: -apple-system, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif;

  /* scale 1.25 on 17px / 18px */
  --t-label: 0.875rem;
  --t-1: 1rem;
  --t-2: 1.25rem;
  --t-3: 1.5625rem;
  --t-5: 2.441rem;
  --t-6: 3.052rem;

  /* 4px grid */
  --s-4: 4px;
  --s-8: 8px;
  --s-12: 12px;
  --s-16: 16px;
  --s-24: 24px;
  --s-32: 32px;
  --s-48: 48px;
  --s-64: 64px;
  --s-80: 80px;

  --rand: 20px;
  --abschnitt: var(--s-48);
  --foto: 80vw;
}

@media (min-width: 600px)  { :root { --foto: 43vw; } }
@media (min-width: 768px)  { :root { --rand: 32px; --abschnitt: var(--s-80); } }
@media (min-width: 1024px) { :root { --foto: 29vw; } }
@media (min-width: 1120px) { :root { --rand: 48px; } }
@media (min-width: 1440px) { :root { --rand: 64px; --foto: 25vw; } }
@media (min-width: 1920px) { :root { --rand: 96px; --foto: 21vw; } }

/* --- base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 17px; -webkit-text-size-adjust: 100%; }
@media (min-width: 768px) { html { font-size: 18px; } }

body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font-family: var(--sans);
  font-size: var(--t-1);
  line-height: 1.6;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h2 {
  margin-bottom: var(--s-16);
  font-size: var(--t-3);
}

p, ol, dl, dd, figure { margin: 0; padding: 0; }
ol { list-style: none; }
a { color: var(--tinte); text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
.nowrap { white-space: nowrap; }

/* Every section sits in the same frame: only gutters, no fixed width. */
.rahmen {
  width: 100%;
  padding-inline: var(--rand);
}

/* --- hazard band: the signature --------------------------------------------- */
.warnband {
  height: 12px;
  margin-bottom: var(--s-24);
  background: repeating-linear-gradient(-45deg, var(--tinte) 0 12px, var(--gelb) 12px 24px);
}
.warnband--kopf { margin-bottom: 0; }
.eyebrow-band {
  display: inline-block;
  width: 32px;
  height: 8px;
  margin-right: var(--s-8);
  vertical-align: 0.05em;
  background: repeating-linear-gradient(-45deg, var(--tinte) 0 8px, var(--gelb) 8px 16px);
}
@media (min-width: 600px) {
  .eyebrow-band { width: 48px; margin-right: var(--s-12); }
}

/* --- header: their sign, yellow lettering on anthracite --------------------- */
.kopf {
  background: var(--anthrazit);
  color: var(--hell);
}
.kopf-innen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-12);
  padding-block: var(--s-12);
}
.schild {
  display: inline-flex;
  flex-direction: column;
  color: var(--gelb);
  font-weight: 700;
  line-height: 1;
}
.schild-oben {
  font-size: var(--t-label);
  letter-spacing: 0.04em;
}
.schild-name {
  margin-top: 2px;
  font-size: clamp(1.5625rem, 1.3rem + 1.4vw, 1.953rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* --- call buttons: they never move, the colour changes at once -------------- */
.kopf-call {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: var(--s-4) var(--s-16);
  border: 2px solid var(--gelb);
  background: var(--gelb);
  color: var(--tinte);
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}
.kopf-call:hover,
.kopf-call:focus-visible {
  border-color: var(--weiss);
  background: var(--weiss);
}
.kopf-call-lang { display: none; flex-direction: column; align-items: flex-start; }
.kopf-call-label {
  font-size: var(--t-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kopf-call-nummer { font-variant-numeric: tabular-nums; }
@media (min-width: 480px) {
  .kopf-call-kurz { display: none; }
  .kopf-call-lang { display: inline-flex; }
}

.cta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: var(--s-8) var(--s-24);
  border: 2px solid var(--tinte);
  background: var(--gelb);
  color: var(--tinte);
  font-weight: 700;
  line-height: 1.15;
}
.cta:hover,
.cta:focus-visible {
  background: var(--tinte);
  color: var(--gelb);
}
.cta-label {
  font-size: var(--t-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cta-nummer {
  font-size: var(--t-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cta-sekundaer {
  display: none;
  align-items: center;
  background: transparent;
}
.cta-sekundaer:hover,
.cta-sekundaer:focus-visible {
  background: var(--tinte);
  color: var(--papier);
}
@media (min-width: 600px) { .cta-sekundaer { display: inline-flex; } }
.cta-dunkel {
  border-color: var(--anthrazit);
  background: var(--anthrazit);
  color: var(--weiss);
}
.cta-dunkel:hover,
.cta-dunkel:focus-visible {
  border-color: var(--weiss);
  background: var(--weiss);
  color: var(--tinte);
}

/* --- hero ------------------------------------------------------------------ */
.hero { padding-block: var(--s-16); }
.hero-reihe {
  display: flex;
  flex-direction: column;
  gap: var(--s-16);
}
.hero-text { min-width: 0; }

.eyebrow {
  margin-bottom: var(--s-12);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--tinte-weich);
}
@media (min-width: 600px) {
  .eyebrow { letter-spacing: 0.08em; text-transform: uppercase; }
}
h1 {
  margin-bottom: var(--s-12);
  font-size: clamp(1.75rem, 1.25rem + 2.2vw, 2.6rem);
  line-height: 1.1;
}
@media (min-width: 1680px) { h1 { font-size: var(--t-6); } }
.h1-name { display: block; }
/* A yellow marker runs under the trade, like a line painted on the shop floor. */
.h1-fach {
  background: linear-gradient(var(--gelb), var(--gelb)) 0 92% / 100% 0.2em no-repeat;
}
.lead {
  max-width: 56ch;
  margin-bottom: var(--s-16);
  font-size: clamp(var(--t-1), 0.95rem + 0.45vw, var(--t-2));
  line-height: 1.5;
}
.cta-reihe {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-12);
  margin-bottom: var(--s-12);
}
.hero-zeiten { color: var(--tinte-weich); }
.hero-zeiten span { white-space: nowrap; }

.hero-foto {
  width: 100%;
  border: 1px solid var(--anthrazit);
  background: var(--anthrazit);
}
.hero-foto img {
  width: 100%;
  aspect-ratio: 4 / 1;
  object-fit: cover;
  object-position: 50% 58%;
}
.foto-caption {
  padding: var(--s-4) var(--s-12);
  border-top: 1px solid var(--anthrazit);
  background: var(--papier);
  font-size: var(--t-label);
  line-height: 1.5;
  color: var(--tinte-weich);
}

@media (min-width: 600px) {
  .hero { padding-block: var(--s-32); }
  .hero-reihe { gap: var(--s-24); }
  .hero-foto img { aspect-ratio: 5 / 2; }
  .foto-caption { padding-block: var(--s-8); }
}
@media (min-width: 900px) {
  .hero { padding-block: var(--s-80); }
  .hero-reihe {
    flex-direction: row;
    align-items: center;
    gap: var(--s-64);
  }
  .hero-text { flex: 1 1 0; }
  .hero-foto { flex: 0 0 42%; width: 42%; }
  .hero-foto img { aspect-ratio: 3 / 2; object-position: 50% 50%; }
  .eyebrow { margin-bottom: var(--s-24); }
  h1 { margin-bottom: var(--s-24); }
  .lead { margin-bottom: var(--s-32); }
  .cta-reihe { margin-bottom: var(--s-16); }
}

/* --- sections -------------------------------------------------------------- */
.taktung,
.pruefliste,
.kontakt {
  padding-block: var(--abschnitt);
  border-top: 1px solid var(--linie);
}
.say {
  max-width: 62ch;
  margin-bottom: var(--s-24);
}

/* --- Werkstatt-Taktung: five day fields ------------------------------------- */
.taktung-liste {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-12);
  margin-bottom: var(--s-16);
}
@media (min-width: 480px) {
  .taktung-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .takt-fr { grid-column: 1 / -1; }
}
/* Tablets: three days in the first row, two wider fields in the second. */
@media (min-width: 600px) {
  .taktung-liste { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s-16); }
  .takt { grid-column: span 2; }
  .takt:nth-child(n + 4) { grid-column: span 3; }
}
@media (min-width: 900px) {
  .taktung-liste { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .takt,
  .takt:nth-child(n + 4) { grid-column: auto; }
}
.takt {
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
  padding: var(--s-16);
  border-top: 4px solid var(--gelb);
  background: var(--papier-dunkel);
}
.takt .tag {
  font-family: var(--serif);
  font-size: var(--t-2);
  font-weight: 700;
  line-height: 1.2;
}
.takt .zeit {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.takt .pause {
  font-size: var(--t-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tinte-weich);
}
.wochenende { color: var(--tinte-weich); }

/* --- Werkstatt-Prüfliste: four posts, then the photo row -------------------- */
.posten-liste {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: var(--s-48);
  border-top: 2px solid var(--tinte);
}
@media (min-width: 768px) {
  .posten-liste { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (min-width: 1440px) {
  .posten-liste { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.posten {
  display: flex;
  align-items: flex-start;
  gap: var(--s-16);
  padding-block: var(--s-16);
  border-bottom: 1px solid var(--linie);
}
.posten-nr {
  flex: 0 0 auto;
  padding: 2px var(--s-8);
  background: linear-gradient(var(--gelb), var(--gelb)) 0 0 / 0 100% no-repeat;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.posten-text { min-width: 0; }
.posten-name {
  font-family: var(--serif);
  font-size: var(--t-2);
  font-weight: 700;
  line-height: 1.25;
}
.posten-desc { color: var(--tinte-weich); }

.fotos-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-16);
  min-height: 48px;
  margin-top: var(--s-48);
  margin-bottom: var(--s-16);
}
.fotos-titel { font-size: var(--t-2); }
.fotos-tasten { display: flex; gap: var(--s-8); }
.fotos-tasten[hidden] { display: none; }
.fotos-taste {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--tinte);
  border-radius: 0;
  background: transparent;
  color: var(--tinte);
  cursor: pointer;
}
.fotos-taste:hover,
.fotos-taste:focus-visible { background: var(--gelb); }

.fotos {
  display: flex;
  gap: var(--s-16);
  padding-inline: var(--rand);
  padding-bottom: var(--s-12);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--rand);
  scrollbar-width: thin;
  scrollbar-color: var(--anthrazit) var(--papier-dunkel);
}
/* With the buttons switched on (fotos.js sets this class) the row shows no
   scrollbar: buttons, swipe or arrow keys move it. Without the script the
   browser's scrollbar stays as the way through. */
.fotos--tasten {
  padding-bottom: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.fotos--tasten::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.foto {
  flex: 0 0 var(--foto);
  width: var(--foto);
  scroll-snap-align: start;
}
.foto img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--anthrazit);
}
.foto-text {
  position: relative;
  padding-block: var(--s-8) var(--s-12);
  font-size: var(--t-label);
  line-height: 1.5;
  color: var(--tinte-weich);
}
.foto-was {
  color: var(--tinte);
  font-weight: 700;
}
.foto-text::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--tinte) 0 6px, var(--gelb) 6px 12px);
}

/* --- Kontakt --------------------------------------------------------------- */
.kontakt-reihe {
  display: flex;
  flex-direction: column;
  gap: var(--s-32);
}
@media (min-width: 900px) {
  .kontakt-reihe { flex-direction: row; align-items: flex-start; gap: var(--s-64); }
  .kontakt-dl { flex: 3 1 0; }
  .kontakt-notiz { flex: 2 1 0; }
}
.kontakt-dl { border-top: 2px solid var(--tinte); }
.kontakt-zeile {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding-block: var(--s-16);
  border-bottom: 1px solid var(--linie);
}
@media (min-width: 640px) {
  .kontakt-zeile { flex-direction: row; align-items: baseline; gap: var(--s-24); }
  .kontakt-dl dt { flex: 0 0 11rem; }
}
.kontakt-dl dt {
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tinte-weich);
}
.kontakt-dl dd { min-width: 0; }
.kontakt-notiz {
  padding: var(--s-24);
  border-top: 4px solid var(--gelb);
  background: var(--papier-dunkel);
}
.kontakt-notiz p + p { margin-top: var(--s-12); }
.notiz-titel {
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tinte-weich);
}

.inline-link {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  font-variant-numeric: tabular-nums;
}
.inline-link:hover,
.inline-link:focus-visible { background: var(--gelb); }

/* --- call strip: a band in the yellow of their front ------------------------- */
.call-strip {
  background: var(--gelb);
  color: var(--tinte);
}
.call-strip-innen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-16) var(--s-32);
  padding-block: var(--s-32);
}
.call-strip-text {
  max-width: 60ch;
  font-family: var(--serif);
  font-size: var(--t-2);
  font-weight: 700;
  line-height: 1.35;
}

/* --- footer ---------------------------------------------------------------- */
.fuss {
  background: var(--anthrazit-tief);
  color: var(--hell);
  padding-block: var(--s-48) var(--s-32);
}
.fuss-spalten {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-32) var(--s-64);
}
.fuss-spalte { flex: 1 1 20ch; }
.fuss-label {
  margin-bottom: var(--s-8);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gelb);
}
.fuss-text {
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
.fuss-link {
  color: var(--hell);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.fuss-link:hover,
.fuss-link:focus-visible {
  color: var(--gelb);
  text-decoration-thickness: 2px;
}
.fuss-legal {
  margin-top: var(--s-32);
  padding-top: var(--s-24);
  border-top: 1px solid var(--anthrazit);
  font-size: var(--t-label);
  line-height: 1.5;
}

/* --- focus ----------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--tinte);
  outline-offset: 3px;
}
.kopf :focus-visible,
.fuss :focus-visible { outline-color: var(--gelb); }
.fotos:focus-visible { outline-offset: -3px; }

/* Marker touches: a yellow field behind a post number, a piece of hazard band
   under a photo caption. Shown on hover and on keyboard focus. */
.fotos:focus-visible .foto-text::after { width: 48px; }
@media (hover: hover) {
  .posten:hover .posten-nr { background-size: 100% 100%; }
  .foto:hover .foto-text::after { width: 48px; }
}

/* --- motion ---------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html, .fotos { scroll-behavior: smooth; }

  .posten-nr { transition: background-size 300ms ease-out; }
  .foto-text::after { transition: width 300ms ease-out; }
  .inline-link,
  .fuss-link,
  .fotos-taste { transition: background-color 150ms ease-out, color 150ms ease-out; }

  /* Load sequence, once, about 1 s in all: the hazard band rolls out under the
     header, the photo rises like a car on the lift, headline and sentence
     settle. Nothing is drawn on the photo, and the call buttons stay still. */
  .warnband--kopf { animation: ausrollen 700ms cubic-bezier(0.65, 0.05, 0.3, 1) 100ms both; }
  .hero-foto { animation: heben 800ms cubic-bezier(0.2, 0.7, 0.2, 1) 200ms both; }
  .hero h1,
  .hero .lead { animation: setzen 600ms cubic-bezier(0.2, 0.65, 0.3, 1) both; }
  .hero h1 { animation-delay: 250ms; }
  .hero .lead { animation-delay: 370ms; }

  @keyframes ausrollen {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
  }
  @keyframes heben {
    from { transform: translateY(16px); }
    to   { transform: none; }
  }
  @keyframes setzen {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
}
