/* Glass folder shape/hinge adapted from the supplied Glass Folder Cards.
   Scoped to case selection. Artwork is existing, downsampled case media. */
.gf-root {
  --gf-scale: .88; --gf-hinge: 0deg; --gf-lift: 38px; --gf-spread: 0px; --gf-stack: 14px; --gf-fan: 0deg;
  --gf-ease: cubic-bezier(.2,.8,.2,1);
  position: relative; display: block; width: 100%; aspect-ratio: 340 / 326;
  isolation: isolate; padding: 0; border: 0; background: none; box-shadow: none;
  border-radius: 20px; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gf-stage { position: absolute; left: 0; top: 0; width: 340px; height: 272px; transform: scale(var(--gf-scale)) translateY(54px); transform-origin: 0 0; }
.gf-shadow { position: absolute; left: 22px; right: 22px; bottom: -5px; height: 36px; border-radius: 50%; background: #47203925; filter: blur(15px); pointer-events: none; }
.gf-back { position: absolute; inset: 0; overflow: hidden; background: var(--accent-soft); }
.gf-art { width: 364px; height: 296px; max-width: none; object-fit: cover; position: absolute; left: -12px; top: -12px; }
.gf-sheen { position: absolute; inset: 0; background: linear-gradient(180deg,#ffffff33,transparent 50%); }
.gf-rim { position: absolute; inset: 0; width: 340px; height: 272px; fill: none; pointer-events: none; }
.gf-back-rim path { stroke: #ffffffaa; stroke-width: 1.2; }
.gf-files { position: absolute; inset: -54px 0 10px; z-index: 2; pointer-events: none; overflow: hidden; }
.gf-sheet { display: block; position: absolute; left: 34px; top: 150px; width: 272px; height: 184px; overflow: hidden; border: 4px solid var(--card); border-radius: 16px; background: var(--card); box-shadow: 0 7px 20px #211b2026;
  transform-origin: 50% 100%;
  transform: translate(calc(var(--gf-slot) * var(--gf-spread)),calc(var(--gf-lift) - var(--gf-depth) * var(--gf-stack))) rotate(calc(var(--gf-slot) * var(--gf-fan)));
  transition: transform .55s var(--gf-ease);
}
.gf-sheet-art { width: 100%; height: 100%; object-fit: contain; background: var(--card); }
.gf-front { display: block; position: absolute; left: 0; top: 140px; width: 340px; height: 132px; z-index: 3; }
.gf-tint { position: absolute; inset: 0; background: #eee3d5; }
.gf-front-rim { height: 132px; }
.gf-front-rim path { stroke: #d8c8b7; stroke-width: 2; }
.gf-label { position: absolute; left: 24px; right: 60px; bottom: 14px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.gf-kicker { font: 700 12px/1.3 var(--f-body); color: var(--accent-ink); }
.gf-title { font: 800 20px/1.12 var(--f-body); letter-spacing: -.025em; overflow-wrap: anywhere; }
.gf-meta { font: 500 12px/1.35 var(--f-body); color: var(--ink-2); }
.gf-key { display: grid; place-items: center; position: absolute; z-index: 4; right: 18px; bottom: 20px; width: 44px; height: 44px; background: var(--ink); color: var(--card); border-radius: 14px; font-size: 25px; transition: background .2s; }
.gf-root.is-active { --gf-hinge: -24deg; --gf-lift: -68px; --gf-spread: 15px; --gf-stack: 20px; --gf-fan: 4deg; box-shadow: none; }
.gf-root.is-active .gf-key { background: var(--accent-ink); }
.gf-root.is-active .gf-kicker::after { content: " · выбран"; }
.gf-root.is-active .gf-front-rim path { stroke: var(--accent-ink); stroke-width: 2; }
.gf-root.is-active .gf-tint { background: var(--accent); }
.gf-root:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 4px; }

@media (hover: hover) and (pointer: fine) {
  .gf-root:not(.is-active):hover { --gf-hinge: -11deg; --gf-lift: -18px; --gf-spread: 5px; --gf-stack: 10px; --gf-fan: 1.4deg; }
}

@media (prefers-reduced-motion: reduce) { .gf-root *, .gf-root *::before { transition: none !important; } }
