/* --- Hero -----------------------------------------------------------------
 * A photograph with the name of the thing on it. The veil is what makes the
 * text readable over a picture nobody has colour-graded: without it the
 * heading disappears into whatever the sky happened to be doing.
 */

.hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: min(78dvh, 42rem);
	background: var(--color-navy) center / cover no-repeat;
	color: var(--color-surface);
}

.hero__veil {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		color-mix(in srgb, var(--color-navy) 22%, transparent) 0%,
		color-mix(in srgb, var(--color-navy) 12%, transparent) 45%,
		color-mix(in srgb, var(--color-navy) 68%, transparent) 100%
	);
}

.hero__inner {
	position: relative;
	padding-bottom: calc(var(--space-xl) + var(--space-lg));
	text-align: center;
}

.hero__title {
	margin: 0 auto;
	max-width: 22ch;
	font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
	font-weight: var(--weight-light);
	line-height: var(--leading-tight);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--color-surface);
	text-wrap: balance;
}

.hero__text {
	max-width: 34rem;
	margin: var(--space-md) auto 0;
	font-size: var(--text-md);
	color: color-mix(in srgb, var(--color-surface) 86%, transparent);
}

/* --- Sections --------------------------------------------------------------- */

.home-section {
	padding-block: var(--space-section);
}

.home-section--tint {
	background: var(--color-surface-alt);
}

.home-section .section-title + .rule {
	margin-bottom: var(--space-xl);
}

/* --- Featured slider ------------------------------------------------------
 * The browser's own scroll with snap points: a finger swipe is native and
 * smooth, and the arrows only ask it to scroll. Three cards on a desktop;
 * on a phone one card fills most of the width and the next one shows at
 * the edge, so it reads as a row to move through.
 */

.slider__track {
	display: flex;
	gap: var(--space-lg);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}

.slider__track::-webkit-scrollbar {
	display: none;
}

.slider__track > * {
	flex: 0 0 calc((100% - 2 * var(--space-lg)) / 3);
	scroll-snap-align: start;
}

.slider__controls {
	display: flex;
	justify-content: center;
	gap: var(--space-sm);
	margin-top: var(--space-lg);
}

/* Nothing to move through: no arrows. Set by slider.js. */
.slider[data-static='true'] .slider__controls {
	display: none;
}

@media (max-width: 60rem) {
	/* The row runs to the screen edge, so the next card is cut by the
	   screen rather than by the page margin. */
	.slider__track {
		margin-inline: calc(var(--gutter) * -1);
		padding-inline: var(--gutter);
		scroll-padding-inline: var(--gutter);
	}

	.slider__track > * {
		flex-basis: 46%;
	}
}

@media (max-width: 40rem) {
	.slider__track > * {
		flex-basis: 85%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.slider__track {
		scroll-behavior: auto;
	}
}

/* The search bar already closes the hero with its own margin, and the first
   section brings a full section of padding on top of that. Only one of the
   two is kept, and at a smaller size, so the yachts follow the search. */
.has-hero .search-bar-wrap {
	margin-bottom: 0;
}

.search-bar-wrap + .home-section {
	padding-top: var(--space-xl);
}

.home-section__more {
	margin: var(--space-xl) 0 0;
	max-width: none;
	text-align: center;
}

.home-about__text {
	max-width: 40rem;
	margin-inline: auto;
	text-align: center;
	font-size: var(--text-lg);
	line-height: var(--leading-body);
	color: var(--color-ink-soft);
}

/* --- Regions -----------------------------------------------------------------
 * Each card borrows a photograph from a boat that sails there, so the set
 * shows three places rather than three coloured panels.
 */

.region-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: var(--space-md);
}

.region-card {
	display: block;
	text-decoration: none;
	color: inherit;
}

.region-card__frame {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	background: var(--color-navy);
}

.region-card__frame img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--speed-slow) var(--ease);
}

.region-card:hover .region-card__frame img {
	transform: scale(1.04);
}

.region-card__veil {
	position: absolute;
	inset: 0;
	background: color-mix(in srgb, var(--color-navy) 42%, transparent);
	transition: background var(--speed) var(--ease);
}

.region-card:hover .region-card__veil {
	background: color-mix(in srgb, var(--color-navy) 28%, transparent);
}

.region-card__name {
	position: relative;
	padding: var(--space-2xs) var(--space-sm);
	border-top: var(--border-hair) solid color-mix(in srgb, #fff 70%, transparent);
	border-bottom: var(--border-hair) solid color-mix(in srgb, #fff 70%, transparent);
	font-size: var(--text-lg);
	font-weight: var(--weight-light);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #fff;
}

.region-card__count {
	display: block;
	margin-top: var(--space-2xs);
	text-align: center;
	font-size: var(--text-xs);
	font-weight: var(--weight-label);
	letter-spacing: var(--track-label);
	text-transform: uppercase;
	color: var(--color-navy-soft);
}

/* --- Extra page content ------------------------------------------------------- */

.home-extra {
	max-width: var(--width-text);
	margin-inline: auto;
}

@media (max-width: 40rem) {

	/* On a phone the first screen is the picture and the search bar
	 * together, with the bar sitting on the fold. Its height is fixed here
	 * so the hero can be worked out from it rather than guessed at: the bar
	 * overlaps the hero by --space-lg and stands 4rem tall, so it protrudes
	 * 1.5rem, and 0.5rem more is left below it to show the screen ends
	 * there rather than being cut off.
	 *
	 * dvh rather than vh because the address bar hides and returns as you
	 * scroll, and vh always measures the taller of the two.
	 */
	.has-hero .hero {
		min-height: calc(100dvh - var(--header-height) - 2rem);
	}

	.has-hero .search-bar {
		height: 4rem;
		padding-block: 0;
	}

	.hero {
		min-height: 70dvh;
	}

	.hero__inner {
		padding-bottom: var(--space-xl);
	}

	.region-card__frame {
		aspect-ratio: 3 / 2;
	}
}

/* --- Closing call to action ------------------------------------------------
 * A dark panel inside the page margins rather than a full-width band, so it
 * reads as its own block and does not merge into the navy footer below.
 * Navy running into a deep parliament blue, a soft light at the far corner,
 * light grey for the reading text and white for what to do next.
 */

.home-cta {
	padding-top: var(--space-lg);
}

.home-cta__panel {
	position: relative;
	overflow: hidden;
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	gap: var(--space-xl);
	align-items: center;
	padding: var(--space-xl) clamp(var(--space-md), 5vw, 5rem);
	border-radius: var(--radius);
	background: linear-gradient(
		115deg,
		var(--color-navy) 0%,
		var(--color-navy) 40%,
		var(--color-navy-bright) 100%
	);
	color: var(--color-surface);
}

.home-cta__panel::after {
	content: '';
	position: absolute;
	top: -40%;
	right: -10%;
	width: 60%;
	height: 180%;
	background: radial-gradient(
		closest-side,
		color-mix(in srgb, var(--color-navy-bright) 60%, #ffffff 40%),
		transparent
	);
	opacity: 0.35;
	pointer-events: none;
}

.home-cta__copy,
.home-cta__actions {
	position: relative;
	z-index: 1;
}

.home-cta__eyebrow {
	margin: 0 0 var(--space-sm);
	color: color-mix(in srgb, var(--color-surface) 62%, var(--color-navy));
}

.home-cta__title {
	margin: 0;
	font-size: var(--text-2xl);
	font-weight: var(--weight-light);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #fff;
	text-wrap: balance;
}

/* On the dark ground the navy half of the rule would vanish. */
.home-cta__rule::before {
	background: var(--color-surface);
}

.home-cta__rule {
	margin-block: var(--space-md);
}

.home-cta__text {
	max-width: 34rem;
	margin: 0;
	color: color-mix(in srgb, var(--color-surface) 80%, var(--color-navy));
}

.home-cta__actions {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}

.home-cta__primary {
	background: var(--color-surface);
	border-color: var(--color-surface);
	color: var(--color-navy);
}

.home-cta__primary:hover {
	background: transparent;
	color: var(--color-surface);
}

.home-cta__call {
	margin: var(--space-2xs) 0 0;
	max-width: none;
	text-align: center;
	font-size: var(--text-sm);
	color: color-mix(in srgb, var(--color-surface) 70%, var(--color-navy));
}

.home-cta__call a {
	color: #fff;
	text-decoration: none;
	border-bottom: var(--border-hair) solid color-mix(in srgb, #fff 45%, transparent);
}

.home-cta__call a:hover {
	border-bottom-color: #fff;
}

@media (max-width: 60rem) {
	.home-cta__panel {
		grid-template-columns: 1fr;
		gap: var(--space-lg);
		text-align: center;
	}

	.home-cta__rule {
		margin-inline: auto;
	}

	.home-cta__text {
		margin-inline: auto;
	}
}
