/* ==========================================================================
   Person Authored Content (neilkelly/person-authored)
   Figma: Designer Profile / 4 — Authored Content (1051:326). Heading + intro,
   a grid of article cards (each card a single link), and a "View All Writing"
   button — on a Surface/Section ground. Token-driven.
   Wrapper: .wp-block-neilkelly-person-authored.nk-person-authored
   ========================================================================== */
.nk-person-authored {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--10);
	background: var(--wp--preset--color--surface-subtle);
	padding: var(--wp--preset--spacing--24) var(--wp--preset--spacing--gutter);
	font-family: var(--wp--preset--font-family--inter);
}

/* Cap + center inner content so the full-bleed section (background + gutter
   padding) doesn't spread edge-to-edge on wide screens. */
.nk-person-authored__intro,
.nk-person-authored__grid,
.nk-person-authored__actions {
	width: 100%;
	max-width: var(--wp--custom--layout--content-width);
}

/* --- Intro --- */
.nk-person-authored__intro {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--3-5);
}

.nk-person-authored__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;
	font-weight: var(--wp--custom--font-weight--extrabold);
	line-height: var(--wp--custom--line-height--xl);
	color: var(--wp--preset--color--ink-primary);
}

.nk-person-authored__lede {
	margin: 0;
	font-size: var(--wp--preset--font-size--md);
	font-weight: var(--wp--custom--font-weight--regular);
	line-height: var(--wp--custom--line-height--lg-tight);
	color: var(--wp--preset--color--ink-secondary);
}

/* --- Grid --- */
.nk-person-authored__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--wp--preset--spacing--6);
}

.nk-person-authored__item {
	display: flex;
}

/* --- Card (the whole card is the link) --- */
.nk-person-authored__card {
	display: flex;
	flex: 1 1 0;
	min-width: 0;
	flex-direction: column;
	align-items: stretch;
	background: var(--wp--preset--color--surface-card);
	border: 1px solid var(--wp--preset--color--neutral-200);
	border-radius: var(--wp--custom--radius--card);
	overflow: hidden;
	text-decoration: none;
	transition: all 0.25s ease;
}

.nk-person-authored__card:focus-visible {
	outline: 2px solid var(--wp--preset--color--brand-red);
	outline-offset: 2px;
}

/* DATA-GAP: no image sub-field on authored_content — decorative placeholder
   stands in for the Figma 212px card photo so proportions match. */
.nk-person-authored__media {
	display: block;
	width: 100%;
	height: var(--wp--custom--components--person--authored-media-height);
	background: var(--wp--preset--color--surface-section);
	overflow: hidden;
}

.nk-person-authored__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

/* Cover image zooms on whole-card hover/focus (clipped by __media overflow). */
.nk-person-authored__card:hover .nk-person-authored__img,
.nk-person-authored__card:focus-visible .nk-person-authored__img {
	transform: scale(var(--wp--custom--components--team--card-hover-zoom));
}

.nk-person-authored__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--2-5);
	padding: var(--wp--preset--spacing--5) var(--wp--preset--spacing--5-5) var(--wp--preset--spacing--6);
}

.nk-person-authored__overline {
	font-size: var(--wp--preset--font-size--xs);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--none);
	letter-spacing: var(--wp--custom--components--person--authored-overline-tracking);
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-red);
}

.nk-person-authored__title {
	font-size: var(--wp--preset--font-size--md-base);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--components--person--authored-card-title-lh);
	color: var(--wp--preset--color--ink-primary);
}

.nk-person-authored__date {
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--font-weight--regular);
	line-height: var(--wp--custom--line-height--xl);
	color: var(--wp--preset--color--ink-tertiary);
}

/* Red "Read Article" CTA affordance (the whole card is the link). */
.nk-person-authored__read {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--1);
	margin-top: var(--wp--preset--spacing--2);
	font-size: var(--wp--preset--font-size--ui-nav);
	font-weight: var(--wp--custom--font-weight--medium);
	color: var(--wp--preset--color--brand-red);
}
.nk-person-authored__arrow {
	display: inline-block;
	transition: transform 200ms ease;
}
.nk-person-authored__card:hover .nk-person-authored__arrow,
.nk-person-authored__card:focus-visible .nk-person-authored__arrow {
	transform: translateX(var(--wp--preset--spacing--1-5));
}
@media (prefers-reduced-motion: reduce) {
	.nk-person-authored__arrow { transition: none; }
	.nk-person-authored__img { transition: none; }
	.nk-person-authored__card:hover .nk-person-authored__img,
	.nk-person-authored__card:focus-visible .nk-person-authored__img { transform: none; }
}

/* --- View All Writing --- */
.nk-person-authored__actions {
	display: flex;
	justify-content: center;
	width: 100%;
	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 person-featured-projects__view-all and the sibling
   location-featured-projects__cta--primary. */
.nk-person-authored__view-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--authored-button-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;
}

.nk-person-authored__view-all:hover,
.nk-person-authored__view-all:focus-visible {
	background: var(--wp--preset--color--neutral-800);
	border-color: var(--wp--preset--color--neutral-800);
}

@media (prefers-reduced-motion: reduce) {
	.nk-person-authored__view-all {
		transition: none;
	}
}

.nk-person-authored__view-all:focus-visible {
	outline: 2px solid var(--wp--preset--color--brand-black);
	outline-offset: 2px;
}

/* --- Responsive --- */
@media (max-width: 1023px) {
	.nk-person-authored {
		padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--12);
	}
	.nk-person-authored__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.nk-person-authored {
		padding: var(--wp--preset--spacing--16) var(--wp--preset--spacing--6);
		gap: var(--wp--preset--spacing--8);
	}
	.nk-person-authored__heading {
		font-size: var(--wp--preset--font-size--xl);
	}
	.nk-person-authored__grid {
		grid-template-columns: 1fr;
	}
	.nk-person-authored__view-all {
		width: 100%;
	}
}

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

/* --- Profile stripe: this section's background depends on how many of the profile's
   middle sections rendered before it, so a hidden section can't leave two panels of
   the same colour touching. The class comes from neilkelly_person_stripe_class()
   in inc/person.php; these rules must stay after nk-person-authored's own background. --- */
.wp-block-neilkelly-person-authored.nk-person-stripe--white {
	background: var(--wp--preset--color--brand-white);
}
.wp-block-neilkelly-person-authored.nk-person-stripe--grey {
	background: var(--wp--preset--color--surface-subtle);
}
