/* FMT Gallery — eigenständiges Stylesheet.
   Farben über Variablen, damit sich das Plugin leicht an andere Seiten anpassen
   lässt, ohne im CSS zu suchen. */

.fmtg {
  --fmtg-accent:   #7B6530;
  --fmtg-ink:      #1a1a1a;
  --fmtg-soft:     #666;
  --fmtg-border:   #c8b89a;
  --fmtg-surface:  #fff;
  --fmtg-cols:     4;
  --fmtg-gap:      14px;

  /* Filterkarte — heller Seitenton, damit sich der Bereich ruhig vom
     Bildraster absetzt, ohne wie ein Werkzeugkasten zu wirken. */
  --fmtg-panel:        #fbf8f3;
  --fmtg-panel-border: #e9e1d3;
  --fmtg-label:        #96805c;
  --fmtg-hover:        #f3ece0;
}

/* ══════════════ FILTERBEREICH ══════════════
   Ruhige Karte im Seitenton, Beschriftungen über den Bedienelementen.
   Alle Regeln mit .fmtg vorangestellt und mit ausdrücklichen Werten, weil
   das Theme (Divi) eigene Vorgaben für label, select, input und button
   mitbringt. */

.fmtg .fmtg-filters {
  display: block !important; position: relative; z-index: 2;
  box-sizing: border-box;
  margin: 0 0 28px !important; padding: 24px 26px 18px !important;
  float: none !important; overflow: visible !important;
  background: var(--fmtg-panel, #fbf8f3);
  border: 1px solid var(--fmtg-panel-border, #e9e1d3);
  border-radius: 14px;
}

/* Reihen */
.fmtg .fmtg-frow {
  display: flex !important; flex-wrap: wrap;
  align-items: flex-start; gap: 18px 44px;
  margin: 0 !important; float: none !important;
}
.fmtg .fmtg-frow--chips {
  margin-bottom: 22px !important;
  /* Enger als die Standardreihe: Die Kästen grenzen die Gruppen jetzt
     sichtbar ab, ein großer Zwischenraum wäre doppelt gemoppelt. */
  gap: 14px !important;
  align-items: stretch !important;   /* beide Kästen gleich hoch */
}
.fmtg .fmtg-frow--selects {
  gap: 14px !important;
  align-items: stretch !important;   /* alle Kästen gleich hoch */
}

/* Jede Filtergruppe steht in einem eigenen Kasten.
   Ohne Grenze verschwimmen sechs Beschriftungen und ihre Bedienelemente zu
   einer einzigen Fläche, und man sieht nicht mehr, welcher Knopf und welche
   Liste zu welcher Frage gehören. Der Kasten ist etwas dunkler als die
   Filterkarte, damit die weißen Chips und Felder darin hervortreten.
   box-sizing, damit die festen Spaltenbreiten weiter unten die Polsterung
   einschließen und die Reihe nicht breiter wird als vorher. */
.fmtg .fmtg-filters .fmtg-fgroup {
  box-sizing: border-box !important;
  padding: 12px 15px 14px !important;
  border: 1px solid var(--fmtg-panel-border, #e9e1d3) !important;
  border-radius: 10px !important;
  background: var(--fmtg-group, #f5efe4) !important;
}

/* Eine Beschriftung mit ihrem Bedienelement darunter */
.fmtg .fmtg-fgroup {
  display: flex !important; flex-direction: column !important;
  align-items: stretch !important;
  gap: 9px; min-width: 0;
  height: auto !important; max-height: none !important;
  margin: 0 !important; padding: 0 !important;
  float: none !important; position: static !important;
  overflow: visible !important;
}
.fmtg .fmtg-flabel {
  display: block !important; width: auto !important;
  margin: 0 !important; padding: 0 !important;
  float: none !important; position: static !important;
  font-size: .7rem; font-weight: 700; font-family: inherit;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--fmtg-label, #96805c);
  line-height: 1.2; white-space: nowrap;
}

/* Breiten der Auswahlspalten — feste Werte, damit nichts zusammenfällt */
.fmtg .fmtg-fgroup--anlass   { flex: 0 1 22rem; }
.fmtg .fmtg-fgroup--jahr     { flex: 0 1 12rem; }
.fmtg .fmtg-fgroup--fotograf { flex: 0 1 14rem; }
.fmtg .fmtg-fgroup--tags     { flex: 0 1 13rem; }

/* ── Chips ── */
.fmtg .fmtg-chips {
  display: flex !important; flex-wrap: wrap; gap: 9px;
  float: none !important;
}
.fmtg .fmtg-chip {
  display: inline-flex !important; align-items: center; justify-content: center;
  width: auto !important; height: auto !important; min-height: 0 !important;
  margin: 0 !important; float: none !important; position: static !important;
  padding: .5em 1.25em !important;
  border: 1px solid var(--fmtg-panel-border, #e3d9c8) !important;
  border-radius: 999px !important;
  background: var(--fmtg-surface, #fff) !important;
  color: var(--fmtg-accent, #7B6530) !important;
  font-size: .85rem; font-weight: 600; font-family: inherit;
  line-height: 1.25; cursor: pointer;
  text-transform: none; letter-spacing: normal; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.fmtg .fmtg-chip:hover {
  background: var(--fmtg-hover, #f3ece0) !important;
  border-color: var(--fmtg-accent, #7B6530) !important;
}
.fmtg .fmtg-chip.is-active {
  background: var(--fmtg-accent, #7B6530) !important;
  border-color: var(--fmtg-accent, #7B6530) !important;
  color: #fff !important;
}

/* ── Auswahlfelder und Suchfeld ── */
.fmtg .fmtg-fgroup select.fmtg-select-filter,
.fmtg .fmtg-search input.fmtg-search__input {
  display: block !important; box-sizing: border-box !important;
  width: 100% !important; max-width: 100% !important;
  height: 42px !important; min-height: 42px !important; max-height: 42px !important;
  margin: 0 !important;
  float: none !important; position: static !important;
  overflow: visible !important;
  padding: 0 2.2em 0 1em !important;
  border: 1px solid var(--fmtg-panel-border, #e3d9c8) !important;
  border-radius: 999px !important;
  background-color: var(--fmtg-surface, #fff) !important;
  color: var(--fmtg-accent, #7B6530) !important;
  font-size: .85rem; font-weight: 500; font-family: inherit;
  line-height: 40px !important;
  text-overflow: ellipsis; vertical-align: middle;
  box-shadow: none !important;
  transition: border-color .15s, box-shadow .15s;
}
.fmtg .fmtg-fgroup select.fmtg-select-filter {
  cursor: pointer; appearance: none !important; -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23967f57' stroke-width='2.2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right .85em center !important;
  background-size: 14px !important;
}
.fmtg .fmtg-fgroup select.fmtg-select-filter:focus,
.fmtg .fmtg-search input.fmtg-search__input:focus {
  outline: none !important;
  border-color: var(--fmtg-accent, #7B6530) !important;
  box-shadow: 0 0 0 3px rgba(123, 101, 48, .15) !important;
}

/* Suchfeld mit Lupe */
.fmtg .fmtg-search {
  position: relative !important; display: block !important;
  width: 100%; margin: 0 !important; float: none !important;
}
.fmtg .fmtg-search__icon {
  position: absolute; left: 1em; top: 50%; transform: translateY(-50%);
  color: var(--fmtg-label, #96805c); pointer-events: none;
}
.fmtg .fmtg-search input.fmtg-search__input {
  padding: 0 1em 0 2.7em !important; font-weight: 400;
  -webkit-appearance: none !important; appearance: none !important;
}
.fmtg .fmtg-search input.fmtg-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.fmtg .fmtg-search input.fmtg-search__input::placeholder {
  color: var(--fmtg-soft, #999); opacity: 1;
}

/* ── Fußleiste ── */
.fmtg .fmtg-bar {
  display: flex !important; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 20px 0 0 !important; padding: 14px 0 0 !important;
  border-top: 1px solid var(--fmtg-panel-border, #e9e1d3);
  float: none !important;
}
.fmtg .fmtg-count {
  font-size: .85rem; font-weight: 600; color: var(--fmtg-soft, #7a7266);
  white-space: nowrap; margin: 0 !important;
}
.fmtg.is-loading .fmtg-count { opacity: .45; }
.fmtg.is-loading .fmtg-grid  { opacity: .55; transition: opacity .15s; }

.fmtg .fmtg-active__lead[hidden] { display: none !important; }
.fmtg .fmtg-active__lead {
  font-size: .82rem; font-weight: 600; color: var(--fmtg-label, #96805c);
  margin-left: 6px;
}
.fmtg .fmtg-active__list { display: flex !important; flex-wrap: wrap; gap: 8px; }
.fmtg .fmtg-active__chip {
  display: inline-flex !important; align-items: center; gap: 8px;
  width: auto !important; height: auto !important; min-height: 0 !important;
  max-width: 20rem; margin: 0 !important; float: none !important;
  padding: .35em .65em .35em 1em !important;
  border: none !important; border-radius: 999px !important;
  background: var(--fmtg-accent, #7B6530) !important; color: #fff !important;
  font-size: .8rem; font-weight: 600; font-family: inherit; cursor: pointer;
  text-transform: none; letter-spacing: normal;
}
.fmtg .fmtg-active__chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmtg .fmtg-active__chip em { font-style: normal; font-size: 1.05em; opacity: .85; }
.fmtg .fmtg-active__chip:hover em { opacity: 1; }

.fmtg .fmtg-reset {
  margin: 0 0 0 auto !important;
  padding: .3em 0 !important;
  width: auto !important; height: auto !important; min-height: 0 !important;
  border: none !important; background: none !important;
  color: var(--fmtg-accent, #7B6530) !important;
  font-size: .85rem; font-weight: 700; font-family: inherit;
  text-decoration: none; cursor: pointer;
  float: none !important; text-transform: none; letter-spacing: normal;
  transition: opacity .15s;
}
.fmtg .fmtg-reset:hover:not(:disabled) { text-decoration: underline; }
.fmtg .fmtg-reset:disabled { opacity: .35; cursor: default; }

/* ── Schmalere Bildschirme ── */
@media (max-width: 900px) {
  .fmtg .fmtg-frow { gap: 16px 24px; }
  .fmtg .fmtg-fgroup--anlass,
  .fmtg .fmtg-fgroup--jahr,
  .fmtg .fmtg-fgroup--fotograf,
  .fmtg .fmtg-fgroup--tags { flex: 1 1 14rem; }
}
@media (max-width: 640px) {
  .fmtg .fmtg-filters { padding: 18px 16px 14px !important; }
  .fmtg .fmtg-fgroup { flex: 1 1 100% !important; }
  .fmtg .fmtg-reset { margin-left: 0 !important; }
}

/* ── Raster ── */
.fmtg-grid {
  display: grid;
  gap: var(--fmtg-gap);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) {
  .fmtg-grid { grid-template-columns: repeat(min(3, var(--fmtg-cols)), 1fr); }
}
@media (min-width: 960px) {
  .fmtg-grid { grid-template-columns: repeat(var(--fmtg-cols), 1fr); }
}

.fmtg-item { margin: 0; min-width: 0; }
.fmtg-item__btn {
  display: block; width: 100%; padding: 0; border: 0;
  background: none; cursor: pointer; overflow: hidden;
  border-radius: 8px; line-height: 0;
}
.fmtg-item__btn img {
  width: 100%; height: 100%; aspect-ratio: 4 / 3;
  object-fit: cover; display: block;
  transition: transform .35s ease;
}
.fmtg-item__btn:hover img { transform: scale(1.04); }

.fmtg-item__cap {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 6px; font-size: .8rem; line-height: 1.35;
}
.fmtg-item__text  { color: var(--fmtg-ink); }
.fmtg-item__photo { color: var(--fmtg-soft); font-size: .74rem; }

.fmtg-empty { color: var(--fmtg-soft); padding: 28px 0; }

/* ── Mehr laden ── */
.fmtg-more-wrap { display: flex; justify-content: center; margin-top: 26px; }
.fmtg-more {
  padding: .6em 1.8em;
  border: 1.5px solid var(--fmtg-accent);
  border-radius: 999px;
  background: var(--fmtg-surface);
  color: var(--fmtg-accent);
  font-weight: 700; cursor: pointer;
  transition: background .15s, color .15s;
}
.fmtg-more:hover:not(:disabled) { background: var(--fmtg-accent); color: #fff; }
.fmtg-more:disabled { opacity: .6; cursor: default; }

/* ── Lightbox ── */
.fmtg-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .92);
  padding: 24px;
}
.fmtg-lightbox[aria-hidden="false"] { display: flex; }

.fmtg-lb__inner {
  margin: 0; max-width: 92vw; max-height: 88vh;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.fmtg-lb__img {
  max-width: 92vw; max-height: 80vh;
  object-fit: contain; display: block;
}
.fmtg-lb__cap {
  color: #eee; font-size: .85rem; text-align: center;
  max-width: 70ch;
}

.fmtg-lb__close,
.fmtg-lb__nav {
  position: absolute;
  border: 0; background: rgba(255, 255, 255, .12);
  color: #fff; cursor: pointer; line-height: 1;
  border-radius: 50%;
  transition: background .15s;
}
.fmtg-lb__close:hover,
.fmtg-lb__nav:hover { background: rgba(255, 255, 255, .28); }

.fmtg-lb__close {
  top: 18px; right: 18px;
  width: 42px; height: 42px; font-size: 26px;
}
.fmtg-lb__nav {
  top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; font-size: 34px;
}
.fmtg-lb__nav--prev { left: 14px; }
.fmtg-lb__nav--next { right: 14px; }

@media (max-width: 600px) {
  .fmtg-lb__nav { width: 40px; height: 40px; font-size: 28px; }
}

/* ═══════════════ UPLOAD & EINGANG ═══════════════ */

.fmtg-notice,
.fmtg-hint { color: #666; font-size: .88rem; }
.fmtg-notice { padding: 14px 0; }
/* Fehlgeschlagene Anmeldung — muss auffallen, ohne zu erschrecken. */
.fmtg-notice--fehler {
  padding: 12px 14px; margin-bottom: 12px;
  background: #fdecec; border: 1px solid #f0c2c2; border-radius: 6px;
  color: #8d2f2f; font-weight: 600;
}

.fmtg-upload { --fmtg-accent: #7B6530; --fmtg-border: #c8b89a; }

.fmtg-fields {
  display: grid; gap: 14px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.fmtg-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fmtg-field--wide { grid-column: 1 / -1; }
.fmtg-label { font-size: .82rem; font-weight: 700; color: #444; }

.fmtg-input, .fmtg-select {
  width: 100%; max-width: 100%;
  padding: .5em .7em;
  border: 1.5px solid var(--fmtg-border, #c8b89a);
  border-radius: 6px; background: #fff;
  font: inherit; font-size: .92rem;
}
.fmtg-select { height: auto; padding: .3em; }
.fmtg-input:focus, .fmtg-select:focus {
  outline: none; border-color: var(--fmtg-accent, #7B6530);
}
/* Getroffene Auswahl deutlich hervorheben (Listenfelder, size > 1). */
.fmtg-select option { padding: .3em .5em; border-radius: 4px; }
.fmtg-select--hl option:checked,
.fmtg-up-anlass__select option:checked {
  background: var(--fmtg-accent, #7B6530); color: #fff;
}
.fmtg-field--narrow { max-width: 160px; }

/* Anlass: Suchfeld über Liste, Chip darunter */
.fmtg-up-anlass__search { border-radius: 6px 6px 0 0; border-bottom: none; }
.fmtg-up-anlass__select { border-radius: 0 0 6px 6px; }
.fmtg-up-anlass__chip[hidden] { display: none !important; }
.fmtg-up-anlass__chip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px;
  padding: .3em .35em .3em .8em; border-radius: 999px;
  background: #efe7d6; color: #5C4820; font-size: .85rem; font-weight: 600; max-width: 100%;
}
.fmtg-up-anlass__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmtg-up-anlass__clear {
  flex: none; width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(92,72,32,.15); color: #5C4820; font-size: 1rem; line-height: 1; cursor: pointer;
}
.fmtg-up-anlass__clear:hover { background: rgba(92,72,32,.3); }

/* Einleitung + Zusammenfassung + Aktionen */
.fmtg-up-lead { font-size: .88rem; color: #6a5729; margin: 0 0 14px; }
.fmtg-up-summary {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 8px;
  background: #f6efe2; font-size: .88rem; color: #5C4820; line-height: 1.5;
}
.fmtg-up-summary:empty { display: none; }
.fmtg-up-summary.is-warn { background: #fbf1e6; color: #8a5a1a; }
.fmtg-up-summary b { font-weight: 700; }
.fmtg-up-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.fmtg-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Ablagefläche */
.fmtg-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 34px 18px; text-align: center;
  border: 2px dashed var(--fmtg-border, #c8b89a);
  border-radius: 10px; background: #fdfbf7;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.fmtg-drop:hover, .fmtg-drop.is-over {
  background: #f6efe2; border-color: var(--fmtg-accent, #7B6530);
}
.fmtg-drop__text { font-weight: 700; color: #444; }
.fmtg-drop__meta { font-size: .78rem; color: #888; }

/* Warteschlange */
.fmtg-queue { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fmtg-queue__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; background: #f7f4ee;
  font-size: .86rem;
}
.fmtg-queue__thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; flex: none; }
.fmtg-queue__name  { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmtg-queue__state { font-size: .78rem; color: #777; flex: none; }
.fmtg-queue__item.is-done  { background: #eef6ee; }
.fmtg-queue__item.is-done  .fmtg-queue__state { color: #1a7f37; font-weight: 600; }
.fmtg-queue__item.is-error { background: #fbeeea; }
.fmtg-queue__item.is-error .fmtg-queue__state { color: #9a3412; font-weight: 600; }
.fmtg-queue__remove {
  flex: none; width: 24px; height: 24px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.08); color: #555; font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.fmtg-queue__remove:hover { background: rgba(0,0,0,.18); }
.fmtg-queue__item.is-uploading { opacity: .8; }

/* Eingang */
.fmtg-inbox__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.fmtg-inbox__bulk { display: flex; gap: 8px; }

.fmtg-inbox__selectall {
  margin-bottom: 8px; font-size: .85rem; font-weight: 600; color: #5C4820;
}
.fmtg-inbox__selectall label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.fmtg-inbox__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fmtg-inbox__item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px; border-radius: 8px; background: #faf7f1;
}
.fmtg-inbox__img {
  width: 84px; height: 84px; object-fit: cover; border-radius: 5px; flex: none;
  cursor: zoom-in;
}
.fmtg-inbox__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fmtg-inbox__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmtg-inbox__by   { font-size: .78rem; color: #777; }
.fmtg-inbox__actions { display: flex; gap: 6px; flex: none; }
.fmtg-pick { width: 17px; height: 17px; cursor: pointer; }

/* Ausprägungen (Anlass/Kategorie/…) als Prüfliste im Eingang */
.fmtg-inbox__tags {
  margin: 4px 0 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 16px;
}
.fmtg-inbox__tag { display: flex; gap: 6px; font-size: .82rem; margin: 0; }
.fmtg-inbox__tag dt { color: #8a7a55; font-weight: 700; flex: none; }
.fmtg-inbox__tag dd { margin: 0; color: #3a3226; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmtg-inbox__tag--key dd { font-weight: 700; }
.fmtg-inbox__tag--empty dd { color: #b08; opacity: .6; }
.fmtg-inbox__tag--key.fmtg-inbox__tag--empty dd { color: #c0392b; opacity: 1; }

/* Hover-Vorschau (identisch zur Medienverwaltung, hier eigenständig definiert,
   da der Eingang nur gallery.css lädt) */
.fmtg-m-preview {
  position: fixed; z-index: 99999; display: none; pointer-events: none;
  padding: 5px; background: #fff; border: 1px solid #c8b89a; border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
}
.fmtg-m-preview img { display: block; width: 300px; height: 300px; object-fit: contain; background: #f2ede3; border-radius: 4px; }

/* Bild-Lightbox im Eingang (eigene Klasse, um nicht mit der Galerie-Lightbox zu kollidieren) */
.fmtg-imgmodal {
  position: fixed; inset: 0; z-index: 100000; display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.85); padding: 24px;
}
.fmtg-imgmodal.is-open { display: flex; }
.fmtg-imgmodal img { max-width: 96vw; max-height: 92vh; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.fmtg-imgmodal__close {
  position: absolute; top: 16px; right: 20px; width: 44px; height: 44px;
  border: none; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer;
}
.fmtg-imgmodal__close:hover { background: rgba(255,255,255,.3); }
.fmtg-imgmodal__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff; font-size: 34px; line-height: 1;
  cursor: pointer;
}
.fmtg-imgmodal__nav:hover { background: rgba(255,255,255,.3); }
.fmtg-imgmodal__nav--prev { left: 16px; }
.fmtg-imgmodal__nav--next { right: 16px; }
@media (max-width: 560px) {
  .fmtg-imgmodal__nav { width: 40px; height: 40px; font-size: 26px; }
}

/* ── Besucher-Galerie unter Beitrag/Veranstaltung ──
   Eigenes Raster statt Verlass auf die Theme-Klasse: Durch die <figure> für
   den Bildnachweis sind die Rasterkinder nicht mehr die Schaltflächen selbst,
   worauf ein Theme-Raster nicht ausgelegt wäre. */
.fmtg-vg__grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.fmtg-vg__figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.fmtg-vg__figure .photo-grid__item {
  padding: 0; border: none; background: none; cursor: zoom-in; display: block;
}
.fmtg-vg__figure .photo-grid__item img {
  display: block; width: 100%; aspect-ratio: 4 / 3;
  object-fit: cover; border-radius: 6px;
}
.fmtg-vg__credit {
  font-size: .75rem; color: #777; line-height: 1.3;
}

/* Korrektur-Leiste im Eingang */
.fmtg-inbox__toolbar { margin-bottom: 10px; }
.fmtg-inbox__edit {
  margin-top: 8px;
  background: #f4efe4; border: 1.5px solid #c8b89a; border-radius: 8px;
}
/* Deutlich als anklickbare Schaltfläche erkennbar — der Einstieg in die
   Korrektur darf nicht wie beiläufiger Text aussehen. */
.fmtg-inbox__edit summary {
  cursor: pointer; padding: 10px 14px;
  font-size: .88rem; font-weight: 700; color: #5C4820;
  list-style: none; display: flex; align-items: center; gap: 8px;
  border-radius: 6px;
}
.fmtg-inbox__edit summary::-webkit-details-marker { display: none; }
.fmtg-inbox__edit summary::before {
  content: "✎"; font-size: 1rem;
  width: 24px; height: 24px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fmtg-accent, #7B6530); color: #fff; border-radius: 50%;
}
.fmtg-inbox__edit summary::after {
  content: "▸"; margin-left: auto; transition: transform .15s;
}
.fmtg-inbox__edit[open] summary::after { transform: rotate(90deg); }
.fmtg-inbox__edit summary:hover { background: #ece3d1; }
.fmtg-inbox__edit .fmtg-inbox__editgrid { padding: 0 14px 14px; }
.fmtg-inbox__editgrid {
  display: flex; flex-wrap: wrap; gap: 14px;
  border-top: 1px solid #e0d5bd; padding-top: 12px;
}
.fmtg-inbox__editfield { display: flex; flex-direction: column; gap: 4px; }
.fmtg-inbox__editfield label {
  font-size: .74rem; font-weight: 700; color: #8a7a55;
  text-transform: uppercase; letter-spacing: .03em;
}
.fmtg-inbox__editfield .fmtg-select { min-width: 150px; }
.fmtg-inbox__editfield--wide .fmtg-select { min-width: 240px; }
.fmtg-inbox__editfield .fmtg-input { min-width: 150px; }

.fmtg-btn {
  padding: .45em 1em; border-radius: 6px;
  border: 1.5px solid var(--fmtg-border, #c8b89a);
  background: #fff; color: #5C4820;
  font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.fmtg-btn:hover { background: #f1e9da; }
.fmtg-btn--primary {
  background: var(--fmtg-accent, #7B6530);
  border-color: var(--fmtg-accent, #7B6530); color: #fff;
}
.fmtg-btn--primary:hover { background: #6a5729; }

@media (max-width: 560px) {
  .fmtg-inbox__item { flex-wrap: wrap; }
  .fmtg-inbox__actions { width: 100%; justify-content: flex-end; }
}

/* Zusatzangaben beim Überfahren — nur für angemeldete Moderatoren, der
   Server liefert das Merkmal data-info sonst gar nicht erst mit. */
.fmtg-info {
  position: fixed; z-index: 100001; display: none; pointer-events: none;
  max-width: 22rem; padding: 10px 13px;
  background: #2b2620; color: #f4efe6;
  border-radius: 8px; box-shadow: 0 8px 26px rgba(0,0,0,.35);
  font-size: .78rem; line-height: 1.5; white-space: pre-line;
}
.fmtg-item[data-info] { cursor: help; }

/* ── Besucherbilder im Redaktionsformular ── */
.fmtg-vgadmin__hint { font-size: .82rem; color: #777; margin: 0 0 12px; }
.fmtg-vgadmin__grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.fmtg-vgadmin__grid.is-saving { opacity: .6; transition: opacity .15s; }
.fmtg-vgadmin__item {
  margin: 0; position: relative; cursor: move;
  border: 1px solid #e0d5bd; border-radius: 8px; overflow: hidden; background: #fff;
}
.fmtg-vgadmin__item img {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
}
.fmtg-vgadmin__item figcaption {
  padding: 5px 8px; font-size: .74rem; color: #777;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fmtg-vgadmin__actions { display: flex; gap: 4px; padding: 0 6px 7px; }
.fmtg-vgadmin__btn {
  flex: 1; padding: .32em .4em; cursor: pointer;
  border: 1px solid #d8ccb4; border-radius: 5px; background: #fff;
  font-size: .72rem; font-weight: 600; font-family: inherit; color: #5C4820;
}
.fmtg-vgadmin__btn:hover:not(:disabled) { background: #f1e9da; }
.fmtg-vgadmin__btn--delete { color: #a33; border-color: #e3c3c3; }
.fmtg-vgadmin__btn--delete:hover:not(:disabled) { background: #fbeaea; }
.fmtg-vgadmin__btn:disabled { opacity: .5; cursor: default; }
.fmtg-vgadmin__placeholder {
  border: 2px dashed #c8b89a; background: rgba(0,0,0,.04);
}

/* ── Tags: Verwaltung (dreisprachig) ── */
.fmtg-k-hint { font-size: .82rem; color: #777; margin: 0 0 10px; }
/* Die Tag-Verwaltung war zunächst eine Tabelle (.fmtg-k-tags mit
   .fmtg-k-tagactions). Sie ist seit 0.9.49 durch Karten ersetzt — die
   Tabelle sprengte die schmalen Spalten der Redaktionsseite. Die Karten
   stehen in redaktion.css unter .fmtg-k-tagkarte. */
.fmtg-k-addtag { display: flex; flex-wrap: wrap; gap: 8px; }
.fmtg-k-addtag .fmtg-k-newtag { flex: 1 1 10rem; min-width: 0; }

/* ── Tags unter dem großen Bild (Lightbox) ── */
.fmtg-lb__tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; margin-top: 8px;
}
.fmtg-lb__tags[hidden] { display: none !important; }
.fmtg-lb__tag {
  padding: .3em .9em; cursor: pointer;
  border: 1px solid rgba(255,255,255,.45); border-radius: 999px;
  background: rgba(255,255,255,.12); color: #fff;
  font-size: .78rem; font-weight: 600; font-family: inherit;
}
.fmtg-lb__tag:hover { background: rgba(255,255,255,.28); }
