/**
 * An Nam Room plan (Figma "Signature · Room plan and side room", Home 25:6315 / 25:7068 /
 * 25:7816). Sand section.
 *
 * Heading (760): label 12 / 150% muted (written in capitals), title Newsreader 48 / 112%
 * (tablet 40, phone 32) 16 under it, line 17 / 150% muted (phone 16) 16 under that.
 * 32 under the heading the plan (720 × 480) and, 48 to its right, the side room card (432):
 * photo 432 × 288 (radius 12), 20 under it the label, the name (h3) 8 under it, the line (body,
 * muted) 8 under that, the link 8 under the line.
 * Plan: room outline (ink rule 1.5 inside, radius 12) with the entrance cut in its bottom rule;
 * kitchen (ink 8%, ink rule 1, radius 4, "Kitchen pass" 12 muted); tables and the side room
 * (sand, ink rule 1.5, radius 4 / 2 / 8); seats 14 (ink); zone numbers 20 (ink, cream digit 11),
 * zone labels 14 ink, 8 right of the number.
 * Tablet: plan 770 × 500, the card under it (28): photo left, text right (366), centred.
 * Phone: plan 350 × 300 with numbers 18 and no visible zone labels (B4 Q15); card stacked,
 * photo 350 × 280.
 */

.an-counter-plan {
	--an-plan-ink: var(--an-heading);
	--an-plan-muted: var(--an-muted);
	--an-plan-table: var(--an-bg);
	--an-plan-number: var(--an-c-cream);
	--an-plan-seat: 14px;
	--an-plan-num: 20px;
	--an-plan-stroke: 1.5px;
}

/* Heading: sizes the design writes without a text style (B4 Q12). */
.an-counter-plan__heading {
	max-width: 760px;
}

.an-counter-plan .an-heading .an-eyebrow {
	line-height: var(--an-lh-text);
}

.an-counter-plan .an-section-title {
	font-size: 48px;
	line-height: 1.12;
}

.an-counter-plan .an-heading__text {
	font-size: 17px;
	line-height: var(--an-lh-text);
}

.an-counter-plan__row {
	margin-top: 32px;
}

.an-counter-plan__row--card {
	display: grid;
	grid-template-columns: minmax(0, 720px) minmax(0, 432px);
	justify-content: space-between;
	align-items: start;
	gap: 48px;
}

/* ---------- Plan ---------- */

.an-counter-plan__plan {
	position: relative;
	aspect-ratio: 720 / 480;
	margin: 0;
	border: var(--an-plan-stroke) solid var(--an-plan-ink);
	border-radius: var(--an-radius);
	color: var(--an-plan-ink);
}

/* Measured from the outer edge of the room outline, as in Figma. */
.an-counter-plan__shapes {
	position: absolute;
	inset: calc(-1 * var(--an-plan-stroke));
}

/* Rules sit inside the shapes (Figma "inside" strokes): 1.5, the kitchen 1. */
.an-counter-plan__shape {
	position: absolute;
	box-sizing: border-box;
	border: var(--an-plan-stroke) solid var(--an-plan-ink);
	border-radius: 4px;
	background: var(--an-plan-table);
}

.an-counter-plan__shape--kitchen {
	border-width: 1px;
	background: color-mix(in srgb, var(--an-plan-ink) 8%, transparent);
}

.an-counter-plan__shape--counter {
	border-radius: 2px;
}

.an-counter-plan__shape--wall {
	border-radius: var(--an-radius-control);
}

/* An opening in a rule (entrance, side room door): the section colour over the rule. */
.an-counter-plan__shape--gap {
	border: 0;
	border-radius: 0;
	background: var(--an-bg);
}

.an-counter-plan__seat {
	position: absolute;
	width: var(--an-plan-seat);
	height: var(--an-plan-seat);
	border-radius: 50%;
	background: var(--an-plan-ink);
	transform: translate(-50%, -50%);
}

.an-counter-plan__note {
	position: absolute;
	color: var(--an-plan-muted);
	font-size: var(--an-fs-label);
	line-height: 1.25;
	white-space: nowrap;
}

.an-counter-plan__zones {
	position: static;
}

.an-counter-plan__zone {
	position: absolute;
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.an-counter-plan__number {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: var(--an-plan-num);
	height: var(--an-plan-num);
	border-radius: 50%;
	background: var(--an-plan-ink);
	color: var(--an-plan-number);
	font-size: 11px;
	line-height: 1;
}

.an-counter-plan__zone-label {
	color: var(--an-plan-ink);
	font-size: var(--an-fs-small);
	line-height: 18px;
}

/* ---------- Side room card ---------- */

.an-counter-plan__card {
	min-width: 0;
}

.an-counter-plan__photo {
	height: 288px;
}

.an-counter-plan__card-text {
	margin-top: 20px;
}

.an-counter-plan__card-text .an-eyebrow {
	color: var(--an-muted);
}

.an-counter-plan__card-title {
	margin-top: 8px;
}

.an-counter-plan__card-line {
	margin-top: 8px;
	color: var(--an-muted);
}

.an-counter-plan__action {
	margin-top: 8px;
}

/* Tablet (834): plan 770 × 500, card under it. */
@media (max-width: 1024px) {
	.an-counter-plan .an-section-title {
		font-size: var(--an-fs-h2);
	}

	.an-counter-plan__row--card {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.an-counter-plan__plan {
		aspect-ratio: 770 / 500;
	}

	.an-counter-plan__card {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 366px);
		align-items: center;
		gap: 24px;
	}

	.an-counter-plan__photo {
		height: 253px;
	}

	.an-counter-plan__card-text {
		margin-top: 0;
	}
}

/* Phone (390): plan 350 × 300, zone numbers only; card stacked. */
@media (max-width: 767px) {
	.an-counter-plan {
		--an-plan-seat: 8px;
		--an-plan-num: 18px;
	}

	.an-counter-plan .an-section-title {
		font-size: 32px;
	}

	.an-counter-plan .an-heading__text {
		font-size: var(--an-fs-body);
	}

	.an-counter-plan__plan {
		aspect-ratio: 350 / 300;
	}

	.an-counter-plan__note {
		font-size: 10px;
	}

	/* Hidden on screen as in the design, still read by screen readers (B4 Q15). */
	.an-counter-plan__zone-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.an-counter-plan__card {
		display: block;
	}

	.an-counter-plan__photo {
		height: 280px;
	}

	.an-counter-plan__card-text {
		margin-top: 20px;
	}
}
