/* KW4 Verdiepingen – frontend */
.kw4 {
  --kw4-accent: #6bbee4;          /* be-MINE blauw */
  --kw4-accent-fill: rgba(107, 190, 228, .38);
  --kw4-ink: #1d1d1b;
  --kw4-green: #3f9b35;           /* beschikbaar */
  --kw4-overlay: rgba(40, 40, 40, .72);
  position: relative;
  font-family: inherit;
  color: var(--kw4-ink);
}
.kw4 *, .kw4 *::before, .kw4 *::after { box-sizing: border-box; }

/* De hero heeft een vaste verhouding (--kw4-ratio = breedte / hoogte).
   De foto vult die als 'cover'; JS plaatst hem zo dat het focuspunt (gebouw) zichtbaar blijft. */
.kw4-stage { position: relative; line-height: 0; overflow: hidden; aspect-ratio: var(--kw4-ratio, auto); }
.kw4-canvas { position: absolute; left: 0; top: 0; width: 100%; }
.kw4-img { display: block; width: 100%; height: auto; max-width: none; }
/* wazige versie (gebouw scherp) verschijnt alleen zolang de muis op de hero (of het paneel) staat */
.kw4-img-blur {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  opacity: 0; transition: opacity .45s ease; pointer-events: none;
}
.kw4:hover .kw4-img-blur { opacity: 1; }
.kw4-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---- Verdieping-vlakken ---- */
.kw4-floor {
  fill: rgba(255, 255, 255, 0);
  stroke: rgba(255, 255, 255, .55);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill .2s ease, stroke .2s ease;
}
.kw4-floor.is-active {
  fill: var(--kw4-accent-fill);
  stroke: var(--kw4-accent);
  stroke-width: 2;
  stroke-dasharray: none;
}
.kw4.is-dimmed .kw4-floor:not(.is-active) { stroke: rgba(255, 255, 255, .25); }

/* ---- Labels rechts van het gebouw ---- */
.kw4-tags { position: absolute; inset: 0; pointer-events: none; line-height: 1.1; }
.kw4-tag {
  position: absolute;
  transform: translate(10px, -50%);
  display: flex; gap: .5em; align-items: baseline;
  padding: .25em .55em;
  background: var(--kw4-overlay);
  color: #fff;
  font-size: clamp(10px, .95vw, 14px);
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  opacity: .85;
  pointer-events: auto; cursor: pointer;
  transition: background .2s, opacity .2s;
}
.kw4-tags.is-left .kw4-tag { transform: translate(calc(-100% - 10px), -50%); }
.kw4-tag small { font-weight: 400; opacity: .85; font-size: .9em; }
.kw4-tag { align-items: center; }
.kw4-tag-nr { font-size: 1.6em; font-weight: 700; line-height: 1; min-width: .8em; text-align: center; }
.kw4-tag.is-active { background: var(--kw4-accent); opacity: 1; }
.kw4-tag:hover { opacity: 1; }

/* ---- Titel (zelfde stijl als huidige hero) ---- */
.kw4-title {
  position: absolute; left: 8%; top: 12%;
  line-height: 1; pointer-events: none;
}
.kw4-title h1, .kw4-title p {
  display: inline-block; margin: 0; color: #fff;
  background: var(--kw4-overlay); font-weight: 700;
}
.kw4-title h1 {
  font-size: clamp(28px, 4.4vw, 64px);
  padding: .08em .15em; text-transform: uppercase;
}
.kw4-title p {
  display: table; margin-top: .3em;
  font-size: clamp(16px, 2.1vw, 30px); padding: .12em .3em;
}

/* ---- Infopaneel ---- */
.kw4-panel {
  position: absolute; right: 2.5%; bottom: -50px; z-index: 5;   /* steekt 50px onder de foto uit */
  width: min(340px, 30%);
  background: #fff;
  padding: 14px 16px 16px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.kw4-eyebrow {
  margin: 0 0 8px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--kw4-accent);
}
.kw4-floors { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-bottom: 12px; }
.kw4-floors button {
  min-width: 0; min-height: 36px;
  border: 1px solid #d5d5d5; background: #fff; color: var(--kw4-ink);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  padding: 4px 8px; border-radius: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.kw4-floors button:hover { border-color: var(--kw4-accent); }
.kw4-floors button[aria-selected="true"] {
  background: var(--kw4-accent); border-color: var(--kw4-accent); color: #fff;
}
.kw4-floors button:focus-visible { outline: 2px solid var(--kw4-ink); outline-offset: 2px; }

.kw4-detail { min-height: 58px; }
.kw4-detail h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.15; color: var(--kw4-ink); }
.kw4-status {
  display: inline-block; padding: 2px 10px;
  color: #fff; font-size: 15px; font-weight: 700;
}
.kw4-status.is-verkocht { background: #8a8a8a; }
.kw4-status.is-beschikbaar { background: var(--kw4-green); }
.kw4-status.is-gepland { background: var(--kw4-ink); }

/* verkochte verdiepingen: grijs i.p.v. blauw */
.kw4-floor.is-verkocht.is-active { fill: rgba(60, 60, 60, .45); stroke: #fff; }
.kw4-tag.is-verkocht small { text-decoration: none; opacity: .7; }
.kw4-tag.is-beschikbaar small { color: #9be27a; opacity: 1; }
.kw4-tag.is-verkocht.is-active { background: #6f6f6f; }
.kw4-tag.is-active small { color: #fff; opacity: 1; }
.kw4-floors button.is-verkocht { color: #8a8a8a; }
.kw4-floors button.is-verkocht[aria-selected="true"] { background: #8a8a8a; border-color: #8a8a8a; color: #fff; }
.kw4-detail p { margin: 0; font-size: 15px; }
.kw4-detail .kw4-link { margin-top: 10px; }
.kw4-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.kw4-detail a { color: var(--kw4-ink); font-weight: 700; }
.kw4-hint { color: #666; font-size: 15px; margin: 0; }

/* ---- Tablet / mobiel: paneel onder de foto ---- */
@media (max-width: 1100px) {
  .kw4-panel { position: static; width: auto; box-shadow: none; padding: 18px 16px; }
  .kw4-title { left: 16px; top: 16px; }
}
@media (max-width: 767px) {
  .kw4-tag { display: none; }

  /* Mobiel: andere verhouding; JS zoomt in op het gebouw */
  .kw4-stage { aspect-ratio: var(--kw4-ratio-m, 4 / 3); }
  .kw4-title h1 { font-size: 24px; }
  .kw4-title p { font-size: 15px; }
}

/* ---- Coördinaten-editor ---- */
.kw4-editor {
  position: fixed; right: 16px; bottom: 16px; z-index: 99999;
  width: 340px; max-width: calc(100vw - 32px);
  display: grid; gap: 8px; padding: 14px;
  background: #111; color: #fff; font: 13px/1.4 system-ui, sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.kw4-editor[hidden] { display: none; }
.kw4-editor textarea { width: 100%; font: 12px/1.4 ui-monospace, monospace; color: #111; }
.kw4-editor button { font: inherit; padding: 4px 10px; cursor: pointer; }
.kw4.is-editing .kw4-stage { cursor: crosshair; }
.kw4-draft { fill: rgba(255, 220, 0, .3); stroke: #ffdc00; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
