/**
 * Whaler Unit Carousel
 *
 * Colours and fonts are the theme's own tokens, so the carousel inherits any
 * future change to them:
 *   --btn-green-bg   #3B826F   accent / arrows / eyebrow
 *   --title-color    #514947   headings
 *   --sub-title-color #3C3C3C  meta line
 * Fonts: geometos_softregular (headings, buttons), proxima_novaregular (text).
 */

.whaler-units {
	--wu-ink: var(--title-color, #514947);
	--wu-muted: var(--sub-title-color, #3C3C3C);
	--wu-accent: var(--btn-green-bg, #3B826F);
	--wu-line: #EBE6DF;
	--wu-card: #fff;
	margin: 0;
	/* The carousel is usually dropped inside a text block, which the theme
	   centres. Cards always read left-aligned. */
	text-align: left;
}

.whaler-units__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 24px;
}

.whaler-units__title {
	margin: 0;
	font-size: var(--title-3-size, 24px);
	color: var(--wu-ink);
	font-family: "geometos_softregular", sans-serif;
	text-align: left;
}

.whaler-units__nav {
	display: flex;
	gap: 10px;
	margin-left: auto;
	flex: 0 0 auto;
}

/* Arrows: a circle with a CSS chevron, matching the theme's round gallery
   arrows without needing inline SVG (which some content filters strip). */
.whaler-units__arrow {
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--wu-accent);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	position: relative;
	transition: background-color .2s, opacity .2s;
}

.whaler-units__arrow::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--wu-accent);
	border-bottom: 2px solid var(--wu-accent);
	transition: border-color .2s;
}

.whaler-units__arrow--next::before {
	transform: translate(-60%, -50%) rotate(-45deg);
}

.whaler-units__arrow--prev::before {
	transform: translate(-40%, -50%) rotate(135deg);
}

.whaler-units__arrow:hover {
	background-color: var(--wu-accent);
}

.whaler-units__arrow:hover::before {
	border-color: #fff;
}

.whaler-units__arrow.swiper-button-disabled {
	opacity: .3;
	cursor: default;
	background-color: transparent;
}

.whaler-units__arrow.swiper-button-disabled::before {
	border-color: var(--wu-accent);
}

.whaler-units__swiper {
	overflow: hidden;
}

.whaler-units__card {
	height: auto;
	background: var(--wu-card);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-sizing: border-box;
}

.whaler-units__img {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #EBE6DF;
}

.whaler-units__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}

.whaler-units__card:hover .whaler-units__img img {
	transform: scale(1.04);
}

.whaler-units__body {
	padding: 20px 22px 24px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

.whaler-units__eyebrow {
	margin: 0;
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--wu-accent);
	font-family: "geometos_softregular", sans-serif;
	line-height: 1.4;
}

.whaler-units__name {
	margin: 0;
	font-size: 20px;
	font-family: "geometos_softregular", sans-serif;
	color: var(--wu-ink);
}

.whaler-units__name a {
	color: var(--wu-ink);
	text-decoration: none;
}

.whaler-units__name a:hover {
	color: var(--wu-accent);
}

.whaler-units__meta {
	margin: 0 0 16px;
	color: var(--wu-muted);
	font-size: 16px;
	font-family: "proxima_novaregular", sans-serif;
}

/* Three classes, to win over the .btn-green sizing in the theme. */
.whaler-units .whaler-units__btn.btn {
	margin-top: auto;
	align-self: flex-start;
	display: inline-block;
	text-align: center;
	text-decoration: none;
	font-size: 14px;
	letter-spacing: .08em;
	text-transform: uppercase;
	line-height: 44px;
	height: 44px;
	padding: 0 22px;
	width: auto;
}

/* Before carousel.js runs, and if Swiper were ever missing, the track stays a
   plain horizontal scroller instead of a column of full-width cards. */
.whaler-units__swiper:not(.whaler-units--ready) {
	overflow-x: auto;
}

.whaler-units__swiper:not(.whaler-units--ready) .swiper-wrapper {
	display: flex;
	gap: 24px;
}

.whaler-units__swiper:not(.whaler-units--ready) .whaler-units__card {
	flex: 0 0 280px;
}

/* The theme's text block renders an empty <h2> plus a divider when the block
   has no Title. Hide that when the block holds only a carousel, which has its
   own heading. Progressive enhancement: without :has() support you simply see
   the divider. */
.area_center_section .area-head:has(.whaler-units) .title:has(h1:empty, h2:empty, h3:empty, h4:empty) {
	display: none;
}

@media (max-width: 767px) {
	.whaler-units__head {
		margin-bottom: 18px;
	}

	.whaler-units__title {
		font-size: 20px;
	}
}
