/* ==========================================================================
   components.css: shared building blocks used on several pages.
   ========================================================================== */

/* ---------- Responsive 16:9 video embed ---------- */
.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Background video (Vimeo, inserted by bg-video.js) ----------
   The section's own background image is the fallback (no JS, reduced
   motion, data saver, or while the player loads). */
.bg-video { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg-video iframe {
  position: absolute;
  top: 50%; left: 50%;
  width: 100vw; height: 56.25vw;          /* 16:9 by width */
  min-width: 177.78vh; min-height: 100vh;  /* ...or by height */
  max-width: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.8s ease;
}
.bg-video.is-playing iframe { opacity: 1; }
/* Cover the section itself (not the viewport) at the video's real aspect
   ratio, as Elementor did. Pages set --bg-video-ratio when the video is not
   16:9; otherwise Vimeo pillarboxes it and the fallback shows at the sides. */
@supports (width: 1cqw) {
  .bg-video { container-type: size; }
  .bg-video iframe {
    width: max(100cqw, 100cqh * var(--bg-video-ratio, 1.7778));
    height: max(100cqh, 100cqw / var(--bg-video-ratio, 1.7778));
    min-width: 0; min-height: 0;
  }
}

/* ---------- Row of buttons ---------- */
.btn-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: var(--widget-gap) 0 0;
  padding: 0;
  list-style: none;
}
.btn-row .btn { width: 100%; padding-inline: 10px; }
@media (max-width: 767px) {
  .btn-row { grid-template-columns: 1fr; }
}

/* ---------- Carousel (scroll-snap, optional prev/next buttons) ---------- */
.carousel { position: relative; display: flex; align-items: center; gap: 8px; }
.carousel__track {
  flex: 1;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(100% / var(--per-view, 6));
  margin: 0; padding: 0;
  list-style: none;
}
.carousel__list li { scroll-snap-align: start; display: flex; justify-content: center; padding: 0 5px; }
.carousel__list img { width: 150px; }
.carousel__btn {
  flex: none;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: rgba(52, 53, 73, 0.85);
  color: var(--c-white);
  font-size: 1.5rem; line-height: 1;
  cursor: pointer;
}
.carousel__btn:disabled { opacity: 0.3; cursor: default; }
@media (max-width: 1024px) { .carousel { --per-view: 4; } }
@media (max-width: 767px)  { .carousel { --per-view: 2; } }

/* ---------- Dialogs (lightbox style, from stikbot-modal.css) ---------- */
.lightbox {
  width: 80%;
  max-width: 700px;
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.5); }
.lightbox[open] { animation: zoom-in 0.6s; }
@keyframes zoom-in { from { transform: scale(0); } to { transform: scale(1); } }
.lightbox__body { max-height: calc(100vh - 40px); overflow-y: auto; }
.lightbox__close {
  position: fixed;
  top: 15px; right: 25px;
  z-index: 2;
  width: 48px; height: 48px;
  border: 0;
  background: transparent;
  color: #f1f1f1;
  font-size: 40px; font-weight: 700; line-height: 1;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}
.lightbox__close:hover, .lightbox__close:focus-visible { color: #bbb; }
@media (max-width: 700px) {
  .lightbox { width: 100%; }
}

/* ---------- Download tiles (Claim page) ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 var(--widget-gap);
  padding: 0;
  list-style: none;
}
.tiles--single { grid-template-columns: minmax(0, 50%); }
@media (max-width: 500px) {
  .tiles, .tiles--single { grid-template-columns: 1fr; }
}
.tile__link {
  display: block;
  border: 1px solid #ccc;
  color: inherit;
  text-decoration: none;
  background: var(--c-white);
}
.tile__link[href]:hover { border-color: #777; }
.tile__link img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tile__text { display: block; padding: 12px 15px; text-align: center; }
.tile__name { display: block; font-weight: 700; }
.tile__status { display: block; font-size: var(--fs-small); color: #555; }
.tile__link[href] .tile__status { color: var(--c-navy); text-decoration: underline; }

/* ---------- Accordion (native <details>) ---------- */
.accordion { margin: 0 0 var(--widget-gap); border: 1px solid #d5d8dc; }
.accordion details + details { border-top: 1px solid #d5d8dc; }
.accordion summary {
  padding: 15px 20px;
  font-weight: 700;
  cursor: pointer;
  list-style-position: inside;
}
.accordion__panel { padding: 15px 20px 20px; }
.accordion__panel p { margin: 10px 0 0; font-size: var(--fs-small); }

/* ---------- Notices / placeholders ---------- */
.notice {
  margin: 20px auto;
  padding: 16px 20px;
  max-width: 600px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.75);
  color: var(--c-white);
  text-align: center;
}
