/*
 * Moon & Milk 2026 — Christmas mode (0.1.88). Loaded only while Appearance > Customise >
 * Christmas mode is on, and never on basket, checkout or account pages (inc/christmas.php).
 *
 * Fonts stay the site's own: the serif for headings, the sans-serif for paragraphs, labels and
 * buttons. The logo and navigation are not touched. Nothing here moves or animates.
 *
 * Contrast (WCAG 2.2 AA):
 * - Cream #fbf1e3 on Cranberry #722836: 9.1:1 (text, button borders, focus outline).
 * - Cranberry on cream button: 9.1:1. Cranberry caption on Caption Cream #f6ead9: 8.5:1.
 * - Antique gold stars #d8b25e are decorative only (never text or a control).
 *
 * Contents: 1. Tokens  2. Homepage hero  3. Gifts section  4. Shop and product strips  5. Header
 */

/* 1. Tokens ------------------------------------------------------------ */

:root {
	--mm-xmas-cranberry: #722836;
	--mm-xmas-cranberry-deep: #5e1f2c;
	--mm-xmas-cream: #fbf1e3;
	--mm-xmas-caption: #f6ead9;
	--mm-xmas-gold: #d8b25e;
}

.xmas-star {
	display: block;
	width: 18px;
	height: 18px;
	fill: var(--mm-xmas-gold);
	pointer-events: none;
}

/* 2. Homepage hero ------------------------------------------------------- */

.xmas-hero {
	padding-block: 20px 36px;
	background: var(--mm-paper);
}

.xmas-hero__card {
	display: grid;
	overflow: hidden;
	background: var(--mm-xmas-cranberry);
	border-radius: 22px;
}

.xmas-hero__panel {
	position: relative;
	padding: 48px 24px 52px;
	color: var(--mm-xmas-cream);
}

/* Three stars in the panel's otherwise empty corners: top left, top right, bottom left. They sit
   inside the padding, so text and buttons never overlap them, and they ignore the pointer. */
.xmas-hero__stars {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.xmas-hero__stars .xmas-star {
	position: absolute;
}

.xmas-hero__stars .xmas-star:nth-child(1) {
	top: 16px;
	left: 18px;
}

.xmas-hero__stars .xmas-star:nth-child(2) {
	top: 16px;
	right: 18px;
	width: 15px;
	height: 15px;
}

.xmas-hero__stars .xmas-star:nth-child(3) {
	bottom: 18px;
	left: 18px;
	width: 14px;
	height: 14px;
}

.xmas-hero__label {
	margin: 0 0 18px;
	font-family: var(--mm-font-body);
	font-size: var(--mm-size-small);
	font-weight: 700;
	letter-spacing: 0.16em;
	line-height: 1.4;
	text-transform: uppercase;
}

/* A short cream rule under the label, in place of the ordinary hero's blush rule. */
.xmas-hero__label::after {
	content: "";
	display: block;
	width: 36px;
	height: 3px;
	margin-top: 14px;
	background: currentColor;
	border-radius: 2px;
}

.xmas-hero__title {
	margin: 0 0 12px;
	color: var(--mm-xmas-cream);
	font-size: clamp(36px, 28px + 2.4vw, 46px);
	line-height: 1.06;
	letter-spacing: -0.02em;
}

.xmas-hero__tagline {
	margin: 0 0 18px;
	font-family: var(--mm-font-display);
	font-size: var(--mm-size-h3);
	line-height: 1.25;
}

.xmas-hero__lead {
	max-width: 34em;
	margin: 0;
	font-size: var(--mm-size-lead);
	line-height: 1.6;
	text-wrap: pretty;
}

.xmas-hero__lead .nowrap {
	white-space: nowrap;
}

.xmas-hero__actions {
	margin-top: 28px;
}

/* Buttons: cream-filled primary and a cream-outlined secondary. Hover swaps fill and outline, so
   the change never relies on colour alone; focus adds a cream outline clear of the button. */
.xmas-hero .xmas-button {
	background: var(--mm-xmas-cream);
	border-color: var(--mm-xmas-cream);
	color: var(--mm-xmas-cranberry);
}

.xmas-hero .xmas-button:hover {
	background: transparent;
	border-color: var(--mm-xmas-cream);
	color: var(--mm-xmas-cream);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.xmas-hero .xmas-button--outline {
	background: transparent;
	color: var(--mm-xmas-cream);
}

.xmas-hero .xmas-button--outline:hover {
	background: var(--mm-xmas-cream);
	color: var(--mm-xmas-cranberry);
}

.xmas-hero__panel a:focus-visible {
	outline: 3px solid var(--mm-xmas-cream);
	outline-offset: 3px;
}

/* Phones: tighter spacing, so "Shop available now" comes as close to the top as the ordinary
   hero's button. Text sizes stay at the site's body and heading sizes. */
@media (max-width: 29.99em) {
	.xmas-hero {
		padding-top: 12px;
	}

	.xmas-hero__panel {
		padding: 40px 20px 48px;
	}

	.xmas-hero__label {
		margin-bottom: 14px;
		letter-spacing: 0.12em;
	}

	.xmas-hero__label::after {
		margin-top: 10px;
	}

	.xmas-hero__title {
		margin-bottom: 8px;
	}

	.xmas-hero__tagline {
		margin-bottom: 12px;
	}

	.xmas-hero__lead {
		font-size: var(--mm-size-body);
	}

	.xmas-hero__actions {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		margin-top: 22px;
	}
}

.xmas-hero__media {
	display: flex;
	flex-direction: column;
	margin: 0;
	background: var(--mm-xmas-caption);
}

.xmas-hero__media img {
	display: block;
	width: 100%;
	height: auto;
	/* Phones: the whole square photograph (Kimi's face and the Christmas-tree outfit). */
	aspect-ratio: 1 / 1;
	object-fit: cover;
	object-position: 50% 20%;
}

.xmas-hero__caption {
	padding: 10px 16px 12px;
	color: var(--mm-xmas-cranberry);
	font-family: var(--mm-font-display);
	font-size: var(--mm-size-ui);
	font-style: italic;
	line-height: 1.4;
	text-align: center;
}

/* Tablets: a wider, shorter photograph, cropped from the bottom so the face and hair stay whole. */
@media (min-width: 40em) and (max-width: 63.99em) {
	.xmas-hero__panel {
		padding: 52px 40px 56px;
	}

	.xmas-hero__media img {
		aspect-ratio: 4 / 3;
		object-position: 50% 8%;
	}
}

/* Desktop: text panel on the left, photograph on the right, meeting on a clean straight edge. */
@media (min-width: 64em) {
	.xmas-hero {
		padding-block: 32px 48px;
	}

	.xmas-hero__card {
		grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
		border-radius: 26px;
	}

	.xmas-hero__panel {
		display: flex;
		flex-direction: column;
		justify-content: center;
		/* The text sets the hero's height (never the photograph), so the buttons stay high. */
		min-height: 540px;
		padding: 64px clamp(40px, 4.5vw, 64px) 68px;
	}

	.xmas-hero__stars .xmas-star:nth-child(1) {
		top: 24px;
		left: 26px;
		width: 22px;
		height: 22px;
	}

	.xmas-hero__stars .xmas-star:nth-child(2) {
		top: 24px;
		right: 26px;
		width: 18px;
		height: 18px;
	}

	.xmas-hero__stars .xmas-star:nth-child(3) {
		bottom: 26px;
		left: 26px;
		width: 18px;
		height: 18px;
	}

	.xmas-hero__title {
		font-size: clamp(44px, 3.9vw, 58px);
		line-height: 1.04;
	}

	.xmas-hero__tagline {
		font-size: clamp(26px, 2vw, 30px);
	}

	/* Zero basis: the photograph fills whatever height the text panel sets, cropped from the
	   bottom so Kimi's face and hair stay whole. */
	.xmas-hero__media img {
		flex: 1 1 0;
		height: auto;
		min-height: 0;
		aspect-ratio: auto;
		object-position: 50% 22%;
	}

	.xmas-hero__caption {
		flex: none;
	}
}

/* 3. Gifts section ------------------------------------------------------- */

.xmas-gifts {
	padding-top: 8px;
}

.xmas-gifts__intro {
	text-align: center;
}

.xmas-gifts__intro .lead {
	margin-inline: auto;
}

.xmas-gifts__links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 48em) {
	.xmas-gifts__links {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 16px;
	}
}

.xmas-gifts__link {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	height: 100%;
	padding: 10px 14px;
	color: var(--mm-ink);
	font-family: var(--mm-font-body);
	font-size: var(--mm-size-ui);
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	background: var(--mm-warm-white);
	border: 2px solid var(--mm-ink);
	border-radius: 999px;
}

.xmas-gifts__link:hover {
	background: var(--mm-xmas-cranberry);
	border-color: var(--mm-xmas-cranberry);
	color: var(--mm-xmas-cream);
}

.xmas-gifts__products {
	margin-top: 40px;
}

.product-card__format {
	display: inline-block;
	align-self: flex-start;
	width: fit-content;
	margin: 0 0 8px;
	padding: 2px 10px;
	color: var(--mm-ink);
	font-size: var(--mm-size-small);
	font-weight: 700;
	line-height: 1.5;
	background: var(--mm-moonlit);
	border-radius: 999px;
}

/* 4. Shop and product strips -------------------------------------------- */

.xmas-strip {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 0 0 16px;
	padding: 9px 16px;
	color: var(--mm-xmas-cream);
	font-family: var(--mm-font-body);
	font-size: var(--mm-size-small);
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.4;
	text-align: center;
	text-transform: uppercase;
	background: var(--mm-xmas-cranberry);
	border-radius: 10px;
}

.xmas-strip .xmas-star {
	flex: none;
	width: 14px;
	height: 14px;
}

/* Product pages: a smaller version above the product, sized to its text. */
.xmas-strip--product {
	display: flex;
	width: fit-content;
	max-width: 100%;
	gap: 10px;
	margin: 0 0 12px;
	padding: 6px 14px;
	font-size: 13px;
	letter-spacing: 0.12em;
	border-radius: 999px;
}

.xmas-strip--product .xmas-star {
	width: 12px;
	height: 12px;
}

/* Phones: keep the shop strip to one slim line. */
@media (max-width: 29.99em) {
	.xmas-strip {
		gap: 8px;
		padding: 8px 12px;
		font-size: 13px;
		letter-spacing: 0.08em;
	}

	.xmas-strip .xmas-star {
		width: 12px;
		height: 12px;
	}

	.xmas-strip--product {
		padding: 6px 12px;
	}
}

/* The narrowest phones: keep "Christmas at Moon & Milk" on one line in the hero. */
@media (max-width: 22.49em) {
	.xmas-hero__label {
		font-size: 13px;
		letter-spacing: 0.06em;
	}
}

/* 5. Header (0.1.91, Aya, 29 November 2026) ------------------------------
 * The top bar turns cranberry with a gold star either side, and a few tiny static gold stars sit
 * in the empty cream space beside the logo. The logo artwork, search, basket and menu are not
 * changed or covered: the stars are CSS backgrounds in zones that end well clear of the logo
 * (and, on desktop, of Search and Basket), with no text and no pointer events. Basket and
 * checkout keep the normal navy bar, as this stylesheet is not loaded there.
 * Cream #fbf1e3 on Cranberry: 9.1:1; the link's hover colour (Sage Mist) on Cranberry: 8.0:1.
 */

:root {
	--mm-xmas-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23d8b25e' d='M12 0c.6 6.4 5.6 11.4 12 12-6.4.6-11.4 5.6-12 12-.6-6.4-5.6-11.4-12-12C6.4 11.4 11.4 6.4 12 0Z'/%3E%3C/svg%3E");
}

.announcement {
	background: var(--mm-xmas-cranberry);
	color: var(--mm-xmas-cream);
	--mm-focus: var(--mm-xmas-cream);
}

.announcement__link {
	color: var(--mm-xmas-cream);
}

/* Keyboard focus: a cream outline (9.1:1). Another stylesheet on the site sets link focus to a dark
   teal, which would be nearly invisible on cranberry. */
.announcement .announcement__link:focus-visible {
	outline: 3px solid var(--mm-xmas-cream);
	outline-offset: 2px;
}

/* A star before the text and after the link, attached to them so they wrap together on phones. */
.announcement__text::before,
.announcement__link::after {
	content: "";
	display: inline-block;
	flex: none;
	width: 12px;
	height: 12px;
	vertical-align: -1px;
	background: var(--mm-xmas-star) no-repeat center / contain;
	pointer-events: none;
}

.announcement__text::before {
	margin-right: 10px;
}

.announcement__link::after {
	margin-left: 10px;
}

/* Phones: no stars in the bar, so the delivery message keeps its usual one line (the stars
   beside the logo still show). */
@media (max-width: 29.99em) {
	.announcement__text::before,
	.announcement__link::after {
		content: none;
	}
}

.site-header__masthead {
	position: relative;
}

.site-header__masthead::before,
.site-header__masthead::after {
	content: "";
	position: absolute;
	top: 6px;
	bottom: 6px;
	background-repeat: no-repeat;
	pointer-events: none;
}

/* Phones and tablets: one or two stars each side of the 168px (188px) logo. */
.site-header__masthead::before {
	left: var(--mm-gutter);
	right: calc(50% + 100px);
	background-image: var(--mm-xmas-star), var(--mm-xmas-star);
	background-size: 13px 13px, 8px 8px;
	background-position: 70% 24%, 20% 72%;
}

.site-header__masthead::after {
	left: calc(50% + 100px);
	right: var(--mm-gutter);
	background-image: var(--mm-xmas-star), var(--mm-xmas-star);
	background-size: 9px 9px, 13px 13px;
	background-position: 25% 30%, 80% 68%;
}

@media (min-width: 40em) {
	.site-header__masthead::before {
		right: calc(50% + 118px);
	}

	.site-header__masthead::after {
		left: calc(50% + 118px);
	}
}

/* Desktop: a small scatter either side of the logo. On the right, the stars sit only in the top
   and bottom bands (6–16% and 84–92% of the masthead height), above and below Search and
   Basket, which are centred on the logo. */
@media (min-width: 60em) {
	.site-header__masthead::before {
		right: calc(50% + 150px);
		background-image: var(--mm-xmas-star), var(--mm-xmas-star), var(--mm-xmas-star), var(--mm-xmas-star), var(--mm-xmas-star);
		background-size: 16px 16px, 9px 9px, 12px 12px, 8px 8px, 14px 14px;
		background-position: 88% 22%, 70% 62%, 46% 30%, 28% 78%, 10% 40%;
	}

	.site-header__masthead::after {
		left: calc(50% + 150px);
		right: var(--mm-gutter);
		background-image: var(--mm-xmas-star), var(--mm-xmas-star), var(--mm-xmas-star), var(--mm-xmas-star);
		background-size: 12px 12px, 9px 9px, 14px 14px, 8px 8px;
		background-position: 6% 16%, 28% 84%, 74% 6%, 96% 92%;
	}
}
