/*
 * Christa Winter – Übergangsseite
 * Mobile First: Die Grundregeln gelten für Smartphones,
 * weiter unten folgen die Anpassungen für Tablet und Desktop.
 */

:root {
  --bg: #fcfcfa;
  --ink: #1d1d1b;
  --ink-soft: #4a4a46;
  --muted: #6f6e6a;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --pad-x: clamp(1.25rem, 5vw, 4rem);
  --pad-y: clamp(1.25rem, 3vw, 2.75rem);
  --side: clamp(10.5rem, 20vw, 21rem);

  /* Dauer der Überblendung – bei Änderung auch BLENDE in js/slideshow.js anpassen */
  --fade: 1.8s;
}

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

html {
  background: var(--bg);
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh; /* sichtbare Höhe bei eingeblendeten Browserleisten */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  row-gap: clamp(0.875rem, 2.5vh, 1.5rem);
  padding:
    max(var(--pad-y), env(safe-area-inset-top))
    max(var(--pad-x), env(safe-area-inset-right))
    max(var(--pad-y), env(safe-area-inset-bottom))
    max(var(--pad-x), env(safe-area-inset-left));
  background: var(--bg);
  color: var(--ink);
  font: 400 0.8125rem/1.6 var(--sans);
}

/* ---------- Name ---------- */

.name {
  margin: 0;
  font: 400 clamp(1.625rem, 1.1rem + 2vw, 2.25rem)/1.15 var(--serif);
  letter-spacing: 0.01em;
  text-align: center;
  text-wrap: balance;
}

/* ---------- Bilder ---------- */

main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.75rem, 2vh, 1.25rem);
  min-width: 0;
}

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 14rem;
  /* nicht höher als ein Hochformat in voller Breite, damit der Hinweis direkt unter dem Bild steht */
  max-height: calc((100vw - 2 * var(--pad-x)) * 1.45);
}

.stage img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity var(--fade) ease-in-out;
}

.stage img.is-visible {
  opacity: 1;
}

.note {
  flex: none;
  text-align: center;
}

.note p {
  margin: 0;
  text-wrap: balance;
}

.note-main {
  font: 400 clamp(1.0625rem, 0.95rem + 0.5vw, 1.375rem)/1.35 var(--serif);
  letter-spacing: 0.01em;
}

.note-sub {
  margin-top: 0.25em;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- Kontakt ---------- */

.contact {
  text-align: center;
  color: var(--ink-soft);
}

.contact address {
  font-style: normal;
}

.contact p {
  margin: 0;
}

.contact p > * {
  white-space: nowrap;
}

.contact p > * + *::before {
  content: "·";
  display: inline-block;
  margin: 0 0.6em;
  color: var(--muted);
}

.contact a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(29, 29, 27, 0.28);
  text-underline-offset: 0.25em;
}

.contact a:hover,
.contact a:focus-visible {
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .stage img {
    transition: none;
  }
}

/* ---------- Tablet / schmaler Desktop: Name oben links ---------- */

@media (min-width: 48em) {
  .name {
    text-align: left;
  }

  .contact address {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 2rem;
  }
}

@media (min-width: 64em) and (min-height: 40em) {
  body {
    font-size: 0.875rem;
  }
}

/* ---------- Querformat-Bildschirme: Name und Kontakt links neben dem Bild ---------- */

@media (min-width: 40em) and (min-aspect-ratio: 4/3) {
  body {
    grid-template-columns: var(--side) minmax(0, 1fr) var(--side);
    grid-template-rows: auto 1fr;
    column-gap: clamp(1rem, 3vw, 3rem);
    row-gap: 0;
  }

  .site-header {
    grid-column: 1;
    grid-row: 1;
  }

  .name {
    font-size: clamp(1.5rem, 0.8rem + 1.3vw, 2.125rem);
    text-align: left;
  }

  main {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .stage {
    min-height: 0;
    max-height: none;
  }

  .contact {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .contact address {
    display: block;
  }

  .contact p + p {
    margin-top: 0.75em;
  }

  .contact p > * {
    display: block;
    white-space: normal;
  }

  .contact p > * + *::before {
    content: none;
  }
}
