/* ===================================================================
 * Learning centre hub
 *
 * Built from the real article library, so the styling has to survive a
 * topic gaining or losing articles without anything looking broken.
 * ================================================================= */

.sm-hub__intro { text-align: center; }

/* ---- The featured article ---- */
.sm-feature {
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	gap: 0;
	margin-block-start: var(--wp--preset--spacing--40);
	border: 2px solid #C3D9EC;
	border-radius: 22px;
	overflow: hidden;
	background: var(--wp--preset--color--paper);
	text-decoration: none;
	text-align: start;
	transition: transform .18s ease, box-shadow .18s ease;
}
.sm-feature:hover,
.sm-feature:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 18px 38px rgba(4, 41, 104, .16);
}
.sm-feature__img { background: var(--wp--preset--color--mist); min-block-size: 260px; }
.sm-feature__img img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	display: block;
}
.sm-feature__body {
	padding: var(--wp--preset--spacing--40);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: .5em;
}
.sm-feature__kicker {
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .06em;
	color: var(--wp--preset--color--brand);
}
.sm-feature__body h2 {
	font-size: clamp(1.4rem, 2.6vw, 2rem);
	line-height: 1.22;
	color: var(--wp--preset--color--navy);
	margin: 0;
	text-wrap: balance;
}
.sm-feature__body p {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.6;
	color: var(--wp--preset--color--ink);
}
.sm-feature__go { font-weight: 700; color: var(--wp--preset--color--brand); }

/* ---- Topic bands ---- */
.sm-hub__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--20);
	padding-block-end: 1em;
	border-block-end: 4px solid var(--wp--preset--color--cloud);
}
/* One colour per topic, carried on the rule under its heading. */
.sm-hub__head--sky   { border-block-end-color: var(--wp--preset--color--sky); }
.sm-hub__head--grass { border-block-end-color: var(--wp--preset--color--grass); }
.sm-hub__head--brand { border-block-end-color: var(--wp--preset--color--brand); }
.sm-hub__head--navy  { border-block-end-color: var(--wp--preset--color--navy); }

.sm-hub__count {
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .05em;
	color: var(--wp--preset--color--brand);
	unicode-bidi: isolate;
}
.sm-hub__head h2 {
	font-size: clamp(1.5rem, 3vw, 2.2rem);
	line-height: 1.2;
	color: var(--wp--preset--color--navy);
	margin: .15em 0 0;
}
.sm-hub__head p {
	margin: .4em 0 0;
	max-inline-size: 46rem;
	color: var(--wp--preset--color--ink);
	line-height: 1.55;
}
.sm-hub__all {
	white-space: nowrap;
	font-weight: 700;
	color: var(--wp--preset--color--navy);
	text-decoration: none;
	padding: .5em 0;
}
.sm-hub__all:hover { color: var(--wp--preset--color--brand); }

@media (max-width: 900px) {
	.sm-feature { grid-template-columns: 1fr; }
	.sm-feature__img { min-block-size: 200px; aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) {
	.sm-feature { transition: none; }
	.sm-feature:hover,
	.sm-feature:focus-visible { transform: none; }
}

/* A topic with two articles left a hole where the third would be. Two
   articles now fill the row; three use three columns.
   Held behind a min-width: :has() outranks the plain-class phone rule on
   specificity, which is how the learning-centre grid broke at 360px. */
.sm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1081px) {
	.sm-cards:has(> :nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
