/* ==================================================================
   Startseite – Grau/Blau, ruhig, mobil zuerst
   Designsystem übernommen aus den Tauchalben (assets/style.css),
   damit beide Seiten zusammengehören.
   ================================================================== */

:root {
  --deep:        #0f2a3c;
  --deep-2:      #17435c;
  --ink:         #16232e;
  --bg:          #eef2f6;
  --surface:     #ffffff;
  --line:        #d7e0e8;
  --line-soft:   #e6ecf2;
  --muted:       #5d7385;
  --accent:      #1c6b95;
  --accent-dark: #14536f;
  --accent-soft: #e4eef4;
  --danger:      #a33a34;

  --radius:      12px;
  --shadow-sm:   0 1px 2px rgba(15, 42, 60, .06);
  --shadow-md:   0 10px 24px -12px rgba(15, 42, 60, .35);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Farbwelt ----------
   Die Seite nutzt durchgängig das blaue Konzept der Tauchalben,
   siehe :root oben.

   Die früheren Varianten Grün und Rot sind hier aufbewahrt. Zum
   Reaktivieren: diesen Block einkommentieren, in index.php und
   user/adminUser.php die Farbermittlung zurückholen und in
   user/adminUser.php das Auswahlfeld wieder einblenden.

body.gruen {
  --deep:        #123528;
  --deep-2:      #1c503c;
  --accent:      #2f7d5a;
  --accent-dark: #245f45;
  --accent-soft: #e3efe9;
}

body.rot {
  --deep:        #3c1f1c;
  --deep-2:      #5c2e29;
  --accent:      #a34a42;
  --accent-dark: #833a33;
  --accent-soft: #f6e8e6;
}
*/

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); }

.wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: 20px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Kopfbereich ---------- */

.masthead {
  background: linear-gradient(165deg, var(--deep-2) 0%, var(--deep) 70%);
  color: #eaf1f6;
}

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 20px;
  padding-block: 26px 24px;
}

.masthead .eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #8fb2c7;
}

.masthead h1 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.1;
}

/* Die Überschrift schaltet den Bearbeitungsmodus um. */
.headline {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.headline:hover { color: #ffffff; }
.headline.static { cursor: default; }

#time {
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: #93b4c8;
  white-space: nowrap;
}

/* ---------- Bearbeitungsleiste ---------- */

.editbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.editbar button {
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.editbar button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* ---------- Tableiste ---------- */

main.wrap { padding-block: 22px 56px; flex: 1 0 auto; }

.tabarea {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 15px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.tab:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.tab.active {
  color: #fff;
  background: var(--accent);
}
.tab.active:hover { background: var(--accent-dark); }

/* Sortiernummer im Bearbeitungsmodus */
.ord {
  font-size: 11px;
  opacity: .7;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

/* ---------- Gruppenraster ---------- */

.linkarea.hidden { display: none; }

/* Spaltenlayout statt Raster.

   Die Kästen werden dicht gepackt, ohne Lücken und ohne Leerraum im
   Inneren. Der Browser füllt dabei spaltenweise: erst die linke Spalte
   von oben nach unten, dann die nächste. Genau so sind die Werte im
   Feld `order` gedacht.

   Die Spaltenzahl ergibt sich aus der Fensterbreite: auf dem Handy
   eine, auf dem Bildschirm vier oder fünf. */
.grid {
  column-width: 270px;
  column-gap: 18px;
}

.grid .group {
  /* Ein Kasten wird nie über eine Spaltengrenze zerrissen. */
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 18px;
}

/* Das Feld isLast stammt aus dem früheren Zeilenlayout und hat im
   Spaltenlayout keine Entsprechung – der Browser verteilt selbst.
   Zum Erzwingen eines Spaltenwechsels nach der Gruppe stattdessen:

   .rowbreak { break-after: column; }
*/
.rowbreak { display: none; }

/* ---------- Gruppe ---------- */

.group {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.group > h3 {
  margin: 0;
  padding: 12px 16px;
  font-size: .82rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--deep);
  background: linear-gradient(180deg, #f7fafc, var(--surface));
  border-bottom: 1px solid var(--line-soft);
}

.group.edit > h3 {
  cursor: pointer;
  color: var(--accent);
}
.group.edit > h3:hover { background: var(--accent-soft); }

.group > h3 .ord {
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.group .html {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.group .html:last-child { border-bottom: 0; }

/* ---------- Link ---------- */

.link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
}
.link:last-child { border-bottom: 0; }
.link:hover { background: #f7fafc; }

.link a {
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link a:hover { color: var(--accent); }

/* Die Zusatzziele (Admin, Log, Welt) sitzen als kleine Symbole davor. */
.link a.icon {
  flex: 0 0 auto;
  display: inline-flex;
  padding: 3px;
  border-radius: 5px;
  opacity: .55;
  transition: opacity .15s ease, background .15s ease;
}
.link a.icon:hover { opacity: 1; background: var(--accent-soft); }
.link a.icon img { width: 16px; height: 16px; }

.link .ord {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--muted);
}

.group.edit .link a { cursor: pointer; color: var(--accent); }

/* ---------- RSS ---------- */

/* Eine Gruppe mit Feed verhält sich wie jeder andere Kasten: eine
   Spalte breit, Meldungen untereinander. Für die volle Breite über
   alle Spalten stattdessen:

   .group-rss { column-span: all; }
*/

.rss {
  max-width: 100%;
  border-top: 1px solid var(--line-soft);
}
.group > h3 + .rss { border-top: 0; }

.rss .item {
  padding: 9px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.rss .item.last { border-bottom: 0; }
.rss .item:hover { background: #f7fafc; }

.rss .item a { text-decoration: none; color: var(--ink); display: block; }
.rss .item a:hover { color: var(--accent); }

.rss .title {
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Kurzfassung: auf großen Anzeigen beim Überfahren, sonst auf Tippen. */
.rss .desc {
  display: none;
  position: relative;
  margin: 0 16px 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rss .desc img.close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  cursor: pointer;
  opacity: .5;
}
.rss .desc img.close:hover { opacity: 1; }

/* ---------- Ladeanzeige ---------- */

.loading {
  display: grid;
  place-items: center;
  padding: 60px 20px;
}

/* ---------- Anmeldung ---------- */

.login {
  display: grid;
  place-items: center;
  padding-block: 40px;
}

.login-box {
  width: 100%;
  max-width: 340px;
  padding: 28px 26px 24px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.login-box h2 {
  margin: 0 0 18px;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -.01em;
}

.login-box label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

.login-box input[type=text],
.login-box input[type=password] {
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-box .check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 18px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.login-box .check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

/* Karte mit Abstand nach unten, etwa die Benutzerliste */
.group.liste { margin-bottom: 20px; }

.notice.breit {
  max-width: none;
  margin: 0 0 16px;
  text-align: left;
}

.notice {
  max-width: 340px;
  margin: 0 auto 16px;
  padding: 11px 15px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid #e0bcb9;
  background: #fbf0ef;
  color: #8d322c;
  text-align: center;
}

/* ---------- Formulare ----------
   Gilt überall: in den Bearbeitungsfenstern wie im Benutzerprofil. */

.field {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

.field input[type=text],
.field input[type=password],
.field select,
.field textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field input[readonly] {
  background: var(--bg);
  color: var(--muted);
}

.field textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Zwei Felder nebeneinander, sobald Platz ist */
.field-row {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

.hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* Hinweis in derselben Zeile wie die Beschriftung */
.hint.inline { display: inline; margin-top: 0; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.form-actions .spacer { margin-left: auto; }

/* Innenraum einer Karte, wenn dort ein Formular steht */
.group-body { padding: 18px 16px; }

@media (min-width: 640px) {
  .group-body { padding: 20px; }
}

/* ---------- Schaltflächen ---------- */

.btn {
  display: inline-block;
  padding: 9px 16px;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-quiet {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--line);
}
.btn-quiet:hover { background: var(--accent-soft); }
.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: #e2c4c1;
}
.btn-danger:hover { background: #fbf0ef; }

.btn-block { width: 100%; }

/* ---------- Leerer Zustand ---------- */

.empty {
  padding: 48px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

/* ---------- Fuß ---------- */

.foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding-block: 18px;
}
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ---------- Größere Anzeigen ---------- */

@media (min-width: 640px) {
  .masthead-inner { padding-block: 32px 28px; }
  .grid { gap: 20px; }
}

/* Auf Geräten mit Zeigegerät reicht das Überfahren für die Kurzfassung. */
@media (hover: hover) and (pointer: fine) {
  .rss .item:hover + .desc,
  .rss .desc:hover { display: block; }
  .rss .desc img.close { display: none; }
}

/* ---------- Bewegung sparsam ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
