/* tini sager – Portfolio. Schrift: System-Schriften, keine externen Dateien. */
:root {
  --accent: #ff2e19;
  --ink: #111;
  --muted: #666;
  --gap: 20px;
  --sidebar: 210px;
  --menu-top: 128px; /* Höhe der ersten Menüzeile: Inhalt beginnt hier */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  padding: 28px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.logo { display: block; height: 56px; }
.logo img { width: 150px; height: auto; }
.menu { margin-top: 44px; display: flex; flex-direction: column; gap: 18px; }
.menu a { font-size: 17px; position: relative; width: fit-content; }
.menu a:hover { text-decoration: none; }
/* Linie baut sich von links nach rechts auf, dezenter Fade */
.menu a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px;
  background: var(--ink); opacity: 0; transform: scaleX(0); transform-origin: left center;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.menu a:hover::after, .menu a:focus-visible::after, .menu a.active::after { opacity: 1; transform: scaleX(1); }
.menu-toggle { display: none; }
.insta { margin-top: 28px; color: var(--ink); display: inline-block; }
.legal { margin-top: auto; font-size: 13px; display: flex; gap: 14px; }
.legal a { color: var(--muted); }
.legal-mobile { display: none; }

/* Zurück nach oben: am Ende jeder Seite */
.to-top {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 56px auto 0;
  border: 1px solid var(--ink); border-radius: 50%;
  color: var(--ink); background: #fff;
}
.to-top[hidden] { display: none; }

/* Portfolio, Special Effects und Video: nutzbare Breite auf 80 %, rechts bleibt ein Streifen frei (ab Tablet-Breite) */
.content-inner { width: 100%; }
@media (min-width: 901px) {
  .content.content-80 .content-inner { width: 80%; }
}
.to-top:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }

.content { flex: 1; padding: var(--menu-top) 32px 60px; min-width: 0; }

/* ---------- Raster ---------- */
.grid {
  column-count: 3;
  column-gap: var(--gap);
}
.tile {
  display: block;
  margin: 0 0 var(--gap);
  break-inside: avoid;
}
.tile img { width: 100%; }
.tile picture { display: block; }
/* Fotos nicht markierbar, kein Ziehen, kein Halten-Menü auf dem Handy */
.tile img, .video-play img, .lightbox img {
  -webkit-user-select: none; user-select: none;
  -webkit-user-drag: none; -webkit-touch-callout: none;
}

/* Übersicht Portfolio/Special Effects: Bild wird beim Hover grau, Titel blendet ein */
.grid-teaser .tile { position: relative; overflow: hidden; }
.tile-title {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  text-align: center; font-size: 20px; font-weight: 700; color: #fff; line-height: 1.3;
  opacity: 0; transition: opacity 0.8s ease; pointer-events: none;
}
/* Nur bei Geräten mit Maus (Hover möglich). Touch-Geräte zeigen Bilder unverändert ohne Titel. */
@media (hover: hover) and (pointer: fine) {
  .grid-teaser .tile img { transition: filter 0.8s ease; }
  .grid-teaser .tile:hover img,
  .grid-teaser .tile:focus-visible img { filter: grayscale(1) brightness(0.7); }
  .grid-teaser .tile:hover .tile-title,
  .grid-teaser .tile:focus-visible .tile-title { opacity: 1; }
}

.entry-title { font-size: 20px; font-weight: 700; margin: 0 0 18px; }

/* ---------- Video ---------- */
.video-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
  max-width: 1040px;
}
/* Browser-Standard für <figure> hat 40 px Rand links/rechts und 16 px oben/unten */
.video { margin: 0; }
.video-play {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}
.video-play img { width: 100%; height: 100%; object-fit: cover; }
.video-fallback { display: block; width: 100%; height: 100%; background: #222; }
.play-icon {
  position: absolute; inset: 0; margin: auto;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; padding-left: 4px;
  pointer-events: none;
}
.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.video figcaption { margin-top: 8px; font-size: 14px; display: flex; flex-direction: column; }
.v-client { color: var(--muted); }

/* ---------- Clients ---------- */
.clients-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; align-items: start; }
.clients-col section { margin-bottom: 44px; }
.clients h2 { font-size: 18px; font-weight: 700; margin: 0 0 8px; line-height: 1.3; }
.clients p { margin: 0; line-height: 1.7; }

/* Upload per Drag and drop */
.dropzone {
  background: #fff; border: 2px dashed #bbb; border-radius: 6px;
  padding: 24px; margin: 12px 0 24px; max-width: 760px; text-align: center;
}
.dropzone.over { border-color: var(--accent); background: #fff5f3; }
.dropzone p { margin: 6px 0; }
.upload-status { list-style: none; padding: 0; margin: 14px 0 0; text-align: left; font-size: 14px; }
.progress { height: 14px; background: #eee; border-radius: 7px; overflow: hidden; margin-top: 14px; }
.progress[hidden] { display: none; }
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.dropzone #upload-text { text-align: left; }
.upload-status li.error { color: #b00020; }

/* ---------- Kontakt ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.contact-photo img { width: 100%; height: auto; }
.contact-text h2 { font-size: 18px; font-weight: 700; margin: 0 0 12px; line-height: 1.3; }
.contact-text p { margin: 0 0 6px; }

/* ---------- Rechtliches ---------- */
.legal-page { max-width: 760px; }
.legal-page h2 { font-size: 18px; margin: 0 0 14px; }
.legal-page h3 { font-size: 14px; margin: 20px 0 6px; }
.legal-page p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; }
.empty { color: var(--muted); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.94);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox { opacity: 0; transition: opacity 0.4s ease; }
.lightbox.is-open { opacity: 1; }
.lightbox figure { margin: 0; max-width: 100vw; max-height: 100vh; text-align: center; }
.lightbox img {
  max-width: 96vw; max-height: 88vh; width: auto; height: auto; margin: 0 auto;
  object-fit: contain;
}
.lightbox img { opacity: 0; transition: opacity 0.6s ease; }
.lightbox img.is-loaded { opacity: 1; }
.lightbox figcaption { color: #bbb; font-size: 13px; margin-top: 8px; }
.lightbox figcaption a { color: #fff; }
.lightbox button {
  position: absolute; background: none; border: 0; color: #fff;
  font-size: 44px; line-height: 1; cursor: pointer; padding: 12px 16px;
}
.lb-close { top: 6px; right: 6px; font-size: 40px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

/* ---------- Admin ---------- */
body.admin { background: #f6f6f6; }
.admin-bar {
  display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center;
  padding: 14px 20px; background: #111; color: #fff;
}
.admin-bar a { color: #fff; }
.admin-bar nav { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.admin-bar .storage { font-size: 14px; opacity: 0.85; }
.img-info { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 4px; }
.too-small { color: #b00020; font-weight: 700; }
.force-upload { margin-left: 8px; padding: 4px 10px; font-size: 13px; background: #b00020; color: #fff; border: 0; border-radius: 3px; cursor: pointer; }
.force-upload:disabled { opacity: 0.5; cursor: default; }
.admin-main { padding: 20px; max-width: 1100px; margin: 0 auto; }
.admin-main h1 { font-size: 24px; }
.narrow { max-width: 420px; margin: 60px auto; padding: 0 20px; }
.admin-form { display: flex; flex-direction: column; gap: 14px; max-width: 640px; background: #fff; padding: 18px; border-radius: 6px; }
.admin-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.admin-form label.check { flex-direction: row; align-items: center; gap: 10px; }
.admin-form input[type=text], .admin-form input[type=password], .admin-form input[type=url], .admin-form input[type=email],
.admin-form select, .admin-form textarea {
  font: inherit; padding: 9px 10px; border: 1px solid #bbb; border-radius: 4px; background: #fff;
}
.admin-form textarea { min-height: 120px; }
.admin-form textarea[rows="3"] { min-height: 70px; }
.inline-add { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.inline-add label { flex: 1 1 200px; }
button, .button {
  font: inherit; padding: 10px 16px; border: 0; border-radius: 4px;
  background: var(--ink); color: #fff; cursor: pointer; display: inline-block;
}
button.danger { background: #b00020; }
button.toggle.on { background: #1e7a3c; }
button.toggle.off { background: #888; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 10px; border-bottom: 1px solid #e5e5e5; text-align: left; vertical-align: middle; font-size: 14px; }
.actions { display: flex; gap: 12px; align-items: center; }
.actions form { margin: 0; }
.actions button { padding: 6px 10px; font-size: 13px; }
.notice { padding: 10px 14px; background: #e8f4ec; border-radius: 4px; }
.notice.error { background: #fbe9ec; }
.hint { font-size: 13px; color: var(--muted); }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.thumb-grid figure { margin: 0; background: #fff; padding: 6px; border-radius: 4px; }
.thumb-grid figure.is-cover { outline: 2px solid var(--ink); }
.cover-label { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.cover-set { margin-top: 8px; padding: 8px 12px; font-size: 13px; width: 100%; }
.thumb-grid img { width: 100%; height: auto; }
.video-admin-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.video-admin-list li { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: #fff; padding: 10px; border-radius: 4px; }
.video-admin-list li img { width: 120px; height: auto; }
.handle { cursor: grab; font-size: 20px; color: #888; user-select: none; }
.row-edit { flex-direction: row; flex-wrap: wrap; align-items: flex-end; flex: 1; max-width: none; padding: 0; background: none; }
.row-edit label { flex: 1 1 160px; }
.admin-main h2 { font-size: 18px; margin-top: 28px; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .grid { column-count: 2; }
  .content { padding: var(--menu-top) 22px 50px; }
}

/* ---------- Handy und kleine Geräte (Hochformat und Querformat) ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: static; height: auto; width: 100%; flex: none;
    padding: 18px 20px 12px;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  }
  .logo { height: auto; }
  .logo img { width: 120px; }
  .menu { margin-top: 0; flex-direction: row; flex-wrap: wrap; gap: 10px 18px; }
  .menu a { font-size: 15px; }
  .insta { margin-top: 0; }
  .legal-desktop { display: none; }
  .legal-mobile { display: flex; justify-content: center; margin-top: 36px; font-size: 11px; }
  .content { padding: 18px 16px 40px; }
  .grid { column-count: 2; column-gap: 12px; }
  .tile { margin-bottom: 12px; }
  .video-list { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; gap: 24px; }
  .clients-cols { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 520px) {
  .grid { column-count: 2; }
  .menu-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    margin-left: auto; width: 40px; height: 40px; padding: 8px;
    background: none; border: 0; cursor: pointer;
  }
  .menu-toggle span { display: block; height: 1.5px; background: var(--ink); }
  .menu { display: none; width: 100%; margin-top: 6px; }
  .sidebar.menu-open .menu { display: flex; flex-direction: column; gap: 14px; padding-top: 10px; }
  .legal-mobile { font-size: 11px; }
  .play-icon { width: 52px; height: 52px; font-size: 18px; }
}

/* Querformat auf dem Handy: Raster bleibt zweispaltig, Lightbox nutzt die Breite */
@media (orientation: landscape) and (max-height: 500px) {
  .sidebar { padding: 10px 16px; }
  .lightbox img { max-height: 80vh; }
}

/* Sanftes Einblenden der Bilder beim Scrollen (nur mit JavaScript aktiv) */
.js-fade .tile img,
.js-fade .video-play img {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.9s ease, transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1), filter 0.8s ease;
}
.js-fade .tile img.is-eager,
.js-fade .video-play img.is-eager { opacity: 1; transform: none; transition: none; }
.js-fade .tile img.is-visible,
.js-fade .video-play img.is-visible {
  opacity: 1;
  transform: none;
}

/* Bewegungsreduzierung im System wird bewusst nicht erzwungen: Einblendungen bleiben aktiv */

.admin-bar .version { font-size: 12px; opacity: 0.6; }
.admin-bar .site-link { margin-left: auto; }
/* Nur für Suchmaschinen und Screenreader sichtbar */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Credits auf der Eintragsseite */
.entry-credits { font-size: 13px; color: var(--muted); margin: 28px 0 0; }
.entry-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.entry-head .entry-title { margin-bottom: 0; }
/* Zurück-Button: gleiche Form wie der Top-Button, Pfeil nach links */
.back-link {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: 0 0 auto;
  border: 1px solid var(--ink); border-radius: 50%;
  color: var(--ink); background: #fff; text-decoration: none;
}
.back-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }

/* Abmelden und kleine Aktionen als schlichter Text-Button */
.link-button { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.admin-bar .logout-form { display: inline; margin: 0; }
.admin-bar .link-button { color: #fff; text-decoration: none; }
.admin-bar .link-button:hover { text-decoration: underline; }
.inline-actions { display: flex; gap: 18px; margin-top: 12px; }
.inline-actions .link-button { color: var(--muted); font-size: 14px; }

/* Login und Einrichtung */
.narrow form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 14px; }
.narrow input[type=text], .narrow input[type=password], .narrow input[type=email] {
  font: inherit; padding: 9px 10px; border: 1px solid #bbb; border-radius: 4px; background: #fff;
}

/* Fotoliste im Admin: aktiv und inaktiv, per Ziehen sortierbar */
.admin-main h3 { font-size: 15px; margin: 18px 0 6px; }
.photo-list {
  list-style: none; padding: 10px; margin: 0 0 24px; min-height: 90px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px;
  background: #fff; border-radius: 4px;
}
.photo-list.is-inactive-list { background: #e9e9e9; }
.photo-item {
  background: #fff; border: 1px solid #e5e5e5; border-radius: 4px; padding: 6px;
  display: flex; flex-direction: column; gap: 4px; cursor: grab;
}
.photo-item img { width: 100%; height: auto; }
.photo-item.is-inactive { opacity: 0.65; }
.photo-item.is-cover { outline: 2px solid var(--ink); }
.photo-item.sortable-ghost { opacity: 0.4; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.photo-actions form { margin: 0; }
.photo-actions button { padding: 6px 10px; font-size: 13px; }
button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--ink); }
