/* Zisler Galerie - one stylesheet for the public pages and the admin area. */
:root {
  --bg: #f4f8fc;
  --surface: #ffffff;
  --header: #e3eff9;
  --text: #15232f;
  --muted: #5b6b79;
  --line: #d6e3ee;
  --accent: #2c6c9e;
  --accent-text: #ffffff;
  --error: #b3261e;
  --ok: #2e6b3a;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1820;
    --surface: #16222d;
    --header: #1a2b3a;
    --text: #e5eef5;
    --muted: #94a7b7;
    --line: #263746;
    --accent: #8cc3ec;
    --accent-text: #0f1820;
    --error: #f2867d;
    --ok: #7fc48d;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
main { max-width: 1200px; margin: 0 auto; padding: 1rem 16px 3rem; }
h1 { font-weight: 600; margin: 0.5rem 0 1rem; }

.site-header {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; justify-content: space-between;
  padding: 0.9rem 16px; border-bottom: 1px solid var(--line); background: var(--header);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.3rem; font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: 0.02em; }
.brand img { width: 36px; height: 36px; border-radius: 8px; display: inline-block; }
.site-header nav { display: flex; gap: 1rem; align-items: center; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; text-align: center; padding: 1.5rem 16px; }
.inline { display: inline; margin: 0; }

button, .button {
  display: inline-block; border: 0; border-radius: 6px; padding: 0.55rem 1rem; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font: inherit; text-decoration: none;
}
button.link { background: none; color: var(--accent); padding: 0; text-decoration: underline; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem 0.6rem; min-width: 0;
}

/* Search */
.search { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.search input[type=search] { flex: 1 1 260px; }
.search input[type=number] { width: 7.5rem; }
.search .reset { font-size: 0.9rem; }
.count { color: var(--muted); margin: 0.5rem 0 1rem; }
.empty { padding: 3rem 0; text-align: center; color: var(--muted); }

/* Grid */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid a { display: block; color: inherit; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; height: 100%; }
.grid a:hover { border-color: var(--accent); }
.grid img, .grid .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; }
.noimg { display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--line); min-height: 160px; }
.caption { display: block; padding: 0.6rem 0.75rem 0.8rem; }
.caption strong { display: block; }
.caption span { color: var(--muted); font-size: 0.9rem; }

.pagination { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-top: 2rem; }
.pagination a, .pagination span { padding: 0.35rem 0.7rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.pagination span[aria-current] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* Detail */
.artwork { display: grid; gap: 2rem; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.artwork figure { margin: 0; }
.artwork dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; }
.artwork dt { color: var(--muted); }
.artwork dd { margin: 0; }
.description { margin-top: 1rem; }
.badge { display: inline-block; font-size: 0.8rem; padding: 0.1rem 0.5rem; border-radius: 99px; background: var(--line); color: var(--text); margin: 0; }
@media (max-width: 760px) { .artwork { grid-template-columns: 1fr; } }

/* Exhibition slideshow (ausstellung.php) */
.show { display: grid; gap: 0.75rem; }
.show-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.show-bar h1 { margin: 0.25rem 0; }
/* "Feldkirchen 2026 – Vom Dunkel ins Licht"; on phones the subtitle goes to a second line */
.exhibition-title .subtitle { font-weight: 400; }
.exhibition-title .subtitle::before { content: " – "; }
@media (max-width: 600px) {
  .exhibition-title .subtitle { display: block; font-size: 0.75em; color: var(--muted); }
  .exhibition-title .subtitle::before { content: none; }
}
.caption .subtitle { display: block; font-style: normal; color: var(--text); }
.lead { color: var(--muted); margin-top: -0.6rem; }
.show-pos { color: var(--muted); font-variant-numeric: tabular-nums; }
.show-stage { margin: 0; display: grid; justify-items: center; gap: 0.6rem; cursor: pointer; }
.show-stage img {
  max-width: 100%; max-height: calc(100vh - 290px); min-height: 200px; width: auto; object-fit: contain;
  border-radius: 6px; opacity: 0; transition: opacity 0.6s ease;
}
.show-stage img.visible { opacity: 1; }
.show-stage figcaption { text-align: center; font-size: 0.875rem; color: var(--muted); display: grid; gap: 0.1rem; }
.show-stage figcaption strong { color: var(--text); font-size: 0.95rem; }
.show-text:empty, #meta:empty { display: none; }
.show-text { white-space: pre-line; max-width: 60ch; color: var(--text); }
/* Title slide (heading slot -1): the exhibition's heading image with its text */
.show-stage.heading figcaption strong { font-size: 1.6rem; font-weight: 600; }
.show-stage.heading figcaption { font-size: 1rem; }
.show-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; }
.show-controls button { min-width: 3rem; }
.button.secondary, button.secondary { background: var(--surface); color: var(--accent); border: 1px solid var(--line); }
.show-progress { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.show-progress span { display: block; height: 100%; width: 0; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .show-stage img { transition: none; } }

/* Admin */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.notice { color: var(--ok); }
.error { color: var(--error); display: block; }
.list { width: 100%; border-collapse: collapse; }
.list th, .list td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
@media (max-width: 760px) { .list th:nth-child(n+5), .list td:nth-child(n+5) { display: none; } }

.form { display: grid; gap: 0.9rem; }
.form.narrow { max-width: 380px; }
.form label { display: grid; gap: 0.25rem; }
.form label.check { display: flex; gap: 0.5rem; align-items: center; }
.form .row { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.form fieldset { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 0.9rem; }
.form button { justify-self: start; }
.form fieldset.checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.edit { display: grid; gap: 2rem; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.edit aside img { border-radius: 6px; border: 1px solid var(--line); }
.danger button { background: var(--error); color: #fff; }
.exhibition-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: baseline; color: var(--muted); }

/* Order of an exhibition (admin/ausstellung.php) */
.hint { color: var(--muted); max-width: 70ch; }
.sorter { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.4rem; max-width: 760px; }
.sorter .sect { font-weight: 600; padding: 0.6rem 0.2rem 0.2rem; border-bottom: 2px solid var(--accent); }
.sorter .sect small { font-weight: normal; color: var(--muted); }
.sorter .divider { margin-top: 0.8rem; }
.sorter .when-empty { display: none; font-weight: normal; color: var(--muted); font-size: 0.9rem; }
.sorter .head.empty .when-empty { display: inline; }
.sorter .item {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.sorter .item.is-heading { border-color: var(--accent); }
.sorter .item.dragging { box-shadow: 0 6px 18px rgb(0 0 0 / 0.25); border-color: var(--accent); position: relative; z-index: 1; }
.sorter .handle {
  background: none; color: var(--muted); font-size: 1.4rem; line-height: 1; padding: 0.4rem 0.3rem;
  cursor: grab; touch-action: none; user-select: none;
}
.sorter .dragging .handle { cursor: grabbing; }
.sorter .slot { min-width: 2.2rem; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent); }
.sorter img, .sorter .noimg { width: 56px; height: 56px; min-height: 0; object-fit: cover; border-radius: 4px; flex: none; }
.sorter .what { flex: 1; min-width: 0; display: grid; }
.sorter .what a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sorter .what small { color: var(--muted); }
.sorter .what .badge { justify-self: start; }
.sorter .moves { display: flex; gap: 0.25rem; }
.sorter .moves button { background: var(--surface); color: var(--accent); border: 1px solid var(--line); padding: 0.3rem 0.55rem; font-size: 0.8rem; }
.sorting-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; position: sticky; bottom: 0; background: var(--bg); padding: 0.6rem 0; }
.dirty { color: var(--error); }
@media (max-width: 760px) { .edit { grid-template-columns: 1fr; } }
.inline-form { margin-top: 2.5rem; max-width: 760px; }
