/* Dienstplan Christkindlmarkt
   Schwarze Kacheln wie im Öffnungskalender des Marktes,
   „Kerzen“ für die Plätze: brennt = besetzt, aus = frei. */

@font-face {
  font-family: "Jost";
  src: url("fonts/jost.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #eef0f2;        /* Schnee */
  --paper: #ffffff;
  --ink: #2b2f33;       /* Graphit */
  --strong: #000000;
  --muted: #5c636a;
  --line: #d5d9dd;
  --silver: #9aa1a8;
  --tile: #000000;
  --tile-ink: #ffffff;
  --tile-past: #6a7178;
  --tile-off: #5e656c;  /* Kerze aus, auf schwarzer Kachel */
  --amber: #f0a12e;     /* Kerze an */
  --amber-glow: rgba(240, 161, 46, .55);
  --focus: #b86e00;
  --danger: #a3202e;
  --radius: 10px;
  --font: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f2226;
    --paper: #2a2e33;
    --ink: #e6e9ec;
    --strong: #ffffff;
    --muted: #a3aab1;
    --line: #3b4046;
    --silver: #6c737b;
    --tile: #000000;
    --tile-past: #4a5057;
    --tile-off: #575e66;
    --focus: #f0a12e;
    --danger: #ff8a95;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--strong); margin: 0; line-height: 1.15; }

a { color: inherit; }

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

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1rem; }

.visually-hidden, .hp {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip { position: absolute; left: -999px; top: .5rem; background: var(--strong); color: var(--bg); padding: .5rem .8rem; z-index: 10; }
.skip:focus { left: .5rem; }

/* ─── Kopf ─────────────────────────────────────────────── */

.hero { padding: 2.2rem 0 1.4rem; }

.place { margin: 0 0 .35rem; color: var(--muted); font-weight: 500; }

.hero h1 {
  font-size: clamp(2.3rem, 9vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1;
}

.intro { margin: .9rem 0 0; max-width: 34em; }

.tally { margin: 1.1rem 0 0; font-size: 1.15rem; }
.tally strong { color: var(--strong); font-weight: 700; }

/* ─── Kalender ─────────────────────────────────────────── */

.overview { margin-bottom: 2rem; }

.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.cal-wd {
  text-align: center;
  font-weight: 600;
  font-size: .85rem;
  color: var(--strong);
  padding-bottom: .15rem;
}

.cal-day {
  aspect-ratio: 1 / 1.08;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  border-radius: 4px;
  color: var(--silver);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  position: relative;
}

.cal-day .m { font-size: .68rem; line-height: 1; margin-bottom: -.2rem; }

a.cal-day {
  background: var(--tile);
  color: var(--tile-ink);
  font-weight: 600;
  font-size: 1.15rem;
}
a.cal-day.is-past { background: var(--tile-past); }
a.cal-day.is-full { box-shadow: inset 0 -3px 0 var(--amber); }
a.cal-day:hover { outline: 2px solid var(--amber); outline-offset: 1px; }

@media (prefers-color-scheme: dark) {
  a.cal-day { box-shadow: inset 0 0 0 1px #4a5058; }
  a.cal-day.is-full { box-shadow: inset 0 0 0 1px #4a5058, inset 0 -3px 0 var(--amber); }
}

.candles { display: flex; gap: 3px; line-height: 0; }
.candles .gap { width: 3px; }
.candles-text { font-size: .72rem; font-weight: 500; }

.candle {
  display: inline-block;
  width: 5px;
  height: 12px;
  border-radius: 2px;
  border: 1.5px solid var(--silver);
  vertical-align: -1px;
}
.cal-day .candle { border-color: var(--tile-off); }
.candle.lit {
  background: var(--amber);
  border-color: var(--amber) !important;
  box-shadow: 0 0 6px var(--amber-glow);
}
.is-past .candle.lit { box-shadow: none; }

.legend {
  display: flex;
  gap: 1.2rem;
  margin: .7rem 0 0;
  font-size: .9rem;
  color: var(--muted);
}
.legend .candle { margin-right: .3rem; }

@media (min-width: 560px) {
  .cal { gap: 8px; }
  a.cal-day { font-size: 1.35rem; }
  .candle { width: 6px; height: 14px; }
}

/* ─── Deine Dienste ────────────────────────────────────── */

.mine {
  background: var(--tile);
  color: var(--tile-ink);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem .4rem;
  margin-bottom: 2rem;
}
@media (prefers-color-scheme: dark) { .mine { box-shadow: inset 0 0 0 1px #4a5058; } }

.mine h2 { color: var(--tile-ink); font-size: 1.25rem; margin-bottom: .4rem; }
.mine ul { list-style: none; margin: 0; padding: 0; }
.mine li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  padding: .75rem 0;
  border-top: 1px solid #33373c;
}
.mine li:first-child { border-top: 0; }
.mine .what { flex: 1 1 14rem; }
.mine .what strong { display: block; font-weight: 600; }
.mine .what span { color: #b9bfc5; font-size: .95rem; }
.mine .acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.mine .late { color: #b9bfc5; font-size: .88rem; flex-basis: 100%; margin: -.2rem 0 0; }

/* ─── Terminliste ──────────────────────────────────────── */

.list-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .6rem 1rem;
  margin-bottom: .6rem;
}
.list-head h2 { font-size: 1.6rem; font-weight: 700; }

.switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; font-size: .98rem; }
.switch input {
  appearance: none; -webkit-appearance: none;
  width: 2.6rem; height: 1.5rem; margin: 0;
  border-radius: 999px; background: var(--line);
  position: relative; cursor: pointer; transition: background .15s;
  flex: none;
}
.switch input::after {
  content: ""; position: absolute; top: .2rem; left: .2rem;
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .15s;
}
.switch input:checked { background: var(--strong); }
.switch input:checked::after { transform: translateX(1.1rem); }

.week { margin-top: 1.8rem; }
.week-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; margin-bottom: .2rem; }
.week-h h3 { font-size: 1.25rem; font-weight: 600; }
.week-h span { color: var(--muted); }

.day {
  display: grid;
  grid-template-columns: 4.1rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1rem;
}
.day:first-of-type { border-top: 0; }

.day-tile {
  width: 4.1rem;
  height: 4.4rem;
  background: var(--tile);
  color: var(--tile-ink);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.day-tile .wd { font-size: .85rem; font-weight: 500; }
.day-tile .dn { font-size: 1.75rem; font-weight: 700; margin: .12rem 0 .1rem; }
.day-tile .mo { font-size: .8rem; color: #c3c8cd; }
.day.is-past .day-tile { background: var(--tile-past); }
@media (prefers-color-scheme: dark) { .day-tile { box-shadow: inset 0 0 0 1px #4a5058; } }

.day:target .day-tile { animation: ping 1.4s ease-out 1; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 var(--amber-glow); }
  40% { box-shadow: 0 0 0 8px var(--amber-glow); }
  100% { box-shadow: 0 0 0 14px transparent; }
}

.shift + .shift { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }

.shift-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: .5rem .8rem;
}
.shift h4 { margin: 0; font-size: 1.12rem; font-weight: 600; color: var(--strong); line-height: 1.25; }
.shift .time { color: var(--muted); font-size: .98rem; }

.seats {
  list-style: none;
  margin: .55rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1rem;
}
.seats li { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.seats .free { color: var(--muted); }

.tag {
  display: inline-block;
  padding: .12rem .55rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  background: var(--line);
  color: var(--strong);
}
.tag.me { background: var(--amber); color: #000; }

.status { color: var(--muted); font-size: .95rem; }

.empty, .loading, .notice {
  padding: 1rem 1.1rem;
  background: var(--paper);
  border-radius: var(--radius);
  margin: 1rem 0;
}
.notice { border-left: 4px solid var(--amber); }

/* ─── Buttons ──────────────────────────────────────────── */

.btn {
  appearance: none;
  border: 2px solid var(--strong);
  background: var(--strong);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  padding: .55rem 1.15rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  min-height: 2.75rem;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn-big { width: 100%; padding: .85rem 1rem; font-size: 1.08rem; }
.btn-small { min-height: 2.4rem; padding: .35rem .9rem; font-size: .95rem; }
.btn-ghost { background: transparent; color: var(--strong); }
.btn-ondark { background: transparent; border-color: #fff; color: #fff; }
.btn-ondark.solid { background: #fff; color: #000; }

/* ─── Dialog ───────────────────────────────────────────── */

dialog {
  border: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  width: min(100%, 30rem);
  max-height: 92vh;
  max-height: 92dvh;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
dialog::backdrop { background: rgba(0, 0, 0, .55); }

@media (max-width: 559px) {
  dialog {
    margin: auto 0 0;
    max-width: 100%;
    width: 100%;
    border-radius: 16px 16px 0 0;
  }
  dialog[open] { animation: rise .22s ease-out; }
}
@keyframes rise { from { transform: translateY(30px); opacity: .4; } }

.sheet { padding: 1.2rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .9rem; }
.sheet[hidden] { display: none; }

.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .2rem; }
.sheet-kicker { margin: 0 0 .2rem; color: var(--muted); font-weight: 500; }
.sheet-head h2 { font-size: 1.55rem; font-weight: 700; }
.sheet-sub { margin: .25rem 0 0; }

.x {
  appearance: none; border: 0; background: var(--bg); color: var(--strong);
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  font-size: 1.6rem; line-height: 1; cursor: pointer; flex: none;
}

.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span { font-weight: 500; }
.field small { font-weight: 400; color: var(--muted); font-size: .88rem; }

.field input {
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: .7rem .8rem;
  width: 100%;
}
.field input:focus { outline: none; border-color: var(--strong); background: var(--paper); }
.field input[aria-invalid="true"] { border-color: var(--danger); }

.consent { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; font-size: .95rem; cursor: pointer; }
.consent input { width: 1.25rem; height: 1.25rem; margin: .12rem 0 0; accent-color: #000; }

.error { margin: 0; color: var(--danger); font-weight: 500; }

.keep { background: var(--bg); border-radius: var(--radius); padding: .9rem; }
.keep p { margin: 0 0 .6rem; font-size: .95rem; }
.copy { display: flex; gap: .5rem; }
.copy input {
  flex: 1; min-width: 0; font: inherit; font-size: .9rem; color: var(--muted);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem;
}

/* ─── Fuß ──────────────────────────────────────────────── */

.foot { margin-top: 3rem; padding: 1.5rem 0 calc(2rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.foot p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
