/*
 * MAIL2BLOG – EINFACHES CSS-TEMPLATE
 *
 * Schnell anpassen: In Abschnitt 1 die Werte rechts ändern.
 * Die Namen links (z. B. --color-accent) bleiben gleich.
 * Keine externen Schriften, kein CSS-Framework und kein JavaScript nötig.
 *
 * Auf dem Server: /opt/mail2blog/share/web/theme.css
 * Nach Änderungen den Dienst neu starten und den Browser neu laden.
 */

/* 1. GRUNDWERTE: Hier beginnt deine eigene Farbgestaltung. */
:root {
  --color-accent: #b51f36;       /* Links, Schaltflächen und Akzente */
  --color-accent-hover: #89172a; /* Etwas dunkler, wenn die Maus darübersteht */
  --color-accent-soft: #fff0f2;  /* Dezente Hervorhebung, etwa im Kalender */
  --color-background: #f6f5f2;   /* Hintergrund der gesamten Seite */
  --color-surface: #ffffff;      /* Hintergrund von Beiträgen und Formularen */
  --color-text: #252b34;         /* Gut lesbarer Haupttext */
  --color-muted: #59636e;        /* Zusätzliche Informationen, z. B. Datum */
  --color-input-border: #7b858f; /* Deutlich sichtbare Eingabefelder */
  --color-border: #deddd7;       /* Ruhige Trennlinien und Rahmen */
  --color-focus: #2255aa;        /* Sichtbarer Tastaturfokus */
  --color-danger: #a51d30;       /* Abgesagte Termine und Warnhinweise */

  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --content-width: 66rem;       /* Maximale Breite: kleiner = schmalere Seite */
  --space: 1rem;                /* Grundabstand, wird mehrfach verwendet */
  --radius: 0.65rem;             /* Ecken: 0 = eckig, 1rem = stärker gerundet */
}

/* 2. SEITENGERÜST: Lesebreite, Kopfzeile, Navigation und Fußzeile. */
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-background);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.site-shell {
  width: min(var(--content-width), calc(100% - 2 * var(--space)));
  margin-inline: auto;
}
.site-header { padding-top: calc(2 * var(--space)); }
.brand {
  display: inline-flex;
  gap: 0.8rem;
  align-items: center;
  color: var(--color-text);
  text-decoration: none;
  max-width: 100%;
}
.brand > span { min-width: 0; }
.brand__logo { width: 3.25rem; height: 3.25rem; flex: none; }
.brand__name { display: block; font-size: 1.4rem; font-weight: 750; letter-spacing: -0.025em; }
.brand__description { display: block; color: var(--color-muted); font-size: 0.8rem; }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.3rem;
  padding-block: var(--space);
  margin-top: var(--space);
  border-block: 1px solid var(--color-border);
}
.site-nav a { color: var(--color-text); text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
.site-nav a:hover { color: var(--color-accent); }
.site-main { padding-block: calc(2 * var(--space)); min-height: 60vh; }
.site-footer { border-top: 1px solid var(--color-border); padding-block: 1.3rem 2rem; color: var(--color-muted); font-size: 0.85rem; }
.site-footer a { color: inherit; }

/* 3. TEXTE UND BEITRÄGE: Auch gerendertes Markdown verwendet diese Regeln. */
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.15rem); margin: 0 0 1.5rem; font-weight: 700; letter-spacing: -0.035em; }
/* Seitentitel (erstes h1 in main) in Akzentrot wie die Beitragstitel in der Übersicht, dazu dezente Trennlinie. */
.site-main > h1:first-child { color: var(--color-accent); padding-bottom: 0.7rem; border-bottom: 1px solid var(--color-border); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0.5rem 0 0.8rem; }
h3 { font-size: 1.3rem; }
p { margin-block: 0.7rem 1rem; }
a { color: var(--color-accent); text-underline-offset: 0.2em; }
a:hover { color: var(--color-accent-hover); }
article, section, form {
  padding: clamp(1rem, 3vw, 1.7rem);
  margin-block: var(--space);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
article > :first-child, section > :first-child { margin-top: 0; }
article > :last-child, section > :last-child { margin-bottom: 0; }
blockquote { margin-inline: 0; padding-left: var(--space); border-left: 3px solid var(--color-accent); color: var(--color-muted); }
img { max-width: 100%; height: auto; }
pre { overflow: auto; padding: var(--space); background: var(--color-background); border-radius: 0.3rem; }
code, textarea { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
hr { border: 0; border-top: 1px solid var(--color-border); margin-block: 2rem; }
.muted { color: var(--color-muted); }
summary { cursor: pointer; font-weight: 600; }
details { margin-block: 0.8rem; }
nav:not(.site-nav) { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.2rem; margin-block: 1rem; }

/* 4. FORMULARE: Große Klickflächen und klarer Tastaturfokus. */
label { display: block; margin-block: 0.8rem; font-size: 0.95rem; font-weight: 600; }
input, select, textarea, button { font: inherit; }
input:not([type="hidden"]):not([type="checkbox"]), select, textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 2.8rem;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-input-border);
  border-radius: 0.3rem;
}
input[type="date"], input[type="time"], input[type="number"] { max-width: 18rem; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--color-accent); vertical-align: middle; }
textarea { min-height: 22rem; line-height: 1.5; resize: vertical; }
button {
  min-height: 2.8rem;
  padding: 0.6rem 1rem;
  margin: 0.35rem 0.35rem 0.35rem 0;
  color: #fff;
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 0.3rem;
  font-weight: 650;
  cursor: pointer;
}
button:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.skip-link { position: absolute; left: 1rem; top: -10rem; padding: 0.7rem; background: var(--color-surface); z-index: 10; }
.skip-link:focus { top: 0.5rem; }

/* 5. KALENDER: Monatsraster und Listenansicht teilen sich dieselben Farben. */
.calendar-filters { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: end; }
.calendar-filters label { flex: 1 1 10rem; margin-block: 0; }
.calendar-filters button { margin-bottom: 0; }
.calendar-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--color-border); }
.calendar-grid { width: 100%; min-width: 42rem; border-collapse: collapse; table-layout: fixed; background: var(--color-surface); font-size: 0.9rem; }
.calendar-grid caption { text-align: left; padding: 0.8rem; font-weight: 700; background: var(--color-surface); }
.calendar-grid th, .calendar-grid td { border: 1px solid var(--color-border); padding: 0.5rem; vertical-align: top; }
.calendar-grid th { color: var(--color-muted); font-size: 0.8rem; }
.calendar-grid td { height: 8rem; }
.calendar-grid .today { background: var(--color-accent-soft); }
.calendar-entry { display: block; margin-top: 0.5rem; padding: 0.35rem; border-left: 2px solid var(--color-accent); background: var(--color-background); font-size: 0.8rem; line-height: 1.45; text-decoration: none; }
.calendar-entry:hover { background: var(--color-accent-soft); }
.calendar-entry.cancelled { text-decoration: line-through; }
.cancelled-badge { color: var(--color-danger); }
.event-tag { display: inline-block; padding: 0.1rem 0.55rem; margin: 0.1rem 0.1rem 0.1rem 0; background: var(--color-accent-soft); color: var(--color-accent); border-radius: 0.3rem; font-size: 0.8rem; }
.post-tag { display: inline-block; padding: 0.1rem 0.55rem; margin: 0.1rem 0.1rem 0.1rem 0; background: var(--color-accent-soft); color: var(--color-accent); border-radius: 0.3rem; font-size: 0.8rem; text-decoration: none; }
.post-tags { margin: 0.2rem 0; }
.post-meta { margin: 0.2rem 0; color: var(--color-muted, inherit); }
.event-card { display: flow-root; }
.event-flyer { float: right; max-width: 8rem; max-height: 11rem; margin: 0 0 1rem 1rem; object-fit: contain; }
.event-poster { max-height: 34rem; object-fit: contain; }

/* 6. KLEINE BILDSCHIRME: Flexbox bricht automatisch um; kein Menü-Skript. */
@media (max-width: 40rem) {
  :root { --space: 0.8rem; }
  .site-header { padding-top: 1.3rem; }
  .site-main { padding-top: 1.5rem; }
  .site-nav { column-gap: 1rem; font-size: 0.95rem; }
  .brand__name { font-size: 1.25rem; }
  .event-flyer { max-width: 5rem; margin-left: 0.7rem; }
  .calendar-filters label { flex-basis: 100%; }
  button { max-width: 100%; }
}

/* 7. DRUCKANSICHT: Navigation und Formulare verbrauchen kein Papier. */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-nav, .site-footer, .skip-link, form { display: none; }
  .site-main { min-height: 0; padding-top: 1rem; }
  article, section { border: 0; padding: 0; }
  .calendar-scroll { overflow: visible; }
  .calendar-grid { min-width: 0; }
}

/* Externe Karte wird nur nach ausdrücklichem Öffnen geladen. */
.event-map { display: block; width: 100%; max-width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius); }

/* Blogübersicht: höchstens drei sichtbare Textzeilen je veröffentlichter Fassung.
 * Für zwei Zeilen beide Werte von 3 auf 2 ändern. */
.post-excerpt {
  max-width: 72ch;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
