/*
 * Fischerei Bestellportal – Seiten-Layout
 *
 * Grundgeruest jeder Seite: Zuruecksetzen, Seitenrahmen (.wrap),
 * Kopfzeile, Fusszeile, sichere Bereiche (iOS). Enthaelt bewusst nur
 * Layout – das Aussehen einzelner Bausteine steht in components.css.
 */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
  background-attachment: scroll; /* "fixed" rendert iOS Safari schlecht */
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: var(--color-accent-soft);
  touch-action: manipulation;
  transition: background-color var(--transition), color var(--transition);
}

.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding-left: max(var(--wrap-pad), env(safe-area-inset-left));
  padding-right: max(var(--wrap-pad), env(safe-area-inset-right));
}

/* Backend: volle Fensterbreite nutzen (Tabellen, viele Spalten).
   Funktioniert flexibel bei jeder Fenstergröße – auch auf Mobilgeräten. */
html[data-area="admin"] .wrap {
  max-width: none;
}

/* ============================================================
   Kopfbereich
   ============================================================ */

.site-head {
  border-bottom: 1px solid var(--color-line);
  background: var(--color-bg);
  /* Halbtransparente Leiste mit Weichzeichnung (wie im PDF-Flipbook).
     Der erste Wert ist der Fallback fuer Browser ohne color-mix(). */
  background: color-mix(in srgb, var(--color-bg) 70%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

/* Bestellseite: Kopfbereich ausblenden (Banner ist bereits vorhanden) */
html[data-area="public"] .site-head {
  display: none;
}

.site-head .kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.site-head .kopf-links {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.site-head .kopf-text {
  min-width: 0;
}

.site-head .verein {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.site-head h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.25;
  color: var(--color-text-strong);
}

.site-head .logo {
  flex: 0 0 auto;
  max-height: 68px;
  max-width: 190px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #ffffff;
  border-radius: var(--radius-xs);
  padding: 4px;
}

.site-head .kopf-aktionen {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

/* ============================================================
   Hauptbereich
   ============================================================ */

main.wrap {
  display: block;
  padding-top: 0;
}

/* ============================================================
   Fussbereich
   ============================================================ */

.site-foot {
  margin-top: 44px;
  padding: 4px 0;
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: 14px;
}

.site-foot .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-foot .fuss-links,
.site-foot .fuss-rechts {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Der Copyright-Text darf auf schmalen Bildschirmen umbrechen, statt
   die Seite horizontal verschiebbar zu machen. */
.site-foot .fuss-links {
  white-space: normal;
  flex-wrap: wrap;
}

.site-foot .fuss-links {
  color: var(--color-muted);
  font-size: 6px;
  padding-top: 2px;
}

.site-foot p {
  margin: 0;
}

/* ============================================================
   Kleine Bildschirme
   ============================================================ */

@media (max-width: 620px) {
  .site-head .kopf {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .site-head h1 {
    font-size: 24px;
  }

  .site-head .kopf-links {
    gap: 12px;
  }

  .site-head .logo {
    max-height: 44px;
    max-width: 96px;
  }

  .card {
    padding: 20px 18px;
  }

  .reihe {
    gap: 0;
  }

  .reihe > .feld {
    flex: 1 1 100%;
  }

  .stepper {
    max-width: none;
  }

  .knöpfe {
    gap: 10px;
  }

  .knöpfe button,
  .knöpfe .button {
    flex: 1 1 100%;
  }

  .tabelle-scroll {
    -webkit-overflow-scrolling: touch;
  }

  .reiter a {
    flex: 1 1 auto;
    text-align: center;
    padding: 11px 12px;
  }

  .site-foot {
    margin-top: 32px;
  }
}

/* Sehr schmale Geraete (kleine iPhones, Splitview-Fenster). */
@media (max-width: 360px) {
  .card {
    padding: 16px 14px;
  }

  .stepper-knopf {
    width: 46px;
  }
}

/* Wenn die Seite ohne Rahmen in den Startbildschirm gelegt wurde,
   liegt der Inhalt bei iOS unter der Kerbe und neben dem
   Home-Anzeiger. Ohne diese Abstaende waeren Knöpfe unerreichbar. */
@supports (padding: max(0px)) {
  .site-foot {
    padding-bottom: max(22px, env(safe-area-inset-bottom));
  }
}
