/* Glas-Ordner – Styles (Portierung, ohne +/···-Taste und Menü) */
.gf-root {
  --gf-px: 0;
  --gf-py: 0;
  --gf-ease: cubic-bezier(.2, .8, .2, 1);
  --gf-spring: cubic-bezier(.34, 1.36, .5, 1);
  --gf-hinge: 0deg;
  --gf-lift: 42px;
  --gf-spread: 0px;
  --gf-fan: 0deg;
  --gf-stack: 15px;
  --gf-ink: #141416;
  --gf-ink-soft: rgba(20, 20, 22, .6);
  position: relative;
  display: block;
  margin: 0 auto;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}
.gf-root[data-tone="dark"] { --gf-ink: #f5f5f7; --gf-ink-soft: rgba(245, 245, 247, .62); }

/* Kippen nur bei echtem Hover (kein „hängender“ Hover auf Tablets) oder Tastaturfokus */
@media (hover: hover) {
  .gf-root:hover { --gf-hinge: -11deg; --gf-lift: -34px; --gf-spread: 8px; --gf-fan: 1.4deg; --gf-stack: 10px; }
}
.gf-root:focus-within { --gf-hinge: -11deg; --gf-lift: -34px; --gf-spread: 8px; --gf-fan: 1.4deg; --gf-stack: 10px; }
.gf-root[data-open] { --gf-hinge: -24deg; --gf-lift: -96px; --gf-spread: 40px; --gf-fan: 4deg; --gf-stack: 36px; }

/* Link-Modus: Drüberfahren oder Tastaturfokus zeigt die aufgefächerten Blätter */
@media (hover: hover) {
  .gf-root[data-link]:hover { --gf-hinge: -24deg; --gf-lift: -96px; --gf-spread: 40px; --gf-fan: 4deg; --gf-stack: 36px; }
}
.gf-root[data-link]:focus-within { --gf-hinge: -24deg; --gf-lift: -96px; --gf-spread: 40px; --gf-fan: 4deg; --gf-stack: 36px; }
/* Touch-Geräte ohne Hover: Blätter dauerhaft leicht sichtbar, damit klar ist, was drin ist */
@media (hover: none) {
  .gf-root[data-link] { --gf-hinge: -11deg; --gf-lift: -34px; --gf-spread: 8px; --gf-fan: 1.4deg; --gf-stack: 10px; }
}
.gf-hit:focus-visible { outline: none; }

.gf-stage { position: absolute; left: 0; top: 0; width: 340px; height: 272px; transform-origin: 0 0; }
.gf-tilt {
  position: absolute;
  inset: 0;
  transform: perspective(1400px) rotateX(calc(var(--gf-py) * -3deg)) rotateY(calc(var(--gf-px) * 4deg));
  transition: transform .9s var(--gf-ease);
}

.gf-shadow {
  position: absolute;
  left: 18px; right: 18px; bottom: -6px;
  height: 60px;
  border-radius: 40px;
  background: rgba(16, 18, 24, .26);
  filter: blur(22px);
  transform: translateX(calc(var(--gf-px) * -8px));
  transition: transform .9s var(--gf-ease), opacity .9s var(--gf-ease);
}
.gf-root[data-tone="dark"] .gf-shadow { background: rgba(0, 0, 0, .62); }

.gf-back { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, #f3f3f4 0%, #e3e3e6 100%); }
.gf-root[data-tone="dark"] .gf-back { background: linear-gradient(180deg, #2a2a2e 0%, #121214 100%); }
.gf-art {
  position: absolute;
  left: -12px; top: -12px;
  max-width: none;
  opacity: 0;
  filter: blur(14px) saturate(.6);
  transform: translate(calc(var(--gf-px) * -7px), calc(var(--gf-py) * -6px)) scale(1.02);
  transition: transform 1.1s var(--gf-ease), opacity 1.2s var(--gf-ease), filter 1.2s var(--gf-ease);
}
.gf-art[data-ready] { opacity: 1; filter: none; }
.gf-back-sheen {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, 0) 22%),
    radial-gradient(120% 80% at 80% 0%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
}

.gf-rim { position: absolute; left: 0; top: 0; max-width: none; overflow: visible; pointer-events: none; fill: none; }
.gf-back-rim { width: 340px; height: 272px; }
.gf-back-rim path { stroke: rgba(255, 255, 255, .45); stroke-width: 1; }
.gf-root[data-tone="dark"] .gf-back-rim path { stroke: rgba(255, 255, 255, .16); }

/* ---- Blätter ---- */
.gf-files {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  clip-path: inset(-400px -400px 10px -400px);
}
.gf-sheet-slot { display: contents; }
.gf-sheet {
  box-sizing: border-box;
  position: absolute;
  left: 34px; top: 96px;
  width: 272px; height: 184px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, #ffffff 0%, #f2f2f0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 .5px rgba(0, 0, 0, .1), 0 10px 26px -8px rgba(10, 12, 20, .28);
  transform-origin: 50% 100%;
  transform:
    translate(calc(var(--gf-jx) + var(--gf-slot) * var(--gf-spread)), calc(var(--gf-lift) + var(--gf-depth) * var(--gf-stack) * -1))
    rotate(calc(var(--gf-jr) + var(--gf-slot) * var(--gf-fan)));
  transition: transform .75s var(--gf-spring) calc(var(--gf-depth) * 40ms), box-shadow .4s var(--gf-ease), translate .9s var(--gf-ease), opacity .9s var(--gf-ease);
}
.gf-root[data-tone="dark"] .gf-sheet {
  background: linear-gradient(180deg, #2c2c30 0%, #1c1c1f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 .5px rgba(255, 255, 255, .08), 0 12px 28px -8px rgba(0, 0, 0, .7);
}
.gf-root[data-open] .gf-sheet:hover,
.gf-root[data-link]:hover .gf-sheet:hover,
.gf-root[data-open] .gf-sheet:focus-visible {
  transform:
    translate(calc(var(--gf-jx) + var(--gf-slot) * var(--gf-spread)), calc(var(--gf-lift) + var(--gf-depth) * var(--gf-stack) * -1 - 18px))
    rotate(calc(var(--gf-slot) * var(--gf-fan) * .6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 .5px rgba(0, 0, 0, .1), 0 22px 40px -12px rgba(10, 12, 20, .42);
  transition-delay: 0s;
}
.gf-sheet:focus-visible { outline: 3px solid var(--gf-focus, #2f6fae); outline-offset: 2px; }
.gf-sheet-head {
  position: absolute;
  left: 14px; right: 14px; top: 11px;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  white-space: nowrap;
}
.gf-sheet-name { overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 650; color: #18181b; }
.gf-sheet-meta { flex: none; font-size: 11px; color: rgba(24, 24, 27, .6); }
.gf-root[data-tone="dark"] .gf-sheet-name { color: #fafafa; }
.gf-root[data-tone="dark"] .gf-sheet-meta { color: rgba(250, 250, 250, .7); }
.gf-lines { position: absolute; left: 14px; right: 14px; top: 40px; display: flex; flex-direction: column; gap: 9px; }
.gf-lines i { display: block; height: 5px; border-radius: 3px; background: rgba(24, 24, 27, .08); }
.gf-lines i:first-child { height: 9px; margin-bottom: 4px; background: rgba(24, 24, 27, .14); }
.gf-root[data-tone="dark"] .gf-lines i { background: rgba(255, 255, 255, .08); }
.gf-root[data-tone="dark"] .gf-lines i:first-child { background: rgba(255, 255, 255, .16); }

/* ---- Glas-Vorderseite ---- */
.gf-front {
  position: absolute;
  left: 0; top: 74px;
  width: 340px; height: 198px;
  z-index: 10;
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  transform-origin: 50% 100%;
  transform: perspective(760px) rotateX(var(--gf-hinge));
  transition: transform .8s var(--gf-spring), translate 1s var(--gf-ease), opacity 1s var(--gf-ease);
}
.gf-tint { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(240, 247, 253, .16) 0%, rgba(236, 244, 251, .5) 42%, rgba(244, 249, 253, .93) 100%); }
.gf-root[data-tone="dark"] .gf-tint { background: linear-gradient(180deg, rgba(12, 26, 44, .18) 0%, rgba(11, 24, 40, .62) 46%, rgba(8, 16, 28, .94) 100%); }
.gf-spec {
  position: absolute;
  inset: 0;
  background: radial-gradient(260px 200px at calc(50% + var(--gf-px) * 46%) calc(30% + var(--gf-py) * 40%), rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 70%);
  mix-blend-mode: soft-light;
  opacity: .9;
  pointer-events: none;
}
.gf-root[data-tone="dark"] .gf-spec { mix-blend-mode: screen; opacity: .16; }
.gf-front-rim { width: 340px; height: 198px; }
.gf-front-rim path { stroke-width: 2.4; transition: stroke-width .3s var(--gf-ease); }
.gf-root[data-tone="dark"] .gf-front-rim { opacity: .55; }

.gf-hit { all: unset; position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.gf-hit:focus-visible ~ .gf-label .gf-title { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.gf-front:has(.gf-hit:focus-visible) .gf-front-rim path { stroke-width: 5; }

.gf-label { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 4px; max-width: 284px; pointer-events: none; color: var(--gf-ink); }
.gf-root[data-place="bottom-left"] .gf-label { left: 28px; bottom: 30px; }
/* Titel darf zweizeilig werden (lange Modulnamen), danach Auslassungspunkte */
.gf-title {
  font-size: 21px; font-weight: 650; line-height: 1.15; letter-spacing: -.012em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  overflow-wrap: anywhere; hyphens: auto;
}
.gf-meta { font-size: 13px; color: var(--gf-ink-soft); white-space: nowrap; }

/* ---- Eingang: Ordner setzt sich zusammen ---- */
.gf-root:not([data-entered]) .gf-back,
.gf-root:not([data-entered]) .gf-back-rim { translate: 0 22px; opacity: 0; }
.gf-root:not([data-entered]) .gf-sheet { translate: 0 -120px; opacity: 0; }
.gf-root:not([data-entered]) .gf-front { translate: 0 46px; opacity: 0; }
.gf-root:not([data-entered]) .gf-shadow { opacity: 0; }
.gf-back, .gf-back-rim { transition: translate 1s var(--gf-ease), opacity .9s var(--gf-ease); }
.gf-root[data-entered] .gf-sheet { transition-delay: calc(var(--gf-depth) * 40ms), 0s, calc(.18s + var(--gf-depth) * 90ms), calc(.18s + var(--gf-depth) * 90ms); }
.gf-root[data-entered] .gf-front { transition-delay: 0s, .42s, .42s; }

@media (prefers-reduced-motion: reduce) {
  .gf-root *, .gf-root *::before, .gf-root *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation: none !important; }
  .gf-tilt { transform: none; }
}

/* FOS-Modulauswahl: dieselben Maße, Logo-Farben und Abstände wie am Gymnasium. */
#module-screen { --brand-blue: #2f6fae; }
[data-theme="dark"] #module-screen { --brand-blue: #6cb4e6; }
#module-screen .module-header h1 span { color: var(--brand-blue) !important; }
#module-screen .greeting-bar { text-align: center; }
#module-screen .back-link { color: var(--brand-blue); min-height: 44px; }
#module-screen .folder-grid {
  box-sizing: border-box;
  width: 100%; max-width: 1240px; margin: 3.5rem auto 3rem; padding: 0 1.5rem;
  display: grid; grid-template-columns: repeat(var(--cols-wide, 2), minmax(0, 1fr));
  gap: 3rem 2rem;
}
#module-screen .folder-cell { display: flex; flex-direction: column; align-items: center; min-width: 0; }
#module-screen .folder-host { width: 100%; max-width: 360px; --gf-focus: var(--brand-blue); }
#module-screen .folder-desc {
  max-width: 340px; margin: .9rem 0 0; text-align: center; font-size: .88rem;
  line-height: 1.45; color: var(--ink-muted); hyphens: auto; overflow-wrap: anywhere;
}
#module-screen .gf-root:has(.gf-hit:focus-visible) { outline: 3px solid var(--brand-blue); outline-offset: 6px; border-radius: 12px; }
@media (max-width: 1099px) {
  #module-screen .folder-grid { grid-template-columns: repeat(var(--cols-mid, 2), minmax(0, 1fr)); max-width: 960px; }
}
@media (max-width: 640px) {
  #module-screen .folder-grid { padding: 0 1rem; margin-top: 2rem; }
}
@media (max-width: 600px) {
  #module-screen .folder-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}
