/* schewe.net – Grundlayout */
:root {
  --bg: #fafaf8;
  --fg: #1b1b1a;
  --muted: #76746f;
  --line: #e4e2dc;
  --accent: #1b1b1a;
  --gap: 10px;
  --row: 260px;           /* Zielhöhe einer Bildreihe in Galerien */
  --max: 1600px;
  --pad: clamp(16px, 4vw, 48px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --fg: #ecebe7;
    --muted: #8f8d87;
    --line: #2a2a28;
    --accent: #ecebe7;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* Kopfzeile */
.site-header {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding: 28px var(--pad) 32px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand {
  text-decoration: none; font-size: 1.25rem; font-weight: 500; letter-spacing: .02em;
}
.site-header nav { display: flex; gap: 22px; }
.site-header nav a {
  text-decoration: none; color: var(--muted); font-size: .95rem;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
}
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--fg); border-color: var(--fg); }

.page-title {
  font-weight: 400; font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  margin: 0 0 24px; letter-spacing: .01em;
}

/* Startseite: Kacheln – Titel auf dem Bild, Bild aufgehellt, beim Überfahren klar */
.tiles {
  display: grid; gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .tiles { grid-template-columns: 1fr; gap: 10px; } }
.tile {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 3 / 2; background: var(--line); text-decoration: none;
}
.tile img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.tile::after {                      /* Schleier über dem Bild */
  content: ""; position: absolute; inset: 0;
  background: #fff; opacity: .15;
  transition: opacity .35s ease;
}
.tile-title {                       /* Glasblock in der Mitte */
  position: absolute; left: 50%; top: 50%; z-index: 1;
  transform: translate(-50%, -50%);
  width: max-content; max-width: 90%;
  padding: .4em 1em; text-align: center; border-radius: 4px;
  background: rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: clamp(1.3rem, 2vw, 1.9rem); font-weight: 400; letter-spacing: .01em;
  color: #1b1b1a;
  transition: opacity .35s ease;
}
/* Schrift wächst mit der Kachelbreite: 3 Spalten ≈ 2 vw, 2 Spalten ≈ 3 vw, 1 Spalte ≈ 6 vw */
@media (max-width: 1100px) { .tile-title { font-size: clamp(1.3rem, 3vw, 1.9rem); } }
@media (max-width: 600px)  { .tile-title { font-size: clamp(1.3rem, 6vw, 1.9rem); } }
@media (hover: hover) {
  .tile:hover::after, .tile:focus-visible::after { opacity: 0; }
  .tile:hover .tile-title, .tile:focus-visible .tile-title { opacity: 0; }
  .tile:hover img { transform: scale(1.03); }
}

/* Galerie: Bildreihen mit gleicher Höhe, keine Beschnitte */
.grid { display: flex; flex-wrap: wrap; gap: var(--gap); }
.grid::after { content: ""; flex-grow: 999999; }
.grid .item {
  flex: var(--ar) 1 calc(var(--ar) * var(--row));
  margin: 0; position: relative; display: block; min-width: 0;
  background: var(--line); overflow: hidden;
  aspect-ratio: var(--ar);
}
.grid img, .grid video { display: block; width: 100%; height: 100%; object-fit: cover; }
.grid a.ph { cursor: zoom-in; }
@media (max-width: 900px) { :root { --row: 200px; --gap: 6px; } }
@media (max-width: 600px) {
  :root { --row: 150px; }
  /* Hochformat-Bilder auf dem Handy nicht zu klein werden lassen */
}

.vid-full {
  position: absolute; right: 8px; bottom: 8px;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; font-size: 18px; cursor: pointer;
}

/* Kontakt */
.contact { max-width: 640px; }
.contact .label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin: 28px 0 4px; }
.contact p { margin: 0; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin: 4px 0; }

/* Fußzeile */
.site-footer {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding: 56px var(--pad) 32px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.social { display: flex; gap: 18px; }
.social a { color: var(--muted); display: inline-flex; }
.social a:hover { color: var(--fg); }
.social svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.social svg .fill { fill: currentColor; stroke: none; }
.small { font-size: .8rem; color: var(--muted); }

/* Lightbox-Feinschliff */
.pswp { --pswp-bg: #0b0b0b; }

/* Mit JavaScript: exakt berechnete Reihen */
.grid.js .item { flex: none; aspect-ratio: auto; }
.grid.js::after { display: none; }

/* Galerie-Kopf mit Umschalter Alle / Sichtbar / Infrarot */
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.gallery-head .page-title { margin: 0; }
.kind-switch {
  display: inline-flex; padding: 4px; gap: 2px;
  background: var(--line); border-radius: 999px;
}
.kind-switch button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: .95rem; padding: .45em 1.1em; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: .45em; transition: background .2s, color .2s;
}
.kind-switch button span { font-size: .8em; opacity: .7; }
.kind-switch button:hover { color: var(--fg); }
.kind-switch button[aria-pressed="true"] { background: var(--bg); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.ir-dot { width: .6em; height: .6em; border-radius: 50%; background: #e8786f; display: inline-block; }
@media (max-width: 600px) {
  .kind-switch { width: 100%; }
  .kind-switch button { flex: 1; justify-content: center; padding: .55em .4em; }
}
.grid { transition: opacity .15s ease; }
.grid.fading { opacity: 0; }
.grid .item.off { display: none; }

/* Kachel-Hinweis: Galerie enthält auch Infrarot */
.tile-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: .4em;
  padding: .25em .7em; border-radius: 999px; font-size: .8rem; color: #1b1b1a;
  background: rgba(255,255,255,.75); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.tile-badge i { width: .55em; height: .55em; border-radius: 50%; background: #e8786f; display: inline-block; }

/* Sprachumschalter DE | EN */
.site-header nav { align-items: baseline; }
.lang-switch { display: inline-flex; margin-left: 6px; border-left: 1px solid var(--line); padding-left: 14px; gap: 2px; }
.lang-switch button {
  appearance: none; border: 0; background: none; font: inherit; font-size: .85rem; letter-spacing: .04em;
  color: var(--muted); padding: 0 4px; cursor: pointer;
}
.lang-switch button:hover { color: var(--fg); }
.lang-switch button[aria-pressed="true"] { color: var(--fg); font-weight: 600; }

/* Lightbox: Bildinfo unten */
.pswp__info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 28px 20px 16px; text-align: center; pointer-events: none;
  color: rgba(255,255,255,.82); font-size: .82rem; line-height: 1.5;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
  transition: opacity .25s;
}
.pswp__info-title { color: #fff; font-size: 1rem; margin-bottom: 2px; }
.pswp--ui-visible .pswp__info { opacity: 1; }
.pswp:not(.pswp--ui-visible) .pswp__info, .pswp--zoomed-in .pswp__info { opacity: 0; }
.pswp__button--slideshow, .pswp__button--share { color: #fff; }
.pswp__button--slideshow svg, .pswp__button--share svg { filter: drop-shadow(0 0 1px rgba(0,0,0,.4)); }

/* Teilen-Hinweis */
.share-toast {
  position: fixed; left: 50%; top: 70px; z-index: 100000; transform: translate(-50%, -8px);
  background: rgba(255,255,255,.92); color: #1b1b1a; padding: .5em 1.1em; border-radius: 999px;
  font-size: .9rem; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
  max-width: 90vw; overflow-wrap: anywhere;
}
.share-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Galerie: Hinweis auf Vergleichspaar */
.grid .pair-badge {
  position: absolute; left: 8px; bottom: 8px; z-index: 1;
  padding: .15em .6em; border-radius: 999px; font-size: .75rem; color: #1b1b1a;
  background: rgba(255,255,255,.8); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  pointer-events: none;
}

/* Vergleich sichtbar <-> Infrarot (in der Lightbox) */
.irl { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; --pos: 50%; }
.irl-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; clip-path: inset(0 0 0 var(--pos)); }
.irl--onir .irl-img { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.irl-line {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 44px; margin-left: -22px;
  pointer-events: auto; cursor: ew-resize; touch-action: none;
}
.irl-line::before { content: ""; position: absolute; top: 0; bottom: 0; left: 21px; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.5); }
.irl-knob {
  position: absolute; top: 50%; left: 0; width: 44px; height: 44px; margin-top: -22px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.4); outline: none;
}
.irl-knob::before { content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; color: #1b1b1a; letter-spacing: 2px; }
.irl-knob:focus-visible { box-shadow: 0 0 0 3px #e8786f, 0 2px 10px rgba(0,0,0,.4); }
.irl.anim .irl-img { transition: clip-path .7s cubic-bezier(.4,0,.2,1); }
.irl.anim .irl-line { transition: left .7s cubic-bezier(.4,0,.2,1); }
.irl-label {
  position: absolute; top: 12px; padding: .25em .75em; border-radius: 999px; font-size: .8rem; color: #1b1b1a;
  background: rgba(255,255,255,.8); display: inline-flex; align-items: center; gap: .4em; transition: opacity .2s;
}
.irl-l { left: 12px; } .irl-r { right: 12px; }
/* beim Hineinzoomen Griff und Beschriftung ausblenden, Trennung bleibt */
.pswp--zoomed-in .irl-knob, .pswp--zoomed-in .irl-label { opacity: 0; }
.pswp--zoomed-in .irl-line { pointer-events: none; }
.pswp:not(.pswp--ui-visible) .irl-label { opacity: 0; }
