/* picme – Design angelehnt an die Website der Fotografin
   (Barlow / Barlow Condensed, monochrom, warmes Off-White, eckige Formen) */

/* ---------- Schriften (lokal) ---------- */
@font-face { font-family: "Barlow"; src: url("fonts/barlow-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* ---------- Design-Variablen ---------- */
:root {
  color-scheme: light;
  --bg: #faf9f7;
  --surface: #f1eee9;
  --text: #1c1b19;
  --muted: #6b6862;
  --line: #e2ded7;
  --stage: #f4f2ee;
  --dark: #0e0e0d;
  --danger: #9c3d31;

  --font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --header-h: 72px;
  --bar-h: 64px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --max-wide: 1680px;
  --gap: 8px;
  --row: 260px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (min-width: 900px) {
  :root { --header-h: 84px; --bar-h: 76px; }
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }
img { max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
p { margin: 0 0 .75rem; }
strong { font-weight: 500; }
code, .mono { font-family: var(--font-mono); font-size: .88em; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.small { font-size: .9rem; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: 1.25rem; }

/* Kleine Überschrift in Versalien (wie „E-Mail“, „Portfolio“ auf der Website) */
.label {
  display: block;
  margin: 0 0 .75rem;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: .85rem;
  line-height: 1.4;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Layout ---------- */
.wrap, .wrap-wide { width: 100%; margin-inline: auto; padding-inline: var(--gutter); }
.wrap { max-width: var(--max); }
.wrap-wide { max-width: var(--max-wide); }
.page { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(4rem, 8vw, 6rem); }
.narrow { max-width: 640px; }
.center-page { display: grid; place-items: center; padding-block: clamp(3rem, 10vw, 7rem); }

.intro { width: 100%; max-width: 560px; }
.intro .muted { margin-bottom: 2rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { flex-shrink: 0; margin-right: auto; text-decoration: none; display: flex; align-items: center; }
.brand img { height: calc(var(--header-h) - 30px); width: auto; display: block; }
.brand-text {
  font: 600 1.35rem/1 var(--font-display);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.admin-nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.25rem); }
.admin-nav form { margin: 0; }
.admin-nav a, .nav-button {
  display: block;
  padding: .5rem 0;
  font: 500 1.05rem/1.2 var(--font-display);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size .3s var(--ease);
}
.admin-nav a:hover, .admin-nav a[aria-current], .nav-button:hover { background-size: 100% 1px; }
.nav-button { border: 0; cursor: pointer; color: var(--muted); background-color: transparent; }
@media (max-width: 560px) {
  .admin-nav a[href="/admin/"] { display: none; }
  .admin-nav a, .nav-button { font-size: .95rem; letter-spacing: .06em; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}
.site-footer__inner {
  max-width: var(--max);
  margin-inline: auto;
  padding: 1.75rem var(--gutter) 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem 2rem;
}
.site-footer p { margin: 0; }
.site-footer__name { font: 600 1.1rem/1.2 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.gallery-page ~ .site-footer { padding-bottom: var(--bar-h); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 46px;
  padding: .6em 1.5em;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
  border-radius: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--text); color: var(--bg); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: transparent; color: var(--text); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--text); color: var(--bg); }
.btn-small { min-height: 40px; padding: .45em 1.1em; font-size: .92rem; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.link-button { background: none; border: 0; padding: 0; color: var(--text); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Formulare ---------- */
input, textarea {
  width: 100%;
  min-height: 46px;
  padding: .6rem .9rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
}
textarea { resize: vertical; min-height: 0; }
input:focus, textarea:focus { outline: none; border-color: var(--text); }
input[readonly], textarea[readonly] { background: var(--bg); }

.field { display: block; }
.field > span { display: block; font-weight: 500; font-size: .95rem; margin-bottom: .35rem; }
.field > span em { font-style: normal; font-weight: 300; }
.field > small { display: block; margin-top: .35rem; font-size: .85rem; }
.field + .field, .field + .btn, .field + form, .field + .actions { margin-top: 1.25rem; }

.inline-form { display: flex; gap: .5rem; }
.inline-form input { flex: 1; min-width: 0; }
@media (max-width: 480px) { .inline-form { flex-direction: column; } }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.copy-row { display: flex; gap: .5rem; }
.copy-row input { flex: 1; min-width: 0; }

/* ---------- Bausteine ---------- */
.panel { background: var(--surface); padding: clamp(1.25rem, 3vw, 1.75rem); }
.panel .label { margin-bottom: 1.25rem; }

.flash { padding: .85rem 1.1rem; margin: 0 0 1.5rem; background: var(--surface); border-left: 2px solid var(--text); font-weight: 400; }
.flash-error { border-left-color: var(--danger); color: var(--danger); }

.badge {
  display: inline-block;
  padding: .2em .65em;
  font: 500 .78rem/1.3 var(--font-display);
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
}
.badge-done { background: var(--text); border-color: var(--text); color: var(--bg); }

.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: block; }
.heart { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; display: inline-block; vertical-align: middle; }

/* ---------- Admin ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.page-head h1 { margin-bottom: .2em; }
.page-head p { margin: 0; }
.back { display: inline-block; margin-bottom: 1.25rem; color: var(--muted); text-decoration: none; font-size: .95rem; }
.back:hover { color: var(--text); }

.gallery-cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(12px, 2vw, 24px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.gallery-card { display: block; text-decoration: none; }
.gallery-card__cover { position: relative; aspect-ratio: 4 / 3; background: var(--surface); overflow: hidden; display: grid; place-items: center; }
.gallery-card__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.gallery-card:hover .gallery-card__cover img { transform: scale(1.04); }
.gallery-card__label {
  position: absolute; inset: auto 0 0 0;
  display: flex; justify-content: space-between; align-items: end; gap: .5rem;
  padding: 2.5rem 1rem .9rem;
  background: linear-gradient(transparent, rgb(0 0 0 / .55));
  color: #fff;
}
.gallery-card__cover:not(:has(img)) .gallery-card__label { background: none; color: var(--text); }
.gallery-card__title { font: 600 clamp(1.2rem, 2vw, 1.5rem)/1.05 var(--font-display); letter-spacing: .05em; text-transform: uppercase; }
.gallery-card__count { font-size: .8rem; opacity: .85; white-space: nowrap; }
.gallery-card__meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding-top: .6rem; font-size: .92rem; color: var(--muted); }
.gallery-card__meta + .gallery-card__meta { padding-top: .1rem; }
.gallery-card__meta strong { color: var(--text); }

.empty { max-width: 560px; padding: 2.5rem 0; }
.empty-gallery { padding: 3rem 0; }

.panels { display: grid; gap: clamp(12px, 2vw, 20px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin-bottom: clamp(12px, 2vw, 20px); }
.big-number { font: 600 2.75rem/1 var(--font-display); letter-spacing: .02em; margin-bottom: .9rem; }
.big-number .muted { font-size: 1.2rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }

.upload { margin-bottom: clamp(2rem, 5vw, 3rem); }
.dropzone { position: relative; margin: 0; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.dropzone-label {
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  padding: clamp(2rem, 5vw, 3rem) 1rem;
  text-align: center;
  border: 1px dashed #c9c3b9;
  background: var(--stage);
  transition: background .2s, border-color .2s;
}
.dropzone-label strong { font: 600 1.5rem/1.2 var(--font-display); letter-spacing: .06em; text-transform: uppercase; }
.dropzone:hover .dropzone-label, .dropzone.is-over .dropzone-label { border-color: var(--text); background: var(--surface); }
.dropzone noscript { display: block; text-align: center; padding-top: 1rem; }
.upload-progress { padding-top: 1rem; }
.progress { height: 2px; background: var(--line); overflow: hidden; margin-bottom: .6rem; }
.progress-bar { height: 100%; width: 0; background: var(--text); transition: width .25s; }
.upload-errors { color: var(--danger); margin: 0; padding-left: 1.1rem; }
.upload-errors button { margin-left: .5rem; }

/* Filter-Pills wie die Kategorie-Leiste der Website */
.tabs { display: flex; gap: .25rem; margin-bottom: 1.25rem; }
.tabs a {
  padding: .3rem .9rem; border-radius: 999px;
  font: 500 1rem/1.4 var(--font-display); letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; color: var(--muted);
  transition: color .2s, background .2s;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { background: var(--text); color: var(--bg); }

.danger-zone { margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }

/* ---------- Bildraster (Zeilen bündig, Reihenfolge bleibt erhalten) ---------- */
.grid { display: flex; flex-wrap: wrap; gap: var(--gap); }
.grid::after { content: ""; flex-grow: 999999; }
.tile {
  position: relative;
  margin: 0;
  flex-grow: calc(var(--r, 1.5) * 100);
  flex-basis: calc(var(--r, 1.5) * var(--row));
  background: var(--stage);
  overflow: hidden;
}
.tile img { display: block; width: 100%; height: auto; }
.tile-link { display: block; cursor: zoom-in; }
@media (max-width: 640px) { :root { --row: 110px; --gap: 4px; } }
@media (min-width: 641px) and (max-width: 1024px) { :root { --row: 190px; } }

.tile::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 var(--text);
  transition: box-shadow .2s var(--ease);
}
.tile.is-selected::after { box-shadow: inset 0 0 0 3px var(--text); }

.tile-toggle { position: absolute; right: 8px; bottom: 8px; margin: 0; }
.heart-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgb(255 255 255 / .75);
  color: var(--text);
  cursor: pointer;
  transition: background .2s, color .2s, opacity .2s, transform .15s;
}
.heart-btn:hover { background: #fff; }
.heart-btn[aria-pressed="true"] { background: var(--text); color: #fff; }
.heart-btn[aria-pressed="true"] .heart { fill: currentColor; }
.heart-btn.pop { animation: pop .3s ease; }
@keyframes pop { 50% { transform: scale(1.15); } }
@media (max-width: 640px) {
  .heart-btn { width: 36px; height: 36px; }
  .heart-btn .heart { width: 17px; height: 17px; }
  .tile-toggle { right: 4px; bottom: 4px; }
}
@media (hover: hover) {
  .tile .heart-btn[aria-pressed="false"] { opacity: 0; }
  .tile:hover .heart-btn, .tile:focus-within .heart-btn { opacity: 1; }
}

.tile-heart {
  position: absolute; right: 8px; top: 8px;
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--text); color: #fff;
}
.tile-heart .heart { width: 15px; height: 15px; fill: currentColor; }

/* Admin: Dateiname + Löschen */
.tile figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: flex-end; gap: .5rem;
  padding: 2rem .6rem .5rem;
  background: linear-gradient(transparent, rgb(0 0 0 / .55));
  color: #fff; font-size: .78rem; font-weight: 400;
  opacity: 0; transition: opacity .2s;
}
.tile:hover figcaption, .tile:focus-within figcaption { opacity: 1; }
@media (hover: none) { .tile figcaption { opacity: 1; } }
.tile figcaption form { margin: 0; }
.tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-delete { display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .85); color: var(--text); cursor: pointer; }
.tile-delete .icon { width: 14px; height: 14px; stroke-width: 2; }
.tile-delete:hover { background: var(--danger); color: #fff; }

/* ---------- Kundengalerie ---------- */
.gallery-hero {
  display: grid; gap: 1rem 3rem; align-items: end;
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem);
}
.gallery-hero h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4rem); }
.gallery-hint { margin: 0; max-width: 46ch; color: var(--muted); }
.gallery-hint strong { color: var(--text); }
.gallery-hint .heart { width: 1.05em; height: 1.05em; margin-top: -.15em; color: var(--text); }
.notice { margin: 0; max-width: 52ch; padding: 1rem 1.25rem; background: var(--surface); border-left: 2px solid var(--text); }
@media (min-width: 900px) { .gallery-hero { grid-template-columns: 1fr auto; } }

/* Auswahl-Leiste (wie die Leiste unter dem Carousel) */
.selection-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.selection-bar__inner { height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.selection-bar form { margin: 0; }
.selection-count {
  display: flex; align-items: center; gap: .6rem; margin: 0;
  font: 500 1.15rem/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.selection-count .heart { fill: currentColor; width: 18px; height: 18px; }
.selection-count strong { font-weight: 600; }
.selection-count .sep { margin-inline: .35em; color: var(--muted); }
.selection-bar.bump .selection-count { animation: pop .3s ease; }
.selection-actions { display: flex; gap: .5rem; }
@media (max-width: 480px) {
  .hide-sm { display: none; }
  .selection-actions .btn { padding-inline: .8em; letter-spacing: .05em; }
}

/* ---------- Lightbox (wie die Vollbild-Ansicht der Website) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  grid-template-rows: 1fr auto;
  background: var(--dark);
  color: #eee;
  user-select: none; -webkit-user-select: none;
}
.lightbox[hidden] { display: none; }
.lb-stage { grid-column: 2; grid-row: 1; margin: 0; min-height: 0; display: grid; place-items: center; padding-top: 16px; }
.lb-stage img { max-width: 100%; max-height: calc(100svh - var(--bar-h) - 16px); object-fit: contain; touch-action: pan-y pinch-zoom; transition: opacity .2s; }
.lb-stage img.loading { opacity: .3; }
.lb-arrow {
  align-self: center; justify-self: center;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgb(255 255 255 / .75);
  color: var(--text); cursor: pointer;
  transition: background .2s;
}
.lb-arrow:hover { background: #fff; }
.lb-prev { grid-column: 1; grid-row: 1; }
.lb-next { grid-column: 3; grid-row: 1; }
.lb-close {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: #eee; cursor: pointer;
}
.lb-close:hover { background: rgb(255 255 255 / .1); }
.lb-bar {
  grid-column: 1 / -1;
  height: calc(var(--bar-h) + env(safe-area-inset-bottom));
  padding: 0 var(--gutter) env(safe-area-inset-bottom);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
}
.lb-counter { font: 500 1.05rem/1 var(--font-display); letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.lb-name { text-align: right; font-size: .85rem; opacity: .55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heart-btn-lg { width: 52px; height: 52px; background: rgb(255 255 255 / .12); color: #eee; }
.heart-btn-lg:hover { background: rgb(255 255 255 / .2); }
.heart-btn-lg .heart { width: 24px; height: 24px; }
.lightbox .heart-btn[aria-pressed="true"] { background: #fff; color: var(--dark); }
@media (hover: none) { .lb-arrow { display: none; } }
@media (max-width: 640px) {
  .lightbox { grid-template-columns: 0 1fr 0; }
  .lb-arrow { display: none; }
  .lb-stage { padding-top: 60px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--header-h) + 12px); z-index: 200;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: .75rem 1.2rem;
  background: var(--text); color: var(--bg);
  font-size: .95rem; font-weight: 400;
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
