/* EG Graveyard */

@font-face {
  font-family: "Marcellus";
  src: url("fonts/marcellus-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Farben ---------- */

:root {
  /* Kühles Grau und Nachtblau aus dem EG-Forenstil, Akzent = EG-Stahlblau */
  --nebel: #E7E9EC;        /* Hintergrund */
  --erde: #A3A9B0;         /* Bodenlinie */
  --stein: #C6CACF;        /* Grabstein */
  --stein-kante: #8E959D;
  --stein-alt: #B2B7BC;    /* verwitterter Stein (Zombie) */
  --sockel: #9AA1A8;
  --sockel-kante: #868D95;
  --gravur: #2C3238;       /* eingravierte Schrift */
  --tinte: #1B2023;
  --tinte-leise: #4D555D;
  --akzent: #2F5F8C;
  --glut: #A04E10;
  --schild: #102030;
  --schild-rahmen: rgba(232, 238, 244, .82);
  --schild-schrift: #EEF2F6;
  --korn: .16;
  --meissel-dunkel: rgba(0, 0, 0, .22);
  --meissel-hell: rgba(255, 255, 255, .55);
  color-scheme: light;
}

/* ---------- Grundlagen ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--nebel);
  color: var(--tinte);
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--akzent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--akzent); outline-offset: 3px; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Kopf ---------- */

.kopf { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem); }

.kopf-inner, .friedhof, .fuss-inner {
  max-width: 78rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Emailleschild am Friedhofstor */
.kopf-inner {
  display: grid;
  grid-template-columns: minmax(0, 30rem) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
  align-items: end;
}

.schild {
  position: relative;
  padding: 1.75rem 2rem 1.4rem;
  color: var(--schild-schrift);
  background: var(--schild);
  border-radius: .45rem;
  box-shadow: 0 .2rem 0 #070E15;
}
.schild::before {
  content: "";
  position: absolute; inset: .45rem;
  border: 2px solid var(--schild-rahmen);
  border-radius: .25rem;
  pointer-events: none;
}

.schild-kopf {
  display: flex; align-items: center; gap: 1.1rem;
  margin-bottom: 1.25rem;
}
.logo { width: 4.6rem; height: auto; flex: none; }
.logo .f { fill: var(--schild-schrift); }
.logo .l { fill: var(--schild); }

h1 {
  margin: 0;
  font-family: "Marcellus", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 4.4vw, 3rem);
  line-height: 1;
  letter-spacing: .01em;
}
/* Schriftzug wie im EG-Logo: Versalien, weit gesperrt */
h1 span {
  display: block;
  margin-top: .55rem;
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 700;
  font-size: .34em;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.belegung { margin: 0; padding: 0; }
.belegung-zeile {
  display: flex; align-items: baseline; gap: .5rem;
  padding: .3rem 0;
  border-top: 1px solid rgba(232, 238, 244, .22);
  font-size: 1rem;
}
.belegung-zeile:last-child { border-bottom: 1px solid rgba(232, 238, 244, .22); }
.belegung dt { display: flex; align-items: center; gap: .45rem; flex: 1; }
.belegung dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; }
.belegung .status-icon { opacity: .85; }

.schild-fuss { margin: .9rem 0 0; font-size: .875rem; opacity: .78; }

.kopf-text { max-width: 34rem; padding-bottom: .4rem; }
.kopf-text p { margin: 0 0 .8rem; }
.kopf-text p:first-child { font-size: clamp(1.125rem, 1.8vw, 1.3rem); line-height: 1.5; }

/* ---------- Filter ---------- */

.friedhof { padding-bottom: 4rem; }

.filter {
  display: none;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0 1.25rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--erde);
  border-bottom: 1px solid var(--erde);
}
.js .filter { display: flex; }

.filter-status { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }

.umschalter {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 2.5rem;
  padding: .3rem .1rem;
  font: inherit; font-size: 1.0625rem;
  color: var(--tinte-leise);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.umschalter:hover { color: var(--tinte); }
.umschalter[aria-pressed="true"] { color: var(--tinte); border-bottom-color: currentColor; }
.umschalter:disabled { opacity: .45; cursor: default; }

.filter-rest { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; }

.feld input, .feld select {
  font: inherit; font-size: 1rem;
  color: var(--tinte);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--stein-kante);
  border-radius: 0;
  padding: .45rem .1rem;
  min-height: 2.5rem;
}
.feld select { padding-right: .5rem; cursor: pointer; }
.feld select option { background: var(--nebel); color: var(--tinte); }
.feld--suche input { width: 14rem; }
.feld input::placeholder { color: var(--tinte-leise); opacity: 1; }
.feld input:focus, .feld select:focus { border-bottom-color: var(--tinte); }

/* ---------- Gräberfeld ---------- */

.feld-graeber {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  column-gap: clamp(1.5rem, 3vw, 2.75rem);
  row-gap: 0;
}
.grab { margin-bottom: clamp(3rem, 5vw, 4.5rem); }

/* Stein und Tafel teilen sich über die ganze Reihe zwei Zeilen,
   damit alle Bodenlinien einer Reihe auf gleicher Höhe liegen. */
.grab { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
.grab[hidden], [hidden] { display: none !important; }
.grab article { display: grid; grid-row: span 2; grid-template-rows: subgrid; }

/* Das Grabmal: Stein auf Sockel */
.grabmal { align-self: end; display: flex; flex-direction: column; align-items: center; }

.stein {
  position: relative;
  width: min(var(--breite, 84%), 15.5rem);
  padding: var(--oben, 2.3rem) 1.15rem 2.2rem;
  text-align: center;
  color: var(--gravur);
  transform: rotate(var(--neigung, 0deg));
  transform-origin: 50% 100%;
}
.form--spitz { width: min(calc(var(--breite, 84%) - 6%), 14rem); }

.stein-form {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
  z-index: -1;
}
.grab article { position: relative; z-index: 0; }

.stein-flaeche { fill: var(--stein); }
.stein-korn { fill: #000; opacity: var(--korn); }
.stein-riss {
  fill: none; stroke: var(--gravur); stroke-opacity: .45;
  stroke-width: 1.3; vector-effect: non-scaling-stroke;
  stroke-linejoin: bevel;
}
.stein-frisch {
  fill: none; stroke: var(--glut);
  stroke-width: 3; vector-effect: non-scaling-stroke;
}
.stein-umriss {
  fill: none; stroke: var(--stein-kante);
  stroke-width: 1.6; stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
}

/* Der Sockel liegt vor dem Stein und überdeckt dessen Fuß,
   damit auch schief stehende Steine ohne Lücke aufsitzen. */
.sockel {
  position: relative;
  z-index: 1;
  width: min(calc(var(--breite, 84%) + 12%), 18.5rem);
  height: 1.35rem;
  margin-top: -.8rem;
  background: var(--sockel);
  border-top: 2px solid var(--sockel-kante);
  border-radius: 2px 2px 0 0;
}

.stein-icon { width: 1.75rem; height: 1.75rem; display: block; margin: 0 auto .75rem; opacity: .7; }

/* Gemeißelt: dunkle Kante oben, helle Kante unten */
.stein-name, .stein-daten { text-shadow: 0 -1px 0 var(--meissel-dunkel), 0 1px 0 var(--meissel-hell); }

.stein-name {
  margin: 0;
  font-family: "Marcellus", Georgia, serif;
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.18;
  letter-spacing: .07em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  hyphens: auto;
  text-wrap: balance;
}

.stein-daten {
  margin: .9rem 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .1rem 1rem;
  font-family: "Marcellus", Georgia, serif;
  font-size: 1.05rem;
  letter-spacing: .05em;
}
.stein-name .nb { white-space: nowrap; }
.d-wieder { flex-basis: 100%; color: var(--akzent); text-shadow: none; }

.stein--totgeburt { color: var(--tinte-leise); }
.stein--totgeburt .stein-name, .stein--totgeburt .stein-daten { text-shadow: none; }

.stein--stirbt-bald .d-tod { color: var(--glut); text-shadow: none; }

.stein--zombie .stein-flaeche { fill: var(--stein-alt); }

/* Boden und Tafel */
.tafel {
  border-top: 3px solid var(--erde);
  padding-top: 1rem;
}

.tafel-status {
  margin: 0 0 .5rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem;
  font-size: 1rem;
  color: var(--tinte-leise);
}

.status { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; color: var(--tinte); }
.status--stirbt-bald { color: var(--glut); }
.status--zombie { color: var(--akzent); }
.status-icon { width: 1.15rem; height: 1.15rem; flex: none; }

.lebenslauf { margin: 0 0 .6rem; font-weight: 700; line-height: 1.35; }
.nachruf { margin: 0 0 .6rem; }
.ursache { margin: 0 0 .6rem; color: var(--tinte-leise); }
.ursache span { font-weight: 600; }
.mehr { margin: 0; }

/* Leerer Zustand */
.leer { padding: 3rem 0; text-align: left; }
.leer p { margin: 0 0 1rem; font-size: 1.25rem; }
.knopf {
  font: inherit; font-size: 1rem;
  padding: .55rem 1.1rem;
  min-height: 2.5rem;
  color: var(--nebel); background: var(--tinte);
  border: 0; border-radius: 2rem; cursor: pointer;
}

/* ---------- Fuß ---------- */

.fuss {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--erde);
  color: var(--tinte-leise);
  font-size: 1rem;
}
.fuss p { margin: 0 0 .5rem; }
.rechtliches { display: flex; gap: 1.25rem; }

/* ---------- Klein ---------- */

@media (max-width: 40rem) {
  body { font-size: 1.0625rem; }
  .kopf-inner { grid-template-columns: 1fr; }
  .schild { padding: 1.6rem 1.5rem 1.3rem; }
  .logo { width: 3.8rem; }
  .filter { flex-direction: column; align-items: stretch; }
  .filter-rest { flex-direction: column; }
  .feld--suche input, .feld select { width: 100%; }
  .feld-graeber { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
