/* ==========================================================================
   Learning Hub — Project Stories (neilkelly/learning-hub-stories)
   Figma: Learning Center / Zone 7 - Project Stories (1831:1004)
   Token-driven. Wrapper: .wp-block-neilkelly-learning-hub-stories.nk-learning-hub-stories
   Heading + intro + 3-up project cards + See All link.

   The card is the shared project card, matching neilkelly/person-featured-projects
   and its siblings (project-related, location-featured-projects,
   designers-featured-projects) — duplicated by convention, keep in sync. Section
   chrome (grey band, content-width headline) stays the Learning Hub's own so the
   zone still sits in the page's rhythm; the closing button is the family's centered
   black primary CTA.
   ========================================================================== */
.wp-block-neilkelly-learning-hub-stories.nk-learning-hub-stories {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--10);
	padding: var(--wp--preset--spacing--24) var(--wp--preset--spacing--gutter);
	background: var(--wp--preset--color--surface-section);
	font-family: var(--wp--preset--font-family--inter);
	box-sizing: border-box;
}

/* Cap + center the inner content so the full-bleed band doesn't spread
   edge-to-edge on wide screens. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__header,
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__grid,
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__footer {
	width: 100%;
	max-width: var(--wp--custom--layout--content-width);
}

/* --- Header --- */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__header {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--3);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__heading {
	/* Headline measure — three quarters of the content column, theme-wide (Shawn, 2026-08-18). */
	max-width: var(--wp--custom--layout--headline-measure);
	/* Size + case from the shared .nk-headline--content class (mapped in render.php). */
	margin: 0;
	color: var(--wp--preset--color--brand-black);
	font-weight: var(--wp--custom--font-weight--extrabold);
	line-height: var(--wp--custom--line-height--lg-tight);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__subtext {
	margin: 0;
	max-width: var(--wp--custom--components--learning-hub--stories-subtext-max-width);
	color: var(--wp--preset--color--ink-secondary);
	font-size: var(--wp--preset--font-size--md);
	font-weight: var(--wp--custom--font-weight--regular);
	line-height: var(--wp--custom--line-height--base);
}

/* --- Cards grid ---
   Three shared rows (media / body / featured) so the cards' inner sections line up
   across the row via subgrid; cards override the row gap to 0 so their own inner
   rows stay seamless. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: auto auto auto;
	column-gap: var(--wp--preset--spacing--6);
	row-gap: var(--wp--preset--spacing--6);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__card {
	position: relative;
	display: grid;
	grid-row: span 3;
	grid-template-rows: subgrid;
	row-gap: 0;
	background: linear-gradient(to bottom, var(--wp--preset--color--surface-card), var(--wp--preset--color--neutral-50));
	border: 1px solid var(--wp--preset--color--neutral-200);
	border-radius: var(--wp--custom--radius--card);
	box-shadow: var(--wp--custom--shadow--card-float);
	overflow: hidden;
}

/* --- Media + award badge --- */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__media {
	grid-row: 1;
	display: block;
	/* Also the containing block for the award badge below. */
	position: relative;
	margin: 0;
	width: 100%;
	height: var(--wp--custom--components--project--related-card-image-height);
	overflow: hidden;
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

/* Image-less card: a flat grey block at the same height, so the shared media row
   never collapses under one card and stretches under another. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__img--placeholder {
	background: var(--wp--preset--color--surface-subtle);
}

/* Cover image zooms on whole-card hover/focus (clipped by __media overflow).
   `:focus-within` rather than `:focus-visible` because the card is an <li> and can't
   take focus itself; the links inside keep their own focus rings. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__card:hover .nk-learning-hub-stories__img,
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__card:focus-within .nk-learning-hub-stories__img {
	transform: scale(var(--wp--custom--components--learning-hub--card-hover-zoom));
}

/* Only projects carrying an award label get the badge. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__badge {
	position: absolute;
	top: var(--wp--preset--spacing--3);
	left: var(--wp--preset--spacing--3);
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--1);
	padding: var(--wp--custom--components--person--featured-badge-pad-y) var(--wp--preset--spacing--2-5);
	border-radius: var(--wp--custom--radius--full);
	background: var(--wp--preset--color--utility-gold);
	font-size: var(--wp--preset--font-size--ui-label);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--none);
	color: var(--wp--preset--color--surface-page);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__badge-star {
	line-height: 1;
}

/* --- Card body --- */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__body {
	grid-row: 2;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--4);
	padding: var(--wp--preset--spacing--6-5) var(--wp--preset--spacing--6-5) var(--wp--preset--spacing--7);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__title {
	margin: 0;
	color: var(--wp--preset--color--ink-primary);
	font-size: var(--wp--preset--font-size--md);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--none);
}

/* Uppercase, wide-tracked eyebrow. Two lines: "service • scope", then location. The
   __subtitle-line spans have no rule of their own, they stack purely as flex items of
   this column, so the line COUNT is set where the array is built
   (neilkelly_learning_hub_stories, inc/resources.php). */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__subtitle {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--1);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: var(--wp--custom--font-weight--regular);
	line-height: var(--wp--custom--line-height--none);
	letter-spacing: var(--wp--custom--letter-spacing--wide);
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-primary);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__blurb {
	margin: 0;
	font-size: var(--wp--preset--font-size--ui-nav);
	line-height: var(--wp--custom--line-height--base);
	color: var(--wp--preset--color--ink-secondary);
}

/* Designer byline — avatar + name + role. Pinned to the foot of the body: the body
   stretches to the shared subgrid row height, so `margin-top: auto` pushes the byline
   down and the bylines line up across the row even when titles/blurbs differ. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__designer {
	margin-top: auto;
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--3);
	text-decoration: none;
	color: inherit;
}
/* Renders as an anchor when the filter supplies a designer_url (published People CPT
   record). Only the anchor variant is interactive; the span fallback stays static. */
a.nk-learning-hub-stories__designer:hover .nk-learning-hub-stories__designer-name {
	text-decoration: underline;
}
a.nk-learning-hub-stories__designer:focus-visible {
	outline: 2px solid var(--wp--preset--color--ink-primary);
	outline-offset: 2px;
	border-radius: var(--wp--custom--radius--default);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__designer-avatar {
	display: block;
	flex: 0 0 auto;
	width: var(--wp--custom--components--content-detail--avatar-size);
	height: var(--wp--custom--components--content-detail--avatar-size);
	border-radius: var(--wp--custom--radius--full);
	border: 1px solid var(--wp--preset--color--border-default);
	overflow: hidden;
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__designer-avatar-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top; /* keep the head in frame, not center-cropped */
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__designer-text {
	display: flex;
	flex-direction: column;
	text-align: left;
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__designer-name {
	color: var(--wp--preset--color--ink-primary);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--font-weight--bold);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__designer-role {
	color: var(--wp--preset--color--ink-secondary);
	font-size: var(--wp--preset--font-size--sm);
}

/* --- Featured Project panel (grey foot of the card) --- */
/* Deliberately unpositioned: the card is the containing block for the "View Project"
   link's whole-card overlay, so `inset: 0` must resolve against the card and not
   against this panel. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__featured {
	grid-row: 3;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--4);
	padding: var(--wp--preset--spacing--6-5) var(--wp--preset--spacing--6-5) var(--wp--preset--spacing--7);
	background: var(--wp--preset--color--surface-subtle);
	border-top: 1px solid var(--wp--preset--color--neutral-200);
}

/* Testimonials toggled off (stories_show_testimonial): the panel holds nothing but
   the "View Project" link, so it stops reading as a panel — drop the grey fill and the
   divider and let the link sit on the card's own gradient. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__featured--bare {
	padding-top: 0;
	padding-bottom: var(--wp--preset--spacing--6-5);
	background: none;
	border-top: 0;
}

/* --- Testimonial sub-card ---
   Fills the panel's spare height (`flex: 1`) so the white sub-cards are equal height
   across the row and the "View Project" link sits directly beneath each one. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__testimonial {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--1-75);
	padding: var(--wp--preset--spacing--3) var(--wp--preset--spacing--5);
	background: var(--wp--preset--color--surface-card);
	border: 1px solid var(--wp--preset--color--border-subtle);
	border-radius: var(--wp--custom--radius--card);
	margin: 0;
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__testimonial-mark {
	height: var(--wp--custom--components--kitchen-remodel--tier-testimonial-mark-height);
	font-size: var(--wp--preset--font-size--xxl);
	font-weight: var(--wp--custom--font-weight--extrabold);
	line-height: var(--wp--custom--line-height--none);
	color: var(--wp--preset--color--brand-red);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__testimonial-quote {
	font-size: var(--wp--preset--font-size--base);
	font-weight: var(--wp--custom--font-weight--medium);
	line-height: var(--wp--custom--line-height--md-tight);
	color: var(--wp--preset--color--ink-primary);
	margin: 0;
}

/* Pinned to the foot of the sub-card, which stretches (`flex: 1` above), so the
   attributions sit on a common line across the row under quotes of differing length. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__testimonial-cite {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--0-5);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__testimonial-name {
	font-size: var(--wp--preset--font-size--sm-md);
	font-weight: var(--wp--custom--font-weight--bold);
	color: var(--wp--preset--color--ink-primary);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__testimonial-place {
	font-size: var(--wp--preset--font-size--xs);
	font-weight: var(--wp--custom--font-weight--regular);
	color: var(--wp--preset--color--ink-secondary);
}

/* --- "View Project" link — red arrow link ---
   Pinned to the foot of the grey panel, same trick as the designer byline, so the
   links line up across the row despite uneven testimonial lengths. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__view {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: var(--wp--preset--spacing--1);
	font-size: var(--wp--preset--font-size--ui-nav);
	font-weight: var(--wp--custom--font-weight--medium);
	text-decoration: none;
	color: var(--wp--preset--color--brand-red);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__view:focus-visible {
	outline: 2px solid var(--wp--preset--color--brand-red);
	outline-offset: 2px;
}

/* --- Whole-card click target ---
   The "View Project" link stretches an invisible overlay over the entire card, so
   clicking anywhere on the card opens the project. One anchor, one tab stop, no JS.
   Trade-off: the overlay also suppresses text selection inside the card. */
.wp-block-neilkelly-learning-hub-stories a.nk-learning-hub-stories__view::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* The designer byline keeps its own destination: only the anchor variant lifts above
   the card overlay. The non-linked <span> variant stays under it, so that part of the
   card still opens the project. */
a.nk-learning-hub-stories__designer {
	position: relative;
	z-index: 1;
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__arrow {
	display: block;
	flex-shrink: 0;
	transition: transform 200ms ease;
}
/* Arrow nudges right on hover/focus of the link — which, thanks to the overlay above,
   means anywhere on the card. The static variant (editor preview, no project to open)
   has no hover treatment of its own. */
.wp-block-neilkelly-learning-hub-stories a.nk-learning-hub-stories__view:hover .nk-learning-hub-stories__arrow,
.wp-block-neilkelly-learning-hub-stories a.nk-learning-hub-stories__view:focus-visible .nk-learning-hub-stories__arrow {
	transform: translateX(var(--wp--preset--spacing--1-5));
}
@media (prefers-reduced-motion: reduce) {
	.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__arrow,
	.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__img { transition: none; }

	.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__card:hover .nk-learning-hub-stories__img,
	.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__card:focus-within .nk-learning-hub-stories__img,
	.wp-block-neilkelly-learning-hub-stories a.nk-learning-hub-stories__view:hover .nk-learning-hub-stories__arrow,
	.wp-block-neilkelly-learning-hub-stories a.nk-learning-hub-stories__view:focus-visible .nk-learning-hub-stories__arrow { transform: none; }
}

/* --- Footer / See All --- */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__footer {
	display: flex;
	justify-content: center;
	padding-top: var(--wp--preset--spacing--5);
}

/* Primary CTA — black fill, lifts to neutral-800 on hover. The section ground is
   Surface/Section, still a light background, so primary is black per the CLAUDE.md
   CTA rules — same treatment as nk-person-authored__view-all,
   person-featured-projects__view-all and location-featured-projects__cta--primary. */
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__see-all {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	/* Figma width is a floor, not a cap — a longer CTA label grows the button
	   instead of wrapping to two lines. */
	min-width: var(--wp--custom--components--person--featured-view-all-width);
	max-width: 100%;
	min-height: var(--wp--preset--spacing--14);
	padding: var(--wp--preset--spacing--3) var(--wp--preset--spacing--6);
	background: var(--wp--preset--color--brand-black);
	border: 1.5px solid var(--wp--preset--color--brand-black);
	border-radius: var(--wp--custom--radius--lg);
	font-size: var(--wp--preset--font-size--base);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--none);
	color: var(--wp--preset--color--brand-white);
	text-decoration: none;
	transition: background-color 200ms ease, border-color 200ms ease;
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__see-all:hover,
.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__see-all:focus-visible {
	background: var(--wp--preset--color--neutral-800);
	border-color: var(--wp--preset--color--neutral-800);
}

.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__see-all:focus-visible {
	outline: 2px solid var(--wp--preset--color--brand-black);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__see-all {
		transition: none;
	}
}

/* Responsive ------------------------------------------------------------*/
@media (max-width: 1023px) {
	/* Two columns; cards keep the subgrid so media/body/featured still align per row. */
	.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.wp-block-neilkelly-learning-hub-stories.nk-learning-hub-stories {
		padding: var(--wp--preset--spacing--16) var(--wp--preset--spacing--6);
	}
	/* Single column: drop the subgrid (nothing to align across) and restore the vertical
	   gap between stacked cards; cards revert to a plain flex column. */
	.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__grid {
		grid-template-columns: 1fr;
		grid-template-rows: none;
		row-gap: var(--wp--preset--spacing--6);
	}
	.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__card {
		display: flex;
		flex-direction: column;
		grid-row: auto;
	}
	.wp-block-neilkelly-learning-hub-stories .nk-learning-hub-stories__see-all {
		width: 100%;
	}
}

/* No block-gap seam between full-bleed sections. */
.wp-block-neilkelly-learning-hub-stories { margin-block: 0; }
