/* /distribution/legrand/by-building/ : building scenes with product callouts.
   The stage is laid out in 1280 x 1120 "stage units"; --u converts one unit to the
   current container width, so the whole drawing scales as one piece. */

.lbb { padding-top: 24px; }

.lbb-tabs {
  scroll-margin-top: 96px;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-bottom: 20px; margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.lbb-tab {
  padding: 10px 16px; border: 1px solid var(--rule-d); border-radius: 999px;
  font: 600 15px/1.2 var(--sans); color: var(--ink); text-decoration: none; background: #fff;
  transition: background .15s, color .15s, border-color .15s;
}
.lbb-tab:hover { border-color: var(--ink); }
.lbb-tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.lbb-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Without JS every panel shows, stacked. With JS only the selected one. */
.lbb.is-ready .lbb-panel:not(.is-active) { display: none; }
.lbb-panel + .lbb-panel { margin-top: 56px; }
.lbb.is-ready .lbb-panel + .lbb-panel { margin-top: 0; }

.lbb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; margin-bottom: 8px; }
.lbb-head h2 { font-size: clamp(24px, 2vw + 0.6rem, 34px); margin: 0; }
.lbb-head p { margin: 0; color: var(--ink-soft); max-width: 62ch; }

.lbb-stage { container-type: inline-size; }
.lbb-canvas { position: relative; }
.lbb-lines { display: none; }

/* ---------- narrow: illustration with numbered pins, list below ---------- */
.lbb-art { position: relative; margin: 8px 0 20px; }
.lbb-art img { display: block; width: 100%; height: auto; }

.lbb-pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(10, 25, 41, .35);
  display: grid; place-items: center; text-decoration: none;
  font: 600 11px/1 var(--sans);
}

.lbb-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .lbb-items { grid-template-columns: 1fr 1fr; } }
.lbb-item a {
  display: flex; align-items: center; gap: 14px; height: 100%;
  padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px;
  color: inherit; text-decoration: none; background: #fff;
}
.lbb-item a:hover, .lbb-item a:focus-visible { border-color: var(--ink); }
.lbb-disc {
  flex: none; display: block; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: var(--bg-alt); box-shadow: 0 0 0 1px var(--rule-d);
}
.lbb-disc img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lbb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lbb-name { font: 600 16px/1.25 var(--sans); color: var(--ink); }
.lbb-num {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 7px;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; vertical-align: 1px;
}
.lbb-use { font-size: 14px; line-height: 1.35; color: var(--muted); }
.lbb-go { font: 600 13px/1.3 var(--sans); color: var(--accent); margin-top: 2px; }

/* ---------- wide: the full drawing with callouts around it ---------- */
@container (min-width: 1000px) {
  .lbb-canvas { --u: calc(100cqw / 1280); aspect-ratio: 1280 / 1120; }

  .lbb-lines { display: block; position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
  .lbb-line line { vector-effect: non-scaling-stroke; transition: stroke .15s, stroke-width .15s; }
  .lbb-line .halo { stroke: #fff; stroke-width: 5; stroke-linecap: round; }
  .lbb-line .ink { stroke: var(--ink-soft); stroke-width: 1.5; }
  .lbb-line.is-active .ink { stroke: var(--accent); stroke-width: 2.5; }

  .lbb-art { position: absolute; margin: 0; left: var(--l); top: var(--t); width: var(--w); }

  .lbb-pin {
    width: calc(var(--u) * 20); height: calc(var(--u) * 20); min-width: 14px; min-height: 14px;
    z-index: 3; background: #fff; border: 2px solid var(--ink-soft); box-shadow: none;
  }
  .lbb-pin span { display: none; }
  .lbb-pin::after {
    content: ""; width: 45%; height: 45%; border-radius: 50%; background: var(--accent);
  }
  .lbb-pin.is-active { border-color: var(--accent); animation: lbb-pulse 1.2s ease-out infinite; }

  .lbb-items { display: block; }
  .lbb-item {
    position: absolute; z-index: 4; left: var(--x); top: var(--y);
    width: calc(var(--u) * 200); transform: translateX(-50%);
    transition: opacity .15s;
  }
  .lbb-item a {
    flex-direction: column; gap: calc(var(--u) * 10); padding: 0; border: 0; border-radius: 0;
    background: none; text-align: center;
  }
  .lbb-disc {
    width: calc(var(--u) * 96); height: calc(var(--u) * 96);
    border: calc(var(--u) * 4) solid #fff;
    box-shadow: 0 0 0 1.5px var(--rule-d), 0 6px 18px rgba(10, 25, 41, .16);
    transition: box-shadow .15s, transform .15s;
  }
  .lbb-text { align-items: center; }
  .lbb-name { font-size: calc(var(--u) * 17); }
  .lbb-num { display: none; }
  .lbb-use { font-size: calc(var(--u) * 13.5); }
  .lbb-text { position: relative; }
  .lbb-go {
    position: absolute; top: 100%; left: 0; right: 0; margin-top: calc(var(--u) * 4);
    font-size: calc(var(--u) * 13); opacity: 0; transition: opacity .15s;
  }

  .lbb-item.is-active .lbb-disc,
  .lbb-item a:focus-visible .lbb-disc {
    transform: translateY(-3px);
    box-shadow: 0 0 0 2.5px var(--accent), 0 10px 24px rgba(10, 25, 41, .22);
  }
  .lbb-item.is-active .lbb-go, .lbb-item a:focus-visible .lbb-go { opacity: 1; }
  .lbb-canvas.has-active .lbb-item:not(.is-active) { opacity: .5; }
  .lbb-item.is-active, .lbb-item:focus-within { z-index: 5; }
  .lbb-item a:focus-visible { outline: none; }
}

@keyframes lbb-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(191, 73, 0, .45); }
  100% { box-shadow: 0 0 0 12px rgba(191, 73, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .lbb-pin.is-active { animation: none; }
  .lbb-disc, .lbb-item, .lbb-go, .lbb-line line { transition: none; }
}
