/* ============================================================
   mahnbescheid - MAHNGERICHTE (Post-Type „mahngerichte")
   Gerichtsseite und Übersicht im Ratgeber-Look. Baut auf
   ratgeber.css auf (Blatt, Aktenleiste, Aktenspalte, Akkordeon)
   und ergänzt nur, was ein Gericht mehr hat: Steckbrief mit
   kleiner Zuständigkeitskarte, Standortbild, Finder, Verzeichnis.

   Geladen nur auf Gerichtsseiten und der Übersicht
   (inc/mahngerichte.php → mb_mg_enqueue), dazu überall, wo der
   Finder oder das Standortbild gerendert wird. Tokens aus
   tokens.css und ratgeber.css (--rg-*).
   ============================================================ */

/* --- Kopf des Blatts --- */
.mg-funktion{
  margin: -6px 0 16px;
  font-size: 15.5px; line-height: 1.5;
  color: var(--c-ink-soft);
}

/* ============================================================
   1) ZUSTÄNDIGKEITSKARTE
   Eine Inline-SVG mit sechzehn Pfaden. Neutral grau, die
   zuständigen Länder in der Primärfarbe. Kein Radius, kein
   Schatten - das Blatt trägt die Karte wie eine Abbildung.
   ============================================================ */
.mg-karte{
  margin: 8px 0 28px;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 8px 24px;
  align-items: start;
}
.mg-karte-svg{ display: block; width: 100%; height: auto; grid-row: 1 / span 2; }
.mg-karte figcaption{
  font-size: 14px; line-height: 1.55; color: var(--c-ink-soft);
  align-self: end;
}
.mg-land{
  fill: var(--rg-tint-2);
  stroke: var(--rg-paper);
  stroke-width: 1.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill .15s;
}
.mg-land.is-zustaendig{ fill: var(--c-primary); stroke: var(--rg-paper); }
.mg-land-link{ cursor: pointer; outline: none; }
.mg-land-link:hover .mg-land,
.mg-land-link:focus .mg-land{ fill: var(--c-primary-100); stroke: var(--c-primary); }
.mg-land-link:hover .mg-land.is-zustaendig,
.mg-land-link:focus .mg-land.is-zustaendig{ fill: var(--c-primary-700); }
.mg-land-link:focus-visible .mg-land{ stroke: var(--c-accent); stroke-width: 3; }

/* Chips: die zuständigen Länder als Liste, rechteckig wie alles hier. */
.mg-laender{
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
  align-self: start;
}
.mg-chip{
  display: inline-block;
  background: var(--c-primary-100); color: var(--c-primary-700);
  padding: 4px 10px;
  font-size: 13px; font-weight: 600; line-height: 1.3;
}

/* Die klickbare Karte der Übersicht: größer, die Liste daneben. */
.mg-karte-hub{
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 16px 32px;
  align-items: start;
  margin: 0 0 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rg-rule);
}
.mg-karte-hub .mg-karte{ display: block; margin: 0; }
.mg-karte-hub .mg-karte figcaption{ margin-top: 8px; }
.mg-karte-liste{
  list-style: none; margin: 0; padding: 0;
  columns: 2; column-gap: 24px;
  font-size: 14.5px; line-height: 1.5;
}
.mg-karte-liste li{
  break-inside: avoid;
  padding: 6px 0;
  border-bottom: 1px solid var(--rg-rule-soft);
}
.mg-karte-land{ display: block; font-size: 12.5px; color: var(--c-muted); }
.mg-karte-liste a{ color: var(--c-ink); text-decoration: none; font-weight: 500; }
.mg-karte-liste a:hover{ color: var(--c-primary-700); text-decoration: underline; }
.mg-karte-offen{ color: var(--c-muted); font-style: italic; }

.mg-nrw-liste{ padding-left: 20px; }
.mg-nrw-liste li{ margin: 0 0 6px; }

/* Kopf der Übersicht: Aktenleiste unter der Überschrift, wie auf dem Blatt. */
.mg-hub-kopf .rg-akte{ margin: 0 0 14px; }
.mg-hub-kopf .rg-kicker{ margin-bottom: 8px; }

/* ============================================================
   1b) STECKBRIEF
   Vier Felder unter dem Lead: Anschrift und Kontakt, Zuständig
   für (mit kleiner Karte), Einreichung, Standort. Ein Kasten in
   der Blattfarbe mit Strich oben und unten - kein zweites Blatt,
   eine Tabelle im Blatt. Die Titel sind h2, damit Screenreader
   die Felder als Abschnitte finden, gesetzt aber wie die
   Beschriftungen der Aktenleiste.
   ============================================================ */
.mg-steckbrief{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 8px 0 36px;
  border-top: 2px solid var(--c-ink);
  border-bottom: 1px solid var(--rg-rule);
  background: var(--rg-tint);
}
.mg-sb{
  padding: 18px 22px 20px;
  border-bottom: 1px solid var(--rg-rule-soft);
  min-width: 0;
}
.mg-sb:nth-child(odd){ border-right: 1px solid var(--rg-rule-soft); }
.mg-sb:nth-last-child(-n+2){ border-bottom: 0; }
.mg-sb-titel{
  margin: 0 0 10px;
  font-size: 11.5px; font-weight: 700; line-height: 1.3;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--c-muted);
}
.mg-sb-zustaendig-inhalt{
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 16px;
  align-items: start;
}
.mg-sb-karte .mg-karte-svg{ display: block; width: 100%; height: auto; }
.mg-sb-zustaendig-text .mg-laender{ margin-bottom: 10px; }
.mg-sb-satz{ margin: 0 0 8px; font-size: 14.5px; line-height: 1.55; color: var(--c-ink); }
.mg-sb-norm{ margin: 0; font-size: 13px; line-height: 1.5; color: var(--c-muted); }
.mg-sb-standort .mg-standort-bild{ border-color: var(--rg-rule); }
.mg-sb-standort .mg-standort-aktion{ margin-top: 10px; }

/* ============================================================
   2) AKTENSPALTE DES GERICHTS
   Finder, Verzeichnis, Antrag - nicht sticky, das Verzeichnis
   mit siebzehn Zeilen ist höher als der Bildschirm.
   ============================================================ */
.mg-aside{ position: static; }
.mg-modul-verzeichnis .mg-karte-liste{ columns: 1; font-size: 14px; }
.mg-modul-verzeichnis .mg-karte-liste li{ padding: 5px 0; }
.mg-verzeichnis-mehr{ margin: 12px 0 0; font-size: 13.5px; }
.mg-verzeichnis-mehr a{ color: var(--c-primary-700); }

.mg-anschrift{
  font-style: normal;
  font-size: 14.5px; line-height: 1.55; color: var(--c-ink);
  margin: 0 0 14px;
}
.mg-anschrift strong{ font-weight: 600; }
.mg-anschrift-funktion{ color: var(--c-ink-soft); }
.mg-anschrift-post{ color: var(--c-muted); font-size: 13.5px; }

.mg-kontakt{ margin: 0; display: flex; flex-direction: column; gap: 8px; }
.mg-kontakt > div{ display: grid; grid-template-columns: 88px 1fr; gap: 10px; }
.mg-kontakt dt{ color: var(--c-muted); font-size: 13px; font-weight: 600; padding-top: 1px; }
.mg-kontakt dd{ margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--c-ink); overflow-wrap: anywhere; }
.mg-kontakt a{ color: var(--c-primary-700); text-decoration: none; }
.mg-kontakt a:hover{ text-decoration: underline; }

/* Datenaustausch: ein Strich je Zeile, wie die Versprechen im Antragskasten. */
.mg-eda{ list-style: none; margin: 0; padding: 0; }
.mg-eda li{
  position: relative;
  padding: 7px 0 7px 18px;
  border-bottom: 1px solid var(--rg-rule-soft);
  font-size: 14.5px; line-height: 1.45; color: var(--c-ink);
}
.mg-eda li:first-child{ padding-top: 0; }
.mg-eda li:first-child::before{ top: 9px; }
.mg-eda li:last-child{ border-bottom: 0; padding-bottom: 0; }
.mg-eda li::before{
  content: ""; position: absolute; left: 0; top: 16px;
  width: 8px; height: 1px; background: var(--c-primary);
}
.mg-eda a{ color: var(--c-primary-700); }
.mg-eda-hinweis{ margin: 12px 0 0; font-size: 13px; line-height: 1.55; color: var(--c-muted); }

/* ============================================================
   3) STANDORT: eigenes Bild, Google erst nach Klick
   ============================================================ */
.mg-standort{ margin: 0; }
.mg-standort-bild{ display: block; width: 100%; height: auto; border: 1px solid var(--rg-rule); }
.mg-standort-platzhalter{
  display: flex; align-items: center; justify-content: center;
  min-height: 140px;
  background: var(--rg-tint); border: 1px solid var(--rg-rule);
  text-align: center; padding: 16px;
}
.mg-standort-platzhalter p{ margin: 0; font-size: 14px; color: var(--c-ink-soft); }
.mg-standort-frame{ display: block; width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--rg-rule); }
.mg-standort-aktion{ margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.mg-standort-aktion .rg-btn{ width: 100%; text-align: center; }
.mg-standort-hinweis{ margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--c-muted); }
.mg-standort-link{ font-size: 13.5px; color: var(--c-primary-700); }
.mg-standort figcaption{
  margin: 12px 0 0;
  font-size: 12.5px; line-height: 1.5; color: var(--c-muted);
}
.mg-standort figcaption a{ color: inherit; }

/* ============================================================
   4) FINDER
   Feldklassen mb-r-* kommen aus rechner.css - derselbe Look wie
   die Rechner, der Finder ist ein Werkzeug wie sie.
   ============================================================ */
.mg-finder{ margin: 0; }
.mg-finder .mb-r-feld{ margin-bottom: 14px; }
.mg-finder-titel{ font-weight: 600; color: var(--c-ink); margin: 0 0 6px; }
.mg-finder-erklaerung{ font-size: 13.5px; line-height: 1.55; color: var(--c-ink-soft); margin: 0 0 14px; }
.mg-finder-senden{ width: 100%; text-align: center; }
.mg-finder-ergebnis:not(:empty){
  margin: 14px 0 0;
  padding: 12px 14px;
  background: var(--rg-tint); border-left: 2px solid var(--c-primary);
  font-size: 14.5px; line-height: 1.55; color: var(--c-ink);
}
.mg-finder-ergebnis p{ margin: 0 0 8px; }
.mg-finder-ergebnis p:last-child{ margin-bottom: 0; }
.mg-finder-ergebnis ul{ margin: 8px 0 0; padding-left: 18px; }
.mg-finder-ergebnis a{ color: var(--c-primary-700); }
.mg-finder-quelle{ margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--c-muted); }
.mg-finder-quelle a{ color: inherit; }

/* Der Finder im Fließtext eines Beitrags (Kurzbefehl): begrenzte Breite. */
.rg-text .mg-finder{ max-width: 560px; margin: 26px 0; }

/* ============================================================
   5) SCHMALE BILDSCHIRME
   ============================================================ */
@media (max-width: 720px){
  .mg-karte,
  .mg-karte-hub{ grid-template-columns: 1fr; }
  .mg-karte-svg{ max-width: 260px; grid-row: auto; }
  .mg-karte-liste{ columns: 1; }
  /* Auf dem Telefon ist die Liste die Karte: Sechzehn Klickflächen auf
     einer 260 Pixel breiten Silhouette trifft niemand mit dem Daumen. */
  .mg-karte-klickbar .mg-karte-svg{ display: none; }
  .mg-kontakt > div{ grid-template-columns: 1fr; gap: 2px; }
  .mg-steckbrief{ grid-template-columns: 1fr; }
  .mg-sb{ padding: 16px 16px 18px; }
  .mg-sb:nth-child(odd){ border-right: 0; }
  .mg-sb:nth-last-child(-n+2){ border-bottom: 1px solid var(--rg-rule-soft); }
  .mg-sb:last-child{ border-bottom: 0; }
  .mg-sb-zustaendig-inhalt{ grid-template-columns: 88px 1fr; }
}

@media print{
  .mg-standort-aktion,
  .mg-modul-finder{ display: none; }
}
