/* Per-slide surfaces override the legacy mobile text-colour fallback. */
.flex-panel.image-slider .swiper-slide.hero-slide--bg-yellow { --hero-surface: #ffc20e; background-color: var(--hero-surface); }
.flex-panel.image-slider .swiper-slide.hero-slide--bg-black { --hero-surface: #000; background-color: var(--hero-surface); }
/* Keep the existing slide height and right-hand caption positioning. */
.flex-panel.image-slider .image-swiper .hero-slide--video::before { display: none; }
.flex-panel.image-slider .hero-video-media { position: absolute; inset: 0 auto 0 0; display: flex; align-items: center; justify-content: center; width: 50%; height: 100%; min-width: 0; overflow: hidden; }
.flex-panel.image-slider .hero-slide-video { display: block; width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
.flex-panel.image-slider .hero-slide--video.hero-slide--image-only .hero-video-media { width: 100%; }
@media (max-width: 991.98px) {
 .flex-panel.image-slider .hero-slide--video .hero-video-media { position: relative; inset: auto; order: 0; width: 100%; height: auto; aspect-ratio: 1; }
 .flex-panel.image-slider .hero-slide-video { width: 100%; height: 100%; max-height: none; }
 .flex-panel.image-slider .hero-slide--video .image-title { position: relative; inset: auto; order: 1; }
}

/* Equal mobile slide proportions for both still images and square video. */
@media (max-width: 991.98px) {
 .flex-panel.panel-style--hero_carousel .swiper-wrapper { align-items: stretch; }
 .flex-panel.panel-style--hero_carousel .swiper-slide { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; height: auto; min-height: 0; }
 .flex-panel.panel-style--hero_carousel .swiper-slide > .bg-img,
 .flex-panel.panel-style--hero_carousel .swiper-slide > .hero-video-media { position: relative; inset: auto; grid-row: 1; order: 0; width: 100%; height: auto; aspect-ratio: 4 / 3; margin: 0; }
 .flex-panel.panel-style--hero_carousel .bg-img picture { display: block; width: 100%; height: 100%; }
 .flex-panel.panel-style--hero_carousel .hero-contained-image,
 .flex-panel.panel-style--hero_carousel .hero-slide-video { display: block; width: 100%; height: 100%; object-fit: contain; }
 .flex-panel.panel-style--hero_carousel .image-title { grid-row: 2; order: 1; align-self: stretch; align-items: center; justify-content: flex-start; width: 100%; height: 100%; min-height: 190px; margin: 0; padding: 0 24px 28px !important; box-sizing: border-box; text-align: center; }
 .flex-panel.panel-style--hero_carousel h4.slide-copy__title { font-size: clamp(1.6rem, 6.5vw, 2rem) !important; line-height: 1.12; }
 .flex-panel.panel-style--hero_carousel .slide-copy__text { font-size: 1rem; line-height: 1.4; margin-bottom: 0; }
 .flex-panel.panel-style--hero_carousel .hero-slide--image-only { grid-template-rows: auto; }
}

@media (max-width: 991.98px) {
 .flex-panel.panel-style--hero_carousel .hero-slide--video .image-title { padding-top: 0 !important; }
 /* Trim the encoded dark rim inside the square video frame. */
 .flex-panel.panel-style--hero_carousel .hero-video-media .hero-slide-video { flex: 0 0 auto; width: auto; height: 100%; max-width: 100%; aspect-ratio: 1; clip-path: inset(2%); border: 0; box-shadow: none; }
}

/* Match the homepage MP4 background sampled from the supplied reference. */
.home .flex-panel.image-slider .swiper-slide.hero-slide--video.hero-slide--bg-yellow { --hero-surface: #fcc301; background-color: var(--hero-surface); }

/* JSON animations share the square MP4 media region. */
.flex-panel.image-slider .hero-slide-animation { width: 100%; height: 100%; max-height: 100%; aspect-ratio: 1; }
.flex-panel.image-slider .hero-slide-animation > svg { display: block; width: 100%; height: 100%; }
.flex-panel.image-slider .hero-slide-animation:has(.hero-animation-poster) { position: relative; }
.flex-panel.image-slider .hero-animation-poster, .flex-panel.image-slider .hero-animation-motion { width: 100%; height: 100%; object-fit: contain; }
.flex-panel.image-slider .hero-animation-poster { display: block; }
.flex-panel.image-slider .hero-animation-motion { display: none; position: absolute; inset: 0; }
.flex-panel.image-slider .hero-slide-animation.is-playing .hero-animation-poster { visibility: hidden; }
.flex-panel.image-slider .hero-slide-animation.is-playing .hero-animation-motion { display: block; }
@media (min-width: 992px) {
 .flex-panel.image-slider .bg-img picture, .flex-panel.image-slider .bg-img .hero-contained-image { display: block; width: 100%; height: 100%; }
 .flex-panel.image-slider .bg-img .hero-contained-image { object-fit: cover; }
}
@media (max-width: 991.98px) {
 .flex-panel.panel-style--hero_carousel .hero-slide-animation { flex: 0 0 auto; width: auto; height: 100%; max-width: 100%; aspect-ratio: 1; }
}
/* The video-specific colour match does not apply to transparent animations. */
.home .flex-panel.image-slider .swiper-slide.hero-slide--animation.hero-slide--bg-yellow { --hero-surface: #ffc20e; }

/* The laptop JSON artwork sits left of centre within its 700px export canvas. */
/* Offset the wrapper: Lottie owns and rewrites the SVG inline transform. */
.home .flex-panel.image-slider .hero-slide-animation[data-animation-url*="/laptop-animation"] { transform: translateX(7.5%); }
@media (max-width: 991.98px) {
 .home .flex-panel.image-slider .hero-slide-animation[data-animation-url*="/laptop-animation"] { transform: translateX(8.5%); }
}
