/* Hall films for confbuild.com, ported from hallen.confbuild.com /
   industrialbuildings.confbuild.com.

   .cb-film-halls          layouts/partials/film-halls.html: live SVG hall
                           (hall-variants.js) that cycles options, dimensions,
                           roof, doors and colour.
   .cb-film-halls-drawing  layouts/partials/film-halls-drawing.html: the 3D clip
                           and its plan drawing, played in sync
                           (hall-drawing.js).

   Every selector is scoped under one of the two roots, so the generic class
   names of assets/css/styles.css neither leak in nor get overridden. The
   roots carry their own white sheet with a faint lilac grid. */

.cb-film-halls,
.cb-film-halls-drawing {
  --cbfh-ink: #061a2d;
  --cbfh-ink-soft: #27394a;
  --cbfh-blue: #075df5;
  --cbfh-line: #e6def9;
  --cbfh-paper: #ffffff;
  --cbfh-grid: rgba(124, 58, 237, 0.07);
  --cbfh-mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  position: relative;
  z-index: 1;
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background-color: var(--cbfh-paper);
  background-image:
    linear-gradient(var(--cbfh-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--cbfh-grid) 1px, transparent 1px);
  background-size: 38px 38px;
  background-position: -1px -1px;
  color: var(--cbfh-ink);
  container-type: inline-size;
}

.cb-film-halls *,
.cb-film-halls-drawing * {
  box-sizing: border-box;
}

/* ---------------------------------------------------------------- live hall */

/* Poster first, then the live SVG in its place; both 3:2 (viewBox 960x640),
   so the swap never shifts the layout. The poster rule outranks
   `.application-detail-visual img` (16:10, cover, rounded). */
.cb-film-halls img.cbfh-poster,
.cb-film-halls .hall-variants {
  position: static;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
  filter: none;
}

/* The shadow is a gradient inside the SVG; a CSS drop-shadow would
   re-rasterise every frame. */
.cb-film-halls .hall-variants {
  overflow: hidden;
}

.cb-film-halls .hall-variants .hv-mono {
  font-family: var(--cbfh-mono);
  font-weight: 600;
}

/* The option chips and the parameter panel need roughly the subdomain's
   desktop size to stay legible; on narrower slots the hall runs alone. */
@container (max-width: 559px) {
  .cb-film-halls .hall-variants .hv-ui {
    display: none;
  }
}

/* ---------------------------------------------------------------- 3D + drawing */

.cb-film-halls-drawing .cbfhd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 12px;
}

/* Side by side only when each clip still gets ~420 px; the plan's dimension
   text is unreadable below that. */
@container (min-width: 880px) {
  .cb-film-halls-drawing .cbfhd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cb-film-halls-drawing .cbfhd-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--cbfh-line);
  border-radius: 6px;
  background: var(--cbfh-paper);
}

.cb-film-halls-drawing .cbfhd-video {
  position: static;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: var(--cbfh-paper);
}

.cb-film-halls-drawing .cbfhd-caption {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--cbfh-line);
  text-align: left;
}

.cb-film-halls-drawing .cbfhd-caption-title {
  display: block;
  margin: 0;
  color: var(--cbfh-blue);
  font: 700 12px/1.3 var(--cbfh-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cb-film-halls-drawing .cbfhd-caption-text {
  display: block;
  margin: 0;
  color: var(--cbfh-ink-soft);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}

@container (max-width: 420px) {
  .cb-film-halls-drawing .cbfhd-grid {
    gap: 8px;
    padding: 8px;
  }
  .cb-film-halls-drawing .cbfhd-caption {
    padding: 12px 12px 14px;
  }
  .cb-film-halls-drawing .cbfhd-caption-text {
    font-size: 13px;
  }
}
