/* Blog (blog.html).

   Ergänzung zu landing.css, nicht Ersatz: Farben, Schrift, Schaltflächen,
   Kopf- und Fußzeile kommen von dort. Hier steht nur, was der Blog zusätzlich
   braucht – Kopfbereich, Hausregeln, Formular und Beitragsliste.

   Es werden ausschließlich die Variablen aus landing.css verwendet
   (--brand, --accent, --paper, --panel, --line, --ink, --muted). Damit
   verschiebt sich der Blog automatisch mit, falls die Farben der Startseite
   je angepasst werden. */

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

/* Dieselbe dunkelgrüne Bühne wie der Hero der Startseite, nur flacher: Der
   Blog beginnt schneller mit dem Inhalt. */
.blog-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 7vw, 84px) 0 clamp(40px, 5vw, 64px);
  color: #fff;
  background:
    radial-gradient(ellipse 60% 80% at 50% -10%, rgba(232, 135, 30, 0.26), transparent 68%),
    var(--brand);
}

/* Das feine Raster erinnert an Millimeterpapier und stellt die Verbindung
   zum Planer her. Identisch zur Abschlussfläche in landing.css. */
.blog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 100% at 50% 30%, #000 30%, transparent 78%);
}

.blog-hero-inner {
  position: relative;
  max-width: 760px;
}

.blog-hero h1 {
  margin-top: 18px;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
}

.blog-hero .h1-line { display: block; }
.blog-hero .h1-accent { color: var(--accent); }

.blog-hero .lead {
  max-width: 62ch;
  margin-top: 20px;
  color: var(--on-dark);
  font-size: 18px;
}

.blog-hero-actions { margin-top: 30px; }
.blog-hero-actions .cta-note { margin-top: 12px; color: rgba(255, 255, 255, 0.6); }

/* ------------------------------------------------------------ Hausregeln */

.blog-rules {
  padding: clamp(36px, 5vw, 56px) 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.rule-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 24px 32px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.rule-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.rule-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--accent-ink);
  background: rgba(232, 135, 30, 0.12);
  border-radius: 11px;
}

.rule-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rule-list h3 {
  font-size: 17px;
  font-weight: 800;
}

.rule-list p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

/* -------------------------------------------------------------- Formular */

.blog-form-section { padding-bottom: 0; }

.blog-form-card {
  padding: clamp(26px, 4vw, 40px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(30, 46, 36, 0.07);
}

.blog-form-card h2 { font-size: clamp(24px, 3vw, 32px); }
.blog-form-card .section-lead { font-size: 16px; }

.blog-form {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.field { display: grid; gap: 7px; }

.field label {
  font-size: 15px;
  font-weight: 700;
}

.field-optional {
  color: var(--muted);
  font-weight: 500;
}

.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 190px;
  line-height: 1.6;
  resize: vertical;
}

.field input[type="text"]:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(232, 135, 30, 0.18);
}

/* Rot bekommt zusätzlich einen Textrahmen: Farbe allein wäre für
   Farbfehlsichtige kein Hinweis. Die Meldung darunter sagt, was fehlt. */
.field.is-invalid input[type="text"],
.field.is-invalid textarea {
  border-color: #b3261e;
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.14);
}

.field-count {
  color: var(--muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.field-count.is-over { color: #b3261e; font-weight: 700; }
.field-count.is-ok { color: #3f6b4f; }

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field-captcha:empty { display: none; }

.form-hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Rückmeldung nach dem Absenden. Der Rahmen links trägt die Bedeutung
   zusätzlich zur Farbe. */
.form-message {
  padding: 13px 16px;
  font-size: 15px;
  line-height: 1.55;
  border-radius: 11px;
  border-left: 4px solid var(--line);
  background: var(--paper);
}

.form-message.is-error {
  color: #7a1c16;
  background: #fdf1f0;
  border-left-color: #b3261e;
}

.form-message.is-success {
  color: #23482f;
  background: #eef6ef;
  border-left-color: #3f7d55;
}

.form-message.is-info {
  color: #5a4212;
  background: #fdf6e9;
  border-left-color: var(--accent);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Zurückhaltende Schaltfläche für Nebenwege (Abbrechen, Nachladen, Melden).
   btn-primary und btn-ghost aus landing.css passen hier nicht: Das eine ist
   zu laut, das andere für dunklen Grund gemacht. */
.btn-quiet {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.btn-quiet:hover {
  color: var(--ink);
  background: var(--paper);
  border-color: #c9d0c5;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* -------------------------------------------------------------- Beiträge */

.blog-list-section { background: var(--paper); }

.blog-list {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}

.blog-state {
  padding: 30px 2px;
  color: var(--muted);
  font-size: 16px;
}

.blog-post {
  padding: 26px 26px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(30, 46, 36, 0.05);
  transition: box-shadow 0.2s ease;
}

.blog-post:hover { box-shadow: 0 18px 40px rgba(30, 46, 36, 0.09); }

/* Ein gerade selbst abgeschickter Beitrag bekommt eine dezente Markierung,
   damit er in der Liste wiederzufinden ist. */
.blog-post.is-own { border-color: rgba(232, 135, 30, 0.5); }

.blog-post-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
}

.blog-post h3 {
  flex: 1 1 100%;
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 800;
  /* Überschriften kommen von außen: Ein einzelnes langes Wort darf die
     Karte nicht sprengen. */
  overflow-wrap: anywhere;
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.blog-author {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.blog-meta-sep { color: var(--line); }

.blog-badge {
  padding: 2px 9px;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(232, 135, 30, 0.14);
  border-radius: 999px;
}

/* white-space: pre-line erhält die Absätze der schreibenden Person, ohne
   dass dafür HTML erlaubt werden müsste: Der Text wird ausschließlich als
   Text eingesetzt (textContent), niemals als Auszeichnung. */
.blog-body {
  margin-top: 14px;
  color: #33413a;
  font-size: 16.5px;
  line-height: 1.66;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.blog-post-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Melden und Zurückziehen sind Randfunktionen und sehen auch so aus –
   sichtbar genug zum Finden, leise genug, um nicht zum Klicken einzuladen. */
.post-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.post-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.post-action:hover {
  color: #b3261e;
  background: #fdf1f0;
  border-color: rgba(179, 38, 30, 0.4);
}

.post-action-own:hover {
  color: var(--accent-ink);
  background: #fdf6e9;
  border-color: rgba(232, 135, 30, 0.45);
}

.post-action[disabled] {
  opacity: 0.6;
  cursor: default;
}

.post-action[disabled]:hover {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.post-note {
  color: var(--muted);
  font-size: 14px;
}

.post-note.is-done { color: #3f6b4f; font-weight: 600; }

/* Auswahl des Meldegrundes. Erscheint erst nach dem Klick auf „Melden“ –
   ein Klick allein soll noch nichts auslösen. */
.report-box {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  margin-top: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.report-box p {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
}

.report-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-reasons button {
  padding: 7px 13px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.report-reasons button:hover {
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* Ohne diese Zeile zöge das Raster den Abbrechen-Knopf auf die volle Breite
   und er sähe wichtiger aus als die eigentliche Auswahl darüber. */
.report-box > .post-action { justify-self: start; }

.blog-more {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

/* ----------------------------------------------------------- Rückmeldung */

/* Kurze Meldung am unteren Rand nach dem Melden oder Zurückziehen. */
.blog-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 120;
  max-width: min(440px, calc(100% - 32px));
  padding: 13px 20px;
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  background: var(--brand);
  border-radius: 13px;
  box-shadow: 0 16px 40px rgba(16, 28, 21, 0.32);
  translate: -50% 0;
  animation: toast-in 0.28s ease-out both;
}

.blog-toast.is-leaving { animation: toast-out 0.5s ease-in both; }

@keyframes toast-in {
  from { opacity: 0; translate: -50% 14px; }
  to   { opacity: 1; translate: -50% 0; }
}

@keyframes toast-out {
  from { opacity: 1; translate: -50% 0; }
  to   { opacity: 0; translate: -50% 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-toast, .blog-toast.is-leaving { animation: none; }
}

/* Ohne JavaScript werden weder Beiträge geladen noch abgeschickt. Statt
   einer leeren Fläche steht dann eine Erklärung da. */
.blog-noscript {
  padding: 20px 22px;
  margin-top: 30px;
  color: var(--ink);
  font-size: 16px;
  background: #fdf6e9;
  border: 1px solid rgba(232, 135, 30, 0.4);
  border-radius: 14px;
}

/* -------------------------------------------------------------- Schmaler */

@media (max-width: 760px) {
  .blog-post { padding: 22px 20px 20px; }
  .blog-form-card { border-radius: 16px; }
  .form-actions .btn { width: 100%; }
  .rule-list { gap: 20px; }
}

@media (max-width: 520px) {
  .blog-hero .lead { font-size: 16.5px; }
  .blog-post-foot { gap: 8px 10px; }
}
