/**
 * RAT Deal Gallery — mosaic tiles + built-in lightbox.
 *
 * Breakpoints are CONTAINER queries measured on .rat-gallery-scope, not the
 * viewport, for the same reason as the other widgets: the block's real width comes
 * from its Elementor container, which inside a Single template's content column
 * is routinely much narrower than the window.
 */

.rat-gallery-scope {
	container-type: inline-size;
}

.rat-gallery {
	--rat-gal-gap: 16px;
	--rat-gal-radius: 14px;
	--rat-gal-ratio: 1288 / 545;
	--rat-gal-btn-bg: #FFFFFF;
	--rat-gal-btn-color: #00448A;
	--rat-gal-btn-bg-hover: #00448A;
	--rat-gal-btn-color-hover: #FFFFFF;
	--rat-gal-btn-offset: 16px;

	position: relative;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-template-rows: repeat(2, minmax(0, 1fr));
	gap: var(--rat-gal-gap);
	aspect-ratio: var(--rat-gal-ratio);
	margin: 0;
}

/* An explicit height from the Style tab wins over the design's aspect ratio. */
.rat-gallery--fixed-height {
	aspect-ratio: auto;
	height: var(--rat-gal-height);
}

/*
 * The tile anchor stays unclipped and unpositioned on purpose. Clipping and the
 * radius live on the inner frame instead, so the pill — a child of tile 1 —
 * resolves its absolute position against .rat-gallery and can sit at the
 * bottom-right of the whole mosaic without being cut off by tile 1's own box.
 */
.rat-gallery__item {
	display: block;
	text-decoration: none;
	line-height: 0;
	min-width: 0;
	min-height: 0;
}

.rat-gallery__frame {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: var(--rat-gal-radius);
	background: #EEEDF3;
}

.rat-gallery__frame img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}

.rat-gallery--zoom .rat-gallery__frame:hover img,
.rat-gallery--zoom .rat-gallery__item:focus-visible .rat-gallery__frame img {
	transform: scale(1.05);
}

.rat-gallery__frame::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--rat-gal-tint, transparent);
	opacity: 0;
	transition: opacity .35s ease;
	pointer-events: none;
}

.rat-gallery__frame:hover::after,
.rat-gallery__item:focus-visible .rat-gallery__frame::after {
	opacity: 1;
}

.rat-gallery__item:focus-visible {
	outline: none;
}

.rat-gallery__item:focus-visible .rat-gallery__frame {
	outline: 3px solid var(--rat-gal-btn-bg-hover);
	outline-offset: 3px;
}

/*
 * Images past the fourth exist only to join the lightbox slideshow. They are
 * taken out of flow rather than display:none'd — Elementor collects slideshow
 * members with a plain attribute selector, and an out-of-flow node is a safer
 * bet than a display:none one for anything that measures the DOM.
 */
.rat-gallery__spare {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	pointer-events: none;
}

/* --- The four-up mosaic: one tall left, one wide top-right, two below. --- */

.rat-gallery__item:nth-child(1) { grid-column: 1 / 3; grid-row: 1 / 3; }
.rat-gallery__item:nth-child(2) { grid-column: 3 / 5; grid-row: 1 / 2; }
.rat-gallery__item:nth-child(3) { grid-column: 3 / 4; grid-row: 2 / 3; }
.rat-gallery__item:nth-child(4) { grid-column: 4 / 5; grid-row: 2 / 3; }

/* --- Degrade below four images. --- */

.rat-gallery--count-1 {
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr);
	aspect-ratio: 16 / 9;
}
.rat-gallery--count-1 .rat-gallery__item:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 2; }

.rat-gallery--count-2 {
	grid-template-rows: minmax(0, 1fr);
	aspect-ratio: 1288 / 420;
}
.rat-gallery--count-2 .rat-gallery__item:nth-child(1) { grid-column: 1 / 3; grid-row: 1 / 2; }
.rat-gallery--count-2 .rat-gallery__item:nth-child(2) { grid-column: 3 / 5; grid-row: 1 / 2; }

.rat-gallery--count-3 .rat-gallery__item:nth-child(2) { grid-column: 3 / 5; grid-row: 1 / 2; }
.rat-gallery--count-3 .rat-gallery__item:nth-child(3) { grid-column: 3 / 5; grid-row: 2 / 3; }

/* --- Gallery button ---------------------------------------------------- */

/*
 * The pill is a child of tile 1's anchor, which is what makes the whole widget
 * zero-JS: the click lands on an anchor that already carries the lightbox
 * attributes, and the lightbox opens on the first image. A sibling <a> would
 * either need a script of its own or would join the slideshow as a duplicate
 * slide.
 */
.rat-gallery__btn {
	position: absolute;
	right: var(--rat-gal-btn-offset);
	bottom: var(--rat-gal-btn-offset);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	border-radius: 999px;
	background: var(--rat-gal-btn-bg);
	color: var(--rat-gal-btn-color);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: .01em;
	white-space: nowrap;
	box-shadow: 0 6px 20px rgba(22, 22, 41, .18);
	transition: background-color .25s ease, color .25s ease, transform .25s ease;
}

.rat-gallery__btn:hover,
.rat-gallery__item:focus-visible .rat-gallery__btn {
	background: var(--rat-gal-btn-bg-hover);
	color: var(--rat-gal-btn-color-hover);
	transform: translateY(-2px);
}

.rat-gallery__btn svg {
	width: 16px;
	height: 16px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.rat-gallery__btn-count {
	opacity: .62;
	font-weight: 500;
}

/* --- Actions bar (built-in lightbox mode) -------------------------------- */

/*
 * With the built-in lightbox the pill no longer has to be nested inside tile 1's
 * anchor - it can be a plain link to #<prefix>-0 - so both buttons sit in one
 * flex bar instead. That is what makes room for the video button beside it;
 * nested anchors are invalid, so it could never have gone inside the old pill's
 * parent. In Elementor-lightbox mode the pill stays nested and this bar carries
 * only the video button, shifted to the opposite corner to avoid overlapping it.
 */
.rat-gallery__actions {
	position: absolute;
	right: var(--rat-gal-btn-offset);
	bottom: var(--rat-gal-btn-offset);
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 12px;
}

.rat-gallery__actions--left {
	right: auto;
	left: var(--rat-gal-btn-offset);
}

/* Inside the bar the pill is laid out by flex, not by its own offsets. */
.rat-gallery__actions .rat-gallery__btn {
	position: static;
	top: auto;
	right: auto;
	bottom: auto;
}

.rat-gallery__video {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--rat-gal-video-size, 40px);
	height: var(--rat-gal-video-size, 40px);
	border-radius: 999px;
	background: var(--rat-gal-btn-bg);
	color: var(--rat-gal-btn-color);
	box-shadow: 0 6px 20px rgba(22, 22, 41, .18);
	transition: background-color .25s ease, color .25s ease, transform .25s ease;
}

.rat-gallery__video:hover,
.rat-gallery__video:focus-visible {
	background: var(--rat-gal-btn-bg-hover);
	color: var(--rat-gal-btn-color-hover);
	transform: translateY(-2px);
}

/*
 * Both buttons are anchors now - the pill used to be a <span>, which theme link
 * rules could not reach. Colours are pinned with two classes on every state, and
 * the icons' fill/stroke set directly, for the same reason as the lightbox
 * arrows: a theme styling `a:hover svg` overrides the paint itself, which no
 * amount of `color` on the anchor can undo.
 */
.rat-gallery .rat-gallery__btn,
.rat-gallery .rat-gallery__video {
	color: var(--rat-gal-btn-color);
	text-decoration: none;
}

.rat-gallery .rat-gallery__btn:hover,
.rat-gallery .rat-gallery__btn:focus,
.rat-gallery .rat-gallery__btn:active,
.rat-gallery .rat-gallery__video:hover,
.rat-gallery .rat-gallery__video:focus,
.rat-gallery .rat-gallery__video:active {
	color: var(--rat-gal-btn-color-hover);
	text-decoration: none;
}

.rat-gallery .rat-gallery__btn svg,
.rat-gallery .rat-gallery__btn:hover svg {
	stroke: currentColor;
	fill: none;
}

.rat-gallery__video svg {
	width: 45%;
	height: 45%;
}

.rat-gallery .rat-gallery__video svg,
.rat-gallery .rat-gallery__video:hover svg,
.rat-gallery .rat-gallery__video:focus svg {
	fill: currentColor;
	stroke: none;
}

/* --- Narrow containers -------------------------------------------------- */

@container (max-width: 780px) {
	.rat-gallery {
		--rat-gal-gap: 12px;
		--rat-gal-btn-offset: 12px;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-template-rows: auto auto;
		aspect-ratio: auto;
		height: auto;
	}

	.rat-gallery__item:nth-child(1) {
		grid-column: 1 / 4;
		grid-row: 1 / 2;
		aspect-ratio: 16 / 10;
	}

	.rat-gallery__item:nth-child(2),
	.rat-gallery__item:nth-child(3),
	.rat-gallery__item:nth-child(4) {
		grid-row: 2 / 3;
		aspect-ratio: 1 / 1;
	}

	.rat-gallery__item:nth-child(2) { grid-column: 1 / 2; }
	.rat-gallery__item:nth-child(3) { grid-column: 2 / 3; }
	.rat-gallery__item:nth-child(4) { grid-column: 3 / 4; }

	.rat-gallery--count-1 .rat-gallery__item:nth-child(1),
	.rat-gallery--count-2 .rat-gallery__item:nth-child(1),
	.rat-gallery--count-3 .rat-gallery__item:nth-child(1) { grid-column: 1 / 4; }

	.rat-gallery--count-2 .rat-gallery__item:nth-child(2),
	.rat-gallery--count-3 .rat-gallery__item:nth-child(2) { grid-column: 1 / 3; }
	.rat-gallery--count-3 .rat-gallery__item:nth-child(3) { grid-column: 3 / 4; }

	/*
	 * The bottom row is now three small squares — the pill would swallow one
	 * whole, so it moves up onto the lead image, which is tall enough for it.
	 * The lead image is 16/10 of the container, hence the cqw arithmetic.
	 */
	.rat-gallery__btn,
	.rat-gallery__actions {
		top: calc(100cqw * 10 / 16 - 40px - var(--rat-gal-btn-offset));
		bottom: auto;
	}

	.rat-gallery__btn {
		padding: 8px 16px;
		font-size: 13px;
	}

	.rat-gallery--count-1 .rat-gallery__btn,
	.rat-gallery--count-2 .rat-gallery__btn,
	.rat-gallery--count-3 .rat-gallery__btn,
	.rat-gallery--count-1 .rat-gallery__actions,
	.rat-gallery--count-2 .rat-gallery__actions,
	.rat-gallery--count-3 .rat-gallery__actions {
		top: auto;
		bottom: var(--rat-gal-btn-offset);
	}

	/* The pill's own top offset is irrelevant once flex is placing it. */
	.rat-gallery__actions .rat-gallery__btn {
		top: auto;
	}

	.rat-gallery__video {
		--rat-gal-video-size: 36px;
	}
}

@container (max-width: 440px) {
	.rat-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rat-gallery__item:nth-child(1) { grid-column: 1 / 3; }
	.rat-gallery__item:nth-child(2) { grid-column: 1 / 2; }
	.rat-gallery__item:nth-child(3) { grid-column: 2 / 3; }
	/*
	 * Two squares fit here, three do not. The fourth drops out of the mosaic
	 * the same way images 5+ do - hidden but still in flow-free DOM, so it
	 * keeps its place in the lightbox slideshow.
	 */
	.rat-gallery--count-4 .rat-gallery__item:nth-child(4) {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		pointer-events: none;
	}

	.rat-gallery--count-2 .rat-gallery__item:nth-child(2),
	.rat-gallery--count-3 .rat-gallery__item:nth-child(2) { grid-column: 1 / 2; }
	.rat-gallery--count-3 .rat-gallery__item:nth-child(3) { grid-column: 2 / 3; }
}

@media (prefers-reduced-motion: reduce) {
	.rat-gallery__frame img,
	.rat-gallery__btn {
		transition: none;
	}
	.rat-gallery--zoom .rat-gallery__frame:hover img {
		transform: none;
	}
}

/* --- Built-in lightbox --------------------------------------------------- */

/*
 * Opens on :target, so a tile click needs no JavaScript at all - which is the
 * whole point on this site, where LiteSpeed's Delay JS leaves script-driven
 * blocks dead until the visitor's first interaction. Swiping and the edge peek
 * are CSS scroll-snap; the arrows and thumbnails are plain anchor links.
 *
 * deal-gallery.js then adds the one thing CSS cannot: keeping "current" in step
 * with a free swipe. Without it the arrows and counter follow :target, which
 * goes stale the moment someone drags instead of clicking.
 */

.rat-lb {
	--rat-lb-backdrop: rgba(11, 20, 40, .95);
	/*
	 * Viewport units, not percentages. A percentage flex-basis resolves against
	 * the track's CONTENT box, which the peek padding has already narrowed - so
	 * "78%" silently became 61% of the screen and doubled the peek. vw keeps the
	 * slide and the padding on the same base.
	 */
	--rat-lb-slide: 78vw;
	--rat-lb-gap: 16px;
	--rat-lb-control: rgba(255, 255, 255, .12);
	--rat-lb-control-hover: #00448A;
	--rat-lb-on-dark: #FFFFFF;

	position: fixed;
	inset: 0;
	z-index: 99990;
	display: none;
	grid-template-rows: 1fr auto;
	background: var(--rat-lb-backdrop);
}

.rat-lb:has(.rat-lb__slide:target) {
	display: grid;
}

/* Fills the viewport behind the track so a click anywhere off-image closes. */
.rat-lb__scrim {
	position: fixed;
	inset: 0;
	z-index: 0;
}

/* --- Slide track: swipe + peek ------------------------------------------- */

.rat-lb__track {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: var(--rat-lb-gap);
	/*
	 * The inline padding is what produces the peek: each slide is narrower
	 * than the track and snaps to centre, so the neighbours sit in the gutters.
	 */
	/*
	 * Longhands with a fallback, for the same reason as the pricing guide's
	 * divider: a var() inside a multi-value shorthand takes the whole
	 * declaration down with it if anything mangles the substitution, and losing
	 * this padding would silently remove the peek.
	 */
	padding-top: 0;
	padding-bottom: 0;
	padding-left: calc((100vw - var(--rat-lb-slide, 78vw)) / 2);
	padding-right: calc((100vw - var(--rat-lb-slide, 78vw)) / 2);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	/*
	 * pan-x keeps the browser's own touch scrolling - that is the swipe on a
	 * phone, and it works with no JavaScript. grab/grabbing advertises the
	 * mouse drag that deal-gallery.js adds on top for desktop.
	 */
	touch-action: pan-x pinch-zoom;
	cursor: grab;
}

/*
 * While a mouse drag is in progress the snap points have to be released, or
 * every pointermove fights the snap and the track judders. They come back on
 * pointerup, when the script settles the track on the nearest slide.
 */
.rat-lb__track.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
	scroll-behavior: auto;
	user-select: none;
}

.rat-lb__track::-webkit-scrollbar {
	display: none;
}

/* Native image dragging would otherwise swallow the mouse-drag gesture. */
.rat-lb__img,
.rat-lb__thumb img {
	-webkit-user-drag: none;
	user-select: none;
}

.rat-lb__slide {
	/* Longhands - a failed `flex: 0 0 var(...)` would collapse every slide. */
	flex-grow: 0;
	flex-shrink: 0;
	flex-basis: var(--rat-lb-slide, 78vw);
	scroll-snap-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 0;
	min-width: 0;
}

.rat-lb__img {
	display: block;
	max-width: 100%;
	max-height: calc(100dvh - 210px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
}

.rat-lb__caption {
	max-width: 70ch;
	color: rgba(255, 255, 255, .78);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
}

/* --- Per-slide controls --------------------------------------------------- */

/*
 * Arrows and counter live inside each slide so that, with no JavaScript, only
 * the targeted slide's set is shown and its hrefs already point at the right
 * neighbours. Once the JS layer is live it flips the source of truth from
 * :target to .is-current, which survives swiping.
 */
.rat-lb__nav,
.rat-lb__counter {
	display: none;
}

.rat-lb__slide:target .rat-lb__nav,
.rat-lb__slide:target .rat-lb__counter {
	display: block;
}

.rat-lb.is-enhanced .rat-lb__slide:target .rat-lb__nav,
.rat-lb.is-enhanced .rat-lb__slide:target .rat-lb__counter {
	display: none;
}

.rat-lb.is-enhanced .rat-lb__slide.is-current .rat-lb__nav,
.rat-lb.is-enhanced .rat-lb__slide.is-current .rat-lb__counter {
	display: block;
}

.rat-lb__counter {
	position: fixed;
	top: 18px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 3;
	color: rgba(255, 255, 255, .8);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .04em;
}

.rat-lb__arrow,
.rat-lb__close {
	position: fixed;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 999px;
	background: var(--rat-lb-control);
	backdrop-filter: blur(6px);
	transition: background-color .2s ease, transform .2s ease;
}

/*
 * The colour is set with two classes' worth of specificity, on both the resting
 * and hover states, so the theme's own `a` and `a:hover` link colours cannot
 * reach the icon. The glyphs are strokes using currentColor, so a theme link
 * colour landing here turns the arrows a different colour on hover - which is
 * exactly what happened before this rule.
 */
.rat-lb .rat-lb__arrow,
.rat-lb .rat-lb__close,
.rat-lb .rat-lb__arrow:hover,
.rat-lb .rat-lb__close:hover,
.rat-lb .rat-lb__arrow:focus,
.rat-lb .rat-lb__close:focus,
.rat-lb .rat-lb__arrow:active,
.rat-lb .rat-lb__close:active {
	color: var(--rat-lb-on-dark);
}

/*
 * And the stroke directly, not just currentColor. A theme that styles
 * `a:hover svg { stroke: ... }` overrides the stroke itself, which no amount of
 * `color` on the anchor can undo. Two classes plus a pseudo-class and an
 * element beats `a:hover svg`, so these win without !important.
 */
.rat-lb .rat-lb__arrow svg,
.rat-lb .rat-lb__close svg,
.rat-lb .rat-lb__arrow:hover svg,
.rat-lb .rat-lb__close:hover svg,
.rat-lb .rat-lb__arrow:focus svg,
.rat-lb .rat-lb__close:focus svg,
.rat-lb .rat-lb__arrow:active svg,
.rat-lb .rat-lb__close:active svg {
	stroke: var(--rat-lb-on-dark);
	fill: none;
}

.rat-lb__arrow:hover,
.rat-lb__close:hover,
.rat-lb__arrow:focus-visible,
.rat-lb__close:focus-visible {
	background: var(--rat-lb-control-hover);
}

.rat-lb__arrow svg,
.rat-lb__close svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.rat-lb__arrow {
	top: 50%;
	transform: translateY(-50%);
}

.rat-lb__arrow--prev { left: 18px; }
.rat-lb__arrow--next { right: 18px; }

.rat-lb__close {
	top: 14px;
	right: 14px;
}

/* --- Thumbnail strip ------------------------------------------------------ */

.rat-lb__thumbs {
	position: relative;
	z-index: 2;
	display: flex;
	gap: 8px;
	padding: 16px 16px 20px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	justify-content: safe center;
}

.rat-lb__thumbs::-webkit-scrollbar {
	display: none;
}

.rat-lb__thumb {
	flex: none;
	width: 72px;
	height: 52px;
	border-radius: 6px;
	overflow: hidden;
	opacity: .48;
	outline: 2px solid transparent;
	outline-offset: 2px;
	transition: opacity .2s ease, outline-color .2s ease;
}

.rat-lb__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rat-lb__thumb:hover,
.rat-lb__thumb:focus-visible {
	opacity: .85;
}

.rat-lb__thumb.is-current {
	opacity: 1;
	outline-color: var(--rat-lb-control-hover);
}

/* No-JS: the targeted slide cannot style the strip, so fall back to :hover. */

/* --- Lightbox at narrow widths ------------------------------------------- */

/*
 * Viewport queries, not container queries - the lightbox is fixed to the
 * viewport, so the gallery's container width is irrelevant to it.
 */
@media (max-width: 782px) {
	.rat-lb {
		--rat-lb-slide: 86vw;
		--rat-lb-gap: 12px;
	}

	/*
	 * Full-size side arrows sit right on top of the photograph on a phone and
	 * fight the swipe, so they shrink and drop to the lower corners, clear of
	 * the image and of the thumbnail strip.
	 */
	.rat-lb__arrow {
		top: auto;
		bottom: 104px;
		width: 40px;
		height: 40px;
		transform: none;
	}

	.rat-lb__arrow--prev { left: 12px; }
	.rat-lb__arrow--next { right: 12px; }

	.rat-lb__img {
		max-height: calc(100dvh - 250px);
	}

	.rat-lb__thumb {
		width: 56px;
		height: 42px;
	}

	.rat-lb__caption {
		font-size: 13px;
		padding: 0 12px;
	}
}

/* Lock the page behind the overlay. Needs the JS layer to add the class. */
html.rat-lb-open,
html.rat-lb-open-video,
html.rat-lb-open-video body,
html.rat-lb-open body {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.rat-lb__track,
	.rat-lb__thumbs {
		scroll-behavior: auto;
	}

	.rat-lb__arrow,
	.rat-lb__close,
	.rat-lb__thumb {
		transition: none;
	}
}

/*
 * Without :has() the overlay can never be revealed, so hide it outright rather
 * than leave dead links - Firefox 110-120 falls back to no lightbox.
 */
@supports not (selector(:has(*))) {
	.rat-lb {
		display: none !important;
	}
}

/* --- Video overlay ------------------------------------------------------- */

/*
 * The overlay element IS the :target here, rather than one of its children, so
 * unlike the image lightbox this needs no :has() at all - it works everywhere.
 */
.rat-vb {
	position: fixed;
	inset: 0;
	z-index: 99991;
	display: none;
	place-items: center;
	padding: 24px;
	background: var(--rat-lb-backdrop, rgba(11, 20, 40, .95));
}

.rat-vb:target {
	display: grid;
}

.rat-vb__scrim {
	position: fixed;
	inset: 0;
	z-index: 0;
}

.rat-vb__frame {
	position: relative;
	z-index: 1;
	width: min(1100px, 100%);
	aspect-ratio: 16 / 9;
	max-height: calc(100dvh - 120px);
	background: #000;
	border-radius: 10px;
	overflow: hidden;
}

.rat-vb__iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Shown only when JavaScript never arrives - see the note in the widget. */
.rat-vb__fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 24px;
	color: #FFFFFF;
	font-family: inherit;
	font-size: 15px;
	text-align: center;
}

.rat-vb__close {
	position: fixed;
	top: 14px;
	right: 14px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 999px;
	background: var(--rat-lb-control, rgba(255, 255, 255, .12));
	transition: background-color .2s ease;
}

.rat-vb .rat-vb__close,
.rat-vb .rat-vb__close:hover,
.rat-vb .rat-vb__close:focus,
.rat-vb .rat-vb__close:active {
	color: #FFFFFF;
}

.rat-vb__close:hover,
.rat-vb__close:focus-visible {
	background: var(--rat-lb-control-hover, #00448A);
}

.rat-vb__close svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.rat-vb .rat-vb__close svg,
.rat-vb .rat-vb__close:hover svg {
	stroke: #FFFFFF;
}

@media (max-width: 782px) {
	.rat-vb {
		padding: 16px;
	}

	.rat-vb__close {
		width: 40px;
		height: 40px;
	}
}

/* --- Elementor's column-wrap containers --------------------------------- */

/*
 * Elementor sets `flex-wrap: wrap` on .e-con at the MOBILE breakpoint only. In
 * a column flex container that wraps, the browser has to resolve each item's
 * height in a pass where the item's width is not yet definite - and every tile
 * here takes its height from aspect-ratio, so the tiles contribute no intrinsic
 * height and the widget's own box collapses. Measured on the Azamara deal at
 * 375px: a 26px-tall widget box wrapped around a 394px mosaic, which then
 * painted straight over the heading and copy beneath it.
 *
 * Nothing the widget can set on itself fixes this. min-height (auto and
 * fit-content), height: fit-content, flex-basis: content, flex-shrink: 0,
 * align-self: stretch, display: flow-root and a definite width on the scope
 * were all measured and all were no-ops - the container is what has to stop
 * wrapping. Desktop escapes the bug only because .e-con is already nowrap
 * there, which is why this looked like a mobile-only problem.
 *
 * Forcing nowrap on a COLUMN container is safe: wrapping only ever kicks in
 * when the container's height is constrained, and these are content-height.
 */
/*
 * A BOXED container puts the widget inside .e-con-inner, which carries its own
 * flex-wrap: wrap - so the rule has to reach that wrapper as well. Douro deal
 * at 390px: the widget box was 16px around a 408px mosaic until this was added.
 * The extra .e-con.e-flex outranks Elementor's own mobile
 * `.e-con.e-flex > .e-con-inner` wrap rule (0,3,0).
 */
.e-con:has(> .elementor-widget-rat-deal-gallery),
.e-con.e-flex > .e-con-inner:has(> .elementor-widget-rat-deal-gallery) {
	flex-wrap: nowrap;
}

/*
 * Fallback for browsers that have container queries but not :has() - Firefox
 * 110 to 120. Dropping the grid to block flow makes every placement rule above
 * inert in one line, and natural-height images give the tiles real intrinsic
 * height, so the box cannot collapse. Loses the mosaic, keeps the page usable.
 */
@supports not (selector(:has(*))) {
	@container (max-width: 780px) {
		.rat-gallery {
			display: block;
			aspect-ratio: auto;
			height: auto;
		}

		.rat-gallery .rat-gallery__item {
			position: static;
			display: block;
			width: auto;
			height: auto;
			margin-bottom: var(--rat-gal-gap);
			aspect-ratio: auto;
			overflow: visible;
			clip-path: none;
			pointer-events: auto;
		}

		.rat-gallery .rat-gallery__spare {
			display: none;
		}

		.rat-gallery .rat-gallery__frame,
		.rat-gallery .rat-gallery__frame img {
			height: auto;
		}

		.rat-gallery .rat-gallery__btn {
			top: auto;
			bottom: var(--rat-gal-btn-offset);
		}
	}
}

/* Editor-only notice when the bound ACF field has nothing in it. */
.rat-gallery-empty {
	padding: 32px 24px;
	border: 1px dashed #C9C5D8;
	border-radius: 14px;
	background: #F6F5FA;
	color: #30303D;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.55;
	text-align: center;
}

.rat-gallery-empty code {
	padding: 1px 6px;
	border-radius: 4px;
	background: #E7E4F0;
	font-size: 13px;
}
