/* ==========================================================================
   COCKTAIL RECIPE — /kokteil/<slug>/

   Redesigned 19.11.2026 from the client's sample (docx "19.11 muudatused"
   p.3, image8): one composition instead of a hero and a recipe a screen
   apart. The photograph on the left, and beside it, in reading order, the
   eyebrow, the name, the introduction, Koostisosad, Valmistamine,
   Kaunistamine and the products the drink uses, each section closed off from
   the next by a hairline.

   Shell: WIDE (docs/layout-system.md), so the trail and the photograph start
   where the logo starts. The written column keeps a reading measure (720) of
   its own; it is not stretched to the rail.

   The photograph is never cropped. Its proportion arrives as --ktl-ratio on
   .cocktail-layout (avallone_cocktail_photo_ratio()), and its column is as
   wide as the picture drawn at the height the window allows — so a square,
   the landscape Vampire's Kiss and any portrait photo each fill their frame
   exactly, never letterboxed, and on a short laptop window the whole picture
   is in view beside the recipe instead of being cut by the fold. It stays in
   view (sticky) while a long recipe scrolls past it.

   Colour, type and radii are the theme's tokens: Libre Caslon for the name
   and the section headings, Work Sans for the recipe, the ink dark button.
   ========================================================================== */

.cocktail {
	/* The main bar is the sticky part of the header: 80px + its 1px rule
	   (components/header.css), plus the admin bar for a logged-in editor. */
	--ktl-bar: calc(81px + var(--wp-admin--admin-bar--height, 0px));
	--ktl-stick: calc(var(--ktl-bar) + var(--space-md));
	/* The tallest the photograph may be and still be seen whole in the first
	   view: the window less what stands above it on arrival — announcement,
	   utility and main bars (~154) and the trail (~56–80) — and a margin.
	   1440 x 900 → 650 (the 46% column, 603, decides), 1366 x 633 → 383,
	   1280 x 585 → 335. Once scrolled it stays in view (sticky, below). */
	--ktl-photo-h: max(300px, calc(100svh - 250px));
	--ktl-rule: 1px solid var(--color-border);
	--ktl-section-pad: clamp(16px, 2.6vh, 24px);

	padding-block-end: var(--space-lg);
}

/* --------------------------------------------------------------------------
   TRAIL — the product page's breadcrumb look (single-product.css), scoped.
   -------------------------------------------------------------------------- */

.cocktail-crumbs {
	margin: clamp(16px, calc(4vh - 4px), 32px) 0 clamp(16px, 3vh, 32px);
	font-family: var(--font-ui);
	font-weight: 500;
	font-size: 12px;
	line-height: 16px;
	color: var(--color-text-secondary);
}

.cocktail-crumbs__list {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cocktail-crumbs__item {
	min-width: 0;
}

.cocktail-crumbs__item + .cocktail-crumbs__item::before {
	content: '\203A';
	padding-inline: var(--space-xs);
	opacity: 0.6;
}

.cocktail-crumbs a {
	color: inherit;
	text-decoration: none;
	transition: color var(--transition-base);
}

.cocktail-crumbs a:hover {
	color: var(--color-primary);
}

.cocktail-crumbs__item--current {
	color: var(--color-ink);
	overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   LAYOUT

   Phone: name, photograph, recipe — one column, in that order.
   From 768: the photograph spans both rows on the left; the name and the
   recipe stack on the right.
   -------------------------------------------------------------------------- */

.cocktail-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		'head'
		'media'
		'body';
	row-gap: var(--space-md);
}

/* No photograph: no empty row (and no doubled gap) where it would stand. */
.cocktail-layout--no-photo {
	grid-template-areas:
		'head'
		'body';
}

.cocktail-head {
	grid-area: head;
	min-width: 0;
}

.cocktail-media {
	grid-area: media;
	min-width: 0;
	margin: 0;
	/* Never taller than most of the screen: a square stays the full width,
	   a portrait photo narrows and is centred rather than filling a screen. */
	width: min(100%, calc(70svh * var(--ktl-ratio, 1)));
	justify-self: center;
}

.cocktail-body {
	grid-area: body;
	min-width: 0;
	/* The product row's layout follows the column's width, not the window's. */
	container: ktl-body / inline-size;
}

.cocktail-media__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--ktl-ratio, 1);
	/* The proportion is the photograph's own, so cover crops nothing; it only
	   guards the 1:2 … 2:1 clamp for an extreme upload. */
	object-fit: cover;
	border-radius: var(--radius-lg);
	background-color: var(--color-surface-light);
}

/* --------------------------------------------------------------------------
   HEAD — eyebrow, name, introduction
   -------------------------------------------------------------------------- */

/* The archive's eyebrow (cocktails.css), with its rule after the words as in
   the client's sample. Inline, so on a phone a two-line badge ("Signatuur-
   kokteilid by Kristo Tomingas") carries the rule after its last word rather
   than pushing it to the far edge. */
.cocktail-head__eyebrow {
	margin: 0 0 var(--space-sm);
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 13px;
	line-height: 18px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-ink);
}

.cocktail-head__eyebrow::after {
	content: '';
	display: inline-block;
	width: 48px;
	height: 1px;
	margin-inline-start: var(--space-sm);
	vertical-align: middle;
	background-color: var(--color-ink);
}

/* A badge long enough to wrap keeps its words and drops the rule, which would
   otherwise stand alone on a line of its own. */
.cocktail-head__eyebrow--long::after {
	content: none;
}

.cocktail-head__title {
	margin: 0;
	font-family: var(--font-heading);
	font-style: normal;
	font-weight: 400;
	/* 34 on a phone, 50 at 1440, 60 at 1920. */
	font-size: clamp(34px, calc(2.2vw + 18px), 60px);
	line-height: 1.08;
	letter-spacing: -0.015em;
	color: var(--color-ink);
	overflow-wrap: break-word;
	hyphens: manual;
}

/* Names over 28 characters, so they take two or three lines, not five. */
.cocktail-head__title--long {
	font-size: clamp(28px, calc(1.5vw + 16px), 46px);
	line-height: 1.12;
}

.cocktail-head__intro {
	max-width: 60ch;
	margin: var(--space-sm) 0 0;
	font-family: var(--font-heading);
	font-style: italic;
	font-weight: 400;
	font-size: 17px;
	line-height: 1.6;
	color: var(--color-text);
}

/* Preparation time and difficulty, when an editor gives them: one quiet line. */
.cocktail-head__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 4px var(--space-md);
	margin: var(--space-sm) 0 0;
	font-family: var(--font-ui);
	font-size: 14px;
	line-height: 20px;
}

.cocktail-head__fact {
	display: flex;
	gap: 6px;
}

.cocktail-head__fact dt {
	color: var(--color-text-secondary);
}

.cocktail-head__fact dd {
	margin: 0;
	font-weight: 500;
	color: var(--color-ink);
}

/* --------------------------------------------------------------------------
   SECTIONS — Koostisosad, Valmistamine, Kaunistamine, Baarmeni nipp, products

   A hairline between two sections, never above the first or below the last,
   so a missing section leaves no doubled or dangling rule.
   -------------------------------------------------------------------------- */

.cocktail-section {
	padding-block: var(--ktl-section-pad);
}

.cocktail-section:first-child {
	padding-block-start: 0;
}

.cocktail-section:last-child {
	padding-block-end: 0;
}

.cocktail-section + .cocktail-section {
	border-block-start: var(--ktl-rule);
}

.cocktail-section__heading {
	margin: 0 0 12px;
	font-family: var(--font-heading);
	font-style: normal;
	font-weight: 400;
	font-size: 24px;
	line-height: 1.2;
	color: var(--color-ink);
}

.cocktail-section__text {
	margin: 0;
	font-family: var(--font-ui);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.65;
	color: var(--color-ink);
	overflow-wrap: break-word;
}

.cocktail-section__text + .cocktail-section__text {
	margin-block-start: 12px;
}

/* --------------------------------------------------------------------------
   INGREDIENTS — "60 ml Crystal Head Onyx", one bullet each
   -------------------------------------------------------------------------- */

.cocktail-ingredients {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cocktail-ingredients__row {
	position: relative;
	padding-inline-start: 20px;
	font-family: var(--font-ui);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.6;
	color: var(--color-ink);
	overflow-wrap: break-word;
}

/* The bullet: the brand red, centred on the first line. */
.cocktail-ingredients__row::before {
	content: '';
	position: absolute;
	inset-inline-start: 4px;
	inset-block-start: calc(0.8em - 2.5px);
	width: 5px;
	height: 5px;
	border-radius: var(--radius-pill);
	background-color: var(--color-primary);
}

.cocktail-ingredients__amount {
	margin-inline-end: 0.3em;
	font-weight: 600;
	white-space: nowrap;
}

/*
 * An ingredient that is a product the shop shows. Ink like its neighbours, so
 * the list stays one list; the underline and the hover colour say it opens.
 */
.cocktail-ingredients__link {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
	transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.cocktail-ingredients__link:hover,
.cocktail-ingredients__link:focus-visible {
	color: var(--color-primary);
	text-decoration-color: currentColor;
}

/* --------------------------------------------------------------------------
   METHOD — numbered only when an editor writes it as several steps
   -------------------------------------------------------------------------- */

.cocktail-steps {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding-inline-start: 1.4em;
	font-family: var(--font-ui);
	font-size: 16px;
	line-height: 1.65;
	color: var(--color-ink);
}

.cocktail-steps__step {
	padding-inline-start: 4px;
	overflow-wrap: break-word;
}

.cocktail-steps__step::marker {
	font-weight: 600;
	color: var(--color-primary);
}

.cocktail-steps__title {
	display: block;
	font-weight: 600;
}

.cocktail-steps__text {
	display: block;
}

/* --------------------------------------------------------------------------
   PRODUCTS — small bottle | label + name | "Vaata toodet →"

   The whole row is the link: the button's ::after covers the row, so a touch
   lands anywhere on it. Below a 520px column (phones, a tablet's or a small
   laptop's narrower recipe column) the button moves under the name and takes
   that column's width.
   -------------------------------------------------------------------------- */

.cocktail-products__label {
	margin: 0 0 12px;
	font-family: var(--font-heading);
	font-style: italic;
	font-size: 16px;
	line-height: 1.4;
	color: var(--color-text);
}

.cocktail-products__list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cocktail-product {
	position: relative;
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) auto;
	grid-template-areas: 'media text link';
	align-items: center;
	column-gap: var(--space-md);
	row-gap: 12px;
	min-height: 88px;
	padding: 8px;
	border: 1px solid transparent;
	border-radius: var(--radius-button);
	transition: border-color var(--transition-base), background-color var(--transition-base);
}

.cocktail-product--no-image {
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas: 'text link';
	padding-inline-start: var(--space-sm);
}

.cocktail-product:hover {
	border-color: var(--color-border);
	background-color: var(--color-surface-light);
}

/* A plate the bottle stands in, whole (bottles are 3:4 portraits). */
.cocktail-product__media {
	grid-area: media;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 88px;
	padding: 6px;
	border-radius: var(--radius-sm);
	background-color: var(--color-surface-light);
}

.cocktail-product__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.cocktail-product__text {
	grid-area: text;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	padding-inline-start: var(--space-md);
	border-inline-start: var(--ktl-rule);
}

.cocktail-product--no-image .cocktail-product__text {
	padding-inline-start: 0;
	border-inline-start: 0;
}

.cocktail-product__label {
	font-family: var(--font-heading);
	font-style: italic;
	font-size: 15px;
	line-height: 1.4;
	color: var(--color-text);
}

.cocktail-product__name {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 18px;
	line-height: 1.3;
	color: var(--color-ink);
	overflow-wrap: break-word;
	transition: color var(--transition-base);
}

.cocktail-product:hover .cocktail-product__name {
	color: var(--color-primary);
}

.cocktail-product__stock {
	font-family: var(--font-ui);
	font-weight: 500;
	font-size: 13px;
	line-height: 18px;
	color: var(--color-primary-dark);
}

/* The ink button at a row's size: 48 tall, sentence case, arrow after. */
.cocktail-product__link {
	grid-area: link;
	gap: 10px;
	width: auto;
	min-height: 48px;
	padding: 12px 20px;
	font-size: 15px;
	line-height: 20px;
	white-space: nowrap;
}

/* The stretched target: the whole row opens the product. */
.cocktail-product__link::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: var(--radius-button);
}

/*
 * No press-shrink here. .btn:active scales the button, and a transform makes
 * the button the ::after's containing block: the target shrank to the button
 * on mousedown, so a press on the name or the picture released outside the
 * link and opened nothing (Playwright, all three engines, 19.11).
 */
.cocktail-product__link:active {
	transform: none;
}

.cocktail-product:hover .cocktail-product__link {
	background-color: var(--color-primary);
}

@container ktl-body (max-width: 519px) {

	.cocktail-product {
		grid-template-columns: 64px minmax(0, 1fr);
		grid-template-areas:
			'media text'
			'media link';
		align-items: start;
		column-gap: var(--space-sm);
		padding: 0;
		border: 0;
	}

	.cocktail-product--no-image {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			'text'
			'link';
	}

	.cocktail-product:hover {
		background-color: transparent;
	}

	.cocktail-product__media {
		width: 64px;
		height: 96px;
	}

	.cocktail-product__text {
		padding-inline-start: 0;
		border-inline-start: 0;
	}

	.cocktail-product__link {
		justify-self: stretch;
		width: 100%;
	}

	.cocktail-products__list {
		gap: var(--space-md);
	}
}

/* A tablet's or small laptop's recipe column: the button keeps its own width
   under the name rather than a 400px bar; phones keep the full-width target. */
@container ktl-body (min-width: 400px) and (max-width: 519px) {

	.cocktail-product__link {
		justify-self: start;
		width: auto;
	}
}

/* --------------------------------------------------------------------------
   < 600 — the trail keeps its path; the name is the heading right below it.
   -------------------------------------------------------------------------- */

@media (max-width: 599px) {

	.cocktail-crumbs__item--current {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   768 — photograph beside the recipe
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {

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

	.cocktail-layout {
		/* The photograph's column: its share of the rail, or narrower when the
		   window's height would otherwise cut the picture off. */
		--ktl-media-w: min(42%, calc(var(--ktl-photo-h) * var(--ktl-ratio, 1)));

		grid-template-columns: var(--ktl-media-w) minmax(0, 1fr);
		grid-template-rows: auto 1fr;
		grid-template-areas:
			'media head'
			'media body';
		column-gap: clamp(32px, 4.5vw, 80px);
		row-gap: clamp(20px, 3vh, 28px);
	}

	.cocktail-media {
		position: sticky;
		inset-block-start: var(--ktl-stick);
		align-self: start;
		width: 100%;
	}

	.cocktail-head,
	.cocktail-body {
		max-width: 720px;
	}

	/* No photograph: the recipe alone, at its reading measure. */
	.cocktail-layout--no-photo {
		grid-template-columns: minmax(0, 720px);
		grid-template-areas:
			'head'
			'body';
	}
}

@media (min-width: 1024px) {

	.cocktail-layout {
		--ktl-media-w: min(46%, calc(var(--ktl-photo-h) * var(--ktl-ratio, 1)));
	}
}

/* --------------------------------------------------------------------------
   Short laptop windows — the theme's short-window system. The name steps
   down so the recipe starts within the first view beside the photograph.
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) and (max-height: 880px) {

	.cocktail-head__title {
		font-size: clamp(34px, calc(1.6vw + 18px), 48px);
	}

	.cocktail-head__title--long {
		font-size: clamp(28px, calc(1.1vw + 16px), 38px);
	}

	.cocktail-section__heading {
		margin-block-end: 8px;
		font-size: 22px;
	}

	.cocktail-ingredients {
		gap: 2px;
	}
}
