/* /baustelle/ (scripts/baustelle.mjs, Zeichnungen scripts/plaene.mjs): „Fünf Pläne, ein Ort“ – die Grundrisse der
   Baumeister übereinander, der gewählte hervorgehoben (src/plaene.js) – und die Kuppel, die sich beim Scrollen über dem
   Tambour schließt (--p von src/szenen.js). Ohne Skript stehen alle Umrisse und Texte und die fertige Kuppel da. */

/* ------------------------------------------------------------ Fünf Pläne, ein Ort */
.plaene { max-width: var(--mittel); margin: var(--luft) auto 0; }
.plaene-buehne { padding: .4rem; border-radius: 14px; background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule); }
.plaene-svg { display: block; width: 100%; height: auto; }
.plaene-svg :is(path, circle, rect, line) { vector-effect: non-scaling-stroke; }
/* Blass bleiben immer stehen: die alte Basilika (gestrichelt) und die Kirche, wie sie gebaut wurde */
.plan-umriss { fill: none; stroke: var(--ink-3); stroke-width: 1; opacity: 0; transition: opacity .45s ease, fill .45s ease, stroke .45s ease; }
.plan--alt .plan-umriss { opacity: .85; stroke-dasharray: 3 3; }
.plan--maderno .plan-umriss { opacity: .85; }
.plan.ist-aktiv .plan-umriss { opacity: 1; fill: var(--gold-tint); stroke: var(--gold-text); stroke-width: 2; stroke-dasharray: none; }
.plan-innen { fill: none; stroke: var(--gold-text); stroke-width: 1; opacity: 0; transition: opacity .45s ease; }
.plan.ist-aktiv .plan-innen { opacity: .8; }
.plan-stuetzen, .plan-saeulen { stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: .1 6; }
.plan-neben { opacity: .7; }
.plan-grab-ring { fill: none; stroke: var(--gold-text); stroke-width: 1.5; }
.plan-grab-punkt { fill: var(--gold-text); stroke: var(--sheet); stroke-width: 1.5; }
.plan-mass path { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.plan-mass text { font-family: var(--font-ui); font-size: 6px; font-weight: 600; fill: var(--ink-3); }
@media (max-width: 640px) { .plan-mass text { font-size: 10px; } }
html:not(.js) .plan .plan-umriss { opacity: .85; fill: none; stroke: var(--ink-3); stroke-width: 1; }
html:not(.js) .plan .plan-innen { opacity: 0; }

/* Die Wahl: je Plan ein Knopf mit seinem Umriss */
.plaene-wahl { display: none; }
.js .plaene-wahl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: .75rem; }
@media (min-width: 720px) { .js .plaene-wahl { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.plaene-knopf {
  display: grid; justify-items: center; align-content: start; gap: .05rem; min-width: 0; min-height: 2.75rem; padding: .45rem .25rem .5rem;
  border: 0; border-radius: 10px; background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule-strong); color: var(--ink-3);
  font-family: var(--font-ui); line-height: 1.25; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.plaene-knopf:hover { background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold-line); }
.plaene-knopf[aria-pressed="true"] { background: var(--gold-tint); box-shadow: inset 0 0 0 2px var(--gold-text); color: var(--gold-text); }
.plaene-knopf:focus-visible { outline-color: var(--fokus-gold); }
.plaene-zeichen { display: block; width: 3.6rem; height: 2.4rem; fill: currentColor; }
.plaene-knopf-name { font-size: .84rem; font-weight: 650; color: var(--ink); }
.plaene-knopf-zeit { font-size: .75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Die Texte: ohne Skript alle untereinander, jeder mit seinem Umriss; mit Skript nur der gewählte; die
   Mindesthöhe hält den Platz, damit beim Wechsel nichts springt */
.plaene-liste { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; gap: 1.1rem; }
.plaene-stufe { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: .9rem; align-items: start; }
.plaene-stufe .plaene-zeichen { margin-top: .3rem; color: var(--ink-3); }
.js .plaene-liste { display: block; position: relative; max-width: var(--spalte); min-height: 17rem; margin-inline: auto; }
@media (min-width: 720px) { .js .plaene-liste { min-height: 10.5rem; } }
/* Die übrigen Texte nur unsichtbar, nicht display: none: Safaris Reader und „Seite anhören“ lassen Verstecktes weg und
   sollen alle zeigen. inert (src/plaene.js) nimmt sie Tastatur und Screenreader. */
.js .plaene-stufe { display: block; }
.js .plaene-stufe:not(.ist-aktiv) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.js .plaene-stufe.ist-aktiv { animation: plan-text .4s ease; }
@keyframes plan-text { from { opacity: 0; } to { opacity: 1; } }
.js .plaene-stufe .plaene-zeichen { display: none; }
.plaene-zeit { margin: 0; font-family: var(--font-kapitalis); font-weight: 600; letter-spacing: .06em; color: var(--gold-text); }
.plaene-titel { margin: .1rem 0 .3rem; font-family: var(--font-display); font-weight: 500; font-size: 1.4rem; line-height: 1.2; }
.plaene-stufe p:not(.plaene-zeit) { margin: 0; line-height: 1.6; color: var(--ink-2); hyphens: auto; -webkit-hyphens: auto; }
.plaene figcaption, .woelbung figcaption { margin-top: .9rem; font-family: var(--font-ui); font-size: .82rem; line-height: 1.5; color: var(--ink-2); }
.js .plaene figcaption { max-width: var(--spalte); margin-inline: auto; }

/* ------------------------------------------------------------ Die Kuppel schließt sich
   --p läuft von 0 (die Zeichnung kommt unten ins Fenster) bis 1 (sie verlässt es oben); gewölbt wird, sobald sie ganz zu
   sehen ist. Linienbreiten in Metern der Zeichnung (1 m sind gut 4 px). */
.woelbung { max-width: 24rem; margin: var(--luft) auto 0; }
.woelbung-svg { display: block; width: 100%; height: auto; }
.w-stein { fill: var(--sheet); stroke: var(--ink-2); stroke-width: .25; stroke-linejoin: round; }
.w-linie { fill: none; stroke: var(--ink-3); stroke-width: .22; }
.w-fenster { fill: var(--ink-3); opacity: .4; }
.w-schale { fill: var(--gold-tint); opacity: clamp(0, (var(--p, 1) - .43) / .04, 1); }
.w-rippe {
  fill: none; stroke: var(--ink-2); stroke-width: .22; stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - clamp(0, (var(--p, 1) - .32) / .15, 1));
}
.w-rand { stroke-width: .32; }
.w-laterne { opacity: clamp(0, (var(--p, 1) - .47) / .04, 1); }
.w-kreuz { opacity: clamp(0, (var(--p, 1) - .52) / .03, 1); }
.w-gold { fill: var(--gold); stroke: var(--gold-text); stroke-width: .12; }
.woelbung .werk { color: var(--ink); font-weight: 600; }
.woelbung .nachweis { display: block; margin-top: .2rem; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) { .plan-umriss, .plan-innen { transition: none; } .js .plaene-stufe.ist-aktiv { animation: none; } }
@media (forced-colors: active) {
  .plan-umriss, .w-stein, .w-rippe, .w-linie { stroke: CanvasText; }
  .plan.ist-aktiv .plan-umriss, .plan-grab-ring { stroke: Highlight; }
  .plan-grab-punkt, .w-gold { fill: Highlight; }
  .plaene-knopf[aria-pressed="true"] { outline: 2px solid Highlight; }
}
@media print { .plaene-wahl { display: none !important; } }
