/* LORD Galerie – helles, minimales Design · CI: LORD-Cyan #0084D7 */
:root {
  --bg: #ffffff;
  --bg2: #fafafa;
  --bg3: #f0f0f0;
  --line: #e2e2e2;
  --text: #111111;
  --muted: #8a8a8a;
  --accent: #0084D7;   /* LORD-Cyan */
  --green: #2eb863;
  --yellow: #e8b73a;
  --red: #e25555;
  --radius: 6px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--muted); }
a:hover { border-bottom-color: var(--text); }
a.plain, .top a { border-bottom: none; }
button { font: inherit; cursor: pointer; }
h1, h2 { font-weight: 700; letter-spacing: .01em; }

/* Header */
.top {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px); z-index: 50;
  overflow: visible;
}
.brand { font-size: 16px; font-weight: 800; letter-spacing: .1em; color: var(--accent); }
.tagline { color: var(--muted); font-size: 12px; letter-spacing: .04em; margin-top: 2px; }
.top .grow { flex: 1; }

.wrap { max-width: 1500px; margin: 0 auto; padding: 28px; }

/* Buttons & Inputs */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 16px; font-size: 14px; transition: .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--text); color: #fff; border-color: var(--text); font-weight: 600; }
.btn.primary:hover { background: #333; }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 13px; }
input[type=text], input[type=password], textarea {
  background: #fff; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px; font: inherit; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* Toggle-Schalter */
.opt { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.opt:last-child { border-bottom: none; }
.opt .lbl { flex: 1; }
.opt .lbl small { display: block; color: var(--muted); font-size: 12px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: var(--bg3);
  border: 1px solid var(--line); border-radius: 999px; transition: .2s;
}
.slider:before {
  content: ""; position: absolute; height: 18px; width: 18px;
  left: 3px; top: 3px; background: #fff; border: 1px solid var(--line);
  border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(20px); border-color: transparent; }

/* Karten / Panels */
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sep { color: var(--muted); }

/* Filter-Pills */
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.pill.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot.green { background: var(--green); } .dot.yellow { background: var(--yellow); } .dot.red { background: var(--red); }

/* Sort-Select */
.sort-sel {
  font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 10px; background: #fff; color: var(--text);
  cursor: pointer; appearance: auto;
}
.sort-sel:focus { outline: none; border-color: var(--accent); }

/* Bildraster */
.grid {
  display: grid; gap: 14px; margin-top: 22px;
  /* min() verhindert Überlauf auf schmalen Displays */
  grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr));
  align-items: start; /* Karten behalten ihre natürliche Höhe */
}
.card {
  position: relative; background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
/* Hover-Feedback bewusst nur an der Karte, nicht am Bild:
   Eine Opacity-Animation auf dem <img> lässt Safari die Bildkacheln neu zusammensetzen –
   das erzeugt den sichtbaren hellen Querbalken über dem Foto. */
.card:hover { border-color: var(--muted); box-shadow: 0 2px 14px rgba(0,0,0,.13); }
/* Originalformat: kein Beschnitt, Hoch- und Querformat bleiben erhalten */
.card img { width: 100%; height: auto; display: block; }
.card .badges {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; gap: 6px; align-items: center; pointer-events: none;
}
.badge { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.9); box-shadow: 0 1px 5px rgba(0,0,0,.3); }
.badge.green { background: var(--green); } .badge.yellow { background: var(--yellow); } .badge.red { background: var(--red); }
.badge-ic { margin-left: auto; font-size: 20px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.card .fname {
  padding: 7px 10px; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Overlay-Buttons auf dem Bild – Safari-Fix */
.card-top {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; gap: 5px; align-items: center; z-index: 1;
  opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
.card:hover .card-top { opacity: 1; }
.card-top:has(.cmk.on) { opacity: 1; }
.card-top .grow { flex: 1; }
.card-top .badge-ic { font-size: 18px; color: #222; text-shadow: 0 1px 3px rgba(255,255,255,.9); }
.cmk {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.88);
  -webkit-backdrop-filter: blur(6px) saturate(1.2);
  backdrop-filter: blur(6px) saturate(1.2);
  box-shadow: 0 1px 6px rgba(0,0,0,.22), inset 0 0 0 .5px rgba(255,255,255,.6);
  color: #333; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: .12s; flex: none; line-height: 1;
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}
.cmk:hover { background: rgba(255,255,255,.98); transform: scale(1.08); }
.cmk.green.on  { background: var(--green); color: #fff; }
.cmk.yellow.on { background: var(--yellow); color: #111; }
.cmk.red.on    { background: var(--red); color: #fff; }
.cmk.heart { color: #9a9a9a; }
/* Gesetzter Favorit: gefüllter Kreis – aus der Distanz sofort erkennbar */
.cmk.heart.on  { background: #ff3b5c; color: #fff; box-shadow: 0 2px 10px rgba(255,59,92,.45); }
/* Grösse der Icons zentral hier steuern (überschreibt die width/height im SVG) */
.cmk svg { pointer-events: none; display: block; width: 20px; height: 20px; }

/* Download-Button */
.card-dl {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 11px; font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line); background: var(--bg2); text-decoration: none;
  opacity: 0; transition: opacity .15s;
}
.card:hover .card-dl { opacity: 1; }
.card-dl:hover { color: var(--text); background: var(--bg3); border-color: var(--line); }

/* Lightbox */
.lb { position: fixed; inset: 0; background: rgba(14,14,14,.98); z-index: 100; display: none; flex-direction: column; }
.lb.open { display: flex; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 14px 22px; }
.lb-top .fname { color: #9a9aa2; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-main { flex: 1; display: flex; min-height: 0; }
.lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; min-width: 0; padding: 0 64px; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 190px); object-fit: contain; }
.lb-nav {
  position: absolute; top: 0; bottom: 0; width: 64px; border: 0; background: transparent;
  color: #9a9aa2; font-size: 36px; transition: .15s; font-weight: 200;
}
.lb-nav:hover { color: #fff; }
.lb-nav.prev { left: 0; } .lb-nav.next { right: 0; }
.lb-bar { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px; flex-wrap: wrap; }
.lb .btn { border-color: #3a3a3a; color: #f0f0f0; }
.lb .btn:hover { border-color: #fff; }
.mk {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid #3a3a3a;
  background: transparent; transition: .15s; font-size: 20px; color: #9a9aa2;
}
.mk:hover { transform: scale(1.08); border-color: #9a9aa2; }
.mk.green.on { background: var(--green); border-color: var(--green); color: #fff; }
.mk.yellow.on { background: var(--yellow); border-color: var(--yellow); color: #111; }
.mk.red.on { background: var(--red); border-color: var(--red); color: #fff; }
.mk.heart.on { background: #ff3b5c; border-color: #ff3b5c; color: #fff; }
.lb-close { background: transparent; border: 0; color: #9a9aa2; font-size: 26px; margin-left: auto; }
.lb-close:hover { color: #fff; }

/* Kommentare */
.lb-side { width: 320px; border-left: 1px solid #2c2c2c; display: flex; flex-direction: column; background: #181818; }
.lb-side h3 { font-size: 14px; padding: 14px 16px; border-bottom: 1px solid #2c2c2c; font-weight: 700; color: #f0f0f0; }
.comments { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.comment { background: #242424; border-radius: var(--radius); padding: 10px 12px; font-size: 14px; color: #e8e8e8; }
.comment .who { font-size: 12px; color: #fff; font-weight: 600; margin-bottom: 2px; }
.comment .when { font-size: 11px; color: #9a9aa2; margin-top: 4px; }
.lb-side .muted { color: #9a9aa2; }
.cform { padding: 12px 16px; border-top: 1px solid #2c2c2c; display: flex; flex-direction: column; gap: 8px; }
.cform input, .cform textarea { background: #242424; color: #f0f0f0; border-color: #3a3a3a; }
.cform input:focus, .cform textarea:focus { border-color: var(--accent); }
.cform .btn.primary { background: #fff; color: #111; border-color: #fff; }

/* Upload-Zone */
.drop {
  border: 1px dashed var(--line); border-radius: 8px; padding: 36px;
  text-align: center; color: var(--muted); transition: .15s; margin-top: 16px;
  background: var(--bg2);
}
.drop.over { border-color: var(--accent); color: var(--accent); background: var(--bg3); }
.progress { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* Galerie-Liste (Admin) */
.glist { display: flex; flex-direction: column; margin-top: 22px; border-top: 1px solid var(--line); }
.gitem {
  display: flex; align-items: center; gap: 16px; padding: 18px 4px;
  border-bottom: 1px solid var(--line);
}
.gitem:hover .t { text-decoration: underline; }
.gitem .t { font-weight: 700; font-size: 16px; }
.gitem .meta { font-size: 13px; color: var(--muted); }
.gitem .grow { flex: 1; }

/* Login */
.login-box { max-width: 380px; margin: 12vh auto; }
.center { text-align: center; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; font-weight: 600;
  padding: 10px 20px; border-radius: 999px; z-index: 200; display: none;
}

@media (max-width: 800px) {
  .lb-main { flex-direction: column; overflow-y: auto; }
  .lb-side { width: 100%; border-left: 0; border-top: 1px solid #2c2c2c; max-height: 40vh; }
  .lb-stage { padding: 0 44px; }
  .lb-nav { width: 44px; }
  .wrap { padding: 16px; }
  .brand { font-size: 13px; letter-spacing: .24em; }
}
