/**
 * Icon list with image block.
 *
 * Figma: PAC-Page-Designs, page "Home Page"
 *   1440px  node 2001:1575   section 1440 x 692
 *   1199px  node 2328:8605   section 1199 x 692
 *    768px  node 2001:1891   section  768 x 647
 *    390px  node 2001:2050   section  390 x 1088.5
 *
 * Three children on a twelve-column grid. The grouping changes between
 * breakpoints, which is why they are siblings rather than nested - see
 * render.php. Each arrangement is written out in full below rather than
 * inherited and patched, because the three are genuinely different shapes.
 */

.pchs-icon-list {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	/* Plus the gutter, so that past 1440 the contents line up with the rest
	   of the page while the background still fills the screen. */
	padding: var(--pchs-section-py) calc(var(--pchs-section-px) + var(--pchs-page-gutter));
	/* Figma stacks a solid white fill over a grey-blue gradient. The white is
	   opaque, so the gradient never shows; the section is simply white. Noted
	   in case the design later lowers that opacity and the gradient is
	   expected to appear. */
	background-color: var(--wp--preset--color--white);
}

.pchs-icon-list__info,
.pchs-icon-list__items,
.pchs-icon-list__media {
	min-width: 0; /* lets grid children shrink instead of overflowing */
}

.pchs-icon-list__info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--12);
}

.pchs-icon-list__eyebrow,
.pchs-icon-list__heading {
	color: var(--wp--preset--color--blue-500);
}

.pchs-icon-list__items {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	margin: 0;
	padding: 0;
	list-style: none;
}

.pchs-icon-list__media {
	overflow: hidden;
	border-radius: var(--wp--custom--radius--xxl); /* 40px */
	/* Softer and further spread than the shared shadow tokens, and used only
	   here, so it is not promoted to theme.json until a second section wants
	   the same. */
	box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.2);
}

.pchs-icon-list__image {
	display: block;
	width: 100%;
	/*
	 * height:auto is doing real work here, not tidying up.
	 *
	 * WordPress writes the file's own width and height onto the <img>, and a
	 * browser maps those attributes to CSS as presentation hints. An author
	 * rule for width overrides that hint, but with no rule for height the
	 * attribute stands - so the picture rendered at its full 1288px and the
	 * aspect-ratio below was ignored, because a ratio only applies when one
	 * dimension is auto. Stating height:auto hands the ratio back control.
	 */
	height: auto;
	/* The frame crops this portrait to 4:5 whatever shape is uploaded. */
	aspect-ratio: 140 / 175;
	object-fit: cover;
	object-position: var(--pchs-icon-list-focal, 50% 50%);
}


/* ------------------------------------------------------------
   Up to 767px
   Figma node 2001:2050.

   One column, and the photograph is drawn first - above the
   heading rather than beside it. It stays last in the document
   so the heading is read first; these rows are what reorder it.
   ------------------------------------------------------------ */

@media (max-width: 767px) {

	.pchs-icon-list__media {
		grid-row: 1;
	}

	.pchs-icon-list__info {
		grid-row: 2;
	}

	.pchs-icon-list__items {
		grid-row: 3;
	}
}


/* ------------------------------------------------------------
   768px to 1023px
   Figma node 2001:1891.

   The heading spans the full width, with the list and the
   photograph side by side beneath it. Column gap is 40 here and
   20 above - measured from the frames, where a twelve-column
   grid resolves to 445.33 and 202.67 only at a 40px gap.
   ------------------------------------------------------------ */

@media (min-width: 768px) {

	.pchs-icon-list {
		grid-template-columns: repeat(12, minmax(0, 1fr));
		/* Shared with the other section on this grid: 40 here,
		   20 from 1024. */
		column-gap: var(--pchs-grid-gap);
	}

	.pchs-icon-list__info {
		grid-column: 1 / -1;
		grid-row: 1;
	}

	.pchs-icon-list__items {
		grid-column: 1 / span 8;
		grid-row: 2;
	}

	.pchs-icon-list__media {
		grid-column: 9 / span 4;
		grid-row: 2;
		/* Keeps its own height rather than stretching to match the
		   list beside it. */
		align-self: start;
	}
}


/* ------------------------------------------------------------
   1024px and up
   Figma nodes 2001:1575 and 2328:8605.

   The heading narrows to the left eight columns and the
   photograph rises to sit beside both it and the list.
   ------------------------------------------------------------ */

@media (min-width: 1024px) {

	.pchs-icon-list {
		column-gap: var(--wp--preset--spacing--20);
	}

	.pchs-icon-list__info {
		grid-column: 1 / span 8;
	}

	/* Holds the heading and the list clear of the photograph.
	   Measured: the text is 788 wide inside an 868 column. */
	.pchs-icon-list__info,
	.pchs-icon-list__items {
		padding-right: var(--wp--preset--spacing--80);
	}

	.pchs-icon-list__media {
		grid-row: 1 / span 2;
	}
}


/* Wider than the design: handled by --pchs-page-gutter in the padding at the
   top of this file, which needs no breakpoint. */


/* ============================================================
   THE PALE BAND
   Figma: PAC-Page-Designs, page "Nursing-PBSN"
     1440px  node 2329:13688   section 1440 x 692
      768px  node 2332:14541   section  768 x 640
      390px  node 2418:9466    section  390 x 1088.5

   The same three children in the same places - only the band
   behind them differs. Where the home page lays an opaque white
   fill over the grey-blue gradient, this one lets the gradient
   show and draws the wave over it.
   ============================================================ */

.pchs-icon-list--pale {
	position: relative;
	/* Contains the wave's blending, so it works against this band's own
	   background rather than against whatever is behind the section. */
	isolation: isolate;
	background-color: var(--wp--preset--color--gray-100);
	/*
	 * 90.27deg - a quarter of a degree off horizontal, which is a sub-pixel
	 * difference across 1440, so no breakpoint restates it.
	 */
	background-image: linear-gradient(
		90.2722deg,
		var(--wp--preset--color--gray-100) 0%,
		var(--wp--preset--color--gray-900) 100%
	);
}

/*
 * The wave.
 *
 * wave-band.png is NOT images/sections/marquee-sm-texture.png, close as the
 * two look: they are different exports of the same drawing and they do not
 * score the same. Against this frame's own pixels, this file at luminosity
 * 0.6 comes to a mean error of 0.44 of 255 and the other to 2.51.
 *
 * Luminosity here, where blocks/steps/style.css needs multiply for its own
 * wave - the two exports differ in exactly the way that matters to a blend.
 * Scored rather than assumed; scratchpad/try-icons-band.php is the working.
 */
.pchs-icon-list--pale::before {
	position: absolute;
	z-index: 0;
	content: "";
	inset: 0;
	background-image: url("../../images/sections/wave-band.png");
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
	opacity: 0.6;
	mix-blend-mode: luminosity;
	pointer-events: none;
}

/* Above the wave. Without this the words and the photograph are painted
   under it and come out tinted. */
.pchs-icon-list--pale > * {
	position: relative;
	z-index: 1;
}
