/**
 * Banner band block ("Marquee-Sm" in Figma).
 *
 * Figma: PAC-Page-Designs, page "Financial Aid"
 *   deep tone  1440px node 3167:7593 (1440 x 452)
 *              768px node 3167:7641 ( 768 x 410)
 *              390px node 3167:7615 ( 390 x 432)
 *   pale tone  1440px node 3167:7532 (1440 x 284)
 *              768px node 3167:7573 ( 768 x 242)
 *              390px node 3167:7553 ( 390 x 209)
 *
 * Almost nothing here is a size. The padding is the shared
 * --pchs-section-px / --pchs-section-py, and the heading and paragraph are
 * the theme's .pchs-heading-2 and .pchs-section-intro, whose ramps already
 * match the frames exactly. What is left is the tones.
 *
 * The blog listing's gold header is the same Figma component and will move
 * onto these rules, at which point they belong in the theme stylesheet
 * rather than here - see the note in the theme's style.css about promoting
 * on the second use. It has one real difference to settle first: its bottom
 * padding is deeper at every width, because the filter bar overlaps it.
 */

.pchs-marquee-sm {
	position: relative;
	/* Plus the gutter, so that past 1440 the words line up with the rest of
	   the page while the band still fills the screen. */
	padding: var(--pchs-section-py) calc(var(--pchs-section-px) + var(--pchs-page-gutter));
	/* Contains the texture's stacking. */
	isolation: isolate;
}

/*
 * The texture over the gradient.
 *
 * MULTIPLY, AND WHY IT HAS TO BE
 *
 * The file Figma exports for this layer is fully opaque and near-white -
 * mean rgb 249,249,249 - because Figma flattens the layer on export. Laid
 * over the gradient at the 60% its generated code reports, that bleached the
 * band to a pale blue-grey: the deep navy came out looking like fog.
 *
 * Figma's codegen reports a layer's opacity but not a blend mode set on the
 * image PAINT, so the mode had to be recovered by measuring. Sampling the
 * frame's own export across the band gives #135f8a to #001d31 - the gradient
 * almost exactly - and try-blend.mjs in the harness scores every candidate
 * against those samples:
 *
 *     multiply 0.6     mean error 1.9   <- this
 *     none at all      mean error 2.2
 *     overlay 0.3      mean error 17.6
 *     soft-light 0.6   mean error 27.8
 *     normal 0.6       mean error 119.8  <- what this used to be
 *
 * Multiply is also the one that makes sense: a near-white image multiplied
 * over a colour leaves the colour, and the texture's slightly darker curves
 * are what show.
 *
 * On a pseudo-element because it carries its own opacity, which a background
 * layer cannot.
 */
.pchs-marquee-sm::before {
	position: absolute;
	z-index: 0;
	content: "";
	inset: 0;
	background-image: var(--pchs-marquee-sm-texture, none);
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
	opacity: 0.6;
	mix-blend-mode: multiply;
	pointer-events: none;
}

.pchs-marquee-sm__content {
	position: relative;
	z-index: 1;
	display: flex;
	max-width: 868px;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--20); /* 20px */
}

.pchs-marquee-sm__actions {
	margin: 0;
}

/*
 * The pale band's sign-off keeps the smaller size at every width, where the
 * ordinary paragraph steps up to 20 from 768. Frame 3167:7532 measures 124
 * of content at 1440 - a 48px heading and two 24px lines - which only works
 * at 16.
 */
.pchs-marquee-sm--small-copy .pchs-marquee-sm__body {
	font-size: var(--wp--preset--font-size--md); /* 16px */
	line-height: 24px;
}


/* ------------------------------------------------------------
   Deep: the blue gradient, white lettering.
   Figma node 3167:7593.
   ------------------------------------------------------------ */

.pchs-marquee-sm--deep {
	background-color: var(--wp--preset--color--blue-500);
	background-image: linear-gradient(
		90.41deg,
		var(--wp--preset--color--blue-300) 0%,
		var(--wp--preset--color--blue-500) 49.97%,
		var(--wp--preset--color--blue-800) 100%
	);
}

.pchs-marquee-sm--deep .pchs-marquee-sm__heading,
.pchs-marquee-sm--deep .pchs-marquee-sm__body {
	color: var(--wp--preset--color--white);
}

.pchs-marquee-sm--deep .pchs-marquee-sm__body a {
	color: var(--wp--preset--color--white);
	font-weight: 600;
	text-decoration: underline;
	text-underline-position: from-font;
}


/* ------------------------------------------------------------
   Pale: the grey gradient, blue lettering.
   Figma node 3167:7532.
   ------------------------------------------------------------ */

.pchs-marquee-sm--pale {
	background-color: var(--wp--preset--color--gray-200);
	background-image: linear-gradient(
		90.66deg,
		var(--wp--preset--color--gray-200) 0%,
		var(--wp--preset--color--gray-600) 49.97%,
		var(--wp--preset--color--gray-800) 100%
	);
}

/* The pale band takes the same multiply as the deep one, from the base rule
   above. Its frame's code says luminosity, which with this near-white opaque
   export washes the grey out exactly the way normal washed out the navy. */

.pchs-marquee-sm--pale .pchs-marquee-sm__heading {
	color: var(--wp--preset--color--blue-500);
}

.pchs-marquee-sm--pale .pchs-marquee-sm__body {
	color: var(--wp--preset--color--neutral-800);
}

.pchs-marquee-sm--pale .pchs-marquee-sm__body a {
	color: var(--wp--preset--color--blue-500);
	font-weight: 600;
	text-decoration: underline;
	text-underline-position: from-font;
}


/* ------------------------------------------------------------
   Gold: the band the blog listing uses.
   Figma node 2215:2178. Here so the tone exists for any page
   that wants it; the blog's own header still has its rules in
   blog.css until the two are reconciled.
   ------------------------------------------------------------ */

.pchs-marquee-sm--gold {
	background-color: var(--wp--preset--color--yellow-500);
	background-image: linear-gradient(
		90.45deg,
		var(--wp--preset--color--yellow-300) 0%,
		var(--wp--preset--color--yellow-500) 100%
	);
}

/* Held against the right-hand edge rather than covering the band. */
/*
 * The gold tone draws a different KIND of artwork, and so composites
 * differently.
 *
 * The deep and pale tones use the wave texture, which Figma exports
 * flattened - fully opaque and near-white - and which therefore has to be
 * multiplied or it bleaches the band. That is the long note above.
 *
 * This one is the ginkgo: a genuinely transparent PNG with its own alpha.
 * It needs no trick, and multiplying it darkens the leaves into the gold
 * instead of laying them over it. Plain compositing at 60% is also what the
 * article's gold band does, which scores 0.00% against its frame.
 */
.pchs-marquee-sm--gold::before {
	background-image: var(--pchs-marquee-sm-texture, url("../../images/blog/hero-pattern.png"));
	background-position: right top;
	background-size: contain;
	mix-blend-mode: normal;
}

.pchs-marquee-sm--gold .pchs-marquee-sm__heading {
	color: var(--wp--preset--color--blue-500);
}

.pchs-marquee-sm--gold .pchs-marquee-sm__body {
	color: var(--wp--preset--color--neutral-800);
}


/* ------------------------------------------------------------
   1024px and up

   The words stop short of the right-hand edge so they never run
   into the texture. Only the 1440 frame (3167:7593) has this
   inset: the 768 one (3167:7641) lets the paragraph run the
   full width of the band, and putting the inset there too cost
   the paragraph a sixth line and the band 30px.

   1024 rather than 1200 because that is about where the 868
   cap starts binding, so from here the text is 788 wide at
   every width and the inset is the whole of the difference.
   ------------------------------------------------------------ */

@media (min-width: 1024px) {

	.pchs-marquee-sm__content {
		padding-right: var(--wp--preset--spacing--80);
	}
}
