/* ==========================================================================
   blog.css — home.php (Posts page), category.php, single.php.
   Enqueued conditionally — see cloudco_enqueue_assets() in inc/enqueue.php.
   The card grid also styles the Past Events grid the same way; see
   blocks/past-events/style.css, which extends .cc-postcard rather than
   redefining it.
   ========================================================================== */

.cc-pagehead__desc { margin-top: var(--wp--preset--spacing--20); max-width: 62ch; color: var(--cc-body); }

.cc-blog { padding-block: var(--wp--preset--spacing--60); }

.cc-blog__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40);
	margin-bottom: var(--wp--preset--spacing--50);
}

@media (max-width: 900px) {
	.cc-blog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
	.cc-blog__grid { grid-template-columns: 1fr; }
}

/* --- Post / event card -----------------------------------------------------
   Flat, square, image on top — the media equivalent of .cc-card (which is
   icon/notch and doesn't fit a photograph). No shadow, no hover-lift: a
   1-line rule under the title on hover is the only affordance, matching the
   route-card link treatment. */

/* No card ground (2026-10-09, blog redesign): the house style has no
   --cc-surface cards, and the approved mockup shows image and text sitting
   on the page. */
.cc-postcard {
	position: relative;
	display: flex;
	flex-direction: column;
}

.cc-postcard__media {
	aspect-ratio: 3 / 2;
	background: var(--cc-rule);
	overflow: hidden;
}

.cc-postcard__mediaLink { display: block; width: 100%; height: 100%; }

.cc-postcard__img { display: block; width: 100%; height: 100%; object-fit: cover; }

.cc-postcard__body { padding: var(--wp--preset--spacing--20) 0 0; }

.cc-postcard__title {
	margin: 0 0 0.5rem;
	font-size: var(--wp--preset--font-size--md);
	font-weight: 600;
	line-height: 1.35;
	text-transform: none;
	letter-spacing: 0;
}

.cc-postcard__title a {
	color: var(--wp--preset--color--black);
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

.cc-postcard__title a:hover { border-bottom-color: var(--wp--preset--color--blue); }

/* Whole-card click target, same technique as .cc-routes__card. */
.cc-postcard__title a::after {
	content: '';
	position: absolute;
	inset: 0;
}

.cc-postcard__excerpt {
	margin: 0 0 0.75rem;
	color: var(--cc-body);
	font-size: var(--wp--preset--font-size--sm);
}

.cc-postcard__date {
	margin: 0;
	color: var(--cc-body);
	font-size: var(--wp--preset--font-size--xs);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

/* --- Core pagination (the_posts_pagination) -------------------------------- */

.pagination.cc-pagination,
.navigation.pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--20);
	flex-wrap: wrap;
}

.pagination .nav-links { display: flex; align-items: center; gap: var(--wp--preset--spacing--20); flex-wrap: wrap; }

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25em;
	padding: 0.35em 0.6em;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--black);
}

a.page-numbers:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--wp--preset--color--blue); }

/* Current page: black text, blue underline (no text on a blue ground,
   2026-10-09). */
.pagination .page-numbers.current {
	color: var(--wp--preset--color--black);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
	text-decoration-color: var(--wp--preset--color--blue);
}

.pagination .page-numbers.dots { color: var(--cc-body); }

/* --- Single post ------------------------------------------------------------ */

.cc-postpage__meta { margin: var(--wp--preset--spacing--20) 0 0; color: var(--cc-body); font-size: var(--wp--preset--font-size--sm); }
/* Second meta line, directly under the first (approved 2026-10-13). */
.cc-postpage__meta.cc-postpage__updated { margin-top: 0; }
.cc-postpage__sep { margin: 0 0.5em; }

/* No featured image on the post page (option 5, approved 2026-10-28). */

/*
 * 1400px, matching theme.json's contentSize — the same width the block
 * editor already visually constrains a post to. Was 68ch (~720px): Andy
 * wants the reading column to match what he sees while writing, not a
 * narrower typographic measure (2026-09-25).
 */
.cc-postpage__body {
	max-width: var(--wp--style--global--content-size, 1400px);
	padding-block: var(--wp--preset--spacing--30) var(--wp--preset--spacing--60);
}

/* base.css caps a bare <p> at 68ch site-wide; this is the one place that's
   deliberately overridden, since the wrapper above is now the real column. */
/* Post text typography (spacing, heading scale) lives in post-content.css,
   which the editor loads too, so posts look the same while writing. */
.cc-postpage__body img { max-width: 100%; height: auto; }

/*
 * Image alignment in posts (2026-10-13). WordPress only floats an aligned
 * image block (<figure class="wp-block-image alignright">) inside a block
 * layout container (.is-layout-flow / -constrained), which a classic
 * template's content wrapper is not, so "Align right" did nothing here and
 * text never wrapped. These are WordPress's own default values for that
 * layout rule (float, 2em gap on the text side), scoped to the post body.
 * Under 600px there is no room to wrap text, so aligned images go full width.
 */
.cc-postpage__body .alignright { float: right; margin-inline: 2em 0; margin-bottom: 1em; }
.cc-postpage__body .alignleft { float: left; margin-inline: 0 2em; margin-bottom: 1em; }
.cc-postpage__body .aligncenter { margin-inline: auto; }
.cc-postpage__body .aligncenter img { margin-inline: auto; }

/* The post body contains its floats, so nothing after it wraps. */
.cc-postpage__body::after { content: ""; display: table; clear: both; }

@media (max-width: 599px) {
	.cc-postpage__body .alignright,
	.cc-postpage__body .alignleft { float: none; margin-inline: 0; }
}

.cc-postnav {
	display: flex;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
	padding-block: var(--wp--preset--spacing--40);
	margin-bottom: var(--wp--preset--spacing--60);
	border-top: 1px solid var(--cc-rule);
}

.cc-postnav__prev,
.cc-postnav__next { max-width: 42%; }
.cc-postnav__next { margin-left: auto; text-align: right; }

.cc-postnav a { display: block; color: var(--wp--preset--color--black); text-decoration: none; }
.cc-postnav a:hover .cc-postnav__title { border-bottom-color: var(--wp--preset--color--blue); }

.cc-postnav__label {
	display: block;
	margin-bottom: 0.3em;
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--cc-body);
}

.cc-postnav__title {
	display: inline;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	border-bottom: 2px solid transparent;
}

@media (max-width: 599px) {
	.cc-postnav { flex-direction: column; }
	.cc-postnav__prev,
	.cc-postnav__next { max-width: 100%; }
	.cc-postnav__next { margin-left: 0; text-align: left; }
}

/* ==========================================================================
   Featured / Latest top (was the News landing, page 1 of home.php). Approved by Andy 2026-10-09 (mockup B):
   Featured (top story + four spots + subscribe panel) beside a Latest column
   with "View all". Markup in parts/post-lead.php, post-mini.php,
   post-latest.php, blog-subscribe.php. No shadows, no lifts, no rounding.
   ========================================================================== */

.cc-newstop {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: var(--wp--preset--spacing--50);
	padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60);
}

.cc-newstop__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--20);
	margin-bottom: var(--wp--preset--spacing--20);
}

/* theme.json styles every h2/h3 as its own size; stated here so the section
   labels stay at this size whatever the element style does. */
.cc-newstop__heading,
.cc-blog__heading {
	margin: 0;
	font-size: var(--wp--preset--font-size--lg);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
}

.cc-newstop__viewall,
.cc-newstop a.cc-newstop__viewall {
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	color: var(--wp--preset--color--black);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
	text-decoration-color: var(--wp--preset--color--blue);
}

.cc-newstop__viewall:hover,
.cc-newstop__viewall:focus-visible { text-decoration-color: currentColor; }

/* Shared small type: kicker and date. */
.cc-postlead__kicker,
.cc-postmini__kicker,
.cc-postlatest__kicker {
	margin: 0;
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--black);
}

.cc-postlead__date,
.cc-postmini__date,
.cc-postlatest__date {
	margin: 0;
	font-size: var(--wp--preset--font-size--xs);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--cc-muted);
}

/* Titles: whole item is the click target (stretched link), underline in
   blue on hover only. text-transform/letter-spacing are stated because
   theme.json uppercases every h3. */
.cc-postlead__title,
.cc-postmini__title,
.cc-postlatest__title {
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	text-wrap: balance;
}

.cc-postlead__title a,
.cc-postmini__title a,
.cc-postlatest__title a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.16em;
	text-decoration-color: transparent;
	transition: text-decoration-color var(--cc-hover-dur, 140ms) var(--cc-hover-ease, ease);
}

.cc-postlead:hover .cc-postlead__title a,
.cc-postmini:hover .cc-postmini__title a,
.cc-postlatest:hover .cc-postlatest__title a,
.cc-postlead__title a:focus-visible,
.cc-postmini__title a:focus-visible,
.cc-postlatest__title a:focus-visible { text-decoration-color: var(--wp--preset--color--blue); }

.cc-postlead__title a::after,
.cc-postmini__title a::after,
.cc-postlatest__title a::after {
	content: '';
	position: absolute;
	inset: 0;
}

/* --- Top story ------------------------------------------------------------ */

/* The notch. .cc-notch lives in cards.css, which only loads where a card
   block renders, so the Blog page states the same clip-path itself. */
.cc-postlead,
.cc-subscribe {
	clip-path: polygon(
		var(--cc-notch) 0,
		100% 0,
		100% 100%,
		0 100%,
		0 var(--cc-notch)
	);
}

.cc-postlead {
	--cc-notch: 32px;
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
	min-height: 330px;
}

.cc-postlead__body {
	display: flex;
	flex-direction: column;
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
}

.cc-postlead .cc-postlead__kicker { color: var(--wp--preset--color--blue); }

.cc-postlead__title {
	margin: 0.75rem 0 1rem;
	font-size: 1.75rem;
	line-height: 1.25;
	color: var(--wp--preset--color--white);
}

.cc-postlead__excerpt {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--cc-body-dark);
}

.cc-postlead .cc-postlead__date {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--30);
	color: var(--cc-muted-dark);
}

.cc-postlead__media { background: var(--cc-surface); overflow: hidden; }
.cc-postlead__img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* --- Four featured spots ----------------------------------------------------- */

.cc-newstop__featured {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: var(--wp--preset--spacing--40);
	margin-top: 0.5rem;
}

.cc-postmini {
	position: relative;
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	gap: 1.1rem;
	align-items: start;
	padding-block: 1.4rem;
	border-bottom: 1px solid var(--cc-rule);
}

.cc-postmini__media { aspect-ratio: 3 / 2; background: var(--cc-surface); overflow: hidden; }
.cc-postmini__img { display: block; width: 100%; height: 100%; object-fit: cover; }

.cc-postmini__title {
	margin: 0.4rem 0 0.5rem;
	font-size: 1rem;
	line-height: 1.4;
	color: var(--wp--preset--color--black);
}

/* --- Subscribe panel ------------------------------------------------------- */

.cc-subscribe {
	--cc-notch: 32px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
	gap: var(--wp--preset--spacing--40);
	align-items: center;
	margin-top: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--black);
}

.cc-subscribe__title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
}

.cc-subscribe__text { margin: 0.6rem 0 0; font-size: 0.95rem; line-height: 1.6; }

.cc-subscribe__placeholder { display: flex; flex-wrap: wrap; gap: var(--wp--preset--spacing--20); }

.cc-subscribe__field {
	flex: 1 1 180px;
	min-width: 0;
	padding: 0.85rem 0.15rem;
	border: 0;
	border-bottom: 2px solid var(--cc-muted-dark);
	border-radius: 0;
	background: transparent;
	color: var(--wp--preset--color--white);
	font: inherit;
	font-size: 0.95rem;
}

.cc-subscribe__field::placeholder { color: var(--cc-muted-dark); opacity: 1; }

/* Version B: blue outline, white text. Square. */
.cc-subscribe__button {
	padding: 0.85rem 1.5rem;
	border: 2px solid var(--wp--preset--color--blue);
	border-radius: 0;
	background: transparent;
	color: var(--wp--preset--color--white);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: not-allowed;
}

.cc-subscribe .cc-tk-note { margin-top: var(--wp--preset--spacing--20); }

/* --- Latest column ----------------------------------------------------------- */

.cc-newstop__latest { margin: 0; padding: 0; list-style: none; }

/* Version B: each item in a thin blue-bordered box. */
.cc-postlatest {
	position: relative;
	margin: 0 0 0.75rem;
	padding: 1rem 1.15rem;
	border: 2px solid var(--wp--preset--color--blue);
}

.cc-postlatest:last-child { margin-bottom: 0; }

.cc-postlatest__title {
	margin: 0.35rem 0 0.5rem;
	font-size: 0.95rem;
	line-height: 1.4;
	color: var(--wp--preset--color--black);
}

/* --- All posts heading on page 1 ------------------------------------------- */

.cc-blog--after-top { border-top: 1px solid var(--cc-rule); }
.cc-blog__heading { margin-bottom: var(--wp--preset--spacing--40); }

/* Visually hidden label for the subscribe field. */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	.cc-postlead__title a,
	.cc-postmini__title a,
	.cc-postlatest__title a { transition: none; }
}

@media (max-width: 1100px) {
	.cc-newstop { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
	.cc-postlead,
	.cc-subscribe { grid-template-columns: 1fr; }
	.cc-postlead__media { min-height: 200px; order: -1; }
	.cc-newstop__featured { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
	.cc-postmini { grid-template-columns: 110px minmax(0, 1fr); }
}

/* ==========================================================================
   Single post: article + sidebar — option A, approved by Andy 2026-10-15.
   The text column is capped at 900px (about 95 characters at 18px) and the
   300px sidebar sits at the right edge of the container. Not sticky, on
   purpose: it scrolls away with the page. The block editor is capped at the
   same 900px for posts (inc/enqueue.php) so writing matches reading.
   ========================================================================== */

.cc-postpage__layout {
	display: grid;
	grid-template-columns: minmax(0, 900px) 300px;
	justify-content: space-between;
	column-gap: var(--wp--preset--spacing--50);
	align-items: start;
	padding-block: var(--wp--preset--spacing--30) var(--wp--preset--spacing--60);
}

/* Inside the layout the body is a grid column, not its own container. */
.cc-postpage__layout .cc-postpage__body {
	max-width: none;
	padding-block: 0;
	min-width: 0;
}

.cc-postside > * + * { margin-top: var(--wp--preset--spacing--40); }

/* --- On this page --------------------------------------------------------- */

.cc-posttoc__title {
	margin: 0 0 0.4rem;
	padding-bottom: 0.65rem;
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	border-bottom: 2px solid var(--wp--preset--color--blue);
}

.cc-posttoc__list { margin: 0; padding: 0; list-style: none; }
.cc-posttoc__item { margin: 0; }

.cc-posttoc__item a {
	display: block;
	padding: 0.5rem 0;
	font-size: 0.9rem;
	line-height: 1.4;
	color: var(--wp--preset--color--black);
	text-decoration: none;
	border-bottom: 1px solid var(--cc-rule);
}

.cc-posttoc__item--h3 a {
	padding-left: 1rem;
	font-size: 0.85rem;
	color: var(--cc-body);
}

.cc-posttoc__item a:hover,
.cc-posttoc__item a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
	text-decoration-color: var(--wp--preset--color--blue);
}

/* --- Become a Partner card -------------------------------------------------
   The card itself is .cc-card--blue (cards.css). Button: black fill, white
   text, square, as shown in the approved mockup. Hover and focus add a blue
   outline; nothing moves and no text ever sits on blue. Site-wide button
   styling is still undecided — revisit this when it is. */

.cc-postcta .cc-card__title { margin-bottom: 0.5rem; }
.cc-postcta__action { margin: var(--wp--preset--spacing--30) 0 0; }

.cc-postcta__btn {
	display: inline-block;
	padding: 0.75rem 1.25rem;
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color var(--cc-hover-dur, 140ms) var(--cc-hover-ease, ease);
}

.cc-postcta__btn:hover,
.cc-postcta__btn:focus-visible { outline: 2px solid var(--wp--preset--color--blue); outline-offset: 2px; }

/* --- Compact subscribe ---------------------------------------------------- */

.cc-subscribe--compact {
	--cc-notch: 28px;
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--20);
	margin-top: 0;
	padding: var(--wp--preset--spacing--30);
}

.cc-postside .cc-subscribe--compact { margin-top: var(--wp--preset--spacing--40); }

.cc-subscribe--compact .cc-subscribe__title { font-size: 1.125rem; }
.cc-subscribe--compact .cc-subscribe__text { font-size: 0.9rem; }
.cc-subscribe--compact .cc-subscribe__placeholder { flex-direction: column; align-items: flex-start; }
.cc-subscribe--compact .cc-subscribe__field { flex: none; width: 100%; }

/* --- Related posts ----------------------------------------------------------- */

.cc-postrelated { padding-block: 0 var(--wp--preset--spacing--60); }

.cc-postrelated__title {
	margin: 0 0 var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--lg);
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}

.cc-postrelated__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40);
}

@media (prefers-reduced-motion: reduce) {
	.cc-postcta__btn { transition: none; }
}

@media (max-width: 1000px) {
	.cc-postpage__layout { grid-template-columns: minmax(0, 1fr); }
	.cc-postside { margin-top: var(--wp--preset--spacing--50); }
	.cc-postrelated__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
	.cc-postrelated__grid { grid-template-columns: 1fr; }
}
