/* Farben und Schriften nach fichterart.de: Lato (Text), Yeseva One (Überschriften), Petrolblau */
@font-face { font-family: "Lato"; font-weight: 300; font-display: swap; src: url("fonts/lato-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-display: swap; src: url("fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/lato-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url("fonts/lato-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Yeseva One"; font-weight: 400; font-display: swap; src: url("fonts/yeseva-one-latin-400-normal.woff2") format("woff2"); }

:root {
  --bg: #f1f2ee;
  --paper: #ffffff;
  --ink: #353432;
  --muted: #74797e;
  --line: #e6e7e2;
  --line-strong: #bcc1c7;
  --accent: #3f6886;
  --accent-dark: #33475a;
  --accent-light: #7d9fb7;
  --accent-ink: #fff;
  --ok: #3d7a4f;
  --err: #a2332b;
  --tile: 190px;
  --display: "Yeseva One", Georgia, serif;
  font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
a { color: var(--accent); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
h1, h2 { font-family: var(--display); font-weight: 400; color: var(--accent); letter-spacing: .005em; }
.muted { color: var(--muted); font-size: .9em; font-weight: 400; }
.nowrap { white-space: nowrap; }
.inline { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
input, select, textarea, button {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: 2px; padding: .4rem .55rem;
}
button, .btn { cursor: pointer; text-decoration: none; color: var(--accent); background: var(--paper); font-weight: 700;
  border: 1px solid var(--accent); border-radius: 2px; padding: .4rem .8rem; font-size: .9rem; }
button:hover, .btn:hover { background: var(--accent); color: var(--accent-ink); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; text-decoration: underline; }
button.link:hover { background: none; color: var(--accent-dark); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-light); outline-offset: 1px;
}

.top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
  padding: .75rem 1.25rem; background: var(--accent); color: #fff; }
.brand { font-family: var(--display); font-weight: 400; font-size: 1.45rem; text-decoration: none; color: #fff; }
.brand:hover { color: #fff; }
.brand span { color: rgb(255 255 255 / .7); }
.login h1 span { color: var(--accent-light); }
.top nav { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.top nav a, .top nav button.link { color: #fff; text-decoration: none; text-transform: uppercase; letter-spacing: .05em;
  font-weight: 400; font-size: .85rem; }
.top nav a:hover, .top nav button.link:hover { color: #fff; text-decoration: underline; }
.brandline { display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; min-width: 0; }
.brand-project { color: #fff; font-weight: 400; text-decoration: none; font-size: 1rem; letter-spacing: .02em;
  border-left: 1px solid rgb(255 255 255 / .45); padding-left: .9rem; }
.brand-project:hover { color: #fff; text-decoration: underline; }
.who { color: rgb(255 255 255 / .75); font-size: .85em; }
main { padding: 1.25rem 1.25rem 3rem; max-width: 1600px; margin: 0 auto; }

.msg { padding: .5rem .75rem; border-radius: 4px; border: 1px solid; }
.msg.ok { color: var(--ok); border-color: var(--ok); }
.msg.err { color: var(--err); border-color: var(--err); }

.login { max-width: 340px; margin: 12vh auto; display: grid; gap: .9rem; background: var(--paper);
  padding: 2rem; border: 1px solid var(--line); border-radius: 6px; }
.login h1 { margin: 0; font-size: 1.8rem; }
.login { border-top: 4px solid var(--accent); }
.login label { display: grid; gap: .3rem; }
.narrow { max-width: 600px; margin: 10vh auto; }

.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.toolbar h1 { margin: 0 1rem 0 0; font-size: 1.5rem; }
#q { flex: 1 1 240px; }
.size { display: inline-flex; }
.size button { border-radius: 0; margin-left: -1px; min-width: 2.2rem; }
.size button:first-child { border-radius: 4px 0 0 4px; }
.size button:last-child { border-radius: 0 4px 4px 0; }
.size button.on { background: var(--accent); color: var(--accent-ink); }
.hint { margin: 0 0 .75rem; }
.dl-dialog { border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); padding: 1.25rem 1.5rem; width: min(380px, 92vw); }
.dl-dialog::backdrop { background: rgb(0 0 0 / .45); }
.dl-dialog h2 { margin: 0 0 .25rem; font-size: 1.25rem; }
.dl-dialog p { margin: 0 0 .75rem; }
.dl-dialog label { display: flex; gap: .5rem; align-items: baseline; padding: .3rem 0; cursor: pointer; }
.dl-dialog input { accent-color: var(--accent); }
.dl-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

.overview { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.filters { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; font-size: .9rem; }
.filters-head { display: flex; justify-content: space-between; align-items: baseline; }
.filters h2 { font-size: 1.1rem; margin: .3rem 0 .5rem; }
.filters .facet { border: 0; border-top: 1px solid var(--line); margin: 0; padding: .5rem 0 .75rem; }
.filters legend { color: var(--accent); padding: 0; margin-bottom: .2rem; }
.filters label { display: flex; align-items: center; gap: .45rem; padding: .15rem 0; cursor: pointer; }
.filters label input { margin: 0; accent-color: var(--accent); }
.filters label .n { margin-left: auto; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); }
.grid[data-size="s"] { --tile: 130px; }
.grid[data-size="l"] { --tile: 280px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; transition: box-shadow .15s; }
.tile[draggable="true"] { cursor: grab; }
.tile:hover { box-shadow: 0 2px 10px rgb(0 0 0 / .12); }
.tile.dragging { opacity: .35; outline: 2px dashed var(--accent); }
.tile a { display: block; color: inherit; text-decoration: none; }
.thumb { aspect-ratio: 4 / 3; position: relative; background: color-mix(in srgb, var(--line) 35%, transparent); }
.thumb img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; }
.cap { padding: .5rem .6rem .6rem; display: grid; gap: .2rem; }
.cap .t { font-size: .95rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cap .m { display: flex; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .8rem; }
.cap .nr b { font-weight: normal; color: var(--ink); }
.badge { justify-self: start; font-size: .72rem; padding: .05rem .4rem; border-radius: 3px;
  background: var(--accent); color: var(--accent-ink); }
.grid[data-size="s"] .cap .t { font-size: .82rem; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.detail figure { margin: 0; position: sticky; top: 1rem; }
.detail figure img { width: 100%; max-height: 70vh; object-fit: contain; background: var(--paper); border: 1px solid var(--line); }
.detail figcaption h1 { margin: .75rem 0 .2rem; font-size: 1.5rem; }
.detail figcaption p { margin: 0; color: var(--muted); }
.gallery { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.gallery button { padding: 3px; width: 100%; display: grid; gap: 2px; background: var(--paper); }
.gallery button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.gallery span { font-size: .65rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery.single { display: none; }
#main-img { cursor: zoom-in; }
.viewer { width: min(1400px, 92vw); height: 88vh; padding: 0; border: 1px solid var(--line); border-radius: 6px;
  background: var(--paper); color: var(--ink); display: none; flex-direction: column; overflow: hidden; }
.viewer[open] { display: flex; }
.viewer::backdrop { background: rgb(0 0 0 / .55); }
.viewer header { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.v-tools { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.v-tools button { min-width: 2.2rem; padding: .25rem .5rem; }
.v-tools a { padding: 0 .4rem; }
#v-zoom { min-width: 4rem; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.v-stage { flex: 1; position: relative; overflow: hidden; cursor: grab; touch-action: none;
  background: color-mix(in srgb, var(--line) 40%, var(--bg)); }
.v-stage.drag { cursor: grabbing; }
.v-stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; }
.viewer footer { padding: .3rem .75rem; font-size: .75rem; border-top: 1px solid var(--line); }
.detail figure { max-height: calc(100vh - 2rem); overflow-y: auto; }
.move { margin-top: 1rem; display: flex; gap: .5rem; align-items: center; }
.move input { width: 5rem; }
.fields fieldset { border: 1px solid var(--line); border-radius: 4px; margin: 0 0 1rem; padding: .5rem 1rem 1rem; background: var(--paper); }
.fields legend { padding: 0 .4rem; color: var(--accent); }
.fields label { display: grid; gap: .2rem; margin-top: .6rem; }
.fields label span { font-size: .8rem; color: var(--muted); }
.fields textarea { resize: vertical; line-height: 1.4; }
.fields [readonly] { background: transparent; }
.dating { display: flex; gap: .5rem; margin-top: .6rem; }
.dating select { flex: 0 0 6rem; }
.dating input { flex: 0 0 8rem; }
.fields input[readonly][title] { color: var(--muted); border-style: dashed; }
.fields summary { cursor: pointer; color: var(--muted); margin-top: .4rem; }
.actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; position: sticky; bottom: 0;
  background: var(--bg); padding: .75rem 0; }

.history { margin-top: 2rem; }
.subnav { display: flex; align-items: baseline; gap: 1.25rem; flex-wrap: wrap; margin-bottom: .75rem; border-bottom: 1px solid var(--line); }
.subnav h1 { margin: 0 .75rem .5rem 0; font-size: 1.5rem; }
.subnav a { text-decoration: none; padding: .3rem 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a.on { border-bottom-color: var(--accent); color: var(--ink); }
.invite-result { margin-bottom: 1.5rem; }
.copyrow { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.copyrow input { flex: 1 1 360px; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.invite-box { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 0 1.25rem 1rem; }
.invite-form { display: grid; gap: .75rem; }
.invite-form > label { display: grid; gap: .25rem; }
.invite-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .3rem; }
.invite-form legend { color: var(--muted); font-size: .85rem; margin-bottom: .2rem; }
.invite-form fieldset label { display: flex; gap: .45rem; align-items: baseline; }
.invite-form input[type=radio], .invite-form input[type=checkbox] { accent-color: var(--accent); }
.invite-form button { justify-self: start; }
.user-actions { display: flex; gap: .3rem; flex-wrap: wrap; margin: 0; }
.user-actions button { font-size: .8rem; padding: .15rem .45rem; }
.login label .muted { font-size: .8rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: .5rem 0 1.5rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: .75rem 1rem; display: grid; }
.stat .v { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .85rem; }
.stat.warn .v, .log .bad { color: var(--err); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.5rem; }
.admin-grid h2, .history h2 { font-size: 1.2rem; }
.admin-grid > section:first-child { grid-column: 1 / -1; }
.admin-grid > .invite-box { grid-column: auto; }
.log .num { text-align: right; font-variant-numeric: tabular-nums; }
.log tr.inactive td { color: var(--muted); }
code { font-size: .85em; background: var(--paper); border: 1px solid var(--line); padding: 0 .3em; border-radius: 3px; }
table.log { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--paper); }
.log th, .log td { text-align: left; vertical-align: top; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.log th { color: var(--muted); font-weight: normal; }
.log .old { color: var(--err); text-decoration: line-through; text-decoration-thickness: 1px; max-width: 28rem; }
.log .new { color: var(--ok); max-width: 28rem; }
.log td { white-space: pre-wrap; word-break: break-word; }

@media (max-width: 800px) {
  main { padding: 1rem; }
  .detail { grid-template-columns: 1fr; }
  .overview { grid-template-columns: 1fr; gap: .5rem; }
  .filters { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
  .filters-head { flex-basis: 100%; }
  .detail figure { position: static; }
  .grid { --tile: 140px; }
}
@media (max-width: 600px) {
  table.log { display: block; overflow-x: auto; }
}

/* Projektübersicht */
.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.project-card { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 2px; }
.project-card:hover { box-shadow: 0 2px 12px rgb(0 0 0 / .1); }
.project-card a { display: block; color: inherit; text-decoration: none; font-weight: 400; }
.project-card .cap { padding: .75rem 1rem 1rem; }
.project-card h2 { margin: 0 0 .3rem; font-size: 1.35rem; }
.project-card p { margin: .2rem 0; }
.project-card.archived { opacity: .6; border-top-color: var(--line-strong); }

/* Projektverwaltung */
.project-form .two, .project-admin .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.project-form .two label, .project-admin .two label { display: grid; gap: .25rem; }
.invite-form .indent { margin-left: 1.6rem; }
.invite-form fieldset select, .invite-form fieldset input[name=bildordner] { margin-left: .4rem; }
.invite-form .check { display: flex; gap: .45rem; align-items: baseline; }
.invite-form .row { display: flex; gap: .5rem; flex-wrap: wrap; }
.project-admin { background: var(--paper); border: 1px solid var(--line); border-radius: 2px; margin-bottom: .6rem; }
.project-admin summary { cursor: pointer; padding: .7rem 1rem; display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.project-admin summary a { margin-left: auto; }
.project-admin.archived summary b { color: var(--muted); }
.project-admin-body { padding: 0 1rem 1rem; display: grid; gap: 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.bad { color: var(--err); }

