/*
 * Collection mosaic (home-4): one collection per slide (large image + two stacked images + white card), arrows at the
 * top right; below, text + block button on a full-width cream band.
 * The root is a 3-row grid: the slider spans rows 1–2, row 2 is exactly the card height and the band (::before)
 * starts there, so the band top always lines up with the card top. Content column = layout.content.
 * HTML reference only: the original theme lays the module out with block settings (collection-banner.wp.njk) and
 * rtthemes/collection-slider has its own CSS.
 */
.rt-collection-banner {
	--rt-collection-banner-card-height: 10.8125rem;
	--rt-collection-banner-arrow-size: 4rem;
	position: relative;
	isolation: isolate;
	display: grid;
	grid-template-columns:
		minmax(var(--rt-spacing-40), 1fr)
		minmax(0, var(--rt-layout-wide, 76.25rem))
		minmax(var(--rt-spacing-40), 1fr);
	grid-template-rows: auto var(--rt-collection-banner-card-height) auto;
	padding-block-start: var(--rt-spacing-70);
}

/* Cream band: from the card top down to the bottom of the section, full width */
.rt-collection-banner::before {
	content: "";
	z-index: -1;
	grid-column: 1 / -1;
	grid-row: 2 / 4;
	background-color: var(--rt-collection-banner-band);
}

.rt-collection-banner__slider {
	position: relative;
	grid-column: 2;
	grid-row: 1 / 3;
	min-width: 0;
}

.rt-collection-banner__track {
	display: grid;
	grid-auto-columns: 100%;
	grid-auto-flow: column;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.rt-collection-banner__track::-webkit-scrollbar {
	display: none;
}

/* Slide: 1220×748, large image on the left (610), two 610×373 images on the right with a 2px gap */
.rt-collection-banner__slide {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
	row-gap: 0.125rem;
	aspect-ratio: 1220 / 748;
	scroll-snap-align: start;
}

.rt-collection-banner .rt-collection-banner__image {
	position: relative;
	margin: 0;
	overflow: hidden;
}

.rt-collection-banner .rt-collection-banner__image img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rt-collection-banner__image--main {
	grid-column: 1;
	grid-row: 1 / 3;
}

/* The card covers the bottom of the large image; stopping the image 1px short keeps its antialiased edge from peeking out below the card at fractional heights */
.rt-collection-banner .rt-collection-banner__image--main img {
	height: calc(100% - 1px);
}

.rt-collection-banner__image--top {
	grid-column: 2;
	grid-row: 1;
}

.rt-collection-banner__image--bottom {
	grid-column: 2;
	grid-row: 2;
}

/* Card over the bottom of the large image: 610×173, text 32px from the left, title 46px above the bottom */
.rt-collection-banner__card {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	grid-column: 1;
	grid-row: 2;
	align-self: end;
	box-sizing: border-box;
	min-block-size: var(--rt-collection-banner-card-height);
	padding: var(--rt-spacing-30) 2rem 2.875rem;
	background-color: var(--rt-color-base);
	color: var(--rt-color-contrast);
}

.rt-collection-banner .rt-collection-banner__count {
	margin: 0;
	font-size: var(--rt-font-size-base);
	line-height: 1.25;
}

.rt-collection-banner .rt-collection-banner__title {
	margin: 0;
	padding-block-start: 0.125rem;
	color: var(--rt-color-contrast);
	font-family: var(--rt-font-family-body);
	font-size: var(--rt-font-size-x-large);
	font-weight: var(--rt-font-weight-regular);
	line-height: 1.25;
}

.rt-collection-banner__title a {
	color: inherit;
	text-decoration: none;
}

/* The title link covers the whole card */
.rt-collection-banner__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.rt-collection-banner__title a:hover,
.rt-collection-banner__title a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

.rt-collection-banner__title a:focus-visible {
	outline: none;
}

.rt-collection-banner__title a:focus-visible::after {
	outline: 2px solid var(--rt-color-accent);
	outline-offset: -2px;
}

/* Arrows (JS): two 64px white squares at the top right, next above previous */
.rt-collection-banner__arrows {
	position: absolute;
	z-index: 2;
	top: 0;
	right: 0;
	display: flex;
	flex-direction: column;
}

.rt-collection-banner__arrow {
	position: relative;
	width: var(--rt-collection-banner-arrow-size);
	height: var(--rt-collection-banner-arrow-size);
	margin: 0;
	padding: 0;
	border: 0;
	background-color: var(--rt-color-base);
	color: var(--rt-collection-banner-arrow);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.rt-collection-banner__arrow::before {
	content: "";
	position: absolute;
	inset: 0;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 14'%3E%3Cpath d='M1.5 1.5l5.5 5.5-5.5 5.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 50% 50% / 0.5625rem 0.875rem no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 14'%3E%3Cpath d='M1.5 1.5l5.5 5.5-5.5 5.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 50% 50% / 0.5625rem 0.875rem no-repeat;
}

.rt-collection-banner__arrow--prev::before {
	scale: -1 1;
}

.rt-collection-banner__arrow:hover,
.rt-collection-banner__arrow:focus-visible {
	background-color: var(--rt-color-accent);
	color: var(--rt-color-on-accent);
}

.rt-collection-banner__arrow:focus-visible {
	outline: 2px solid var(--rt-color-contrast);
	outline-offset: -2px;
}

/* Footer on the band: text (636px, 18/26) left, block button right; 77px below the card, 101px to the band bottom */
.rt-collection-banner__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--rt-spacing-40) var(--rt-spacing-50);
	grid-column: 2;
	grid-row: 3;
	padding-block: 4.8125rem 6.3125rem;
}

.rt-collection-banner .rt-collection-banner__text {
	flex: 0 1 39.75rem;
	margin: 0;
	color: var(--rt-color-contrast);
	font-size: var(--rt-font-size-base-plus);
	line-height: 1.625rem;
}

.rt-collection-banner .rt-collection-banner__actions {
	flex: none;
	margin: 0;
}

@media (prefers-reduced-motion: reduce) {
	.rt-collection-banner__arrow {
		transition: none;
	}
}

@media (width <= 64rem) {
	.rt-collection-banner {
		--rt-collection-banner-card-height: 8.5rem;
	}

	.rt-collection-banner__card {
		padding: var(--rt-spacing-30) var(--rt-spacing-40) var(--rt-spacing-40);
	}

	.rt-collection-banner__footer {
		padding-block: var(--rt-spacing-60) var(--rt-spacing-70);
	}
}

/* Mobile: the two small images side by side on top, the large image with its card below (the band still starts at the card) */
@media (width <= 37.5rem) {
	.rt-collection-banner {
		--rt-collection-banner-card-height: 6.5rem;
		--rt-collection-banner-arrow-size: 2.75rem;
		padding-block-start: var(--rt-spacing-60);
	}

	.rt-collection-banner__slide {
		grid-template-rows: auto auto;
		gap: 0.125rem;
		aspect-ratio: auto;
	}

	.rt-collection-banner__image--top,
	.rt-collection-banner__image--bottom {
		grid-row: 1;
		aspect-ratio: 610 / 373;
	}

	.rt-collection-banner__image--top {
		grid-column: 1;
	}

	.rt-collection-banner__image--main {
		grid-column: 1 / 3;
		grid-row: 2;
		aspect-ratio: 610 / 748;
	}

	.rt-collection-banner__card {
		grid-column: 1 / 3;
		padding: var(--rt-spacing-30) var(--rt-spacing-40) var(--rt-spacing-40);
	}

	.rt-collection-banner .rt-collection-banner__count {
		font-size: var(--rt-font-size-small);
	}

	.rt-collection-banner .rt-collection-banner__title {
		font-size: var(--rt-font-size-large);
	}

	/* Arrows in a row: previous, next */
	.rt-collection-banner__arrows {
		flex-direction: row;
	}

	.rt-collection-banner__arrow--prev {
		order: -1;
	}

	.rt-collection-banner__footer {
		flex-direction: column;
		align-items: flex-start;
		padding-block: var(--rt-spacing-50) var(--rt-spacing-60);
	}

	.rt-collection-banner .rt-collection-banner__text {
		flex: none;
		font-size: var(--rt-font-size-base);
		line-height: 1.5;
	}
}
