/* ==========================================================================
   KOKTEILID — the cocktail archive
   --------------------------------------------------------------------------
   Measured off the archive frame in UI Final: a three-column mosaic with a
   24px gutter where the large tile spans two columns, an active filter pill in
   --color-primary standing 32px tall, and a hero whose second photograph
   overlaps the first from the left.

   The frame draws the page on 48px gutters. The site's container is locked at
   64px and 1312, so the container is the site's and the proportions inside it
   are the frame's — three columns, one gutter, the large tile across two.

   Every selector is scoped to .cocktails / .cocktail-card. Nothing generic
   from the reference implementation (.hero, .card, .gallery) exists here.
   ========================================================================== */

.cocktails {
	padding-block-end: var(--space-2xl);
}

/* --------------------------------------------------------------------------
   HERO
   -------------------------------------------------------------------------- */

/*
 * 48 above and below rather than 80 and 64: the client found the cocktail
 * pages too long, with too much unused space (3.11.2026 p12) — at 1180 x 540
 * the hero alone was 590px and the first cocktail began 300px below the fold.
 */
.cocktails-hero {
	padding-block: var(--space-lg);
}

.cocktails-hero__inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-xl);
}

.cocktails-hero__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-md);
	min-width: 0;
}

.cocktails-hero__eyebrow {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	margin: 0;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-ink);
}

.cocktails-hero__rule {
	display: block;
	flex-shrink: 0;
	width: 48px;
	height: 1px;
	background-color: var(--color-ink);
}

.cocktails-hero__title {
	margin: 0;
	font-family: var(--font-heading);
	font-style: normal;
	font-weight: 400;
	font-size: 44px;
	line-height: 1.05;
	letter-spacing: -0.022em;
	color: var(--color-ink);
}

.cocktails-hero__intro {
	max-width: 46ch;
	margin: 0;
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.45;
	color: var(--color-ink);
}

.cocktails-hero__link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	min-height: 44px;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--color-ink);
	text-decoration: none;
	transition: color var(--transition-base);
}

.cocktails-hero__link:hover {
	color: var(--color-primary);
}

.cocktails-hero__link svg {
	flex-shrink: 0;
	transition: transform var(--transition-base);
}

.cocktails-hero__link:hover svg {
	transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   HERO MEDIA

   Two photographs, the second overlapping the first from the left. The overlap
   is a percentage of the media column rather than a fixed offset, so it holds
   its proportion at every width instead of drifting apart on a wide screen.
   -------------------------------------------------------------------------- */

.cocktails-hero__media {
	position: relative;
	min-width: 0;
}

.cocktails-hero__figure {
	overflow: hidden;
	border-radius: var(--radius-button);
}

/* Landscape while the hero is one stacked column: a portrait photograph at the
   full container width would push the filter row most of a screen down. The
   frame's 4:5 arrives with the two-column layout, below. */
.cocktails-hero__figure--main {
	aspect-ratio: 4 / 3;
	box-shadow: var(--shadow-lg);
}

.cocktails-hero__figure--second {
	position: absolute;
	inset-inline-start: 0;
	inset-block-start: 18%;
	/* Sized so it stays inside the landscape photograph behind it; the frame's
	   larger proportion arrives with the portrait ratio at 1024. */
	width: 44%;
	aspect-ratio: 3 / 4;
	/* The cream border is what lifts it off the photograph behind it. */
	border: 8px solid var(--color-cream);
	box-shadow: var(--shadow-md);
}

.cocktails-hero__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * A single picture carries its own composition, so it gets none of the pair's
 * framing: no corner, no shadow, no ratio to be cropped to. It sets its own
 * height, which is also what gives the media column something to stand on.
 */
.cocktails-hero__figure--single {
	border-radius: 0;
}

.cocktails-hero__figure--single .cocktails-hero__image {
	height: auto;
	object-fit: contain;
}

/* --------------------------------------------------------------------------
   FILTER

   Real links. Inactive is the outlined control, active is the filled primary,
   and both are the same height — the active state changes colour and weight,
   never the box, so choosing a spirit cannot make the row jump.
   -------------------------------------------------------------------------- */

/* 24 above and below the row rather than 48 (client 3.11.2026 p12). */
.cocktails-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-sm) var(--space-md);
	padding-block: var(--space-md);
	border-block-start: 1px solid var(--color-border);
}

.cocktails-filters__label {
	margin: 0;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-ink);
	white-space: nowrap;
}

.cocktails-filters__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xs);
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
}

.cocktails-filters__pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* 44px of target around a 32px control, so the row stays tappable without
	   the pills themselves growing past what the frame draws. */
	min-height: 32px;
	/* 20px line + 10px padding + 2px border = the frame's 32. */
	padding: 5px 20px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-pill);
	background-color: transparent;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 13px;
	line-height: 20px;
	color: var(--color-ink);
	text-decoration: none;
	white-space: nowrap;
	transition:
		background-color var(--transition-base),
		border-color var(--transition-base),
		color var(--transition-base);
}

.cocktails-filters__pill:hover {
	border-color: var(--color-primary);
	color: var(--color-primary);
}

.cocktails-filters__pill.is-active {
	border-color: var(--color-primary);
	background-color: var(--color-primary);
	color: var(--color-on-dark);
}

/* --------------------------------------------------------------------------
   MOSAIC

   Three columns with a 24px gutter. The large tile takes two of them and the
   other two stack in the third. Which side the large tile sits on alternates
   per group, and that decision is made on the server — see grid.php.
   -------------------------------------------------------------------------- */

.cocktails-mosaic {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.cocktails-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-md);
}

.cocktails-stack {
	display: grid;
	grid-template-rows: 1fr 1fr;
	gap: var(--space-md);
	min-height: 0;
}

/* --------------------------------------------------------------------------
   CARD
   -------------------------------------------------------------------------- */

.cocktail-card {
	position: relative;
	/* Grid items default to min-height:auto, which lets content win over the
	   track size. Both are needed for the row's ratio to hold. */
	min-width: 0;
	min-height: 0;
}

.cocktail-card__link {
	position: relative;
	display: block;
	height: 100%;
	overflow: hidden;
	border-radius: var(--radius-button);
	background-color: var(--color-surface-light);
	color: var(--color-on-dark);
	text-decoration: none;
}

/*
 * Absolutely positioned rather than a block in flow. In flow the photograph
 * contributes its own intrinsic height, which overrides the row's aspect ratio
 * and stretches a 672px row to whatever the source image happens to be — the
 * mosaic ends up taller than the viewport. Taking the media out of flow leaves
 * the row's ratio as the only thing deciding the height.
 */
.cocktail-card__media {
	position: absolute;
	inset: 0;
	display: block;
}

.cocktail-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--transition-slow);
}

/*
 * The gradient stops short of the top so the photograph is still a photograph.
 * Dark enough to read white type over the lower third, not so dark that every
 * cocktail turns into the same grey rectangle.
 */
.cocktail-card__body {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: var(--space-md);
	background-image: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.72) 0%,
		rgba(0, 0, 0, 0.32) 42%,
		rgba(0, 0, 0, 0) 72%
	);
}

.cocktail-card__spirit {
	display: block;
	margin-block-end: var(--space-xs);
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 11px;
	line-height: 16px;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--color-on-dark);
}

.cocktail-card__title {
	margin: 0;
	font-family: var(--font-heading);
	font-style: normal;
	font-weight: 400;
	font-size: 22px;
	line-height: 1.25;
	color: var(--color-on-dark-pure);
}

.cocktail-card__text {
	display: -webkit-box;
	margin-block-start: var(--space-xs);
	/* The title is an h2 and so takes this from the reset; the description is a
	   span, because it sits inside the card's link, and so does not. Without it
	   a long unbroken word is sliced mid-glyph at the clip edge instead of
	   wrapping the way the title above it does. */
	overflow-wrap: break-word;
	max-width: 46ch;
	font-family: var(--font-ui);
	font-size: 15px;
	line-height: 1.5;
	color: color-mix(in srgb, var(--color-on-dark-pure) 82%, transparent);
	overflow: hidden;
	-webkit-box-orient: vertical;
	/* Two lines on a small tile, three on a large one. The description is
	   rendered on every card; where the tile is small it is clamped rather than
	   dropped. */
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.cocktail-card__link:hover .cocktail-card__image {
	transform: scale(1.03);
}

.cocktail-card__link:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

	.cocktail-card__image,
	.cocktails-hero__link svg {
		transition: none;
	}

	.cocktail-card__link:hover .cocktail-card__image {
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   LOAD MORE
   -------------------------------------------------------------------------- */

.cocktails-more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-sm);
	/* 48 rather than 80 (client 3.11.2026 p12). */
	padding-block-start: var(--space-lg);
}

.cocktails-more .btn.cocktails-more__button {
	width: auto;
	padding-inline: var(--space-lg);
}

.cocktails-more__count {
	margin: 0;
	font-family: var(--font-ui);
	font-weight: 500;
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-text-secondary);
}

/* A swap in progress: dimmed, but never showing the old results as if they
   were the new ones. */
.cocktails-results[aria-busy='true'] {
	opacity: 0.55;
	pointer-events: none;
	transition: opacity var(--transition-base);
}

/* --------------------------------------------------------------------------
   MOBILE — the mosaic becomes one column

   Every tile gets a real height of its own here, because a grid row that took
   its height from a sibling has nothing to take it from once the row is a
   single column.
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {

	.cocktail-card--large .cocktail-card__link {
		aspect-ratio: 4 / 3;
	}

	.cocktail-card--small .cocktail-card__link {
		aspect-ratio: 3 / 2;
	}

	/* The filter row scrolls sideways rather than growing to four lines. */
	.cocktails-filters__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-block-end: var(--space-xs);
		scrollbar-width: none;
	}

	.cocktails-filters__list::-webkit-scrollbar {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   TABLET AND UP
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {

	.cocktails-hero__title {
		font-size: 64px;
	}

	.cocktails-row {
		/* Three columns and a 24px gutter, from the frame. */
		grid-template-columns: repeat(3, minmax(0, 1fr));
		/* The frame's row is 1342 x 688; held as a ratio so it scales with the
		   container instead of being pinned to one width. */
		aspect-ratio: 1342 / 688;
	}

	.cocktails-row--start .cocktail-card--large {
		grid-column: 1 / span 2;
		grid-row: 1;
	}

	.cocktails-row--start .cocktails-stack {
		grid-column: 3;
		grid-row: 1;
	}

	.cocktails-row--end .cocktails-stack {
		grid-column: 1;
		grid-row: 1;
	}

	.cocktails-row--end .cocktail-card--large {
		grid-column: 2 / span 2;
		grid-row: 1;
	}

	/* A trailing group of one or two: equal tiles, no stretched large slot. */
	.cocktails-row--rest {
		aspect-ratio: auto;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.cocktails-row--rest .cocktail-card__link {
		aspect-ratio: 431 / 332;
	}

	.cocktail-card--large .cocktail-card__title {
		font-size: 30px;
	}

	.cocktail-card--large .cocktail-card__body {
		padding: var(--space-lg);
	}

	.cocktail-card--large .cocktail-card__text {
		-webkit-line-clamp: 3;
		line-clamp: 3;
	}
}

@media (min-width: 1024px) {

	.cocktails-hero__inner {
		display: grid;
		grid-template-columns: 1fr 1fr;
		align-items: center;
		gap: var(--space-xl);
	}

	/* No photographs, no second column — the text keeps its measure rather
	   than sitting beside a reserved gap. */
	.cocktails-hero__inner--text {
		grid-template-columns: minmax(0, 1fr);
	}

	.cocktails-hero__inner--text .cocktails-hero__text {
		max-width: 46ch;
	}

	/* The frame insets the media column so the overlapping photograph has room
	   to sit outside the main one without leaving the grid. */
	.cocktails-hero__media {
		padding-inline-start: 25%;
	}

	/* A composed picture already contains that offset, so insetting it again
	   would only make it smaller. */
	.cocktails-hero__media--single {
		padding-inline-start: 0;
	}

	/* 4:5 in the frame — a portrait photograph, once there is a column to hold
	   one without dominating the page. */
	.cocktails-hero__figure--main {
		aspect-ratio: 4 / 5;
	}

	/* Sized against the main photograph, as the frame draws it. */
	.cocktails-hero__figure--second {
		inset-block-start: 14%;
		width: 58%;
	}

	/* 64 rather than 84 (client 3.11.2026 p12): two lines of 84 were 176px
	   of the first screen on their own. */
	.cocktails-hero__title {
		font-size: 64px;
	}

	/*
	 * A composed picture is held to the window's height as well as the
	 * column — about the viewport less the header, the hero's own padding and
	 * a margin — so a short laptop screen is not filled by it; never below
	 * 320px. Pinned to the outer edge, level with the rail.
	 */
	.cocktails-hero__figure--single .cocktails-hero__image {
		width: auto;
		max-width: 100%;
		max-height: max(320px, 100svh - 230px);
		margin-inline-start: auto;
	}

	.cocktail-card--large .cocktail-card__title {
		font-size: 36px;
	}
}

@media (min-width: 1280px) {

	/* 72 rather than 96 (client 3.11.2026 p12) — on a short window. */
	.cocktails-hero__title {
		font-size: 72px;
	}
}

/*
 * A window as tall as the design's own 1440 x 900 frame has the room the
 * frame's 96px title was drawn for, so it keeps it; the compact size is for
 * the short laptop screens the client measured on (~1414 x 645). From 881,
 * where the short-laptop rule below ends (860 until 19.11.2026, when that
 * rule went from 820 to 880 and would otherwise have overridden this one
 * at 860-880 — independent QA note).
 */
@media (min-width: 1280px) and (min-height: 881px) {

	.cocktails-hero__title {
		font-size: 96px;
	}
}

/*
 * Short laptop windows (≥1024 wide, ≤880 tall — the client's ~1414 x 645):
 * the first row of cocktails should be at least partly on screen when the
 * page opens (QA round 1, 4.11.2026; client 3.11.2026 p12). At 1414 x 645 the
 * first card started at 714, 69px under the fold. Here the hero sits 24 from
 * the header and the filter row, its title is 56, its lines 16 apart, and the
 * composed picture is held to the height of the writing beside it (~300) —
 * which brings the first card up to ~540. Taller windows keep the layout
 * above unchanged.
 */
@media (min-width: 1024px) and (max-height: 880px) {

	.cocktails-hero {
		padding-block: var(--space-md);
	}

	.cocktails-hero__text {
		gap: var(--space-sm);
	}

	.cocktails-hero__title {
		font-size: 56px;
	}

	.cocktails-hero__figure--single .cocktails-hero__image {
		max-height: max(280px, 100svh - 340px);
	}

	.cocktails-filters {
		padding-block: var(--space-sm);
	}
}
