/* ==========================================================================
   IBRA — Slider

   The thing that makes or breaks a slide with text over a photograph is
   legibility: a headline dropped straight onto a picture competes with
   whatever is behind it. Here the text sits in the lower part of the frame
   over a gradient that rises from the bottom edge, so the top of the
   picture stays untouched and the words always have a dark ground.
   ========================================================================== */

.ibra-slider__inner {
  max-width: var(--ibra-max, 1240px);
  margin-inline: auto;
}

.ibra-slider__heading {
  margin: 0 0 12px;
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.ibra-slider__intro {
  max-width: 78ch;
  margin: 0 0 26px;
  line-height: 1.65;
}

.ibra-slider__intro p { margin: 0 0 .7em; }
.ibra-slider__intro p:last-child { margin-bottom: 0; }

/* The stage ---------------------------------------------------------------
   Width is set here rather than on the section, so the heading above can
   run to the container while the slider itself stays narrower. */

.ibra-slider__stage {
  position: relative;
  margin-inline: auto;
}

.ibra-slider--narrow .ibra-slider__stage { max-width: 720px; }
.ibra-slider--medium .ibra-slider__stage { max-width: 900px; }
.ibra-slider--wide   .ibra-slider__stage { max-width: none; }

.ibra-slider__viewport {
  position: relative;
  overflow: hidden;
  background: #0E2233;
  touch-action: pan-y;   /* let the page scroll; the script claims sideways */
}

.ibra-slider.is-rounded .ibra-slider__viewport { border-radius: 10px; }

/* The track ---------------------------------------------------------------
   Slides are laid in a row at 100% each and the row is shifted by whole
   multiples of that. Percentages mean a resize needs no recalculation. */

.ibra-slider__track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ibra-slider__stage.is-ready .ibra-slider__track {
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

.ibra-slider__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}

/* Without the script every slide would stack down the page, so all but the
   first are hidden until the script takes over and lays them in a row.

   The guard class is set on the STAGE, which is where the script can see
   it — matching on the section here would never switch off. */
.ibra-slider__stage:not(.is-ready) .ibra-slider__slide + .ibra-slider__slide { display: none; }

/* Media ------------------------------------------------------------------ */

.ibra-slider__image {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  /* The image is dragged by the swipe handler, not by the browser */
  user-select: none;
  -webkit-user-drag: none;
}

.ibra-slider--3-2  .ibra-slider__image { aspect-ratio: 3 / 2; }
.ibra-slider--4-3  .ibra-slider__image { aspect-ratio: 4 / 3; }
.ibra-slider--21-9 .ibra-slider__image { aspect-ratio: 21 / 9; }

.ibra-slider__image--empty { background: #1B3244; }

/* The text ----------------------------------------------------------------
   A gradient rather than a flat overlay. The top of the picture keeps its
   full contrast and the bottom darkens just enough to carry the words. */

.ibra-slider__body {
  position: absolute;
  inset: 0;
  display: flex;
  padding: clamp(20px, 4vw, 40px);
  pointer-events: none;   /* the link inside re-enables it */
  background: linear-gradient(
    to top,
    rgba(7, 20, 30, var(--shade, .55)) 0%,
    rgba(7, 20, 30, calc(var(--shade, .55) * .72)) 34%,
    rgba(7, 20, 30, calc(var(--shade, .55) * .22)) 62%,
    transparent 88%);
}

.ibra-slider--bottom-left .ibra-slider__body { align-items: flex-end; justify-content: flex-start; }
.ibra-slider--bottom-center .ibra-slider__body { align-items: flex-end; justify-content: center; }
.ibra-slider--center .ibra-slider__body { align-items: center; justify-content: center; }

.ibra-slider__content {
  max-width: 54ch;
  color: #fff;
}

.ibra-slider--bottom-center .ibra-slider__content,
.ibra-slider--center .ibra-slider__content { text-align: center; }

.ibra-slider__eyebrow {
  margin: 0 0 8px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
}

.ibra-slider__title {
  margin: 0 0 10px;
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -.015em;
  text-wrap: balance;
  color: #fff;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .35);
}

/* Three lines, whatever an editor pastes in. A slide that grows to eight
   lines stops being a slide. */
.ibra-slider__copy {
  margin: 0;
  font-size: .9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .88);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .3);
}

.ibra-slider__cta {
  display: inline-flex;
  align-items: center;
  margin-top: 18px;
  padding: 11px 26px;
  border-radius: 3px;
  background: var(--accent, #7E1220);
  color: #fff !important;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none !important;
  pointer-events: auto;
  transition: background-color .25s ease, transform .25s cubic-bezier(.2, .7, .3, 1);
}

.ibra-slider__cta:hover,
.ibra-slider__cta:focus {
  color: #fff !important;
  background: color-mix(in srgb, var(--accent, #7E1220) 82%, #fff);
  transform: translateY(-1px);
}

@supports not (color: color-mix(in srgb, red 50%, white)) {
  .ibra-slider__cta:hover { background: #992233; }
}

.ibra-slider__cta:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* An off-screen slide keeps its text in the document for screen readers to
   skip, but it must not be reachable or visible through the frame. */
.ibra-slider__slide[aria-hidden="true"] .ibra-slider__content {
  opacity: 0;
  transition: opacity .3s ease;
}

.ibra-slider__slide.is-current .ibra-slider__content {
  opacity: 1;
  transition: opacity .5s ease .12s;
}

/* Arrows ------------------------------------------------------------------
   Inside the frame, because an arrow outside it would push the slider off
   centre at narrow widths. Circular, low contrast at rest. */

.ibra-slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, .34) !important;
  border-radius: 50% !important;
  background: rgba(10, 24, 34, .42) !important;
  color: #fff !important;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color .25s ease, border-color .25s ease, opacity .25s ease;
}

.ibra-slider__arrow svg { width: 10px; height: 16px; }

.ibra-slider__arrow--prev { left: 14px; }
.ibra-slider__arrow--next { right: 14px; }

.ibra-slider__arrow:hover,
.ibra-slider__arrow:focus {
  background: rgba(10, 24, 34, .72) !important;
  border-color: rgba(255, 255, 255, .6) !important;
  color: #fff !important;
}

.ibra-slider__arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.ibra-slider__arrow[disabled] {
  opacity: .3;
  cursor: default;
  pointer-events: none;
}

/* Dots --------------------------------------------------------------------
   Under the frame rather than over it, so they never sit on the copy. The
   current one is a short bar, which reads as position rather than as one
   more dot that happens to be brighter. */

.ibra-slider__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.ibra-slider__dot {
  padding: 8px 2px !important;   /* a 40px tap target around a 4px mark */
  border: 0 !important;
  background: none !important;
  cursor: pointer;
  line-height: 0;
}

.ibra-slider__dot span {
  display: block;
  width: 8px;
  height: 4px;
  border-radius: 999px;
  background: rgba(16, 38, 48, .26);
  transition: width .3s cubic-bezier(.4, 0, .2, 1), background-color .3s ease;
}

.ibra-slider__dot:hover span { background: rgba(16, 38, 48, .45); }

.ibra-slider__dot.is-current span {
  width: 26px;
  background: var(--accent, #7E1220);
}

.ibra-slider__dot:focus-visible { outline: 2px solid var(--accent, #7E1220); outline-offset: 1px; }

/* The announcement is for screen readers only */
.ibra-slider__live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 767px) {
  .ibra-slider__arrow { width: 36px; height: 36px; }
  .ibra-slider__arrow--prev { left: 8px; }
  .ibra-slider__arrow--next { right: 8px; }
  .ibra-slider__copy { -webkit-line-clamp: 2; font-size: .85rem; }
}

@media (max-width: 520px) {
  /* A 16:9 frame at phone width leaves no room for a headline and a
     button, so the picture is given more height instead. */
  .ibra-slider__image,
  .ibra-slider--21-9 .ibra-slider__image { aspect-ratio: 4 / 3; }

  .ibra-slider__arrow { display: none; }
  .ibra-slider__cta { padding: 10px 20px; font-size: .74rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ibra-slider__stage.is-ready .ibra-slider__track,
  .ibra-slider__content,
  .ibra-slider__cta,
  .ibra-slider__dot span,
  .ibra-slider__arrow { transition: none !important; }
  .ibra-slider__cta:hover { transform: none !important; }
}