/* ============================================================================
   YEMMA CORE — the story page

   Almost nothing. The theme already styles every band on this page: `.sopen`,
   `.years`, `.method`, `.price-split` and `.refuse` are in its story.css, and
   `.phead`, `.bespoke`, `.sec-head` and `.stats` are in the sheets that load
   beside it. This file carries only what the theme cannot know, which is the
   two things the plugin invented: hiding a band per screen size, and a counter
   row that is not three columns wide.
   ========================================================================== */

/*
 * Hiding a band on some screens and not others.
 *
 * **Done in CSS rather than by leaving the markup out, and that is not laziness.**
 * There is no server-side way to know which of the three screens a reader is on
 * — a phone and a desktop are handed the same HTML by every cache in front of
 * this shop, so a band left out for the phone would be left out for whoever
 * warmed the cache. The class is the only honest place to make this decision.
 *
 * A band switched off for ALL three never reaches the page at all; `Story::ordered()`
 * drops it before the template sees it, so nobody downloads markup that every
 * screen then hides. These three rules are only for the in-between case.
 *
 * The breakpoints are the page's own — 1024 and 620, the two `story.css` already
 * turns on — so a band hidden "on tablet" disappears exactly where the layout
 * changes anyway, rather than at some width chosen for an admin screen.
 */
@media (min-width: 1025px) {
	.ystory-hide--desktop {
		display: none !important;
	}
}

@media (min-width: 621px) and (max-width: 1024px) {
	.ystory-hide--tablet {
		display: none !important;
	}
}

@media (max-width: 620px) {
	.ystory-hide--phone {
		display: none !important;
	}
}

/*
 * `!important` here and almost nowhere else in this plugin, deliberately.
 *
 * Every band's own rule sets `display` — `.sopen` is a grid, `.refuse` is a
 * grid, `.bespoke` is a grid — and those are single classes in the theme's
 * sheet, which loads after this one. Without the flag the hide loses to the
 * layout it is trying to hide, on exactly the bands most worth hiding. This is
 * a visibility switch and not a style, and there is nothing it should ever lose
 * to.
 */

/*
 * The counters, when there are more than three.
 *
 * The theme's `.stats` is `repeat(3, 1fr)`, which is right where it was written
 * — the home page shows three. The story shows five, and five in a three-column
 * grid is a row of three above a row of two pushed to the left, which reads as
 * a mistake rather than a design. Auto-fit keeps them on one line while they
 * fit and breaks them evenly when they do not.
 */
.stats--story {
	grid-template-columns: repeat(auto-fit, minmax(clamp(7rem, 16vw, 11rem), 1fr));
}

/*
 * The price split's own heading and lede, which the prototype set with inline
 * styles and this page cannot: the markup is generated, and a style attribute
 * per row is a style sheet nobody can find.
 */
.psplit__h {
	margin-top: 0.6rem;
}

.psplit__lede {
	max-width: 46ch;
	margin-top: 1.2rem;
	font-size: 0.95rem;
	line-height: 1.85;
	color: var(--ink-3);
}

.psplit__lede + .psplit__lede {
	margin-top: 1rem;
}

/*
 * The money column. The prototype set this per row with a style attribute; it
 * is one rule here, and it carries the tabular figures that attribute never
 * did — a column of prices that do not line up is a column somebody has to read
 * twice.
 */
.psplit__amount {
	font-family: var(--serif);
	font-size: 1.1rem;
	/* Straight figures, as every price in the theme (base.css, PRICES). */
	font-variant-numeric: lining-nums tabular-nums;
}

.psplit__row--her .psplit__amount {
	color: var(--clay);
}

/* The opening's heading, sized where the prototype sized it inline. */
.sopen__h {
	margin-top: 0.9rem;
	font-size: clamp(1.8rem, 3.2vw, 2.9rem);
	font-weight: 300;
	line-height: 1.08;
}

/* The refusal band's own lede, on ink rather than on paper. */
.refuse__lede {
	color: var(--muted-2);
}
