/* ═══════════════════════════════════════════════════════════ YEMMA CORE ══ */
/*  The room planner, on a product page.                                      */
/*                                                                            */
/*  Unlike certificate.css, which dresses two documents the plugin renders     */
/*  whole, this one is enqueued onto somebody else's page. Two rules follow    */
/*  from that and neither is negotiable:                                       */
/*                                                                            */
/*  1. Nothing here selects a bare element. Every rule is a class under        */
/*     .yplan, so a theme's own h2 and dl are never argued with, and this      */
/*     file can never win an argument about a margin somewhere else on the     */
/*     page. A stylesheet that reached outside its section would be the        */
/*     plugin redesigning the shop, which is the theme's job.                  */
/*                                                                            */
/*  2. Every colour is a variable declared on .yplan itself. A theme that      */
/*     wants the plan in its own palette redeclares six values and gets it,    */
/*     without overriding a single rule or fighting specificity.               */
/*                                                                            */
/*  No webfont. The panel inherits the page's own sans, because a product      */
/*  page has already paid for its typefaces and a second family loading for    */
/*  one section is a second render of the whole page.                          */
/* ══════════════════════════════════════════════════════════════════════════ */

.yplan {
	/* --- Neutrals: warm, undyed wool. Never pure white or black ----------- */
	--yp-bone:   #FAF6EF;
	--yp-bone-2: #F3ECE0;
	--yp-sand:   #E7DBC7;
	--yp-line:   #DFD4C2;
	--yp-line-2: #C9BCA6;

	/* --- Ink: espresso, not black ---------------------------------------- */
	--yp-ink:   #14100D;
	--yp-ink-3: #3B322A;
	--yp-muted: #8A7B6B;

	/* --- The three things a verdict can be, and how a short one can be shown */
	--yp-good:     #4F7A52;
	--yp-workable: #B98B45;
	--yp-bad:      #A9522F;

	/*
	 * Advice: a size too small for the room, when the shop chooses to say so
	 * gently. Its own token, because the obvious two are taken — --yp-bad also
	 * paints the "we recommend" dot, and --yp-workable would make a short size
	 * look like a caveat about a size that fits. A warm umber, 5.4:1 on the
	 * bone band, so the 10px tag still reads.
	 */
	--yp-advice:   #6B5D50;

	/* --- Type. The sans is the page's own; the figures get a serif -------- */
	--yp-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--yp-ease:  cubic-bezier( 0.22, 1, 0.36, 1 );

	color: var(--yp-ink);
	container-type: inline-size;
}

.yplan *,
.yplan *::before,
.yplan *::after {
	box-sizing: border-box;
}

.yplan__sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

/* ── The heading ────────────────────────────────────────────────────────── */

.yplan__head {
	margin: 0 0 clamp( 1.6rem, 3vw, 2.8rem );
	text-align: center;
}

.yplan__eyebrow {
	margin: 0;
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--yp-muted);
}

.yplan__title {
	margin: 0.6rem 0 0;
	font-size: clamp( 1.8rem, 4vw, 3rem );
	font-weight: 300;
	line-height: 1.05;
}

.yplan__lede {
	max-width: 46ch;
	margin: 0.9rem auto 0;
	font-size: 0.95rem;
	line-height: 1.7;
	color: var(--yp-ink-3);
}

/* ── The two columns ────────────────────────────────────────────────────── */

.yplan__body {
	display: grid;
	grid-template-columns: 1.2fr 0.8fr;
	gap: clamp( 1.4rem, 3vw, 3rem );
	align-items: start;
}

/*  A container query rather than a media query: the planner is dropped into
    a column of somebody else's layout, and what decides whether two columns
    fit is the width of that column, not the width of the phone.             */
@container ( max-width: 720px ) {

	.yplan__body {
		grid-template-columns: 1fr;
	}

	/*  A phone is a thumb. Both rails read as the same slim pills a mouse gets,
	    and are 44px of reachable target underneath — the size chips are the
	    control that drives the drawing, the verdict and the price, and at 37px
	    in two wrapped rows a thumb aimed at one row lands on the other.
	    The centring is written out because a button that becomes a flex
	    container loses the browser's own.                                    */

	.yplan__room,
	.yplan__size {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 44px;
	}
}

@supports not ( container-type: inline-size ) {

	@media ( max-width: 782px ) {

		.yplan__body {
			grid-template-columns: 1fr;
		}

		.yplan__room,
		.yplan__size {
			display: flex;
			align-items: center;
			justify-content: center;
			min-height: 44px;
		}
	}
}

/* ── The drawing ────────────────────────────────────────────────────────── */

.yplan__stage {
	position: relative;
	padding: clamp( 0.8rem, 2vw, 2rem );
	border: 1px solid var(--yp-line);
	background: linear-gradient( 160deg, var(--yp-bone) 0%, var(--yp-sand) 100% );
}

.yplan__svg {
	display: block;
	width: 100%;
	height: auto;
}

.yplan__noscript {
	margin: 0;
	font-size: 0.88rem;
	line-height: 1.6;
	color: var(--yp-ink-3);
}

/*  The floor-plan drawing language. Every one of these classes is written by
    planner.js onto an element it has just made, so the script carries no
    colours of its own beyond the two that belong to the wool itself.        */

.yplan .yplan-floor {
	fill: var(--yp-bone-2);
}

.yplan .yplan-wall {
	fill: none;
	stroke: var(--yp-ink);
	stroke-width: 3;
	stroke-opacity: 0.5;
}

.yplan .yplan-grid {
	stroke: var(--yp-line-2);
	stroke-width: 0.6;
	opacity: 0.5;
}

/*  The woven rug draws its own ground, so its edge is a plain dark hairline
    rather than the wash a schematic rectangle would carry.                  */
.yplan .yplan-rug-edge {
	fill: none;
	stroke: #14100D;
	stroke-width: 1.3;
	stroke-opacity: 0.5;
}

/*  A piece of furniture with no photograph. This is the ordinary state of a
    fresh install — the plugin ships the measurements and not the pictures —
    so it is drawn to look deliberate rather than broken: the real footprint
    of a real sofa, in ink, at the size it actually occupies.                */
.yplan .yplan-piece {
	fill: var(--yp-ink-3);
	fill-opacity: 0.82;
	stroke: var(--yp-bone);
	stroke-width: 1.2;
}

.yplan .yplan-dim {
	stroke: var(--yp-ink);
	stroke-width: 1;
	stroke-opacity: 0.55;
}

.yplan .yplan-dim-w {
	stroke: var(--yp-ink);
	stroke-width: 0.7;
	stroke-opacity: 0.22;
}

.yplan .yplan-dim-t {
	stroke: var(--yp-ink);
	stroke-width: 1.3;
	stroke-opacity: 0.65;
	stroke-linecap: round;
}

/*  These two are the only text inside the drawing, and their sizes are in the
    viewBox's own units — so they shrink with the plan. At the width a phone
    gives this section the drawing renders at about half scale, which put the
    rug's own measurements on screen at six pixels: the one section that
    promises "drawn to scale in feet" was printing the feet too small to read.

    The numbers below are still the hand-tuned ones, and at a width where they
    render large enough they are what is used. planner.js measures the drawing
    and raises these two variables when they would land under a legible size —
    which is arithmetic CSS cannot do, because it cannot divide by a length.
    The script writes the text, so sizing it there adds no dependency that the
    text did not already have.                                               */

.yplan .yplan-dim-l {
	font-size: var(--yp-dim-size, 12px);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	fill: var(--yp-ink);
}

.yplan .yplan-note {
	font-size: var(--yp-note-size, 11.5px);
	letter-spacing: 0.1em;
	fill: var(--yp-muted);
}

/* ── The panel ──────────────────────────────────────────────────────────── */

.yplan__rooms {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-bottom: 1.4rem;
}

.yplan__room {
	padding: 0.6em 1.15em;
	border: 1px solid var(--yp-line);
	border-radius: 99px;
	background: none;
	font: inherit;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--yp-muted);
	cursor: pointer;
	transition: background 0.35s var(--yp-ease), border-color 0.35s var(--yp-ease), color 0.35s var(--yp-ease);
}

.yplan__room:hover {
	border-color: var(--yp-ink);
	color: var(--yp-ink);
}

.yplan__room.is-active {
	background: var(--yp-ink);
	border-color: var(--yp-ink);
	color: var(--yp-bone);
}

.yplan__name {
	margin: 0;
	font-size: clamp( 1.25rem, 2vw, 1.7rem );
	font-weight: 400;
	line-height: 1.2;
}

.yplan__rule {
	margin: 0.6rem 0 0;
	font-size: 0.92rem;
	line-height: 1.7;
	color: var(--yp-ink-3);
}

.yplan__legend {
	display: flex;
	align-items: center;
	gap: 0.4em;
	margin: 1.5rem 0 0.7rem;
	font-size: 9.5px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--yp-muted);
}

.yplan__legend-rec {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

.yplan__legend-rec[hidden] {
	display: none;
}

.yplan__legend-sep {
	color: var(--yp-line-2);
}

.yplan__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--yp-bad);
}

.yplan__sizes {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}

.yplan__size {
	position: relative;
	padding: 0.58em 1.05em;
	border: 1px solid var(--yp-line);
	border-radius: 99px;
	background: none;
	font: inherit;
	font-size: 12.5px;
	letter-spacing: 0.04em;
	white-space: nowrap;
	color: inherit;
	cursor: pointer;
	transition: background 0.35s var(--yp-ease), border-color 0.35s var(--yp-ease), color 0.35s var(--yp-ease);
}

.yplan__size:hover {
	border-color: var(--yp-ink);
}

.yplan__size.is-active {
	background: var(--yp-ink);
	border-color: var(--yp-ink);
	color: var(--yp-bone);
}

/*  The recommendation, as a single dot. It is the same clay the legend above
    prints, so the sentence "● we recommend" is answered by the mark itself
    rather than by a word repeated on every chip.                            */
.yplan__size.is-rec::after {
	content: "";
	position: absolute;
	top: -3px;
	right: 6px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--yp-bad);
}

.yplan__size[hidden] {
	display: none;
}

/* ── The verdict, which is the point of the whole section ───────────────── */

/*  The one sentence this whole feature exists to print. On a phone the panel
    is a single column, so the sentence sits below the chips that change it —
    and a shop with a sticky buy bar puts an opaque strip over the bottom of
    the screen, where the sentence lands. The script scrolls it into view after
    a press; this is how much room it asks for. `--sbar-h` is the height the
    theme's own bar measures and writes onto the document, so a folded bar asks
    for less and a theme with no bar asks for nothing.                        */
.yplan__verdict {
	margin-top: 1.6rem;
	padding: 0.2rem 0 0.2rem 1.1rem;
	border-left: 2px solid var(--yp-line);
	scroll-margin-block: 1.2rem calc(var(--sbar-h, 0px) + 1.2rem);
	transition: border-color 0.4s var(--yp-ease);
}

.yplan__tag {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	margin: 0;
	font-size: 10px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.yplan__icon {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentcolor;
	stroke-width: 1.8;
}

.yplan__sentence {
	margin: 0.55rem 0 0;
	font-size: 0.95rem;
	line-height: 1.7;
	color: var(--yp-ink-3);
}

.yplan__verdict.is-good {
	border-color: var(--yp-good);
}

.yplan__verdict.is-good .yplan__tag {
	color: var(--yp-good);
}

.yplan__verdict.is-workable {
	border-color: var(--yp-workable);
}

.yplan__verdict.is-workable .yplan__tag {
	color: var(--yp-workable);
}

.yplan__verdict.is-bad {
	border-color: var(--yp-bad);
}

.yplan__verdict.is-bad .yplan__tag {
	color: var(--yp-bad);
}

.yplan__verdict.is-advice {
	border-color: var(--yp-advice);
}

.yplan__verdict.is-advice .yplan__tag {
	color: var(--yp-advice);
}

/* ── The facts ──────────────────────────────────────────────────────────── */

.yplan__facts {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 0.8rem;
	margin: 1.6rem 0 0;
}

.yplan__fact {
	padding-top: 0.7rem;
	border-top: 1px solid var(--yp-line);
}

.yplan__fact dt {
	font-size: 9px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--yp-muted);
}

.yplan__fact dd {
	margin: 0.2rem 0 0;
	font-family: var(--yp-serif);
	font-size: 1.14rem;
	line-height: 1.3;
	/* The size in straight figures, as on the rest of the rug page (theme base.css). */
	font-variant-numeric: lining-nums;
}

.yplan__buy {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	align-items: center;
	margin: 1.8rem 0 0;
	padding-top: 1.5rem;
	border-top: 1px solid var(--yp-line);
}

.yplan__link {
	display: inline-flex;
	align-items: center;
	padding: 0.7em 1.4em;
	border: 1px solid var(--yp-ink);
	border-radius: 99px;
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	text-decoration: none;
	color: inherit;
	transition: background 0.35s var(--yp-ease), color 0.35s var(--yp-ease);
}

.yplan__link:hover,
.yplan__link:focus-visible {
	background: var(--yp-ink);
	color: var(--yp-bone);
}

.yplan :focus-visible {
	outline: 2px solid var(--yp-workable);
	outline-offset: 3px;
}

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

	.yplan__room,
	.yplan__size,
	.yplan__link,
	.yplan__verdict {
		transition: none;
	}
}
