/**
 * OptConnect post loops (PR 3.14).
 *
 * `optconnect/post-loop-news` and `optconnect/post-loop-library` reuse the card-grid
 * system wholesale — `.oc-card-grid` for the section shell, `.oc-card` /
 * `.oc-card--resource` for the surface, `.oc-card__media` / `__body` / `__label` /
 * `__title` inside it. All of that lives in `card-grid.css` and is not repeated here.
 * This file holds only what a *query* adds: the `<li>` core puts between the grid and
 * the card, the meta line, and the pager.
 *
 * The no-margins rule from `card-grid.css` applies here too — core's flow layout sets
 * `margin-block-start` at one-class specificity and this file loads after it, so a
 * `margin` here silently deletes a `blockGap` the pattern asked for.
 */

/* --------------------------------------------------------------------------
 * The post-template list item
 *
 * `core/post-template` renders `<ul><li class="wp-block-post">`, so the grid item is the
 * `<li>` and not the card — without this a row of cards ends up three different heights.
 * `min-width: 0` stops a long unbroken title widening the track past `1fr`.
 * ---------------------------------------------------------------------- */
.oc-post-loop__items > .wp-block-post {
	display: flex;
	min-width: 0;
	flex-direction: column;
}

.oc-post-loop__items > .wp-block-post > .oc-card {
	flex: 1;
	min-width: 0;
}

/* --------------------------------------------------------------------------
 * Meta line
 *
 * The label here is a `core/post-date` or a `core/post-terms`, and the parent theme
 * styles both from its own `theme.json`. Those global styles land at
 * `:root :where(.wp-block-post-date)` — (0,1,0), the same specificity as
 * `.oc-card__label` — so which one wins is a question of stylesheet order rather than
 * intent. Two classes settle it.
 *
 * The colour half of that collision is fixed at source in this theme's `theme.json`:
 * TT5 paints `core/post-date` with `accent-4`, which is #686868 in its palette and
 * **#f47920, OC Orange, in ours**. Left alone every post date on the site is orange.
 * ---------------------------------------------------------------------- */
.oc-card__body .oc-card__label {
	color: var(--wp--preset--color--accent-2, #006ba4);
	font-size: 0.875rem;
	font-weight: 700;
}

.oc-post-loop__meta time {
	color: inherit;
}

.oc-post-loop__meta .wp-block-post-terms a {
	color: inherit;
	text-decoration: none;
}

.oc-post-loop__meta .wp-block-post-terms a:hover,
.oc-post-loop__meta .wp-block-post-terms a:focus-visible {
	color: var(--wp--preset--color--accent-2, #006ba4);
	text-decoration: underline;
}

.oc-post-loop__terms .wp-block-post-terms__separator {
	margin-inline: 0.15em;
}

/* --------------------------------------------------------------------------
 * Pagination
 *
 * `core/query-pagination` renders nothing at all when the query fits on one page, which
 * is why both patterns carry it unconditionally.
 *
 * Links are sized as controls rather than as prose: a bare digit is otherwise well under
 * the 44px target WCAG 2.5.5 asks for. The current page keeps the same box so the row
 * does not reflow as you page through it.
 * ---------------------------------------------------------------------- */
.oc-post-loop__pagination {
	font-family: var(--wp--preset--font-family--nunito, sans-serif);
	font-size: 0.9375rem;
	font-weight: 700;
}

.oc-post-loop__pagination .wp-block-query-pagination-numbers {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
}

.oc-post-loop__pagination .page-numbers,
.oc-post-loop__pagination .wp-block-query-pagination-previous,
.oc-post-loop__pagination .wp-block-query-pagination-next {
	display: inline-flex;
	min-width: 44px;
	min-height: 44px;
	align-items: center;
	justify-content: center;
	padding: 0 0.5rem;
	border-radius: 8px;
	color: var(--wp--preset--color--accent-2, #006ba4);
	text-decoration: none;
	transition: background-color 0.2s ease-in-out;
}

.oc-post-loop__pagination a.page-numbers:hover,
.oc-post-loop__pagination a.page-numbers:focus-visible,
.oc-post-loop__pagination .wp-block-query-pagination-previous:hover,
.oc-post-loop__pagination .wp-block-query-pagination-previous:focus-visible,
.oc-post-loop__pagination .wp-block-query-pagination-next:hover,
.oc-post-loop__pagination .wp-block-query-pagination-next:focus-visible {
	background-color: var(--wp--preset--color--base, #ffffff);
	color: var(--wp--preset--color--accent-2, #006ba4);
	text-decoration: underline;
}

/* The current page is not a link and must not read as one — `aria-current` is the only
   thing saying so to a screen reader, and a filled chip says it to everyone else.
   The page links and this chip are `accent-2` (PR 6.2): white on `accent-1`, and
   `accent-1` on white, are both 4.27:1 at 15px / 700. */
.oc-post-loop__pagination .page-numbers.current {
	background-color: var(--wp--preset--color--accent-2, #006ba4);
	color: var(--wp--preset--color--base, #ffffff);
}

/* The elision between page ranges is not interactive; at control size it reads as a
   disabled one. */
.oc-post-loop__pagination .page-numbers.dots {
	min-width: 0;
	padding: 0 0.25rem;
	color: var(--wp--preset--color--accent-6, #454545);
}

.oc-post-loop__pagination :focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1, #0081c2);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.oc-post-loop__pagination .page-numbers,
	.oc-post-loop__pagination .wp-block-query-pagination-previous,
	.oc-post-loop__pagination .wp-block-query-pagination-next {
		transition: none;
	}
}

.oc-post-loop__none {
	color: var(--wp--preset--color--accent-6, #454545);
}

/* --------------------------------------------------------------------------
 * Industry list — `optconnect/page-case-studies` (PR 4.3)
 *
 * These are `core/categories` term links, styled as a row of chips. **Keep the `<ul>`** —
 * it is what tells a screen reader how many industries there are, and it is the reason
 * this reads as a list of destinations rather than the isotope filter bar it replaces.
 *
 * Sized as controls, not prose: 44px of hit target per WCAG 2.5.5, the floor the pager
 * above uses.
 *
 * **⚠️ Do not add a `margin` reset here.** Core's constrained-layout rule for the
 * wrapping group, `.wp-container-…-is-layout-N > * + *`, is a single class — the same
 * (0,1,0) as `.oc-post-loop__industries-list` — and this file loads later, so a
 * `margin: 0` wins and silently deletes the `spacing|20` blockGap between the `<h2>` and
 * the list. It buys nothing either: that same rule already zeroes the UA block margins.
 * ---------------------------------------------------------------------- */
.oc-post-loop__industries-title {
	font-size: 1.25rem;
}

.oc-post-loop__industries-list {
	display: flex;
	flex-wrap: wrap;
	padding-left: 0;
	gap: 0.5rem;
	list-style: none;
}

.oc-post-loop__industries-list a {
	display: inline-flex;
	min-height: 44px;
	align-items: center;
	padding: 0 1rem;
	border: 1px solid var(--wp--preset--color--accent-2, #006ba4);
	border-radius: 999px;
	color: var(--wp--preset--color--accent-2, #006ba4);
	font-family: var(--wp--preset--font-family--nunito, sans-serif);
	font-size: 0.9375rem;
	font-weight: 700;
	text-decoration: none;
	transition:
		background-color 0.2s ease-in-out,
		color 0.2s ease-in-out;
}

/* `accent-2` in both states, because the *resting* one is the constraint: `accent-1` on
   white is 4.27:1 and a 15px bold label is not large text, so it fails AA for everyone
   who never hovers. `accent-2` is 5.77:1 as label-on-white and as white-on-fill alike. */
.oc-post-loop__industries-list a:hover,
.oc-post-loop__industries-list a:focus-visible {
	border-color: var(--wp--preset--color--accent-2, #006ba4);
	background-color: var(--wp--preset--color--accent-2, #006ba4);
	color: var(--wp--preset--color--base, #ffffff);
}

.oc-post-loop__industries-list a:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1, #0081c2);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.oc-post-loop__industries-list a {
		transition: none;
	}
}
