/* seiten.css – Regeln für leistungen.html, leistung-stuckarbeiten.html und referenzen.html.
   Lädt NACH entwurf.css. Nur Variablen des Systems (Farben, Abstände, Radien), keine festen Farbwerte. */

/* 1. Rücklink über der Überschrift („Alle Leistungen"): Pfeil nach links, 44 px Klickhöhe */
.zurueck { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; font-weight: 500; color: var(--ink);
  text-decoration: underline; text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); text-underline-offset: 4px; }
.zurueck::before { content: "\2190"; display: inline-block; text-decoration: none; }
.zurueck:hover { text-decoration-color: currentColor; }
.hero__text > .zurueck + h1 { margin-top: var(--s-3); }

/* 2. Text neben Foto: Absätze in Lesebreite, Verweis mit Abstand und 44 px Klickhöhe */
.text-spalte { display: grid; gap: var(--s-4); align-content: start; }
.text-spalte > .section-head { margin-bottom: 0; }
.text-spalte > p { max-width: 52ch; }
.text-spalte > .link, .text-spalte > .rows { margin-top: var(--s-3); }
.text-spalte > .link { justify-self: start; }
.text-spalte .link, .section-head--row > .link { min-height: 44px; }

/* 3. Schritte des Ablaufs: Zahl vor dem Namen der Zeile */
.rows--schritte { counter-reset: schritt; }
.rows--schritte > li { counter-increment: schritt; }
.rows--schritte .rows__name::before { content: counter(schritt) ". "; font-variant-numeric: tabular-nums; }

/* 4. Fotoraster: ruhige Reihe gleich hoher Fotos, ohne Bildunterschrift.
      Am PC nimmt die Reihe die Höhe, die der Bildschirm unter der Überschrift lässt (.fill des Kits);
      am Tablet und Handy haben die Fotos ein festes Seitenverhältnis und der Abschnitt wächst mit. */
.fotos { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--card-gap) var(--gutter); }
.fotos > .foto { position: relative; display: block; grid-column: auto / span 4; min-width: 0; min-height: 0;
  overflow: clip; border-radius: var(--r-lg); background: var(--surface); aspect-ratio: 4 / 5; }
.ground-surface .fotos > .foto { background: var(--p-bg); }
.fotos > .foto > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
  object-position: var(--pos, 50% 50%); transition: transform 600ms var(--ease); }
.fotos > a.foto { cursor: zoom-in; }
@media (hover: hover) { .fotos > a.foto:hover > img { transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .fotos > .foto > img { transition: none; } .fotos > a.foto:hover > img { transform: none; } }
.fotos > a.foto:focus-visible { outline-offset: 3px; }
.fotos--2 > .foto { grid-column: auto / span 6; aspect-ratio: 4 / 3; }
.fotos--4 > .foto, .fotos--mix > .foto { grid-column: auto / span 6; }
.fotos--mix > .foto--breit { grid-column: 1 / -1; aspect-ratio: 3 / 2; }

@media (min-width: 1024px) {
  .fotos.fill { grid-template-rows: minmax(0, 1fr); min-height: 320px; }
  .fotos.fill > .foto { aspect-ratio: auto; height: 100%; }
  .fotos--4 > .foto, .fotos--mix > .foto { grid-column: auto / span 3; }
  .fotos--mix > .foto--breit { grid-column: auto / span 6; }
}
@media (max-width: 1023px) {
  main > :is(section, .section) > .wrap > .fotos.fill, .group > .fotos.fill { flex: none; }
  .fotos { align-content: start; }
  .fotos--2 > .foto { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
  /* Foto unter dem Text einer Leistung: Abstand zum Verweis darüber */
  .grid > .text-spalte + .frame { margin-top: var(--s-5); }
  /* Baudenkmal (zwei Gruppen): die zweite Fotoreihe schließt direkt an die erste an */
  #baudenkmal > .wrap { display: flex; flex-direction: column; row-gap: var(--card-gap); }
  #baudenkmal > .wrap > :last-child { margin-block: 0; }
}
/* Tablet: drei Fotos als zwei nebeneinander und eines quer darunter */
@media (min-width: 640px) and (max-width: 1023px) {
  .fotos--3 > .foto { grid-column: auto / span 6; }
  .fotos--3 > .foto:last-child { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
}
/* Handy: das erste von drei Fotos groß, die beiden anderen nebeneinander */
@media (max-width: 639px) {
  .fotos--3 > .foto { grid-column: auto / span 6; }
  .fotos--3 > .foto:first-child { grid-column: 1 / -1; }
}

/* 5. Großansicht eines Fotos (referenzen.html): natives <dialog>, vom Skript der Seite angelegt.
      Schließen mit dem Knopf, der Esc-Taste oder einem Klick auf den Rand neben dem Foto. */
.lupe { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; border: 0; padding: var(--s-4); box-sizing: border-box; overflow: hidden; background: var(--p-bg); color: var(--p-ink); }
.lupe[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--s-4); }
.lupe::backdrop { background: var(--p-bg); }
.lupe__leiste { display: flex; justify-content: flex-end; }
.lupe__bild { position: relative; min-height: 0; }
.lupe__bild > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
html.lupe-offen { overflow: hidden; }

/* 6. Telefonnummer im Abschluss der Leistungsseite: unterstrichener Link in Schriftfarbe */
.tel-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; text-decoration: underline;
  text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); text-underline-offset: 4px; }
.tel-link:hover { text-decoration-color: currentColor; }

/* 7. Querformat-Foto neben Text (leistung-anfertigung.html: Bildtafel der Bogenprofile, ganz gezeigt) */
.frame--quer { aspect-ratio: 3 / 2; }
