/* =============================================================================
   ORTSSUCHE AUF DER WEBSITE  ·  gemeinsamjung.de/kontakt und /alltagsheld-werden

   Im Kopf der Seite, direkt unter "Lernen Sie uns kennen" und dem
   Einleitungstext: ein Feld fuer Postleitzahl oder Ort und "Weiter" in einer
   Leiste. Das Markup steht in kontakt.html der Website (Repo `website`,
   Kommentar ORTSSUCHE). Diese Datei wird nur dort eingebunden.

   Alle Klassen tragen das Praefix `gjo-`, damit nichts mit der style.css der
   Website kollidiert. Die Farben kommen aus deren Variablen; die Werte
   dahinter sind nur der Ersatz, falls eine fehlt.
   ============================================================================= */

/* Der Kopf der Website schneidet ab, was ueber seinen Rand ragt
   (overflow: hidden) -- wegen des Farbkreises oben rechts (::before), der
   sonst rechts aus der Seite hinausstuende. Die Vorschlagsliste haengt aber
   unten aus dem Kopf heraus und wuerde mit abgeschnitten. Deshalb hier nur
   noch seitlich abschneiden. `clip` statt `hidden`, weil nur clip die andere
   Richtung frei laesst. Wo ein Browser clip nicht kennt, bleibt es bei der
   Regel der Website: dann ist die Liste unten abgeschnitten, Tippen geht. */
.page-hero:has([data-gjo]) { overflow-x: clip; overflow-y: visible; }

/* position: relative wie bei Ueberschrift und Text im Kopf: sonst laege der
   Farbkreis darueber und finge auf dem Handy die Klicks auf "Weiter" ab. */
.gjo-ort { position: relative; max-width: 600px; margin: 36px auto 0; text-align: left; }

/* Beschriftung wie im frueheren ersten Schritt des Formulars (.rf-group
   label in formular.css). */
.gjo-label {
  display: block; margin: 0 0 8px 22px;
  font-size: .9rem; font-weight: 600; color: var(--text, #1a1a1a);
}

/* ---------- Die Leiste ----------
   Feld und Knopf in einer weissen Pille, der Knopf in der Form der Knoepfe
   auf der Website. Die Leiste traegt auch die Vorschlagsliste, damit die so
   breit wird wie die ganze Leiste und nicht nur wie das Feld. */
.gjo-leiste {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  background: var(--white, #fff);
  border: 2px solid rgba(26,92,42,.14);
  border-radius: 50px;
  padding: 6px;
  box-shadow: var(--shadow, 0 4px 30px rgba(0,0,0,.08));
  transition: border-color .25s;
}
.gjo-leiste:focus-within { border-color: var(--green, #1a5c2a); }

.gjo-feldzeile { flex: 1; min-width: 0; }

.gjo-feld {
  width: 100%; box-sizing: border-box;
  border: none; background: transparent; outline: none;
  padding: 14px 18px;
  font-family: inherit; font-size: 1.05rem; color: var(--text, #1a1a1a);
}
.gjo-feld::placeholder { color: var(--text-muted, #8a8a8a); }

.gjo-knopf {
  flex: none; cursor: pointer;
  background: var(--green, #1a5c2a); color: var(--white, #fff);
  border: none; border-radius: 50px;
  padding: 15px 30px;
  font-family: inherit; font-size: 1rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .25s, transform .25s, box-shadow .25s;
}
.gjo-knopf:hover {
  background: var(--green-dark, #0f3d1a);
  transform: translateY(-1px); box-shadow: 0 8px 22px rgba(26,92,42,.25);
}
.gjo-knopf svg { width: 17px; height: 17px; }

/* Ausgegraut: waehrend der Pruefung ("Wird geprüft …") und solange der
   Warteliste-Kasten dasteht -- dann geht es nur ueber dessen Knopf weiter. */
.gjo-knopf:disabled {
  background: #e3e0d9; color: var(--text-muted, #8a8a8a);
  cursor: not-allowed; transform: none; box-shadow: none;
}

/* ---------- Die Vorschlagsliste ---------- */
.gjo-liste {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  list-style: none; margin: 0; padding: 5px;
  background: var(--white, #fff); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.16);
  /* Bis zu 50 Vorschlaege, und nie hoeher als der Bildschirm. */
  max-height: min(58vh, 430px); overflow-y: auto;
}
.gjo-liste[hidden] { display: none; }

.gjo-treffer {
  padding: 12px 16px; border-radius: 12px; cursor: pointer;
  color: var(--text, #1a1a1a); line-height: 1.35;
}
.gjo-treffer b    { display: block; font-weight: 600; font-size: 1rem; }
.gjo-treffer span { display: block; font-size: .84rem; color: var(--text-muted, #8a8a8a); }
.gjo-treffer:hover, .gjo-treffer.an { background: var(--green-pale, #e8f5ec); }

.gjo-mehr {
  padding: 10px 16px 6px; font-size: .82rem; color: var(--text-muted, #8a8a8a);
  border-top: 1px solid rgba(0,0,0,.07); margin-top: 4px;
}

/* Hinweis unter der Leiste: "Wird gesucht …" grau, Fehlendes dunkel und fett. */
/* `.gjo-ort` davor, weil die Website jedem Absatz im Kopf Groesse, Abstand
   und Breite gibt (.page-hero p) -- und diese Regel waere sonst staerker. */
.gjo-ort .gjo-stand {
  max-width: none; line-height: 1.5;
  font-size: .88rem; color: var(--text-light, #5a5a5a);
  margin: 6px 0 0; padding: 0 22px; min-height: 1.3em;
}
.gjo-ort .gjo-stand.gjo-warnung { color: var(--text, #1a1a1a); font-weight: 600; }

/* ---------- Die Antwort ----------
   Wie der Kasten im frueheren ersten Schritt des Formulars (.rf-note in
   formular.css): fette erste Zeile, darunter der Satz, darunter der Weg nach
   vorn. Gruen fuer "verfuegbar", Gold fuer "noch nicht aktiv" -- keine
   Absage, ein anderer Weg --, Rot nur, wenn die Pruefung nicht klappte. */
.gjo-ergebnis {
  margin-top: 4px; padding: 18px 22px; border-radius: 12px;
  background: var(--gold-pale, #f7efde); color: var(--text, #1a1a1a);
  font-size: .95rem; line-height: 1.6; text-align: left;
}
.gjo-ergebnis[hidden] { display: none; }
.gjo-ergebnis strong { display: block; margin-bottom: 4px; }
.gjo-ergebnis a { color: var(--green, #1a5c2a); font-weight: 600; white-space: nowrap; }
.gjo-ergebnis.da { background: var(--green-pale, #e8f5ec); }
.gjo-ergebnis .zuteilung { display: block; margin-top: 6px; color: var(--text-light, #5a5a5a); font-size: .9rem; }

/* Bewerbung: "Welcher Standort soll es sein?" -- wie die Standortwahl im
   frueheren ersten Schritt von alltagsheld.html (.rf-options.klein). */
.gjo-wahl-titel { display: block; margin: 14px 0 8px; font-weight: 600; font-size: .92rem; }
.gjo-wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.gjo-wahl button {
  cursor: pointer; font-family: inherit; font-size: .9rem; color: var(--text, #1a1a1a);
  background: var(--white, #fff); border: 2px solid rgba(26,92,42,.16); border-radius: 50px;
  padding: 8px 16px; transition: border-color .2s, background .2s;
}
.gjo-wahl button span { color: var(--text-muted, #8a8a8a); font-size: .82rem; margin-left: 4px; }
.gjo-wahl button:hover { border-color: var(--green, #1a5c2a); }
.gjo-wahl button.an { border-color: var(--green, #1a5c2a); background: var(--green, #1a5c2a); color: var(--white, #fff); }
.gjo-wahl button.an span { color: rgba(255,255,255,.75); }
/* `.gjo-ort` davor wegen `.page-hero p` der Website, siehe .gjo-stand. */
.gjo-ort .gjo-wahl-hinweis { max-width: none; margin: 10px 0 0; font-size: .88rem; line-height: 1.5; font-weight: 600; }

/* "Jetzt anmelden" / "Auf die Warteliste" / "Jetzt bewerben": derselbe Knopf
   wie "Weiter". */
.gjo-ergebnis a.gjo-los {
  display: flex; width: fit-content; align-items: center; gap: 8px; margin-top: 14px;
  background: var(--green, #1a5c2a); color: var(--white, #fff);
  padding: 13px 28px; border-radius: 50px; text-decoration: none;
  transition: background .25s, transform .25s, box-shadow .25s;
}
.gjo-ergebnis a.gjo-los:hover {
  background: var(--green-dark, #0f3d1a);
  transform: translateY(-1px); box-shadow: 0 8px 22px rgba(26,92,42,.25);
}
.gjo-ergebnis a.gjo-los svg { width: 17px; height: 17px; }
/* Keine Antwort vom Server: wie .rf-note.warnung im Formular. */
.gjo-ergebnis.warnung { background: #fbeae8; }
.gjo-ergebnis.warnung strong { color: #a5301f; }

/* Auf dem Handy untereinander: ein Feld neben einem Knopf liesse dem Feld
   keine 200 Pixel. */
@media (max-width: 600px) {
  .gjo-leiste { flex-direction: column; align-items: stretch; border-radius: 24px; padding: 8px; }
  .gjo-feld { padding: 14px 16px; }
  .gjo-knopf { width: 100%; }
  .gjo-label { margin-left: 6px; }
  .gjo-ort .gjo-stand { padding: 0 6px; }
  .gjo-ergebnis a.gjo-los { width: 100%; justify-content: center; }
}

/* Wer JavaScript abgeschaltet hat, bekommt den Link statt des Feldes. Ohne
   diese Regel stuende dort ein Feld, das nichts tut. */
.gjo-ohne-js { display: none; }
.gjo-still { text-align: center; }
.gjo-still .gjo-form { display: none; }
.gjo-still .gjo-ohne-js { display: inline-flex; }
