/* ONLANG – gemeinsame Gestaltung.
   Farben und Formen wie im Admin (website-admin.html). Vorerst nutzt nur
   das Studio (studio.html) diese Datei; Admin und Template 7 haben ihre
   Gestaltung noch in der eigenen Seite.
   Zuerst fuers Handy gedacht: eine Spalte, grosse Tippflaechen. */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=DM+Serif+Display&display=swap');

:root {
  --orange: #E87722; --orange-dunkel: #d06010; --orange-hell: #FDF1E7;
  --navy: #0D1B2A;
  --gray: #F5F5F0; --text: #2A2A2A; --text-light: #666;
  --green: #2E7D32; --red: #C62828; --border: #E0E0DC;
  --lila: #6A4BC4; --lila-hell: #F1EDFB;
  --radius: 16px; --radius-klein: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'DM Sans', system-ui, sans-serif; background: var(--gray); color: var(--text); line-height: 1.5; }
a { color: var(--orange); text-decoration: none; }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ── Kopfzeile ─────────────────────────────────────────────── */
/* Der Inhalt der Kopfzeile sitzt in derselben mittigen Spalte wie die
   Seite (.od-seite) und haelt immer Abstand zum Bildschirmrand, auch bei
   Geraeten mit runden Ecken oder Aussparung (safe-area). */
.od-kopf { background: var(--navy); color: white; padding: 0.6rem 0; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
.od-kopf-innen { max-width: 560px; margin: 0 auto; padding: 0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left)); display: flex; align-items: center; gap: 0.7rem; min-height: 2.75rem; }
.od-zurueck { background: rgba(255,255,255,0.1); border: none; color: white; font-size: 1.5rem; line-height: 1; width: 2.75rem; height: 2.75rem; flex-shrink: 0; border-radius: 50%; cursor: pointer; padding: 0 0 0.15rem; }
.od-zurueck:hover, .od-zurueck:active { background: rgba(255,255,255,0.2); }
.od-logo { font-family: 'DM Serif Display', serif; font-size: 1.15rem; }
.od-logo span { color: var(--orange); }
.od-kopf-titel { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-kopf-verein { font-size: 0.75rem; font-weight: 400; color: rgba(255,255,255,0.65); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Schilder ──────────────────────────────────────────────── */
.od-kopf .od-schild { flex-shrink: 0; }
.od-schild { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.4px; padding: 0.2rem 0.6rem; border-radius: 100px; background: var(--border); color: var(--text-light); white-space: nowrap; }
.od-schild.pro { background: var(--orange); color: white; }
.od-schild.pro_plus { background: var(--lila); color: white; }
.od-schild.basic { background: rgba(255,255,255,0.18); color: white; }
.od-schild.beispiel { background: var(--orange-hell); color: var(--orange-dunkel); }
.od-schild.bald { background: var(--lila-hell); color: var(--lila); }

/* ── Seite ─────────────────────────────────────────────────── */
.od-seite { max-width: 560px; margin: 0 auto; padding: 1rem 1rem 2rem; }
.od-ansicht { display: none; }
.od-ansicht.aktiv { display: block; }
.od-abschnitt-titel { font-size: 0.78rem; font-weight: 700; color: var(--text-light); letter-spacing: 0.6px; text-transform: uppercase; margin: 1.5rem 0 0.6rem; }

/* ── Kacheln ───────────────────────────────────────────────── */
.od-kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.od-kachel { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 0.9rem; min-height: 7.5rem; text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; gap: 0.5rem; color: var(--navy); transition: transform 0.1s, border-color 0.2s; }
.od-kachel:active { transform: scale(0.98); }
.od-kachel:hover { border-color: var(--orange); }
.od-kachel-icon { font-size: 1.8rem; line-height: 1; }
.od-kachel-name { font-size: 1rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
.od-kachel-info { font-size: 0.78rem; color: var(--text-light); font-weight: 400; }
.od-kachel.haupt { background: var(--orange); border-color: var(--orange); color: white; }
.od-kachel.haupt .od-kachel-info { color: rgba(255,255,255,0.85); }
/* Noch nicht verfügbar: wie die gesperrten Kanäle, mit Schild. */
.od-kachel.bald .od-kachel-icon, .od-kachel.bald .od-kachel-name { opacity: 0.45; }
.od-kachel.bald .od-schild { margin-top: 0.3rem; }
.od-kachel[disabled] { opacity: 0.45; cursor: not-allowed; }
.od-kachel[disabled]:hover { border-color: var(--border); }
.od-kachel.haupt[disabled] { background: white; border-color: var(--border); color: var(--navy); }
.od-kachel.haupt[disabled] .od-kachel-info { color: var(--text-light); }

/* ── Karten und Hinweise ───────────────────────────────────── */
.od-karte { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1rem; margin-bottom: 0.9rem; }
.od-frage { font-family: 'DM Serif Display', serif; font-size: 1.25rem; color: var(--navy); margin-bottom: 0.15rem; }
.od-frage-hilfe { font-size: 0.82rem; color: var(--text-light); margin-bottom: 0.9rem; }
.od-hinweis { border-radius: var(--radius-klein); padding: 0.8rem 0.9rem; font-size: 0.88rem; display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.9rem; background: var(--orange-hell); color: #7a3d08; }
.od-hinweis.gross { flex-direction: column; padding: 1.1rem 1rem; font-size: 0.95rem; }
.od-hinweis.gross strong { font-size: 1.05rem; color: var(--navy); }
.od-hinweis.lila { background: var(--lila-hell); color: #3f2a85; }
.od-leer { text-align: center; color: var(--text-light); font-size: 0.9rem; padding: 1.5rem 0.5rem; }

/* ── Formular ──────────────────────────────────────────────── */
.od-feld { margin-bottom: 0.9rem; }
.od-feld:last-child { margin-bottom: 0; }
.od-label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--text-light); letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 0.3rem; }
.od-eingabe { width: 100%; background: white; border: 1.5px solid var(--border); color: var(--text); padding: 0.8rem 0.9rem; border-radius: var(--radius-klein); font-size: 1rem; font-family: inherit; outline: none; transition: border-color 0.2s; }
.od-eingabe:focus { border-color: var(--orange); }
.od-eingabe:disabled { background: var(--gray); color: var(--text); opacity: 1; }
textarea.od-eingabe { min-height: 8.5rem; resize: vertical; line-height: 1.5; }
.od-zeile { display: flex; gap: 0.6rem; }
.od-zeile > * { flex: 1; min-width: 0; }
input.od-eingabe[type="date"], input.od-eingabe[type="time"] { min-width: 0; max-width: 100%; min-height: 3.1rem; }

/* Bilder */
.od-bilder { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.od-bild, .od-bild-neu { width: 5rem; height: 5rem; border-radius: var(--radius-klein); border: 1.5px solid var(--border); background: var(--gray) center / cover no-repeat; }
.od-bild-neu { border-style: dashed; color: var(--text-light); font-size: 1.6rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.od-bild-neu:hover { border-color: var(--orange); color: var(--orange); }
.od-bild { position: relative; }
/* Knopf "Bild entfernen" oben rechts auf dem Bild */
.od-bild-weg { position: absolute; top: -0.5rem; right: -0.5rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 2px solid white; background: var(--navy); color: white; font-size: 0.85rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
/* Die Tippfläche ist größer als der sichtbare Knopf. */
.od-bild-weg::after { content: ''; position: absolute; inset: -0.5rem; }
.od-bilder.beschaeftigt { opacity: 0.55; pointer-events: none; }

/* Auswahl-Zeilen: Haekchen (WOHIN) und Punkte (WANN) */
.od-wahl { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.25rem; border-bottom: 1px solid var(--border); cursor: pointer; min-height: 3.25rem; }
.od-wahl:last-child { border-bottom: none; }
.od-wahl input { width: 1.4rem; height: 1.4rem; accent-color: var(--orange); flex-shrink: 0; cursor: pointer; }
.od-wahl-icon { font-size: 1.25rem; width: 1.6rem; text-align: center; flex-shrink: 0; }
.od-wahl-text { flex: 1; min-width: 0; font-weight: 500; }
.od-wahl-info { display: block; font-size: 0.78rem; font-weight: 400; color: var(--text-light); }
.od-wahl.aus { cursor: default; }
.od-wahl.aus .od-wahl-icon, .od-wahl.aus .od-wahl-name { opacity: 0.45; }
.od-wahl.aus input { cursor: not-allowed; }
.nur-termin > .od-wahl, .nur-termin > .od-plus { display: none; }
.od-link { background: none; border: none; color: var(--orange); font-size: 0.82rem; font-weight: 700; cursor: pointer; padding: 0.5rem 0.5rem; min-height: 2.75rem; }
.od-unterfeld { padding: 0.25rem 0 0.75rem 2.4rem; }

/* Mehr Optionen */
.od-mehr { margin-top: 0.9rem; border-top: 1px solid var(--border); padding-top: 0.6rem; }
.od-mehr summary { cursor: pointer; font-size: 0.88rem; font-weight: 700; color: var(--text-light); padding: 0.4rem 0; list-style: none; }
.od-mehr summary::-webkit-details-marker { display: none; }
.od-mehr summary::after { content: ' ▾'; }
.od-mehr[open] summary::after { content: ' ▴'; }
.od-mehr[open] summary { margin-bottom: 0.6rem; }

/* Knoepfe */
.od-knopf { width: 100%; background: var(--orange); color: white; border: none; padding: 1rem; border-radius: 100px; font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.od-knopf:hover { background: var(--orange-dunkel); }
.od-knopf.zweit { background: white; color: var(--navy); border: 1.5px solid var(--border); }
.od-knopf-weitere { display: flex; flex-direction: column; gap: 0.6rem; padding-bottom: 0.75rem; }
.od-knopf-leiste { position: sticky; bottom: 0; background: linear-gradient(to top, var(--gray) 70%, rgba(245,245,240,0)); padding: 1rem 0 0.75rem; margin-top: 0.5rem; }

/* ── Listen ────────────────────────────────────────────────── */
.od-liste { background: white; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.od-eintrag { display: flex; gap: 0.75rem; align-items: center; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); cursor: pointer; width: 100%; background: white; border-left: none; border-right: none; border-top: none; text-align: left; font-size: inherit; color: inherit; }
.od-eintrag:last-child { border-bottom: none; }
.od-eintrag:active { background: var(--gray); }
.od-eintrag-bild { width: 3.25rem; height: 3.25rem; border-radius: var(--radius-klein); background: var(--gray) center / cover no-repeat; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.od-eintrag-text { flex: 1; min-width: 0; }
/* Titel und zweite Zeile als Block: nur so kürzt der Browser zu lange
   Texte mit "…" statt sie am Rand abzuschneiden. */
.od-eintrag-text br { display: none; }
.od-eintrag-titel, .od-eintrag-meta { display: block; }
.od-eintrag-titel { font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-eintrag-meta { font-size: 0.78rem; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Pro+-Zeile mit Schloss */
.od-plus { display: flex; align-items: center; gap: 0.75rem; background: white; border: 1px dashed var(--lila); border-radius: var(--radius); padding: 0.85rem 0.9rem; width: 100%; text-align: left; cursor: pointer; font-size: inherit; color: inherit; margin-top: 0.9rem; }
.od-plus-icon { font-size: 1.3rem; flex-shrink: 0; }
.od-plus-text { flex: 1; min-width: 0; font-weight: 700; color: var(--navy); }
.od-plus-info { display: block; font-size: 0.78rem; font-weight: 400; color: var(--text-light); }

/* ── Meldung unten ─────────────────────────────────────────── */
/* left + right + margin auto: die Meldung darf fast so breit werden wie der
   Bildschirm (mit left: 50% wäre bei halber Breite Schluss). */
.od-meldung { position: fixed; left: 1rem; right: 1rem; margin: 0 auto; width: fit-content; bottom: calc(1.25rem + env(safe-area-inset-bottom)); transform: translateY(1rem); background: var(--navy); color: white; padding: 0.8rem 1.1rem; border-radius: 1.4rem; font-size: 0.9rem; font-weight: 500; box-shadow: 0 6px 24px rgba(0,0,0,0.25); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: 30rem; text-align: center; z-index: 100; }
.od-meldung.sichtbar { opacity: 1; transform: translateY(0); }

/* ── Fusszeile ─────────────────────────────────────────────── */
.od-fuss { text-align: center; font-size: 0.8rem; color: var(--text-light); padding: 1.5rem 1rem 2rem; }
.od-fuss a { display: inline-block; padding: 0.8rem 0.35rem; }
.od-stand { font-size: 0.7rem; opacity: 0.6; margin-top: 0.35rem; }

/* Schmales Handy: Datum und Uhrzeit des Termins untereinander. */
@media (max-width: 430px) {
  .od-unterfeld .od-zeile { flex-direction: column; }
}

@media (min-width: 600px) {
  .od-seite { padding-top: 1.5rem; }
  .od-kachel { min-height: 8.5rem; padding: 1.25rem 1.1rem; }
}

/* ── Editor mit Werkzeugleiste ─────────────────────────────── */
.od-feld-hilfe { font-size: 0.78rem; color: var(--text-light); margin-top: 0.3rem; }
.od-leiste { display: flex; align-items: center; gap: 0.35rem; border: 1.5px solid var(--border); border-bottom: none; border-radius: var(--radius-klein) var(--radius-klein) 0 0; background: var(--gray); padding: 0.35rem; }
.od-leiste + .od-editor { border-top-left-radius: 0; border-top-right-radius: 0; }
.od-werkzeug { min-width: 2.75rem; height: 2.75rem; padding: 0 0.5rem; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--navy); font-size: 1rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; white-space: nowrap; }
.od-werkzeug:active { background: var(--orange-hell); border-color: var(--orange); }
.od-werkzeug.breit { font-size: 0.82rem; font-weight: 700; padding: 0 0.6rem; }
.od-editor-fuss { text-align: right; }
.od-editor { min-height: 9.5rem; line-height: 1.6; overflow-wrap: anywhere; cursor: text; }
.od-editor:empty::before { content: attr(placeholder); color: #999; pointer-events: none; }
.od-editor.gesperrt { background: var(--gray); cursor: default; }
.od-editor a, .od-artikel-text a { color: var(--orange-dunkel); text-decoration: underline; }
.od-editor p, .od-artikel-text p { margin-bottom: 0.9em; }
.od-editor p:last-child, .od-artikel-text p:last-child { margin-bottom: 0; }
.od-video-block { display: flex; align-items: center; gap: 0.5rem; background: var(--navy); color: white; border-radius: 8px; padding: 0.55rem 0.5rem 0.55rem 0.75rem; margin: 0.4rem 0; font-size: 0.85rem; user-select: none; }
.od-video-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-video-weg { background: rgba(255,255,255,0.15); border: none; color: white; width: 2.75rem; height: 2.75rem; border-radius: 50%; cursor: pointer; flex-shrink: 0; }

/* Player (So sieht es aus, Beitrag ansehen) */
.od-player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: black; border-radius: var(--radius-klein); overflow: hidden; margin: 0.9em 0; }
.od-player iframe, .od-player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Artikel in "So sieht es aus" */
.od-artikel-meta { font-size: 0.78rem; color: var(--text-light); margin-bottom: 0.35rem; }
.od-artikel-titel { font-family: 'DM Serif Display', serif; font-weight: 400; font-size: 1.5rem; line-height: 1.25; color: var(--navy); margin-bottom: 0.8rem; overflow-wrap: anywhere; }
.od-artikel-bild { width: 100%; border-radius: var(--radius-klein); margin-bottom: 0.9rem; display: block; }
.od-artikel-text { font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }

/* Eingabe-Blatt von unten (Link, Video) */
.od-blatt-hintergrund { position: fixed; inset: 0; background: rgba(13,27,42,0.5); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.od-blatt { background: white; width: 100%; max-width: 560px; border-radius: var(--radius) var(--radius) 0 0; padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom)); box-shadow: 0 -8px 32px rgba(0,0,0,0.2); }
.od-blatt-fehler { color: var(--red); font-size: 0.85rem; margin-top: 0.5rem; }
.od-blatt-knoepfe { margin-top: 1rem; }
