/* ==============================
   Ukrainian Bandurist Chorus of North America — page-specific
   ============================== */

/* ---------- Project summary ----------
   The shared metric strip lets a figure wrap; "$1M–$1.5M" would break at
   its dash and read as two separate figures. */
.hero-stats.card li strong {
  white-space: nowrap;
}

/* ---------- 360 tour ----------
   Embedded through SeekBeak's sbembed.js (js/bandura-360.js). Before it
   mounts, the block only carries the tour address, which is not shown. */
#viewer .ubc-snap-pending {
  position: absolute;
  inset: 0;
}

#viewer .ubc-snap-pending > * {
  display: none;
}

/* sbembed.js sizes its content box by padding (16:9) with inline styles;
   here the tour fills the whole viewer instead. */
#viewer .snap-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none !important;
  max-height: none !important;
}

#viewer .snap-embed-content {
  position: absolute !important;
  inset: 0;
  height: 100% !important;
  padding-bottom: 0 !important;
}

/* The shared footer script may add an "open panorama" link here; the tour
   stays on this page */
#viewer .seekbeak-open-link {
  display: none;
}

/* iOS: a cross-origin frame inside a rounded, clipped box can fail to draw
   or to take touches in Safari, so the viewer is square and unclipped
   there. (-webkit-touch-callout is supported only by iOS Safari/WebKit.) */
@supports (-webkit-touch-callout: none) {
  #viewer {
    border-radius: 0;
    overflow: visible;
  }
}

.ubc-360-open {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  width: min(1200px, 95vw);
  margin: -24px auto 0;
}

.ubc-360-open p {
  display: none;
  margin: 0;
  color: #64748b;
  font: 500 14px/1.5 "Plus Jakarta Sans", system-ui, sans-serif;
}

/* Expanded: the same viewer, fixed over the page. dvh follows Safari's
   toolbar so the tour always fills what is visible. */
html.ubc-360-lock,
html.ubc-360-lock body {
  overflow: hidden;
}

#viewer.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  border-radius: 0;
}

/* Top left: SeekBeak keeps its own controls top centre and top right */
.ubc-360-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(15, 10, 6, 0.6);
  color: #ffffff;
  font: 400 28px/1 system-ui, sans-serif;
  cursor: pointer;
}

.ubc-360-close[hidden] {
  display: none;
}

.ubc-360-close:focus-visible {
  outline: 2px solid #f3d6ad;
  outline-offset: 2px;
}

@media (max-width: 768px) {
  /* A substantial part of the phone screen. svh stays fixed as Safari's
     toolbar shows and hides, so the frame is not resized mid-scroll; the
     floor never exceeds the screen in landscape. */
  #viewer {
    height: 72vh;
    height: 72svh;
    min-height: min(440px, 88vh);
    min-height: min(440px, 88svh);
  }

  .ubc-360-open {
    margin-top: -16px;
  }

  .ubc-360-open .btn {
    width: 100%;
  }

  .ubc-360-open p {
    display: block;
  }
}

/* A phone on its side is wider than the mobile breakpoint but short; the
   shared 560 px floor would push the tour past the bottom of the screen */
@media (orientation: landscape) and (max-height: 500px) {
  #viewer {
    height: 85vh;
    height: 85svh;
    min-height: 0;
  }
}

/* ---------- Introduction and Naming Opportunities ---------- */
main.culture-detail .ubc-story .culture-copy,
main.culture-detail .ubc-naming .culture-copy {
  max-width: 860px;
  margin: 0 0 32px;
}

.ubc-naming {
  margin-bottom: 96px;
}

.ubc-naming .table-subtitle {
  width: auto;
  margin-bottom: 32px;
}

.ubc-subhead {
  max-width: 860px;
  margin: 8px 0 16px;
  color: #8a5a2d;
  font: 700 clamp(18px, 1.6vw, 22px)/1.35 "Sora", system-ui, sans-serif;
}

.ubc-naming .table-wrap + .ubc-subhead {
  margin-top: 64px;
}

/* Editorial schedule built on the shared .naming-table: a heavy rule above
   and below, hairlines between rows, nothing boxed and no row hover. */
.ubc-table {
  border-top: 2px solid #0f172a;
  border-bottom: 2px solid #0f172a;
}

.ubc-table thead th {
  padding: 14px 16px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font: 700 11px/1.3 "Plus Jakarta Sans", system-ui, sans-serif;
  border-bottom: 1px solid #cbd5e1;
  vertical-align: bottom;
}

.ubc-table tbody tr {
  cursor: default;
}

.ubc-table tbody tr:hover {
  background: transparent;
}

.ubc-table tbody td {
  padding: 26px 16px;
  vertical-align: top;
  border-bottom: 1px solid #e2e8f0;
}

.ubc-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Column widths: the schedule has five columns, the two summaries three */
.ubc-col-num {
  width: 56px;
}

.ubc-col-name {
  width: 250px;
}

.ubc-col-level {
  width: 180px;
}

.ubc-col-amount {
  width: 160px;
}

.ubc-table--collection .ubc-col-level,
.ubc-table--potential .ubc-col-level {
  width: 260px;
}

.ubc-table td.ubc-num {
  color: #b07a4a;
  font: 800 13px/1.6 "Sora", system-ui, sans-serif;
  letter-spacing: 0.06em;
}

.ubc-name {
  display: block;
  color: #0f172a;
  font: 800 clamp(17px, 1.5vw, 20px)/1.3 "Sora", system-ui, sans-serif;
}

.ubc-line {
  display: block;
  margin-top: 6px;
  color: #8a5a2d;
  font: italic 600 15px/1.5 "Plus Jakarta Sans", system-ui, sans-serif;
}

.ubc-table td.ubc-desc {
  color: #475569;
  font: 500 15px/1.65 "Plus Jakarta Sans", system-ui, sans-serif;
}

.ubc-table td.ubc-level {
  color: #8a5a2d;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font: 700 11px/1.5 "Plus Jakarta Sans", system-ui, sans-serif;
}

.ubc-table td.ubc-calc {
  color: #475569;
  font: 600 15px/1.6 "Plus Jakarta Sans", system-ui, sans-serif;
}

.ubc-table td.ubc-amount {
  text-align: right;
}

.ubc-amount strong {
  display: block;
  color: #0f172a;
  white-space: nowrap;
  font: 800 clamp(20px, 1.8vw, 26px)/1.1 "Sora", system-ui, sans-serif;
}

.ubc-amount span {
  display: block;
  margin-top: 4px;
  color: #8a5a2d;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font: 700 11px/1.3 "Plus Jakarta Sans", system-ui, sans-serif;
}

/* Totals: set off by a heavy rule, the figures a step larger */
.ubc-table tr:not(.ubc-total) + tr.ubc-total td {
  border-top: 2px solid #0f172a;
}

.ubc-table tr.ubc-total .ubc-amount strong {
  font-size: clamp(24px, 2.2vw, 32px);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .ubc-col-name {
    width: 200px;
  }

  .ubc-col-level {
    width: 140px;
  }

  .ubc-table tbody td {
    padding: 22px 12px;
  }
}

@media (max-width: 768px) {
  .ubc-naming {
    margin-bottom: 64px;
  }

  .ubc-naming .table-wrap + .ubc-subhead {
    margin-top: 44px;
  }

  /* Stack each row instead of the shared table's sideways scroll */
  .ubc-table {
    min-width: 0;
  }

  .ubc-table thead {
    display: none;
  }

  .ubc-table,
  .ubc-table tbody,
  .ubc-table tr,
  .ubc-table td {
    display: block;
    width: auto;
  }

  .ubc-table tbody tr {
    padding: 22px 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .ubc-table tbody tr:last-child {
    border-bottom: 0;
  }

  .ubc-table tbody td,
  .ubc-table tr:not(.ubc-total) + tr.ubc-total td {
    padding: 0;
    border: 0;
  }

  .ubc-table td.ubc-amount {
    text-align: left;
  }

  .ubc-table tr:not(.ubc-total) + tr.ubc-total {
    border-top: 2px solid #0f172a;
  }

  .ubc-table td.ubc-num {
    margin-bottom: 6px;
  }

  .ubc-table td.ubc-desc {
    margin-top: 12px;
  }

  .ubc-table td.ubc-level,
  .ubc-table td.ubc-calc {
    margin-top: 12px;
  }

  .ubc-amount strong {
    margin-top: 10px;
    font-size: 26px;
  }

  .ubc-table tr.ubc-total .ubc-amount strong {
    font-size: 30px;
  }
}

/* ---------- Films ----------
   One film per chapter, alternating sides, its story beside it. The sources
   are 480 px wide, so the frame stops there on every screen. At rest a film
   is a still, black-and-white image; approached, it plays and colour returns
   (js/bandura-films.js). */
.ubc-films {
  width: min(1200px, 95vw);
  margin: 0 auto 120px;
}

.ubc-films-intro .table-title,
.ubc-films-intro .table-subtitle {
  width: auto;
}

.ubc-films-intro .table-title {
  margin-top: 0;
}

.ubc-films-intro .table-subtitle {
  margin-bottom: 56px;
}

.ubc-film {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: clamp(48px, 7vw, 112px);
  align-items: center;
  padding: 96px 0;
  border-top: 1px solid #e2e8f0;
}

.ubc-film--reverse {
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
}

.ubc-film--reverse .ubc-film-media {
  order: 2;
  justify-self: end;
}

.ubc-film--reverse .ubc-film-text {
  justify-self: end;
}

/* Film 03: the central chapter gets more room and a slightly wider frame,
   still at or under its 480 px source width */
.ubc-film--feature {
  grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
  padding: 144px 0;
}

.ubc-film--feature .ubc-film-title {
  font-size: clamp(32px, 3.6vw, 48px);
}

/* A story can run longer than its film; the film then stays in view below
   the site header (116 px) while the story is read, scaled down on short
   screens so the whole frame always fits. */
.ubc-film {
  align-items: start;
}

.ubc-film-text {
  align-self: center;
}

.ubc-film-media {
  position: sticky;
  top: 140px;
  width: min(100%, calc((100vh - 172px) * 9 / 16));
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 12px;
  background: #0f0a06;
}

.ubc-film-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0f0a06;
  cursor: pointer;
  filter: grayscale(100%);
  transition: filter 0.6s ease;
}

.ubc-film-media.is-live video {
  filter: grayscale(0%);
}

/* Sound control: small, in a corner, away from faces */
.ubc-film-sound {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(15, 10, 6, 0.4);
  color: #ffffff;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.ubc-film-sound svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ubc-film-sound svg path:first-child {
  fill: currentColor;
}

.ubc-film-media.is-live .ubc-film-sound,
.ubc-film-sound:hover,
.ubc-film-sound:focus-visible {
  opacity: 1;
}

.ubc-film-sound:focus-visible {
  outline: 2px solid #f3d6ad;
  outline-offset: 2px;
}

.ubc-film-media.has-sound .ubc-film-sound {
  border-color: #f3d6ad;
  background: rgba(138, 90, 45, 0.75);
  opacity: 1;
}

.ubc-film-text {
  max-width: 520px;
}

.ubc-film-num {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
  color: #b07a4a;
  font: 800 13px/1 "Sora", system-ui, sans-serif;
  letter-spacing: 0.08em;
}

.ubc-film-num span {
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font: 700 11px/1 "Plus Jakarta Sans", system-ui, sans-serif;
}

.ubc-film-title {
  margin: 0 0 20px;
  color: #0f172a;
  font: 800 clamp(26px, 2.8vw, 38px)/1.15 "Sora", system-ui, sans-serif;
}

.ubc-film-story p {
  margin: 0 0 14px;
  color: #475569;
  font: 500 16px/1.75 "Plus Jakarta Sans", system-ui, sans-serif;
}

.ubc-film-story p:last-child {
  margin-bottom: 0;
}

/* The one-line turns in a story */
.ubc-film-story p.ubc-film-lead {
  color: #0f172a;
  font: 700 clamp(17px, 1.4vw, 19px)/1.5 "Sora", system-ui, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  .ubc-film-media video,
  .ubc-film-sound {
    transition: none;
  }
}

@media (max-width: 768px) {
  .ubc-films {
    margin-bottom: 72px;
  }

  .ubc-films-intro .table-subtitle {
    margin-bottom: 32px;
  }

  /* One column: film first, its story beneath, never beside */
  .ubc-film,
  .ubc-film--reverse,
  .ubc-film--feature {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 56px 0;
  }

  .ubc-film--feature {
    padding: 72px 0;
  }

  .ubc-film--reverse .ubc-film-media {
    order: 0;
  }

  .ubc-film-media,
  .ubc-film--reverse .ubc-film-media {
    position: relative;
    top: auto;
    justify-self: stretch;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
  }

  .ubc-film--reverse .ubc-film-text {
    justify-self: stretch;
  }

  .ubc-film-text {
    max-width: none;
  }

  /* No hover on touch: keep the sound control plainly visible */
  .ubc-film-sound {
    width: 40px;
    height: 40px;
    opacity: 0.85;
  }
}
