/* ==========================================================================
   Univers — eingebettete Webfonts (liegen in assets/fonts/)
   "Univers":           300 Light · 400 Regular · 700 Bold
   "Univers Condensed": 400 Regular · 700 Bold  (schmaler Schnitt)
   ========================================================================== */

@font-face {
  font-family: "Univers";
  src: url("../assets/fonts/univers-light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Univers";
  src: url("../assets/fonts/univers-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Univers";
  src: url("../assets/fonts/univers-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Univers Condensed";
  src: url("../assets/fonts/univers-cond-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Univers Condensed";
  src: url("../assets/fonts/univers-cond-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ==========================================================================
   Janis Reitmann — Portfolio "Digitaler Ordner"
   ========================================================================== */

:root {
  /* Farben */
  --bg: #f5f5f5;
  --ink: rgba(0, 0, 0, .7);        /* Grundtext */
  --gray: rgba(0, 0, 0, .4);       /* Kopfzeile */
  /* Win11-Prinzip: keine Konturen — Rückblatt dunkler, Vorderblatt hell,
     Trennung über Tonwert + weiche Schatten */
  --folder-front: #f1ece6;         /* Vorderblatt (Körper) */
  --folder-back: #e5ddd2;          /* Rückblatt (Band + Reiter) */
  --rim: #d9cec0;                  /* toniger Rand des Vorderblatts (Win11-Prinzip) */

  /* Geometrie
     --scale: Gesamtgröße des Ordners (1 = ursprüngliche Größe, kleiner = kompakter)
     --page-pad: sichtbarer Hintergrund rundum (gilt seitlich UND unten) */
  --scale: 0.85;
  --page-pad: clamp(20px, 6vw, 120px);
  --stack-step: calc(var(--tab-h) * 0.62);  /* < Reiterhöhe: Reiter überlappen */
  --tab-h: calc(clamp(34px, 4.6vw, 52px) * var(--scale));
  --fold-radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* Eingebettete Univers (assets/fonts/) — für den schmalen Schnitt
     einfach "Univers Condensed" an die erste Stelle setzen */
  font-family: "Univers", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
}

/* ------------------------- Kopfzeile ------------------------- */

.site-header {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
  flex-wrap: wrap;
  padding: 18px var(--page-pad);
}

.contact {
  font-size: clamp(14px, 1.05vw, 20px);
  color: var(--gray);
  text-decoration: none;
}

.contact:hover,
.contact:focus-visible { color: rgba(0, 0, 0, .95); }

.contact--right { margin-left: auto; }

/* ------------------------- Ordner-Stapel ------------------------- */

.stack {
  position: relative;
  margin: clamp(24px, 4vh, 48px) var(--page-pad) 0;
  /* Höhe wird per JS gesetzt (Oberkante vorderster Ordner + dessen Inhalt) */
}

.folder {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--stack-top, 0px);            /* per JS gesetzt */
  z-index: var(--stack-z, 1);            /* per JS gesetzt */
  transition: transform .18s ease;
}

/* Herauszieh-Feedback: beim Überfahren des Reiters zieht sich der ganze
   Ordner nach oben aus dem Stapel — er bleibt dabei in seiner Ebene und
   verdeckt keine vorderen Reiter (der offene ist bereits draußen) */
.folder:not(.is-open):has(.tab:hover) {
  transform: translateY(calc(var(--tab-h) * -0.55));
}

/* Reiter: transparente Klickfläche — die sichtbare Silhouette
   (Erhebung + durchgängige Oberkante) zeichnet das .outline-SVG */
.folder .tab {
  position: relative;
  z-index: 3;
  display: block;
  left: var(--tab-left, 40%);
  width: var(--tab-width, 22%);
  height: var(--tab-h);
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: calc(clamp(13px, 1.45vw, 28px) * var(--scale));
  color: var(--gray);
  cursor: pointer;
  transition: transform .12s ease;
}

.folder .tab span {
  position: absolute;
  inset: 14% 7% 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Durchgängige Oberkante: Füllung der Reiter-Erhebung + eine Linie
   über die gesamte Ordnerbreite (per JS passend gezeichnet) */
.folder .outline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--tab-h) + 26px);
  overflow: visible;
  pointer-events: none;
  z-index: 2;
  transition: transform .12s ease;
}

.folder .outline .outline-fill {
  fill: var(--folder-back);
  filter: drop-shadow(0 -2px 4px rgba(64, 55, 42, .24));
}

/* Offener Ordner: der dunklere Band-Ton stammt vom Schattenwurf der
   Vorderseite — sie ist weggeklappt, also steht alles im hellen Grundton,
   und auch der Schlagschatten oben entfällt für eine ruhige, ebene Fläche */
.folder.is-open .outline .outline-fill {
  fill: var(--folder-front);
  filter: none;
}

/* Absenkungs-Tasche: sichtbarer Rückblatt-Ton im Blick in den Ordner */
.folder .outline .outline-pocket { fill: var(--folder-back); }

/* Toniger Rand der Absenkungs-Kurve (wie der Vorderblatt-Rahmen) */
.folder .outline .outline-rim {
  fill: none;
  stroke: var(--rim);
  stroke-width: 1.5;
}

/* Weicher Schatten des Vorderblatts auf dem Rückblatt (Überlappung) */
.folder .outline .outline-shadow {
  fill: none;
  stroke: rgba(96, 84, 66, .30);
  stroke-width: 6;
}

/* Andrücken: Schrift und Silhouette bewegen sich gemeinsam */
.folder .tab:active,
.folder .tab:active + .outline { transform: translateY(4px); }

.folder .tab:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Ordnerkörper im Win11-Look: toniger Rand statt Kontur, diagonaler
   Verlauf (hell oben links -> wärmer unten) und helle Innenkante oben */
.folder .body {
  position: relative;
  min-height: calc(var(--stack-step) + 40px);
  border: 1.5px solid var(--rim);
  border-radius: var(--fold-radius);
  background-color: var(--folder-front);
  background-image: url("../assets/grain.png"),
                    linear-gradient(160deg, #f6f2ec 0%, #ece4d9 100%);
  background-blend-mode: soft-light, normal;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55),
              0 3px 14px rgba(90, 78, 62, .10);
}

/* Offener Ordner: Vorderseite ist weggeklappt — Rand entfällt,
   nur die untere Rundung des Inhaltsbereichs bleibt */
.folder.is-open .body {
  border: none;
  border-radius: 0 0 var(--fold-radius) var(--fold-radius);
}

/* ------------------------- Inhalt ------------------------- */

.folder .content {
  display: none;
  padding: calc(clamp(70px, 10vh, 110px) * var(--scale))
           calc(clamp(20px, 3.2vw, 60px) * var(--scale))
           calc(clamp(48px, 6vh, 80px) * var(--scale));
}

.folder.is-open .content {
  display: block;
  animation: content-in .5s ease .1s both;
}

@keyframes content-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Mehrspaltiges Masonry-Raster: kleinere Bilder, versetzt, mit Lücken
   (Spaltenzahl skaliert mit der Breite; Hoch-/Querformate mischen sich) */
.folder .images {
  column-count: 3;
  column-gap: clamp(12px, 1.4vw, 26px);
}

.folder .images figure {
  margin: 0 0 clamp(12px, 1.4vw, 26px);
  break-inside: avoid;
}

@media (max-width: 1000px) { .folder .images { column-count: 2; } }
@media (max-width: 560px)  { .folder .images { column-count: 1; } }

.folder .images img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

/* ------------------------- Lightbox (Laytheme-Stil) -------------------------
   Verhalten wie das Laytheme-Lightbox-Addon:
   sanftes Einblenden, linke Hälfte = Zurück, rechte Hälfte = Weiter
   (mit den Original-Pfeil-Cursorn), Wischgesten, ESC/Button zum Schließen. */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .95);  /* Website bleibt dahinter leicht sichtbar */
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lb-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
}

.lb-stage.cursor-left  { cursor: url("../assets/cursor_prev.svg") 9 9, pointer; }
.lb-stage.cursor-right { cursor: url("../assets/cursor_next.svg") 9 9, pointer; }
.lb-stage.oneimage,
.lb-stage.oneimage img { cursor: default; }

.lb-stage img {
  max-width: 92vw;
  max-height: 92vh;
  transition: opacity 200ms ease;
}

.lb-close {
  position: absolute;
  top: 14px;
  right: 22px;
  z-index: 101;
  border: none;
  background: none;
  padding: 6px;
  font-family: inherit;
  font-size: 34px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

/* ------------------------- Reduzierte Bewegung ------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .folder, .folder .tab, .folder .outline { transition: none; }
  .folder.is-open .content { animation: none; }
}
