/* =============================================================
   Elite Pearl Charter — fleet section + yacht cards

   Same card anatomy as the live site (framed card, logo badge,
   keyword + underline, gradient title, AED price, 2x2 spec
   boxes, split footer buttons) with the finish tightened up.

   Grid: 1 col -> 2 (560px) -> 3 (1200px).
   ============================================================= */

.epc-fleet {
	background: var(--epc-black);
	color: var(--epc-silver);
}

.epc-fleet__inner {
	width: 100%;
	max-width: var(--epc-container);
	margin-inline: auto;
	padding: 4rem var(--epc-gutter);
}

@media (min-width: 768px) {
	.epc-fleet__inner {
		padding-block: 5.5rem;
	}
}

@media (min-width: 1200px) {
	.epc-fleet__inner {
		padding-block: 7rem;
	}
}

/* --- Intro band ------------------------------------------------ */

.epc-fleet__intro {
	max-width: 62rem;
	margin: 0 auto 3rem;
	text-align: center;
}

@media (min-width: 768px) {
	.epc-fleet__intro {
		margin-bottom: 4rem;
	}
}

.epc-fleet__heading {
	margin: 0;
	font-family: var(--epc-font-serif);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	font-size: clamp(1.75rem, 5.2vw, 3.25rem);
}

.epc-fleet__quote {
	margin: 1.5rem 0 0;
	padding: 0;
	border: 0;
}

.epc-fleet__quote p {
	margin: 0;
	padding-inline: 1.25rem;
	font-family: var(--epc-font-serif);
	font-size: clamp(1rem, 2.4vw, 1.375rem);
	font-style: italic;
	line-height: 1.7;
	color: var(--epc-nav-idle);
}

.epc-fleet__quote p::before,
.epc-fleet__quote p::after {
	content: "\201C";
	font-style: normal;
	color: var(--epc-grey);
}

.epc-fleet__quote p::after {
	content: "\201D";
}

/* --- Grid ------------------------------------------------------ */

.epc-fleet__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.75rem;
}

@media (min-width: 560px) {
	.epc-fleet__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.75rem;
	}
}

@media (min-width: 1200px) {
	.epc-fleet__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 2.25rem;
	}
}

/* =============================================================
   Card
   ============================================================= */

.epc-yacht {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: var(--epc-font-serif);
	color: var(--epc-white);
	background: var(--epc-gradient-surface);
	border-radius: 18px;

	/*
	 * The live card uses `border: 4px solid gray`, a flat mid-grey that reads as
	 * dirty against the black page. Same weight, but tied to the brand silver
	 * and translucent so it sits on the card rather than on top of it.
	 */
	border: 3px solid rgb(141 143 142 / 45%);

	/*
	 * Three shadow layers here and three on :hover. box-shadow only interpolates
	 * when both states have the SAME number of layers; resting on two and
	 * hovering on three makes the browser hard-swap instead of easing, which is
	 * a large part of why the hover felt abrupt.
	 */
	box-shadow:
		0 10px 30px rgb(0 0 0 / 35%),
		0 0 0 rgb(0 0 0 / 0%),
		inset 0 1px 0 rgb(255 255 255 / 6%);

	transition: transform 520ms var(--epc-ease-soft),
		border-color 520ms var(--epc-ease-soft),
		box-shadow 520ms var(--epc-ease-soft);
}

/*
 * Live card hovers with translateY(-12px) scale(1.08) rotateX(2deg), which
 * makes cards visibly collide with their neighbours and blurs the text mid
 * transition. A lift plus a brighter frame reads as premium without the wobble.
 */
.epc-yacht:hover,
.epc-yacht:focus-within {
	transform: translateY(-6px);
	border-color: rgb(255 255 255 / 65%);
	box-shadow:
		0 24px 54px rgb(0 0 0 / 50%),
		0 10px 24px rgb(0 0 0 / 38%),
		inset 0 1px 0 rgb(255 255 255 / 12%);
}

/* --- Media ------------------------------------------------------ */

.epc-yacht__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 800 / 434;
	background: var(--epc-ink-900);
}

.epc-yacht__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 760ms var(--epc-ease-soft);
}

.epc-yacht:hover .epc-yacht__img,
.epc-yacht:focus-within .epc-yacht__img {
	transform: scale(1.06);
}

/* Logo badge, top-left, same as the live card. Kept small so it marks the
   photo without covering it. */
.epc-yacht__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 7px;
	background: var(--epc-black);
	border: 1px solid rgb(255 255 255 / 18%);
	border-radius: 50%;
	box-shadow: 0 2px 10px rgb(0 0 0 / 45%);
}

.epc-yacht__badge img {
	width: 100%;
	height: auto;
}

@media (min-width: 560px) {
	.epc-yacht__badge {
		width: 50px;
		height: 50px;
		padding: 8px;
	}
}

@media (min-width: 1200px) {
	.epc-yacht__badge {
		top: 12px;
		left: 12px;
		width: 58px;
		height: 58px;
		padding: 9px;
	}
}

/* --- Body -------------------------------------------------------- */

.epc-yacht__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding-top: 1rem;
}

/* --- Keyword + underline ------------------------------------------ */

.epc-yacht__keyword-wrap {
	margin: 0 1.25rem 0.5rem;
	text-align: center;
}

.epc-yacht__keyword {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--epc-white);
}

/* Hairline that fades out at both ends. */
.epc-yacht__underline {
	display: block;
	width: min(180px, 70%);
	height: 1px;
	margin: 0.7rem auto 0;
	background: linear-gradient(
		to right,
		transparent 0%,
		rgb(255 255 255 / 55%) 50%,
		transparent 100%
	);
}

/* --- Title --------------------------------------------------------- */

/*
 * Sized so titles sit on one line. The longest is "Elite 62 FT Lucky Star" at
 * 22 characters, roughly 13.3em wide in Cardo bold, so each step below is set
 * against the card width that column count actually gives us. balance keeps any
 * rare overflow splitting evenly rather than dropping one orphan word.
 */
.epc-yacht__title {
	margin: 0.85rem 1.25rem 0;
	font-family: var(--epc-font-serif);
	font-size: clamp(1.125rem, 4.5vw, 1.5rem);
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	text-wrap: balance;
}

/* Two columns — the narrowest cards on the site. */
@media (min-width: 560px) and (max-width: 1199.98px) {
	.epc-yacht__title {
		font-size: clamp(0.8125rem, 2.5vw, 1.5rem);
	}
}

/* Three columns. */
@media (min-width: 1200px) {
	.epc-yacht__title {
		font-size: 1.375rem;
	}
}

@media (min-width: 1536px) {
	.epc-yacht__title {
		font-size: 1.5rem;
	}
}

.epc-yacht__title a {
	background: var(--epc-gradient-title);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	text-decoration: none;
}

/* Makes the whole card clickable from a single link. */
.epc-yacht__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* --- Price ---------------------------------------------------------- */

.epc-yacht__price {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.75rem 1.25rem 0;
	line-height: 1;
}

.epc-yacht__aed {
	width: 26px;
	height: auto;
	flex-shrink: 0;
}

.epc-yacht__price-now {
	font-size: 1.375rem;
	font-weight: 700;
	color: var(--epc-white);
}

.epc-yacht__price-now--request {
	font-size: 1.0625rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--epc-silver);
}

/* Sits tight to the figure and stays muted, so the number still leads. */
.epc-yacht__unit {
	margin-left: -0.2rem;
	font-family: var(--epc-font-sans);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--epc-silver);
}

.epc-yacht__price-was {
	font-size: 0.9375rem;
	color: var(--epc-grey);
	text-decoration-thickness: 1px;
}

/* --- Spec boxes ------------------------------------------------------ */

.epc-yacht__specs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 1.5rem 1.25rem;
	padding: 0;
	list-style: none;
}

/*
 * An odd number of spec boxes (the fishing boats carry no cabin count) would
 * leave the last one at half width with a gap beside it, so it spans the row.
 */
.epc-yacht__spec:last-child:nth-child(odd) {
	grid-column: 1 / -1;
}

.epc-yacht__spec {
	display: grid;
	place-items: center;
	min-height: 48px;
	padding: 0.6rem 0.6rem;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.35;
	text-align: center;
	text-transform: uppercase;
	color: var(--epc-white);
	background: var(--epc-ink-800);

	/*
	 * The live boxes use `border: 3px groove` — a 1990s bevel that renders as a
	 * muddy double line. A hairline plus an inset highlight gives the same
	 * raised feel, cleanly.
	 */
	border: 1px solid rgb(255 255 255 / 16%);
	border-radius: 8px;
	box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%);

	transition: background-color 460ms var(--epc-ease-soft),
		border-color 460ms var(--epc-ease-soft);
}

.epc-yacht:hover .epc-yacht__spec,
.epc-yacht:focus-within .epc-yacht__spec {
	background: var(--epc-ink-700);
	border-color: rgb(255 255 255 / 30%);
}

@media (min-width: 1200px) {
	.epc-yacht__spec {
		min-height: 52px;
		padding-block: 0.7rem;
		font-size: 0.75rem;
	}
}

/* --- Footer buttons --------------------------------------------------- */

.epc-yacht__buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin-top: auto;
	border-top: 1px solid rgb(255 255 255 / 20%);
}

.epc-yacht__btn {
	position: relative;
	z-index: 2;
	padding: 1.05rem 0.75rem;
	font-family: var(--epc-font-serif);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--epc-white);
	background: var(--epc-black);
	overflow: hidden;
	transition: color 460ms var(--epc-ease-soft);
}

.epc-yacht__btn + .epc-yacht__btn {
	border-left: 1px solid rgb(255 255 255 / 20%);
}

/* Wipe that fills from the left, instead of a hard background swap. */
.epc-yacht__btn::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--epc-gradient-title);
	transform: translateX(-101%);
	transition: transform 560ms var(--epc-ease-soft);
}

.epc-yacht__btn:hover::before,
.epc-yacht__btn:focus-visible::before {
	transform: translateX(0);
}

.epc-yacht__btn:hover,
.epc-yacht__btn:focus-visible {
	color: var(--epc-black);
}

.epc-yacht__btn span {
	position: relative;
	z-index: 1;
}

.epc-yacht__btn:focus-visible {
	outline: 2px solid var(--epc-white);
	outline-offset: -3px;
}

@media (min-width: 1200px) {
	.epc-yacht__btn {
		font-size: 0.875rem;
		padding-block: 1.15rem;
	}
}

/* Narrow phones — stack so the labels never truncate. */
@media (max-width: 380px) {
	.epc-yacht__buttons {
		grid-template-columns: 1fr;
	}

	.epc-yacht__btn + .epc-yacht__btn {
		border-left: 0;
		border-top: 1px solid rgb(255 255 255 / 20%);
	}
}

/* --- Reduced motion ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.epc-yacht,
	.epc-yacht__img,
	.epc-yacht__spec,
	.epc-yacht__btn,
	.epc-yacht__btn::before {
		transition-duration: 0.01ms !important;
	}

	.epc-yacht:hover,
	.epc-yacht:focus-within {
		transform: none;
	}

	.epc-yacht:hover .epc-yacht__img,
	.epc-yacht:focus-within .epc-yacht__img {
		transform: none;
	}
}

/* =============================================================
   Filler tile

   Closes off a short last row. Purely decorative, and shown only
   at the column counts that actually leave a gap.
   ============================================================= */

.epc-yacht-filler {
	display: none;
	position: relative;
	overflow: hidden;
	min-height: 260px;
	background-color: var(--epc-ink-950);
	border: 3px solid rgb(141 143 142 / 28%);
	border-radius: 18px;
}

/*
 * Never on mobile. The tile is display:none above and is only ever switched on
 * inside the two media queries below, both of which start at 768px, so there is
 * no width under 768px at which it can appear. That holds whatever the fleet
 * count is: even if a future count made the 560px two-column grid ragged, the
 * tile still will not show on a phone.
 */

/* 2 columns, tablet and up. */
@media (min-width: 768px) and (max-width: 1199.98px) {
	.epc-yacht-filler.is-2col {
		display: block;
	}
}

/* 3 columns. */
@media (min-width: 1200px) {
	.epc-yacht-filler.is-3col {
		display: block;
	}
}

/*
 * The diamond-and-circle motif, drawn as one inline SVG tile rather than an
 * image request. Brand monochrome: white at low opacity over the dark ground,
 * no gold.
 */
.epc-yacht-filler::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.09' stroke-width='1'%3E%3Ccircle cx='32' cy='32' r='21'/%3E%3Cpath d='M32 0v64M0 32h64'/%3E%3C/g%3E%3Cpath d='M32 16 Q33.4 30.6 48 32 Q33.4 33.4 32 48 Q30.6 33.4 16 32 Q30.6 30.6 32 16 Z' fill='%23ffffff' fill-opacity='0.14'/%3E%3C/svg%3E");
	background-repeat: repeat;
	background-size: 64px 64px;
}

/* Fades the pattern out towards the centre so the logo stays readable. */
.epc-yacht-filler::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(
		ellipse at center,
		rgb(11 12 16 / 92%) 0%,
		rgb(11 12 16 / 55%) 45%,
		rgb(11 12 16 / 0%) 78%
	);
}

.epc-yacht-filler__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	height: 100%;
	min-height: inherit;
	padding: 2rem 1.5rem;
	text-align: center;
}

/* The focal point of the panel, so it is deliberately large. */
.epc-yacht-filler__badge {
	display: grid;
	place-items: center;
	width: 116px;
	height: 116px;
	padding: 19px;
	background: var(--epc-black);
	border: 1px solid rgb(255 255 255 / 16%);
	border-radius: 50%;
	box-shadow: 0 4px 20px rgb(0 0 0 / 55%);
}

@media (min-width: 1200px) {
	.epc-yacht-filler__badge {
		width: 136px;
		height: 136px;
		padding: 22px;
	}
}

.epc-yacht-filler__badge img {
	width: 100%;
	height: auto;
}

.epc-yacht-filler__rule {
	display: block;
	width: 86px;
	height: 1px;
	background: linear-gradient(
		to right,
		transparent 0%,
		rgb(255 255 255 / 55%) 50%,
		transparent 100%
	);
}

.epc-yacht-filler__wordmark {
	margin: 0;
	font-family: var(--epc-font-serif);
	font-size: clamp(0.9375rem, 1.6vw, 1.125rem);
	font-weight: 600;
	letter-spacing: 0.14em;
	line-height: 1.3;
	text-transform: uppercase;
}

/* =============================================================
   Wide card — the last tile of a short grid

   A 7 yacht grid leaves two empty slots on the last row at three
   columns, and two filler tiles side by side read as yachts that
   failed to load rather than as a closing flourish. The final card
   takes the whole row instead and turns landscape: media on one
   side, the same body on the other. Below 700px there is no room
   to split it, so it falls back to the ordinary stacked card.
   ============================================================= */

.epc-yacht--wide {
	grid-column: 1 / -1;
}

@media (min-width: 700px) {
	.epc-yacht--wide {
		display: grid;
		grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
		align-items: stretch;
	}

	/*
	 * The media fills the column rather than holding the card's usual
	 * 800x434 box, so both sides finish at the same height whatever
	 * the body contains.
	 */
	.epc-yacht--wide .epc-yacht__media {
		height: 100%;
		min-height: 300px;
		aspect-ratio: auto;
	}

	/*
	 * The photo met the body panel on a hard vertical line, which read as
	 * two pasted rectangles rather than one card. A short fade on the
	 * inner edge carries the image into the panel colour instead.
	 */
	.epc-yacht--wide .epc-yacht__media::after {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 2;
		background: linear-gradient(90deg, transparent 48%, rgb(0 0 0 / 82%) 100%);
		pointer-events: none;
	}

	/*
	 * The box is wider than the photo's own ratio, so cover crops top and
	 * bottom. A marine shot puts its subject at or below the horizon, and a
	 * centred crop spends the frame on sky, so the crop is biased downward
	 * to hold the boat and the waterline.
	 */
	.epc-yacht--wide .epc-yacht__img {
		object-position: center 62%;
	}

	/*
	 * The card's surface gradient runs 135deg from black to silver. Across a
	 * 380px card it is almost all black; across a 1185px one the silver end
	 * lands squarely on the body panel and washes it out, which is what made
	 * this card look unfinished. The body lays its own dark gradient over the
	 * top, built from the same ink tokens, so the panel stays dark and the
	 * spec boxes and buttons keep their contrast.
	 */
	.epc-yacht--wide .epc-yacht__body {
		background: linear-gradient(150deg, var(--epc-ink-850) 0%, var(--epc-ink-950) 55%, var(--epc-black) 100%);
	}

	/*
	 * The buttons keep their margin-top: auto so they stay pinned to the
	 * bottom edge; an auto margin on the first child balances it, which
	 * centres everything above them in the space left over. Using
	 * justify-content: center instead would cancel the auto margin and
	 * leave a bare strip of card below the button row.
	 */
	.epc-yacht--wide .epc-yacht__body {
		padding-top: 1.75rem;
	}

	.epc-yacht--wide .epc-yacht__body > *:first-child {
		margin-top: auto;
	}

	.epc-yacht--wide .epc-yacht__title {
		margin-top: 1rem;
		font-size: clamp(1.375rem, 2.2vw, 1.75rem);
	}

	.epc-yacht--wide .epc-yacht__price {
		margin-top: 1rem;
	}

	/*
	 * One row of equal spec boxes: the wide body is roomy enough that
	 * the usual two column stack would leave large gaps. Overrides the
	 * odd count rule further up, which would otherwise stretch a third
	 * box across the full width.
	 */
	.epc-yacht--wide .epc-yacht__specs {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: minmax(0, 1fr);
		margin-block: 1.4rem 1.6rem;
	}

	.epc-yacht--wide .epc-yacht__spec:last-child:nth-child(odd) {
		grid-column: auto;
	}

}

@media (min-width: 1200px) {
	.epc-yacht--wide .epc-yacht__media {
		min-height: 340px;
	}

	.epc-yacht--wide .epc-yacht__body {
		padding-inline: 1.5rem;
	}

	.epc-yacht--wide .epc-yacht__keyword-wrap,
	.epc-yacht--wide .epc-yacht__title,
	.epc-yacht--wide .epc-yacht__price,
	.epc-yacht--wide .epc-yacht__specs {
		margin-inline: 1.5rem;
	}

	.epc-yacht--wide .epc-yacht__buttons {
		margin-inline: -1.5rem;
	}
}
