/* Persönliche Gedenk- und Abschiedsseiten – ruhig, hell, ohne Animationen.
   Die Person steht im Mittelpunkt; die Plattform bleibt zurückhaltend. */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-latin-wght-italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('fonts/source-sans-3-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* Gedämpfte, markenneutrale Palette: warmes Papier, Tinte, ein stilles Grau-Violett. */
:root {
  color-scheme: light;
  --page-bg: #f6f3ee; /* wird vom Modus-Skript für die Browserleiste gelesen */
  --paper: #f6f3ee;
  --card: #fffdf9;
  --ink: #26232b;
  --ink-soft: #57525e;
  --accent: #5a5268;
  --line: rgba(38, 35, 43, 0.12);
  --focus: #7a6f8f;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --column: 820px;
  --gutter: clamp(16px, 5vw, 32px);
  --portrait-ring: #fffdf9;
}

/* Nacht-Modus: gedämpftes, warmes Dunkel – gleiche Automatik und Umschalter wie auf den Marken-Seiten. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --page-bg: #17151b;
  --paper: #17151b;
  --card: #201d25;
  --ink: #eeebf2;
  --ink-soft: #b8b2c2;
  --accent: #c9bedd;
  --line: rgba(238, 235, 242, 0.12);
  --focus: #c9bedd;
  --portrait-ring: #2a2630;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --page-bg: #17151b;
    --paper: #17151b;
    --card: #201d25;
    --ink: #eeebf2;
    --ink-soft: #b8b2c2;
    --accent: #c9bedd;
    --line: rgba(238, 235, 242, 0.12);
    --focus: #c9bedd;
    --portrait-ring: #2a2630;
  }
}
.theme-transition,
.theme-transition * {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  .theme-transition,
  .theme-transition * {
    transition: none !important;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.35vw + 1rem, 1.1875rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
picture {
  display: contents;
}
a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}
p {
  margin: 0;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.m-skip {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
}
.m-skip:focus {
  top: 12px;
}

/* --- Header ---------------------------------------------------------- */
.m-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 62px;
  padding: 18px var(--gutter) 0;
}
.m-logo {
  display: block;
  flex: none;
  background-color: var(--logo-light);
  -webkit-mask: var(--logo-url) center / contain no-repeat;
  mask: var(--logo-url) center / contain no-repeat;
}
:root[data-theme='dark'] .m-logo {
  background-color: var(--logo-dark);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .m-logo {
    background-color: var(--logo-dark);
  }
}
/* Runder Tag-/Nacht-Umschalter oben rechts, wie auf den Marken-Seiten. */
.m-theme-toggle {
  position: absolute;
  top: 14px;
  right: var(--gutter);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.m-theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.m-theme-toggle__icon {
  display: inline-flex;
}
.m-theme-toggle__icon--sun,
:root[data-theme='dark'] .m-theme-toggle__icon--moon {
  display: none;
}
:root[data-theme='dark'] .m-theme-toggle__icon--sun {
  display: inline-flex;
}
:root:not(.js) .m-theme-toggle {
  display: none;
}

/* --- Inhalt ---------------------------------------------------------- */
.m-main {
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(48px, 8vw, 88px);
}
.m-section {
  margin-top: clamp(48px, 8vw, 80px);
}

.m-hero {
  text-align: center;
  padding-top: clamp(28px, 6vw, 56px);
}
.m-hero__headline {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.2;
  text-wrap: balance;
  font-style: italic;
  font-weight: 450;
  font-size: clamp(2rem, 4vw + 1rem, 3.4rem);
  color: var(--accent);
}
.m-hero__portrait {
  width: min(78vw, 360px);
  margin: clamp(28px, 5vw, 44px) auto 0;
}
.m-hero__portrait img {
  width: 100%;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 10px var(--portrait-ring), 0 0 0 11px var(--line), 0 30px 60px -30px rgba(0, 0, 0, 0.45);
}
.m-hero__name {
  margin-top: clamp(28px, 5vw, 40px);
  font-size: clamp(2.1rem, 3.6vw + 1rem, 3.2rem);
  font-weight: 500;
}
.m-hero__dates {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 14px;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.m-hero__dates span[aria-hidden] {
  margin-right: 6px;
  color: var(--accent);
}
/* Kreuz als Grafik statt Zeichen ✝ – sonst zeigt iOS ein farbiges Emoji. */
.m-cross {
  display: inline-block;
  vertical-align: -0.12em;
}

.m-farewell {
  max-width: 62ch;
  margin-inline: auto;
  text-align: center;
}
.m-farewell p {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1vw + 1rem, 1.45rem);
  line-height: 1.65;
}

/* --- Galerie: Bilder vollständig, ohne Beschnitt ---------------------- */
/* Ausgerichtete Zeilen: Breite proportional zum Seitenverhältnis (--ar), dadurch sind
   alle Bilder einer Zeile gleich hoch und werden nicht beschnitten (Desktop: 3 + 2). */
.m-gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 2vw, 20px);
}
.m-gallery__item {
  flex: var(--ar) 1 calc(var(--ar) * 280px);
  min-width: 0;
}
.m-gallery__link {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -28px rgba(38, 35, 43, 0.5);
}
.m-gallery__link img {
  width: 100%;
}
@media (max-width: 420px) {
  .m-gallery__item {
    flex-basis: 100%;
  }
}

/* --- Widmung -------------------------------------------------------- */
.m-dedication {
  text-align: center;
}
.m-dedication__title {
  font-size: clamp(1.8rem, 2vw + 1rem, 2.3rem);
  font-style: italic;
  color: var(--accent);
}
.m-dedication__group {
  margin-top: 28px;
}
.m-dedication__group h3 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.m-dedication__group p {
  max-width: 64ch;
  margin: 10px auto 0;
  line-height: 1.85;
}

/* --- Infoboxen ------------------------------------------------------ */
.m-box {
  padding: clamp(24px, 4vw, 36px);
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
}
.m-box + .m-box {
  margin-top: clamp(20px, 3vw, 28px);
}
.m-box__title {
  font-size: 1.45rem;
  margin-bottom: 12px;
}
.m-box__link {
  margin-top: 16px;
  font-weight: 600;
}
.m-box__link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* --- Footer --------------------------------------------------------- */
.m-footer {
  display: grid;
  gap: 32px;
  justify-items: center;
  padding: clamp(36px, 6vw, 56px) var(--gutter) 40px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.m-footer__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 10px;
  border-radius: 12px;
  text-align: left;
  line-height: 1.45;
  color: var(--ink-soft);
  text-decoration: none;
}
.m-footer__domain {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  color: var(--accent);
}
.m-footer__brand:hover .m-footer__domain {
  text-decoration-thickness: 2px;
}
.m-footer__brand strong {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--ink);
}
.m-footer__corporate {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 100%;
}
.m-footer__art {
  width: min(100%, 520px);
  border-radius: 12px;
}
.m-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.m-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
}
.m-footer__trust {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.m-footer__copy {
  margin-top: -0.4rem;
  font-size: 0.85rem;
}

/* --- Zurück nach oben (wie auf den Marken-Seiten) -------------------- */
.to-top {
  position: fixed;
  right: calc(clamp(16px, 3vw, 32px) + env(safe-area-inset-right, 0px));
  bottom: calc(clamp(16px, 3vw, 32px) + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: var(--paper);
  background: color-mix(in srgb, var(--accent) 62%, transparent);
  border: 1px solid color-mix(in srgb, var(--paper) 35%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px -12px rgba(20, 18, 24, 0.55);
  text-decoration: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}
.to-top:hover,
.to-top:focus-visible {
  background: color-mix(in srgb, var(--accent) 92%, transparent);
}
.js .to-top:not(.is-visible) {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .to-top {
    transition: none;
  }
}

/* --- Bildansicht (Lightbox) ---------------------------------------- */
.m-lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 56px 16px;
  border: 0;
  background: rgba(20, 18, 24, 0.94);
}
.m-lightbox::backdrop {
  background: rgba(20, 18, 24, 0.6);
}
.m-lightbox__figure {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
}
.m-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}
.m-lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.m-lightbox__btn:focus-visible {
  outline-color: #fff;
}
.m-lightbox__close {
  top: 12px;
  right: 12px;
}
.m-lightbox__prev,
.m-lightbox__next {
  top: 50%;
  margin-top: -24px;
}
.m-lightbox__prev {
  left: 12px;
}
.m-lightbox__next {
  right: 12px;
}

@media print {
  .m-header,
  .to-top,
  .m-lightbox,
  .m-box__link {
    display: none;
  }
}
