/* TONWERK · Varianten 3D · 1.7.10 (12.11.2026: Standbild ohne WebGL .tw-3d__ersatz) · 1.7.9 (05.11.2026, unverändert zu 1.7.8: Ladeanzeige #5b6475 wie 1.9.1, Kontrast 5,3:1) · vorher 1.6.1 (Child-Theme v25) — lädt nur auf Seiten mit dem Block .tw-3d
   Bühne mit Canvas (three.js), Titel oben und Knopfleiste unten im Bild, Info-Karte wie das Schild im Gebäude-Explorer. */
.tw-3d { --tw3-blau: #22428E; --tw3-tief: #172E66; --tw3-beton: #EEF0F3; --tw3-linie: #C9CED8; position: relative; width: 100%; }
.tw-3d__buehne { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 74svh; background: var(--tw3-beton); overflow: hidden; }
.tw-3d__buehne canvas { display: block; width: 100%; height: 100%; }
.tw-3d__status { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 26px; font-size: 14px; color: #5b6475; perspective: 700px; z-index: 1; }
/* Lade-Würfel (1.7.3): Linien in TONWERK-Blau, dreht sich, Seiten gehen leicht auseinander (Anspielung auf die Explosion) */
@property --tw3-z { syntax: '<length>'; inherits: true; initial-value: 24px; }
.tw-3d__wuerfel { --tw3-z: 24px; position: relative; width: 44px; height: 44px; transform-style: preserve-3d;
  animation: tw3-dreh 6s linear infinite, tw3-auf 2.4s ease-in-out infinite; }
.tw-3d__seite { position: absolute; inset: 0; border: 1.5px solid var(--tw3-blau); background: rgba(34, 66, 142, .04);
  outline: 1px solid transparent; backface-visibility: visible; will-change: transform; }   /* v28: Kantenglättung bei 3D-Transform */
.tw-3d__seite:nth-child(1) { transform: rotateY(0deg) translateZ(var(--tw3-z)); }
.tw-3d__seite:nth-child(2) { transform: rotateY(90deg) translateZ(var(--tw3-z)); }
.tw-3d__seite:nth-child(3) { transform: rotateY(180deg) translateZ(var(--tw3-z)); }
.tw-3d__seite:nth-child(4) { transform: rotateY(-90deg) translateZ(var(--tw3-z)); }
.tw-3d__seite:nth-child(5) { transform: rotateX(90deg) translateZ(var(--tw3-z)); }
.tw-3d__seite:nth-child(6) { transform: rotateX(-90deg) translateZ(var(--tw3-z)); background: rgba(34, 66, 142, .38); }
@keyframes tw3-dreh { from { transform: rotateX(-24deg) rotateY(0deg); } to { transform: rotateX(-24deg) rotateY(360deg); } }
@keyframes tw3-auf { 0%, 100% { --tw3-z: 24px; } 50% { --tw3-z: 34px; } }   /* v28: nie unter 24 px, sonst liegen die Kanten zweier Seiten aufeinander und fransen aus */
.tw-3d__status-text { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .tw-3d__wuerfel { animation: none; transform: rotateX(-24deg) rotateY(35deg); } }
.tw-3d__titel { position: absolute; left: 12px; top: 10px; width: fit-content; max-width: calc(100% - 24px); font-size: 15px; line-height: 1.4; margin: 0;
  padding: 4px 10px; background: rgba(238, 240, 243, .9); color: var(--tw3-tief); pointer-events: none; z-index: 2; }   /* 1.7.4: hinterlegt (Lesbarkeit) */
.tw-3d__leiste { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px 12px; z-index: 2;
  background: linear-gradient(to top, rgba(238, 240, 243, .96) 70%, rgba(238, 240, 243, 0)); }
.tw-3d__halte { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.tw-3d__halt { appearance: none; border: 1px solid var(--tw3-linie); background: #fff; color: var(--tw3-tief); border-radius: 999px;
  padding: 9px 16px; font: inherit; font-size: 14px; line-height: 1.2; cursor: pointer; min-height: 40px; transition: border-color .2s, color .2s, background .2s; }
.tw-3d__halt:hover { border-color: var(--tw3-blau); }
.tw-3d__halt[aria-pressed="true"] { background: var(--tw3-blau); border-color: var(--tw3-blau); color: #fff; }
.tw-3d__halt:focus-visible { outline: 2px solid var(--tw3-blau); outline-offset: 2px; }
.tw-3d__legende { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; margin-top: 10px; color: #4b556a; }
.tw-3d__legende span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.tw-3d__daten { display: none !important; }
/* v29: Detailbereich ohne tw-ex im HTML (Startseiten-Kopie, sonst greift tonwerk-explorer.js zu): bis das Skript die Klassen setzt nur der Überblick */
.tw-3d-ex:not(.tw-ex) .tw-ex__detail > :not(.tw-ex__ebenen), .tw-3d-ex .tw-ex__nutzungen { display: none; }

/* Info-Karte wie das Schild im Gebäude-Explorer */
.tw-3d__karte { position: absolute; left: 0; top: 0; z-index: 3; min-width: 220px; max-width: min(320px, calc(100% - 16px));
  background: #fff; padding: 14px 18px 12px; border-bottom: 2px solid var(--tw3-blau); box-shadow: 0 8px 28px rgba(23, 46, 102, .14);
  display: flex; flex-direction: column; gap: 2px; pointer-events: none; opacity: 0; transition: opacity .15s; }
.tw-3d__karte.is-on { opacity: 1; }
.tw-3d__karte-code { font-family: var(--tw-font-display, "neue-haas-grotesk-display", "Helvetica Neue", Arial, sans-serif); font-weight: 600; font-size: 24px; line-height: 1.15; color: #111; }
.tw-3d__karte-art { font-size: 14px; line-height: 1.4; color: #5b6475; }
.tw-3d__karte-flaeche { font-family: var(--tw-font-display, "neue-haas-grotesk-display", "Helvetica Neue", Arial, sans-serif); font-weight: 600; font-size: 28px; line-height: 1.2; color: var(--tw3-blau); margin-top: 4px; }
.tw-3d__karte-status { font-size: 14px; color: #5b6475; margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; }
.tw-3d .tw-3d__karte-status::before { content: ""; width: 9px; height: 9px; border-radius: 0; background: #2fb35a; flex: 0 0 9px; animation: none; box-shadow: none; }   /* 1.7.4: Quadrat statt Kreis (Wunsch Hatsch) */
.tw-3d .tw-3d__karte-status[data-belegung="reserviert"]::before { background: #d99a1e; }
.tw-3d .tw-3d__karte-status[data-belegung="vermietet"]::before { background: transparent; background-image: repeating-linear-gradient(135deg, #7a8296 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px #7a8296; }
.tw-3d .tw-3d__karte-status[data-belegung="Gemeinschaftsfläche"]::before { display: none; }
.tw-3d__ansage { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

@media (max-width: 767px) {
  .tw-3d__buehne { aspect-ratio: 4 / 5; max-height: 72svh; }
  .tw-3d__halte { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tw-3d__halt { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; }
  .tw-3d__titel { font-size: 13px; left: 8px; top: 8px; max-width: calc(100% - 16px); padding: 3px 8px; }
}

/* 1.7.10: ohne WebGL Standbild aus dem Modell mit Hinweis (Skript setzt .is-ersatz) */
.tw-3d__ersatz { position: absolute; inset: 0; margin: 0; z-index: 1; }
.tw-3d__ersatz img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tw-3d__ersatz-text { position: absolute; left: 16px; right: 16px; bottom: 16px; max-width: 60ch; padding: 10px 14px; background: rgba(255,255,255,.92); color: var(--tw3-tief); font-size: 14px; line-height: 1.45; text-align: left; }
.tw-3d__ersatz-text a { color: var(--tw3-blau); text-decoration: underline; }
.tw-3d.is-ersatz .tw-3d__leiste, .tw-3d.is-ersatz .tw-3d__titel { display: none; }
@media (max-width: 767px) { .tw-3d__ersatz-text { left: 8px; right: 8px; bottom: 8px; font-size: 13px; } }
