/*
 * Strikers theme: Updates (posts). Split out of style.css (STR-185, speed) so other pages
 * don't download it. Loaded after style.css only where it is used:
 *   /updates/ (posts page), post archives (category, tag, date, author), single posts; also /manage-subscriptions/, MailPoet pages and legal pages (/privacy_policy/, page-legal template; STR-184) (they reuse the post head and post text)
 * (functions.php strikers_enqueue_page_styles).
 * Same rules as style.css: theme.json tokens only, no colors or sizes here.
 */

/* ======================================================================
 * Updates (STR-178): /updates/ (home.html), category pages (archive.html), posts (single.html).
 * Mix rhythm: a night-fade head (strikers-gb-intro, so the White look turns it white), then a
 * white reading zone. The one bold moment: on a post, the featured image straddles the night/day
 * edge; on the list, the newest post is a wide lead from 782px (page 1 only).
 * Reading width: custom measure-read (36rem, about 65 characters of 17px body text). It is in
 * rem, not ch, because WordPress applies the content size to every child (a ch value would
 * grow with each heading's font size).
 * Pairs (all existing): night E8E8ED 12.3:1 on navy / 17.2:1 on black, A1A1A6 5.82:1 on navy;
 * light 1D1D1F 16.83:1, 6E6E73 5.07:1, links 0000F9 8.87:1, white on red 5.84:1 (on white).
 * ====================================================================== */

/* ---- Chips: the category list (core/categories) and a post's categories (core/post-terms).
   Same shape as the leagues jump chips: 1px A1A1A6 edge, E8E8ED label, 44px tall; hover and
   the current category fill E8E8ED with a black label (17.2:1). ---- */
.strikers-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--2);
	list-style: none;
	margin: 0;
	padding: 0;
}

.strikers-chips > li {
	margin: 0;
}

.strikers-updates-intro .strikers-chips {
	margin-block-start: var(--wp--preset--spacing--6);
}

.strikers-chips .wp-block-post-terms__separator {
	display: none;
}

.strikers-chips a {
	align-items: center;
	border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--ink-muted-dark);
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--ink-dark);
	display: inline-flex;
	font-size: var(--wp--preset--font-size--caption);
	font-weight: var(--wp--custom--font-weight--semibold);
	line-height: var(--wp--custom--line-height--caption);
	min-height: var(--wp--custom--tap-target);
	padding: 0 var(--wp--preset--spacing--4);
	text-decoration: none;
}

.strikers-chips a:hover,
.strikers-chips .current-cat > a {
	background-color: var(--wp--preset--color--ink-dark);
	border-color: var(--wp--preset--color--ink-dark);
	color: var(--wp--preset--color--surface-dark);
	text-decoration: none;
}

/* ---- Posts list: one column on phones (photo, title, date, excerpt), three from 782px.
   No card boxes: the photo's corners and the space between posts do the grouping. ---- */
.strikers-updates-list {
	display: grid;
	gap: var(--wp--preset--spacing--10);
	grid-template-columns: minmax(0, 1fr);
}

.strikers-updates-list > li {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--4);
	margin: 0;
	position: relative;
}

.strikers-updates-list > li > *,
.strikers-updates-text > * {
	margin: 0;
}

.strikers-updates-photo img,
.strikers-post-media img {
	border-radius: var(--wp--custom--radius--md);
	display: block;
	height: auto;
	width: 100%;
}

/* No photo (rev 1): same 3:2 and corners as a photo, navy to black with one blue lane glow
   from below. Decorative and empty (no logo: the colour logo never sits on dark; add the white
   logo here once Strikers supplies it). */
.strikers-photo-placeholder {
	aspect-ratio: 3 / 2;
	background: var(--wp--preset--gradient--photo-placeholder);
	border-radius: var(--wp--custom--radius--md);
	width: 100%;
}

.strikers-updates-title {
	font-size: var(--wp--preset--font-size--h-3);
	line-height: var(--wp--custom--line-height--h-3);
}

/* Excerpt (rev 1): 30 words in the HTML, 3 lines on screen; the date sits closer to the title
   than the excerpt does. Text 1D1D1F on white 16.83:1. */
.strikers-updates-excerpt {
	padding-top: var(--wp--preset--spacing--1);
}

.strikers-updates-excerpt .wp-block-post-excerpt__excerpt {
	-webkit-box-orient: vertical;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	margin: 0;
	overflow: hidden;
}

/* The title is the post's one link; its hit area covers the whole post (photo, date, excerpt). */
.strikers-updates-title a::after {
	border-radius: var(--wp--custom--radius--md);
	content: "";
	inset: 0;
	position: absolute;
}

.strikers-updates-list > li:hover .strikers-updates-title a {
	text-decoration: underline;
}

/* Keyboard: the ring goes round the whole post, not just the title (0000F9 8.87:1 on white). */
.strikers-updates-title a:focus-visible {
	box-shadow: none;
	outline: none;
	text-decoration: underline;
}

.strikers-updates-title a:focus-visible::after {
	box-shadow: var(--wp--custom--focus-glow);
	outline: var(--wp--custom--border--width) solid var(--wp--preset--color--blue-text-dark);
	outline-offset: var(--wp--preset--spacing--2);
}

@media (min-width: 782px) {
	.strikers-updates-list {
		column-gap: var(--wp--preset--spacing--10);
		grid-template-columns: repeat(3, minmax(0, 1fr));
		row-gap: var(--wp--preset--spacing--16);
	}

	/* Page 1: the newest post leads across the row, photo 7 / text 5 (body.paged = page 2+). */
	body:not(.paged) .strikers-updates-list > li:first-child {
		grid-column: 1 / -1;
	}

	body:not(.paged) .strikers-updates-list > li:first-child:has(> .strikers-updates-photo) {
		align-items: center;
		column-gap: var(--wp--preset--spacing--10);
		display: grid;
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	}

	body:not(.paged) .strikers-updates-list > li:first-child .strikers-updates-title {
		font-size: var(--wp--preset--font-size--h-2);
		line-height: var(--wp--custom--line-height--h-2);
	}

	body:not(.paged) .strikers-updates-list > li:first-child .strikers-updates-excerpt {
		font-size: var(--wp--preset--font-size--body-lg);
		line-height: var(--wp--custom--line-height--body-lg);
	}

	/* The lead's text column is wider and beside the photo: one more line fits its height. */
	body:not(.paged) .strikers-updates-list > li:first-child .wp-block-post-excerpt__excerpt {
		-webkit-line-clamp: 4;
		line-clamp: 4;
	}
}

/* ---- Pagination: Newer Posts | 1 2 | Older Posts on a hairline. Numbers are 44px circles;
   the current page is filled ink (white on 1D1D1F 16.83:1). ---- */
.strikers-updates .strikers-pager {
	border-top: var(--wp--custom--border--hairline) solid var(--wp--preset--color--hairline-dark);
	gap: var(--wp--preset--spacing--4);
	margin-top: var(--wp--preset--spacing--16);
	padding-top: var(--wp--preset--spacing--6);
}

.strikers-pager > *,
.strikers-pager .wp-block-query-pagination-numbers {
	margin: 0;
}

.strikers-pager .wp-block-query-pagination-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--1);
}

.strikers-pager :is(.page-numbers, .wp-block-query-pagination-previous, .wp-block-query-pagination-next) {
	align-items: center;
	display: inline-flex;
	font-weight: var(--wp--custom--font-weight--semibold);
	min-height: var(--wp--custom--tap-target);
}

.strikers-pager .page-numbers {
	border-radius: var(--wp--custom--radius--pill);
	justify-content: center;
	min-width: var(--wp--custom--tap-target);
}

.strikers-pager .page-numbers.current {
	background-color: var(--wp--preset--color--ink-dark);
	color: var(--wp--preset--color--surface-dark);
}

/* ---- Single post: the head and the reading zone share the reading width; the featured image
   (and any wide block in the text) uses the theme's content width, 760px. ---- */
.strikers-post-main {
	--wp--style--global--wide-size: var(--wp--style--global--content-size);
}

.strikers-post-intro,
.strikers-post {
	--wp--style--global--content-size: var(--wp--custom--measure-read);
}

.strikers-post-intro {
	padding-bottom: var(--wp--preset--spacing--10);
}

/* "Updates" back to the list: E8E8ED, underlined (blue 6B7BFF is 4.21:1 on navy). */
.strikers-post-intro .strikers-post-back {
	margin-bottom: 0;
}

.strikers-post-intro .strikers-post-title {
	font-size: var(--wp--preset--font-size--h-2);
	line-height: var(--wp--custom--line-height--h-2);
	margin-top: 0;
}

@media (min-width: 782px) {
	.strikers-post-intro .strikers-post-title {
		font-size: var(--wp--preset--font-size--h-1);
		line-height: var(--wp--custom--line-height--h-1);
	}
}

/* The photo straddles the edge: the night band grows by space-16 and the photo rises into it.
   flow-root keeps the negative margin from pulling the white ground up with it. */
.strikers-post-intro:has(+ .strikers-post > .strikers-post-media) {
	padding-bottom: calc(var(--wp--preset--spacing--10) + var(--wp--preset--spacing--16));
}

.strikers-post {
	display: flow-root;
	padding-top: var(--wp--preset--spacing--10);
}

.strikers-post:has(> .strikers-post-media) {
	padding-top: 0;
}

.strikers-post.strikers-zone-light > .strikers-post-media {
	margin-top: calc(-1 * var(--wp--preset--spacing--16));
	position: relative;
}

.strikers-post.strikers-zone-light > .strikers-post-media + .strikers-post-text {
	margin-top: var(--wp--preset--spacing--10);
}

/* ---- Post text (staff content). Underlined links (WCAG 1.4.1), air above headings, photos
   with the photo radius. Live posts use H3 subheads; both H2 and H3 read as subheads here. ---- */
.strikers-post-text > :first-child {
	margin-top: 0;
}

.strikers-post-text a:not(.wp-element-button) {
	text-decoration: underline;
	text-decoration-thickness: var(--wp--custom--border--hairline);
	text-underline-offset: 0.15em;
}

.strikers-post-text a:not(.wp-element-button):hover {
	text-decoration-thickness: var(--wp--custom--border--width);
}

.strikers-post-text > :is(h2, h3, h4) {
	margin-top: var(--wp--preset--spacing--10);
}

.strikers-post-text > :is(h2, h3, h4) + * {
	margin-top: var(--wp--preset--spacing--2);
}

.strikers-post-text h4 {
	font-size: var(--wp--preset--font-size--body-lg);
	line-height: var(--wp--custom--line-height--body-lg);
}

.strikers-post-text :is(ul, ol) {
	padding-left: var(--wp--preset--spacing--6);
}

.strikers-post-text li + li {
	margin-top: var(--wp--preset--spacing--2);
}

.strikers-post-text img {
	border-radius: var(--wp--custom--radius--md);
	height: auto;
	max-width: 100%;
}

/* ---- End of post: the approved book line, Book a Lane (red) + Plan a Party (outline), then the
   previous / next post. Hairlines D2D2D7 only mark the change of topic. ---- */
.strikers-post > .strikers-post-cta {
	border-top: var(--wp--custom--border--hairline) solid var(--wp--preset--color--hairline-dark);
	margin-top: var(--wp--preset--spacing--16);
	padding-top: var(--wp--preset--spacing--10);
}

.strikers-post > .strikers-post-nav {
	border-top: var(--wp--custom--border--hairline) solid var(--wp--preset--color--hairline-dark);
	display: grid;
	gap: var(--wp--preset--spacing--4);
	margin-top: var(--wp--preset--spacing--16);
	padding-top: var(--wp--preset--spacing--6);
}

.strikers-post-nav a {
	display: flex;
	flex-direction: column;
	font-weight: var(--wp--custom--font-weight--semibold);
	justify-content: center;
	min-height: var(--wp--custom--tap-target);
}

.strikers-post-nav a:hover .post-navigation-link__title {
	text-decoration: underline;
}

.strikers-post-nav a:hover {
	text-decoration: none;
}

.strikers-post-nav .post-navigation-link__label {
	color: var(--wp--preset--color--ink-muted-dark);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: var(--wp--custom--font-weight--regular);
	line-height: var(--wp--custom--line-height--caption);
}

@media (min-width: 782px) {
	.strikers-post > .strikers-post-nav {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.strikers-post-nav .post-navigation-link-next {
		grid-column: 2;
		text-align: right;
	}

	.strikers-post-nav .post-navigation-link-next a {
		align-items: flex-end;
	}
}

/* ---- legal.body (STR-184): post reading zone; the first line is "Last updated" (caption,
   6E6E73 5.07:1 on white); numbered H2s at the h3 size with a hairline above, so the sections
   scan as a list without 32px headings wrapping on phones. ---- */
.strikers-legal-text > p:first-child {
	color: var(--wp--preset--color--ink-muted-dark);
	font-size: var(--wp--preset--font-size--caption);
	line-height: var(--wp--custom--line-height--caption);
}

.strikers-post-text.strikers-legal-text > h2 {
	border-top: var(--wp--custom--border--hairline) solid var(--wp--preset--color--hairline-dark);
	font-size: var(--wp--preset--font-size--h-3);
	line-height: var(--wp--custom--line-height--h-3);
	padding-top: var(--wp--preset--spacing--6);
}
