/* Schriften liegen auf dem eigenen Server (DSGVO). Atkinson Hyperlegible ist für gute Lesbarkeit bei Sehschwäche entwickelt. */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('../fonts/material-symbols-outlined-400.woff2') format('woff2');
}

/* Grünes Theme. Die *-invert-l-Werte sorgen für weiße Schrift auf dunkelgrünen Flächen (Kontrast > 7:1). */
:root {
  --app-forest: hsl(140deg, 40%, 20%);
  --app-focus: hsl(40deg, 100%, 50%);

  /* 17px Grundschrift: gut lesbar, aber nicht wuchtig. Eingabefelder bleiben damit über 16px (sonst zoomt iOS). */
  --bulma-body-size: 106.25%;
  --bulma-family-primary: 'Atkinson Hyperlegible', Verdana, Arial, sans-serif;
  --bulma-body-background-color: hsl(100deg, 20%, 96%);

  /* Ruhigere Überschriften (Bulma-Standard: 2rem / 1.5rem / 1.25rem) */
  --bulma-size-3: 1.6rem;
  --bulma-size-4: 1.3rem;
  --bulma-size-5: 1.1rem;

  /* Weichere Optik: rundere Ecken, sanfte Schatten */
  --bulma-radius: 0.5rem;
  --bulma-radius-large: 0.875rem;
  --bulma-box-padding: 1.125rem;
  --bulma-shadow: 0 1px 2px rgb(20 50 30 / 6%), 0 4px 14px rgb(20 50 30 / 6%);
  --app-shadow-raised: 0 2px 4px rgb(20 50 30 / 8%), 0 10px 24px rgb(20 50 30 / 10%);

  --bulma-primary-h: 140deg;
  --bulma-primary-s: 40%;
  --bulma-primary-l: 26%;
  --bulma-primary-invert-l: 100%;
  --bulma-primary-on-scheme-l: 26%;

  --bulma-link-h: 140deg;
  --bulma-link-s: 40%;
  --bulma-link-l: 26%;
  --bulma-link-invert-l: 100%;
  --bulma-link-on-scheme-l: 26%;

  /* Dunkleres Rot: Bulmas Standard-Rot erreicht als Schriftfarbe auf Weiß nur ca. 3:1. */
  --bulma-danger-s: 75%;
  --bulma-danger-l: 40%;
  --bulma-danger-invert-l: 100%;
  --bulma-danger-on-scheme-l: 40%;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 1.5em;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* Knöpfe und Felder mindestens 44px hoch – Empfehlung für die Bedienung mit dem Finger */
.button,
.input {
  min-height: 44px;
}

/* Deutlich sichtbarer Fokusrahmen für die Bedienung per Tastatur. */
:focus-visible {
  outline: 3px solid var(--app-focus);
  outline-offset: 2px;
}

/* Links sind immer unterstrichen, damit sie als klickbar erkennbar sind. */
.content a,
p a {
  text-decoration: underline;
}

/* Kopfbereich */
.site-header {
  background-color: var(--app-forest);
  color: #fff;
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 1rem;
}

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
}

.site-title:hover {
  color: #fff;
}

/* Hauptmenü: immer sichtbar, kein verstecktes Burger-Menü */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.main-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: none;
  border: 0;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.main-nav-item .material-symbols-outlined {
  font-size: 1.3em;
}

.main-nav-item:hover {
  background-color: rgb(255 255 255 / 14%);
  color: #fff;
}

.main-nav-item[aria-current='page'] {
  background-color: #fff;
  color: var(--app-forest);
  font-weight: 700;
}

.main-nav-item {
  position: relative;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background-color: hsl(var(--bulma-warning-h), var(--bulma-warning-s), var(--bulma-warning-l));
  color: #000;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Handy: alle Menüpunkte in einer Reihe, Symbol über dem Text (wie bei Apps üblich) */
@media (max-width: 600px) {
  .nav-badge {
    position: absolute;
    top: 0.1rem;
    right: 0.3rem;
  }

  #app-nav,
  .main-nav {
    width: 100%;
  }

  .main-nav {
    /* Immer eine Zeile – egal ob 4 Punkte (Mitglieder) oder 5 (Moderatoren/Admins) */
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }

  .main-nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    width: 100%;
    padding: 0.35rem 0.2rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    line-height: 1.15;
    text-align: center;
    hyphens: auto;
  }

  .site-title {
    font-size: 1.1rem;
  }
}

/* Inhaltsbereich */
.site-main {
  padding: 1.5rem 1rem 3rem;
}

@media (max-width: 600px) {
  .site-main {
    padding-top: 1rem;
  }

  :root {
    --bulma-size-3: 1.4rem;
    --bulma-box-padding: 1rem;
  }
}

.breadcrumb {
  font-size: 0.95rem;
}

.site-main:focus {
  outline: none;
}

.page-narrow {
  max-width: 34rem;
  margin: 0 auto;
}

.page-medium {
  max-width: 48rem;
  margin: 0 auto;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header .title {
  margin-bottom: 0.5rem;
}

/* Große, vollständig anklickbare Karten für Gruppen und Themen */
.list-cards {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.list-cards .list-card {
  margin-bottom: 0;
}

.list-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.list-card-title .title {
  margin-bottom: 0.5rem;
}

.list-card-meta {
  color: var(--bulma-text-weak);
}

/* Beiträge */
.post-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.post-header span {
  color: var(--bulma-text-weak);
}

.post.is-unread {
  border-left: 0.5rem solid hsl(var(--bulma-warning-h), var(--bulma-warning-s), var(--bulma-warning-l));
}

.post-body {
  overflow-wrap: anywhere;
}

/* Startseite */
.section-block {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-header .title {
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}

.card-grid .box {
  margin-bottom: 0;
}

.dashboard-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
}

.dashboard-hint-action {
  margin-left: auto;
  text-decoration: underline;
}

/* Marktplatz */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.box.listing-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
}

.listing-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: hsl(100deg, 15%, 90%);
}

.listing-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bulma-text-weak);
}

.listing-card-body {
  padding: 1rem;
}

.listing-card-body .title {
  margin: 0.5rem 0;
}

/* Handy: Anzeigen als kompakte Zeilen mit kleinem Bild links, statt sehr hoher Kacheln */
@media (max-width: 600px) {
  .listing-grid {
    grid-template-columns: 1fr;
  }

  .box.listing-card {
    flex-direction: row;
  }

  .listing-card-image {
    flex: 0 0 7.5rem;
    width: 7.5rem;
    aspect-ratio: auto;
    min-height: 7.5rem;
  }

  .listing-card-body {
    min-width: 0;
    padding: 0.75rem;
  }
}

.listing-price {
  color: hsl(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l));
  font-size: 1.1rem;
  font-weight: 700;
}

.listing-detail {
  display: grid;
  gap: 1.5rem;
}

/* Breite Bildschirme: Fotos links, Angaben rechts */
@media (min-width: 900px) {
  .listing-detail {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.listing-photos {
  display: grid;
  gap: 1rem;
}

.listing-photos img {
  width: 100%;
  border-radius: var(--bulma-radius-large);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-tabs .button[aria-current='page'] {
  border-color: transparent;
  background-color: hsl(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l));
  color: #fff;
  font-weight: 700;
}

/* Fotoauswahl im Anzeigenformular */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.photo-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.photo-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--bulma-radius);
}

.photo-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
}

/* Der Datei-Knopf ist ein <label>; das eigentliche Eingabefeld ist unsichtbar, aber per Tastatur erreichbar. */
label.button:focus-within {
  outline: 3px solid var(--app-focus);
  outline-offset: 2px;
}

/* Große Auswahlknöpfe statt kleiner Radiobuttons */
fieldset.field {
  min-width: 0;
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
}

.choice span {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.4rem 1rem;
  border: 2px solid var(--bulma-border);
  border-radius: 0.5rem;
  background-color: var(--bulma-scheme-main);
  cursor: pointer;
}

.choice input:checked + span {
  border-color: hsl(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l));
  background-color: hsl(var(--bulma-primary-h), var(--bulma-primary-s), 92%);
  font-weight: 700;
}

.choice input:focus-visible + span {
  outline: 3px solid var(--app-focus);
  outline-offset: 2px;
}

/* Großes Ankreuzfeld */
.checkbox-large {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: 700;
}

.checkbox-large input {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.1rem;
}

/* Regeln über dem Anzeigenformular */
.rules-box ul {
  margin-left: 1.25rem;
  list-style: disc;
}

.rules-box li + li {
  margin-top: 0.25rem;
}

.push-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Schritt-für-Schritt-Anleitung (z. B. App auf dem iPhone installieren) */
.steps {
  margin-left: 1.5rem;
  list-style: decimal;
}

.steps li + li {
  margin-top: 0.5rem;
}

.steps .icon {
  vertical-align: middle;
}

/* Nachrichten als Chat-Verlauf */
.chat {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.chat-message {
  display: flex;
}

.chat-message.is-own {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(36rem, 85%);
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  background-color: var(--bulma-scheme-main);
  box-shadow: var(--bulma-shadow);
  overflow-wrap: anywhere;
}

.chat-message.is-own .chat-bubble {
  background-color: hsl(140deg, 40%, 90%);
}

.chat-meta {
  margin-top: 0.25rem;
  color: var(--bulma-text-weak);
  font-size: 0.85rem;
}

.details-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  margin-bottom: 1.5rem;
  overflow-wrap: anywhere;
}

.details-list dt {
  font-weight: 700;
}

/* Rückmeldungen */
.toast-container {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 100;
  max-width: 32rem;
  margin-left: auto;
}

.toast-container .notification {
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 20%);
  cursor: pointer;
}

/* Handy: Meldungen unten im Daumenbereich, damit sie das Menü nicht verdecken */
@media (max-width: 600px) {
  .toast-container {
    top: auto;
    bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}

/* Reservierte Anzeigen: Bild leicht abgeblendet, damit Verfügbares ins Auge fällt */
.listing-card.is-reserved .listing-card-image {
  opacity: 0.6;
}

/* Weiche Übergänge: Karten heben sich beim Überfahren leicht an, Knöpfe reagieren sanft */
.box {
  border: 1px solid rgb(20 50 30 / 5%);
}

a.box {
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

a.box:hover {
  box-shadow: var(--app-shadow-raised);
  transform: translateY(-2px);
}

a.box:active {
  transform: translateY(0);
}

.button {
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.notification {
  border-radius: var(--bulma-radius-large);
}

.tag:not(body) {
  border-radius: 999px;
}

/* Wer in den Systemeinstellungen „Bewegung reduzieren“ gewählt hat, bekommt keine Animationen. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }

  a.box:hover {
    transform: none;
  }
}

/* Mein Konto: Einträge als große, ganz anklickbare Zeilen */
.settings-list {
  display: grid;
  gap: 0.75rem;
}

.settings-list .box {
  margin-bottom: 0;
}

.settings-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-link-text {
  display: flex;
  flex: 1;
  flex-direction: column;
}

/* Aufzählungen ohne eigene Formatierung (z. B. Hinweise zum Löschen, Rollenbeschreibung) */
.steps-plain,
.role-help {
  margin-left: 1.25rem;
  list-style: disc;
}

.steps-plain li + li,
.role-help li + li {
  margin-top: 0.25rem;
}

.role-help {
  margin-top: 0.75rem;
  color: var(--bulma-text-weak);
  font-size: 0.9rem;
}

/* Vorläufiges Passwort: groß und eindeutig lesbar, damit es sich gut vorlesen lässt */
.temporary-password-value {
  margin: 0.5rem 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  user-select: all;
}

/* Fußzeile mit Impressum und Datenschutz – auf jeder Seite, auch vor der Anmeldung */
.site-footer {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem 2rem;
  color: var(--bulma-text-weak);
  font-size: 0.9rem;
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
}

/* Platzhalter in Impressum/Datenschutz, die der Vorstand noch ausfüllen muss */
.placeholder {
  padding: 0 0.2rem;
  border-radius: 0.25rem;
  background-color: hsl(48deg, 100%, 85%);
}

/* Vereinswappen in der Kopfzeile */
.site-logo {
  display: block;
  width: auto;
  height: 2.5rem;
}

@media (max-width: 600px) {
  .site-logo {
    height: 2rem;
  }
}

/* Suche */
.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.search-form .control {
  flex: 1;
}

mark {
  padding: 0 0.1rem;
  border-radius: 0.2rem;
  background-color: hsl(48deg, 100%, 80%);
  color: inherit;
}
