/* =====================================================================
   Feature 2 – file storage with changing views (slide "projektansichten")
   Folders as headings, files with names; files move with transform only.
   ===================================================================== */
.pv { position: absolute; inset: 0; display: flex; flex-direction: column; --pv-t: 100px; --pv-cap: 20px; }

/* the same warm folder as in feature 1 */
.pv-folder { width: 18px; height: 15px; flex: none; fill: #d9d3c8; stroke: none; }

/* ---------- top bar: project · files | order by ---------- */
.pv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px solid var(--border);
}
.pv-project { margin: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pv-project b { font-size: 14px; font-weight: 600; }
.pv-project span { font-size: 13px; color: var(--muted); }
.pv-switch { position: relative; display: flex; align-items: center; gap: 2px; margin-left: auto; }
.pv-switch__lead { font-size: 13px; color: var(--muted); margin-right: 8px; white-space: nowrap; }
.pv-switch__btn {
  position: relative; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 500; color: #9a978f;
  padding: 10px 8px; min-height: 44px;
  transition: color 180ms var(--ease);
}
.pv-switch__btn:hover { color: var(--text-2); }
.pv-switch__btn[aria-pressed="true"] { color: var(--text); }
.pv-switch__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-radius: 6px; }
.pv-switch__btn:active { transform: scale(0.985); }
.pv-switch__line {
  position: absolute; left: 0; bottom: -13px; height: 2px; width: 0;
  background: var(--text); border-radius: 2px;
  transition: transform 340ms cubic-bezier(0.2, 0, 0, 1), width 340ms cubic-bezier(0.2, 0, 0, 1);
}

/* ---------- folders and files ---------- */
.pv-field { position: relative; flex: 1; min-height: 0; }

.pv-head {
  position: absolute; left: 0; top: 0; margin: 0;
  display: flex; align-items: center; gap: 7px; height: 20px;
  font-size: 13px; line-height: 1; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 160ms var(--ease);
}
.pv-head.is-on { opacity: 1; transition: opacity 380ms var(--ease) 380ms; }
.pv-head b { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.pv-head span { color: var(--muted); font-variant-numeric: tabular-nums; }
.pv-head i { flex: 1; height: 1px; background: var(--border); margin-left: 4px; }

.pv-file {
  position: absolute; left: 0; top: 0; margin: 0;
  transform-origin: 0 0;                 /* same as feature 1, so the fan matches exactly */
  width: var(--pv-t);
  will-change: transform;
}
.pv-file__face {
  position: relative; display: block; width: var(--pv-t); height: var(--pv-t);
  border-radius: 5px;
  transition: transform 360ms cubic-bezier(0.2, 0, 0, 1), box-shadow 360ms var(--ease);
}
.pv-file__face > * { position: absolute; inset: 0; border-radius: inherit; }
/* picked up while travelling, set down when arrived */
.pv-field.is-moving .pv-file__face { transform: scale(0.94); }
.pv-field.is-moving .pv-file--foto .pv-file__face { box-shadow: 0 18px 30px -20px rgba(28, 24, 18, 0.5); }
.pv-file figcaption {
  height: var(--pv-cap); padding-top: 5px;
  font-size: 11.5px; line-height: 1.2; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* the file we follow through every view */
.pv-file.is-tracked .pv-file__face { outline: 2px solid var(--accent); outline-offset: 2px; }
.pv-file.is-tracked figcaption { color: var(--accent); font-weight: 600; }

.pv-photo { background: #e6e2da center / cover no-repeat; }

/* documents: a preview of the page itself (like Finder/Quick Look) – white sheet with a clear
   edge and dark content, so it stands out from the light background without a backdrop */
.pv-doc { display: grid; place-items: center start; background: transparent; }   /* left edge in line with the file name */
.pv-doc__page {
  position: relative; display: block; overflow: hidden;
  height: 100%; aspect-ratio: 0.74;
  background: #fff; border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(28, 28, 26, 0.16), 0 6px 14px -8px rgba(28, 24, 18, 0.35);
}
.pv-doc__h {
  position: absolute; left: 11%; right: 11%; top: 9%;
  font-size: 8.5px; line-height: 1.2; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
}
.pv-doc__text { position: absolute; left: 11%; right: 11%; top: 34%; display: grid; gap: 5px; }
.pv-doc__text i { display: block; height: 2.5px; border-radius: 1px; background: #a9a59c; }
.pv-doc__text i:nth-child(3n) { width: 82%; }
.pv-doc__text i:nth-child(5) { width: 60%; }
.pv-doc__page--bericht .pv-doc__text i:nth-child(4) { margin-top: 4px; width: 45%; background: var(--text); }
.pv-doc__plan { position: absolute; left: 8%; right: 8%; top: 7%; height: 62%; }
.pv-doc__plan svg { width: 100%; height: 100%; stroke: var(--text); stroke-width: 1.6; fill: none; vector-effect: non-scaling-stroke; }
.pv-doc__plan svg .t { stroke: #8b877f; stroke-width: 1; }
/* title block of the plan, bottom right */
.pv-doc__stamp { position: absolute; right: 8%; bottom: 7%; width: 44%; display: grid; gap: 3px; padding: 4px; box-shadow: inset 0 0 0 1px #8b877f; }
.pv-doc__stamp i { display: block; height: 2px; background: #8b877f; }
.pv-doc__stamp i:last-child { width: 60%; }
.pv-doc__tag {
  position: absolute; left: 0; bottom: 8%;
  padding: 2px 6px 2px 11%; border-radius: 0 3px 3px 0;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.03em; line-height: 1.3; color: #fff;
}
.pv-doc__tag--pdf { background: #d8402f; }
.pv-doc__tag--docx { background: #2b5fb8; }

/* ---------- the folder from feature 1: files start inside it ---------- */
.pv-big {
  position: absolute; z-index: 1; pointer-events: none;
  transition: opacity 600ms var(--ease) 700ms, transform 600ms var(--ease) 700ms;
}
.pv-big--front { z-index: 3; }
.pv-big__back { position: absolute; inset: 0; border-radius: 9px; background: #d9d3c8; }
.pv-big__back::before {
  content: ""; position: absolute; left: 0; top: -13%; width: 40%; height: 20%;
  border-radius: 8px 12px 0 0; background: #d9d3c8;
}
.pv-big__front {
  position: absolute; left: 0; right: 0; bottom: 0; height: 76%; border-radius: 9px;
  background: linear-gradient(180deg, #ebe6dd 0%, #e3ddd2 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 18px 30px -22px rgba(28, 24, 18, 0.45);
}
.pv:not(.is-intro) .pv-big { opacity: 0; transform: scale(0.97); }
.pv-big--front { z-index: 10; }
.pv-file { z-index: 2; }
.pv.is-opening .pv-file { z-index: 11 !important; } /* leaving the folder: above the front flap */
.pv-file.is-tucked { opacity: 0; }
.pv-file { transition-property: transform; }
.pv.is-intro .pv-file__face { border-radius: 3px; }
.pv.is-intro .pv-file--foto .pv-file__face { box-shadow: 0 0 0 calc(4px / var(--pv-k, 0.5)) #fbfaf7, 0 2px 6px rgba(28, 24, 18, 0.18); }
.pv.is-intro .pv-file.is-tracked .pv-file__face { outline-color: transparent; }
.pv-file figcaption { transition: opacity 300ms var(--ease) 500ms; }
.pv.is-intro .pv-file figcaption { opacity: 0; transition: none; }
.pv-project .pv-folder { transition: opacity 300ms var(--ease) 1100ms; }
.pv.is-intro .pv-project .pv-folder { opacity: 0; transition: none; }
.pv.is-intro .pv-foot { opacity: 0; }
.pv-foot { transition: opacity 400ms var(--ease) 900ms; }

/* ---------- foot: the point of it all ---------- */
.pv-foot { margin: 12px 0 0; font-size: 13px; color: var(--text-2); }
.pv-foot__note { color: var(--muted); }

/* ---------- phone ---------- */
@media (max-width: 560px) {
  .frs__slide[data-slide="projektansichten"] .frs__visual { aspect-ratio: 5.6 / 10; }
  .pv-bar { flex-direction: column; align-items: flex-start; gap: 4px; padding-bottom: 0; margin-bottom: 16px; }
  .pv-switch { margin-left: -8px; }
  .pv-switch__lead { display: none; }
  .pv-switch__line { bottom: -1px; }
  .pv-file figcaption { font-size: 10px; padding-top: 4px; }
  .pv-doc__tag { font-size: 8px; padding: 1px 4px 1px 9%; }
  .pv-foot { font-size: 12px; }
  .pv-foot__note { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .pv * { transition: none !important; }
}

/* title of this slide: the grey part starts on its own line */
.frs__slide[data-slide="projektansichten"] .frs__title .muted { display: block; }

/* the stage keeps the shared folder fully visible during the slide change … */
.frs__slide:not(.is-active) .pv > * { opacity: 0; transition: opacity 320ms var(--ease); }
/* … the bar and the foot fade in around it */
.pv-bar { transition: opacity 420ms var(--ease) 120ms; }

/* TEST – the hand-over folder in black, matching feature 1 (remove together with the block there) */
.pv-big__back, .pv-big__back::before { background: #0d0d0d; }
.pv-big__front {
  background: linear-gradient(180deg, #2b2b2a 0%, #1a1a19 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 18px 30px -18px rgba(0, 0, 0, 0.55);
}

/* the Bautagebuch lifts a little just before feature 3 opens it */
.pv-file .pv-doc__page { transition: transform 420ms var(--ease), box-shadow 420ms var(--ease); }
.pv-file.is-picked .pv-doc__page { transform: translateY(-4px) scale(1.04); box-shadow: 0 0 0 1px rgba(28, 28, 26, 0.16), 0 16px 26px -14px rgba(28, 24, 18, 0.45); }
/* hand-over: the Bautagebuch file fades a little later than the rest – the opening page takes its place */
.frs__slide:not(.is-active) .pv-file.is-picked { transition: opacity 360ms var(--ease) 180ms !important; }   /* beats the inline transition set by the layout */
