/* ═══════════════════════════════════════════════════════════════
   Haus-Stockwerks-Layout (Phase A, 2026-05-14)
   15 Stroemungen auf 5 Etagen vertikal angeordnet
   Ersetzt das alte .grundriss-gebaeude-Layout
   ═══════════════════════════════════════════════════════════════ */

.stockwerke {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Dekoratives Dach OBERHALB des Dachgeschosses — schneidet keinen Inhalt ab */
.haus-dach {
  max-width: 1100px;
  margin: 0 auto;
  height: 38px;
  position: relative;
  /* trapezfoermige Form per clip-path nur auf dem Dach-Element */
  background: linear-gradient(180deg, rgba(180,90,50,0.85) 0%, rgba(140,60,30,0.85) 100%);
  clip-path: polygon(12% 0%, 88% 0%, 100% 100%, 0% 100%);
  box-shadow: 0 -2px 0 rgba(60,45,30,0.5) inset;
}
.haus-dach::before {
  /* Schornstein als kleiner Strich rechts oben */
  content: '';
  position: absolute;
  top: -14px;
  right: 14%;
  width: 10px;
  height: 22px;
  background: #5c4d3a;
  border-radius: 1px;
  border-top: 3px solid #3a2f24;
}
.haus-dach::after {
  /* dezente Dach-Linie als Andeutung */
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: rgba(60,45,30,0.55);
}

.stw-etage {
  background: rgba(255, 250, 240, 0.92);
  border: 1px solid rgba(60, 45, 30, 0.6);
  border-top: none;        /* nahtloser Stapel, oberer Rand ist die Etagen-Decke darunter */
  padding: 1.05rem 1.5rem 1.25rem;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.06);
  color: #1a1715;
  position: relative;
}
/* erste Etage (Dach) bekommt den oberen Rand wieder */
.stw-etage:first-of-type { border-top: 1px solid rgba(60,45,30,0.6); }
/* letzte (Keller) bekommt einen schweren unteren Rand (Fundament) */
.stw-etage:last-of-type {
  border-bottom: 3px double rgba(60,45,30,0.7);
  margin-bottom: 0.5rem;
}

/* Dachgeschoss: Inhalt voll, KEIN clip-path; Form macht die .haus-dach davor */
.stw-etage[data-etage="dach"] {
  background: linear-gradient(180deg, rgba(238,232,250,0.92) 0%, rgba(245,242,255,0.94) 60%);
  border-top: none;       /* Dachform sitzt direkt drueber */
}

/* Keller: leicht zurueckgesetzt, Boden-Andeutung */
.stw-etage[data-etage="keller"] {
  background:
    linear-gradient(180deg, rgba(245,243,240,0.94) 0%, rgba(232,228,221,0.94) 100%);
  margin: 0 0.6rem 0;
  padding-bottom: 1.5rem;
}
.stw-etage[data-etage="keller"]::after {
  /* dezent gestreifter "Boden" */
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 6px;
  background: repeating-linear-gradient(90deg,
    rgba(60,45,30,0.25) 0 6px, transparent 6px 14px);
}

.stw-etage-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(60,45,30,0.18);
}
.stw-etage-titel {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.stw-etage-titel .stw-icon { font-size: 1.15rem; margin-right: 0.4rem; }
.stw-etage-thema {
  font-size: 0.78rem;
  color: rgba(26,23,21,0.65);
  font-style: italic;
  text-align: right;
  flex-shrink: 1;
}

/* Zimmer-Karten pro Etage */
.stw-zimmer-reihe {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.55rem;
}
.stw-zimmer {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(60,45,30,0.18);
  border-radius: 4px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 96px;
  border-left: 3px solid transparent;
  color: #1a1715;
}
.stw-zimmer:hover {
  background: rgba(247,237,233,0.95);
  border-color: rgba(60,45,30,0.4);
}
.stw-zimmer-name {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.2;
}
.stw-zimmer-name .stw-icon { font-size: 1.05rem; flex-shrink: 0; }
.stw-zimmer-sub {
  font-size: 0.7rem;
  color: rgba(26,23,21,0.62);
  font-style: italic;
  line-height: 1.3;
}
.stw-zimmer-typ {
  margin-top: auto;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(26,23,21,0.45);
}

/* Eingangsraum: hervorgehoben im Erdgeschoss */
.stw-eingang {
  background: linear-gradient(180deg, rgba(247,237,233,1) 0%, rgba(255,250,240,0.95) 100%);
  border: 1px solid #c0533a;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  grid-column: 1 / -1;
  color: #1a1715;
}
.stw-eingang-titel {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.stw-eingang-text {
  font-size: 0.85rem;
  margin-bottom: 0.7rem;
  line-height: 1.55;
}
.stw-eingang-aktionen { display: flex; gap: 0.65rem; flex-wrap: wrap; }
.stw-eingang-btn {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  background: #c0533a;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.84rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.stw-eingang-btn:hover { background: #973a24; }
.stw-eingang-btn.sek {
  background: white;
  color: #c0533a;
  border: 1px solid #c0533a;
}
.stw-eingang-btn.sek:hover { background: #f7ede9; }

/* Stockwerks-typ-Faerbungen (dezenter Tint pro Etage) */
.stw-etage[data-etage="dach"]        { background: rgba(245,242,255,0.94); }
.stw-etage[data-etage="etage2"]      { background: rgba(252,242,240,0.94); }
.stw-etage[data-etage="etage1"]      { background: rgba(245,250,242,0.94); }
.stw-etage[data-etage="erdgeschoss"] { background: rgba(255,250,240,0.96); }
.stw-etage[data-etage="keller"]      { background: rgba(245,243,240,0.94); }

/* Stroemungs-Modal */
.stw-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(26,23,21,0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 200;
  overflow-y: auto;
  padding: 2rem 1rem;
}
.stw-modal-bg.open { display: flex; }
.stw-modal {
  background: #fffaf0;
  width: min(720px, 100%);
  border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.4);
  padding: 1.5rem 1.75rem 1.75rem;
  position: relative;
  color: #1a1715;
}
.stw-modal-kopf {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.stw-modal-kopf .stw-icon { font-size: 1.5rem; }
.stw-modal-kopf .stw-titel { font-size: 1.25rem; font-weight: 600; }
.stw-modal-kopf .stw-stockwerk {
  font-size: 0.72rem;
  color: rgba(26,23,21,0.55);
  margin-left: auto;
}
.stw-modal-typ {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(60,45,30,0.3);
  border-radius: 4px;
  color: rgba(26,23,21,0.6);
  margin-bottom: 1rem;
}
.stw-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: rgba(26,23,21,0.5);
  cursor: pointer;
  padding: 0 0.4rem;
  line-height: 1;
}
.stw-modal-close:hover { color: #1a1715; }

.stw-modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(60,45,30,0.18);
  margin-bottom: 1rem;
}
.stw-modal-tab {
  background: none;
  border: none;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  color: rgba(26,23,21,0.55);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}
.stw-modal-tab.active {
  color: #c0533a;
  border-bottom-color: #c0533a;
  font-weight: 600;
}
.stw-modal-tab:hover { color: #1a1715; }

.stw-modal-pane { display: none; }
.stw-modal-pane.active { display: block; }
.stw-modal-pane h4 { font-size: 0.86rem; font-weight: 600; margin: 1rem 0 0.4rem; }
.stw-modal-pane h4:first-child { margin-top: 0; }
.stw-modal-pane p { font-size: 0.88rem; line-height: 1.55; margin-bottom: 0.5rem; }
.stw-modal-pane .stw-leer {
  font-size: 0.82rem;
  color: rgba(26,23,21,0.5);
  font-style: italic;
}

.stw-bewohner-reihe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0.75rem;
}
.stw-bewohner {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(60,45,30,0.15);
  border-radius: 12px;
  font-size: 0.74rem;
}

@media (max-width: 540px) {
  .stw-zimmer-reihe { grid-template-columns: 1fr 1fr; }
  .stw-modal { padding: 1.25rem 1rem; }
  .stw-etage-thema { font-size: 0.7rem; }
}
