/* ============================================================
   Stack mode — applied to .file-cabinet when no hunt is currently
   running. The 12 case folders are rendered as a tilted, overlapping
   pile on the table, visually implying "the dossier isn't open right
   now". Clicks are suppressed via JS, plus pointer-events: none here
   as a defense-in-depth so hover/click states aren't even reachable.
   ============================================================ */
/* stack-mode greift nur auf den REGULÄREN Akten-Tab (Monatsakten).
   Finale-Akten bleiben jederzeit klickbar — Token-Einlösen geht auch
   außerhalb der Hunt-Phase, und mit Token soll die Akte normal öffnenbar
   sein. .finale-grid ist die Tab-Klasse, die wir vom Stacking ausschließen. */
.file-cabinet.stack-mode .files-grid:not(.finale-grid) {
  /* Tighter grid so cards feel piled rather than displayed */
  gap: 6px 10px;
  row-gap: 18px;
}
.file-cabinet.stack-mode .files-grid:not(.finale-grid) .file-tab {
  /* Use the per-card random tilt/offset variables set in JS */
  transform:
    translate(var(--stack-x, 0), var(--stack-y, 0))
    rotate(var(--stack-tilt, 0deg));
  cursor: default;
  pointer-events: none;
  /* Slight desaturation — feels like resting/archived */
  filter: saturate(0.88) brightness(0.97);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.3, 1.1);
}
.file-cabinet.stack-mode .files-grid:not(.finale-grid) .file-tab:hover {
  /* Kill the normal hover lift in stack mode */
  transform:
    translate(var(--stack-x, 0), var(--stack-y, 0))
    rotate(var(--stack-tilt, 0deg));
}

/* Individual Akte (Manila folder with tab) */
.file-tab {
  /* Illustrierte Kraftpapier-Mappe (assets/akte-mappe-*.webp, vier
     per Farbnormalisierung auf denselben Manila-Ton gebrachte
     Abnutzungs-Varianten, Verteilung siehe nth-child-Regeln unten).
     Die Finalakten (.file-folder.tier-*) behalten bewusst ihre
     Tier-Einfaerbung und sind hiervon unberuehrt. */
  background: url("/assets/akte-mappe-1.webp") center / 100% 100% no-repeat;
  /* KEIN border / inset-Highlight mehr: das waren Relikte aus der Zeit,
     als die Mappe per CSS gezeichnet wurde. Die Illustration hat
     beschnittene Ecken — ein rechteckiger 1px-Rahmen + helle
     Inset-Linie lagen sichtbar UM die Mappe herum. Die Kontur
     zeichnet jetzt allein das Bild. */
  padding: 1.3rem 1.1rem 3.2rem;
  cursor: pointer;
  position: relative;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.18),
    0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.1), box-shadow 0.3s;
  height: 240px;
  /* Eigene GPU-Layer erzwingen — ohne dies werden gedrehte Akten
     (-2.8° bis +2.9° via --stack-tilt) auf Subpixel-Position
     gerastert, wodurch der Text verwaschen aussieht. translateZ(0)
     hebt das Element auf einen separaten Compositor-Layer, der
     dann sauber resampled wird. */
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Abnutzungs-Varianten im Wechsel, damit die 12 Mappen nicht wie
   Klone aussehen (die Illustration selbst traegt jetzt die
   Papierstruktur — das fruehere CSS-Linienmuster ist ersetzt) */
.file-tab:nth-child(4n+2) { background-image: url("/assets/akte-mappe-2.webp"); }
.file-tab:nth-child(4n+3) { background-image: url("/assets/akte-mappe-3.webp"); }
.file-tab:nth-child(4n)   { background-image: url("/assets/akte-mappe-4.webp"); }

/* The reiter / tab on top */
.file-tab-reiter {
  position: absolute;
  top: -14px;
  left: 16px;
  height: 20px;
  padding: 2px 12px 5px;
  background:
    linear-gradient(to bottom, #dfc48a 0%, var(--manila) 100%);
  border: 1px solid var(--manila-dark);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-transform: uppercase;
  z-index: 2;
  box-shadow: inset 0 1px 0 rgba(255, 250, 230, 0.35);
}
/* Stagger tab positions: left, center, right, repeat */
.file-tab:nth-child(3n+2) .file-tab-reiter { left: 50%; transform: translateX(-50%); }
.file-tab:nth-child(3n) .file-tab-reiter { left: auto; right: 14px; }

/* Hover: lift the folder */
.file-tab:hover {
  transform: translateY(-10px) rotate(-0.5deg);
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.28),
    0 16px 30px rgba(0, 0, 0, 0.15);
  z-index: 5;
}
.file-tab:nth-child(2n):hover { transform: translateY(-10px) rotate(0.5deg); }

/* Solved: red marker on the reiter */
.file-tab.solved .file-tab-reiter::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--stamp-red);
  box-shadow: 0 0 0 1.5px rgba(184, 39, 39, 0.2);
}

.file-tab-body-content {
  margin-top: 0.4rem;
  position: relative;
  z-index: 1;
  max-height: 130px;
  overflow: hidden;
}
/* Instagram cases include a sticker under the meta line, which needs
   more vertical space than the standard body-content allows. The
   cap (168px = card 240px minus top/bottom padding) keeps the sticker
   clear of the absolutely-positioned status chip. */
.file-tab.ig-only .file-tab-body-content {
  max-height: 168px;
}
/* Vault cases use a much larger icon (76px vs IG's 38px) AND no
   label. The body-content needs to remove its overflow clip so the
   bottom of the icon isn't cut off. We don't need a max-height
   here — the natural content height plus padding stays under the
   card's 240px so nothing escapes the card boundary. We also
   tighten the title margin to claim back a bit of vertical space
   for the larger icon. */
.file-tab.vault-case .file-tab-body-content {
  max-height: none;
  overflow: visible;
}
.file-tab.vault-case .file-tab-title {
  margin-bottom: 0.2rem;
  min-height: 0;
}
.file-tab-title {
  font-family: var(--font-type);
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.45rem;
  min-height: 2.4em;
}
.file-tab-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--manila-deep);
  text-transform: uppercase;
}
.file-tab-status {
  position: absolute;
  bottom: 1.1rem;
  left: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 8px;
  z-index: 1;
}
.file-tab.solved .file-tab-status {
  background: var(--ink);
  color: var(--paper);
  /* Centered rather than left-aligned — the dark chip carries visual
     weight and sitting flush-left leaves an obvious gap on the right. */
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}
.file-tab.open .file-tab-status {
  border: 1px dashed var(--manila-deep);
  color: var(--manila-deep);
}
.file-tab .mini-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-14deg);
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--stamp-red);
  border: 3px double var(--stamp-red);
  padding: 0.35rem 1.1rem 0.45rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.82;
  z-index: 3;
  pointer-events: none;
  background: rgba(239, 231, 212, 0.22);
  text-shadow: 1px 1px 0 rgba(184, 39, 39, 0.15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

