/**
 * Post styling — list/grid (Frontend\PostsShortcode / templates/post-list.php)
 * and single-Post detail (Frontend\PostDetailsShortcode /
 * templates/post-details.php). Self-contained — does not depend on
 * `bchbc-events.css`/`bchbc-projects.css` being loaded, even though the
 * visual language deliberately matches them (same brand-color variables,
 * same filter-card/badge/button conventions). Unlike those two, the list
 * card itself is vertical (large image on top, body below) rather than a
 * horizontal thumb-beside-body row, laid out in a 2-column grid.
 *
 * @package BCHBC\ChapterManagement
 */

:root {
	--bchbc-primary: var( --e-global-color-primary, #2c4540 );
	--bchbc-accent: var( --e-global-color-accent, #5e7c8a );
	--bchbc-border-color: #e3e0d8;
	--bchbc-muted: #6b6f66;
	--bchbc-badge-bg: #e4e9ec;
	--bchbc-badge-text: #45535c;
}

/* ---- Filter card ---- */

.bchbc-posts-filter-card {
	display: flex;
	flex-direction: column;
	gap: 1em;
	margin-bottom: 0.75em;
	padding: 1.5em;
	background: #fff;
	border: 1px solid var( --bchbc-border-color );
	border-radius: 14px;
}

.bchbc-posts-filters {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	gap: 1.5em;
	align-items: flex-end;
}

.bchbc-posts-filter {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	min-width: 160px;
}

.bchbc-posts-filter label {
	font-size: 0.8em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var( --bchbc-muted );
}

.bchbc-posts-filter select {
	width: 100%;
	padding: 0.65em 0.9em;
	background: #fff;
	color: inherit;
	font-size: 1em;
	border: 1px solid var( --bchbc-border-color );
	border-radius: 8px;
}

.bchbc-posts-filter-submit {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.75em 1.4em;
	background: var( --bchbc-accent );
	color: #fff;
	font-size: 0.9em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	white-space: nowrap;
	border: none;
	border-radius: 999px;
	cursor: pointer;
}

.bchbc-posts-filter-submit:hover {
	background: color-mix( in srgb, var( --bchbc-accent ) 85%, black );
}

.bchbc-posts-clear-filters {
	align-self: flex-start;
	font-size: 0.85em;
	font-weight: 600;
	color: var( --bchbc-primary );
	text-decoration: underline;
}

.bchbc-posts-clear-filters:hover {
	color: color-mix( in srgb, var( --bchbc-primary ) 85%, black );
}

.bchbc-posts-count {
	margin: 0 0 0.75em;
	font-size: 1.4em;
	font-weight: 700;
}

.bchbc-posts-empty {
	padding: 1em 0;
}

/* ---- 2-column grid of vertical cards ---- */

.bchbc-post-grid {
	display: grid;
	grid-template-columns: repeat( 2, 1fr );
	gap: 2em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bchbc-post-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var( --bchbc-border-color );
	border-radius: 14px;
	overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.bchbc-post-card:hover {
	transform: translateY( -2px );
	border-color: color-mix( in srgb, var( --bchbc-primary ) 35%, var( --bchbc-border-color ) );
	box-shadow: 0 6px 16px rgba( 0, 0, 0, 0.08 );
}

.bchbc-post-card-thumb-link {
	display: block;
}

.bchbc-post-card-thumb-img {
	display: block;
	width: 100%;
	aspect-ratio: 940 / 788; /* matches this site's actual featured-image dimensions */
	object-fit: cover;
}

.bchbc-post-card-thumb-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 940 / 788; /* matches this site's actual featured-image dimensions */
	background: color-mix( in srgb, var( --bchbc-primary ) 12%, white );
}

.bchbc-post-card-thumb-placeholder-img {
	max-width: 40%;
	max-height: 40%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.bchbc-post-card-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.6em;
	padding: 1.5em;
}

.bchbc-post-card-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bchbc-post-category-badge {
	display: inline-block;
	padding: 0.3em 0.9em;
	background: var( --bchbc-badge-bg );
	color: var( --bchbc-badge-text );
	font-size: 0.75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-decoration: none;
	border-radius: 999px;
}

.bchbc-post-category-badge:hover {
	background: color-mix( in srgb, var( --bchbc-badge-bg ) 70%, black );
}

.bchbc-post-card-title {
	margin: 0;
	font-size: 1.4em;
	line-height: 1.3;
}

.bchbc-post-card-title a {
	color: inherit;
	text-decoration: none;
}

.bchbc-post-card-title a:hover {
	text-decoration: underline;
}

.bchbc-post-card-date {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	color: var( --bchbc-muted );
	font-size: 0.9em;
}

.bchbc-post-card-date .bchbc-event-icon {
	color: var( --bchbc-primary );
}

.bchbc-post-card-excerpt {
	margin: 0;
	flex: 1 1 auto;
	color: var( --bchbc-muted );
	line-height: 1.6;
}

.bchbc-post-card-links {
	margin: 0.5em 0 0;
}

.bchbc-post-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	padding: 0.6em 1.2em;
	background: var( --bchbc-accent );
	color: #fff;
	font-size: 0.85em;
	font-weight: 700;
	white-space: nowrap;
	text-decoration: none;
	border-radius: 999px;
}

.bchbc-post-btn:hover {
	background: color-mix( in srgb, var( --bchbc-accent ) 85%, black );
	color: #fff;
}

.bchbc-posts-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 2em;
}

.bchbc-posts-load-more {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.75em 1.75em;
	background: var( --bchbc-accent );
	color: #fff;
	font-size: 0.9em;
	font-weight: 700;
	text-decoration: none;
	border-radius: 999px;
}

.bchbc-posts-load-more:hover {
	background: color-mix( in srgb, var( --bchbc-accent ) 85%, black );
}

/* ---- Archive pagination (templates/archive-post-list.php) ----
   WordPress's own paginate_links() markup, styled to match — no `type`
   argument is passed, so it's a plain string of `.page-numbers` anchors/
   spans rather than a `<ul>`. */

.bchbc-posts-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5em;
	margin-top: 2em;
}

.bchbc-posts-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.4em;
	padding: 0.5em 0.9em;
	background: #fff;
	color: var( --bchbc-primary );
	font-size: 0.9em;
	font-weight: 700;
	text-decoration: none;
	border: 1px solid var( --bchbc-border-color );
	border-radius: 999px;
}

.bchbc-posts-pagination a.page-numbers:hover {
	background: color-mix( in srgb, var( --bchbc-accent ) 10%, white );
	border-color: var( --bchbc-accent );
}

.bchbc-posts-pagination .page-numbers.current {
	background: var( --bchbc-accent );
	color: #fff;
	border-color: var( --bchbc-accent );
}

.bchbc-posts-pagination .page-numbers.dots {
	background: transparent;
	color: var( --bchbc-muted );
	border-color: transparent;
}

.bchbc-posts-load-more[aria-busy="true"] {
	opacity: 0.7;
	pointer-events: none;
}

/* Visible focus states throughout — never rely on the browser default alone. */
.bchbc-posts a:focus-visible,
.bchbc-posts button:focus-visible,
.bchbc-posts select:focus-visible,
.bchbc-post-detail a:focus-visible {
	outline: 2px solid var( --bchbc-primary );
	outline-offset: 2px;
}

/* Collapses earlier than the plugin's usual 600px breakpoint — a 2-column
   grid of large featured images needs more room per card than a simple
   list row does, and stays cramped well above 600px on common
   tablet/landscape-phone widths. */
@media ( max-width: 700px ) {
	.bchbc-posts-filter-card {
		flex-direction: column;
		align-items: stretch;
	}

	.bchbc-posts-filters {
		flex-direction: column;
		align-items: stretch;
	}

	.bchbc-posts-filter-submit {
		justify-content: center;
		width: 100%;
	}

	.bchbc-post-grid {
		grid-template-columns: 1fr;
	}
}

/* ---- Single-Post detail ----
   Two columns on desktop (main content / sidebar), one column — main
   first — on mobile. */

.bchbc-post-detail {
	display: grid;
	grid-template-columns: minmax( 0, 2fr ) minmax( 0, 1fr );
	gap: 2em;
	align-items: start;
}

.bchbc-post-detail-main,
.bchbc-post-detail-sidebar {
	display: flex;
	flex-direction: column;
	gap: 1.5em;
}

.bchbc-post-detail-card {
	padding: 1.5em;
	background: #fff;
	border: 1px solid var( --bchbc-border-color );
	border-radius: 14px;
}

.bchbc-post-detail-thumb-link {
	display: block;
}

.bchbc-post-detail-thumb-img {
	display: block;
	width: 100%;
	max-height: 420px;
	object-fit: cover;
	border-radius: 14px;
}

/* Slim, unboxed byline row above the content — Category badges, Date, and
   Author — deliberately not wrapped in a card, so it reads as a lightweight
   label rather than its own content block. */
.bchbc-post-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em 1.25em;
}

.bchbc-post-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	color: var( --bchbc-muted );
	font-size: 0.9em;
}

.bchbc-post-meta-item a {
	color: inherit;
}

.bchbc-post-meta-item .bchbc-event-icon {
	color: var( --bchbc-primary );
}

.bchbc-post-tags {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.4em;
	margin: 0;
	color: var( --bchbc-muted );
	font-size: 0.9em;
}

.bchbc-post-tags .bchbc-event-icon {
	color: var( --bchbc-primary );
}

.bchbc-post-tags a {
	color: var( --bchbc-primary );
	text-decoration: none;
}

.bchbc-post-tags a:hover {
	text-decoration: underline;
}

.bchbc-post-detail-section {
	padding-top: 1.5em;
	border-top: 1px solid var( --bchbc-border-color );
}

.bchbc-post-detail-section:first-of-type {
	padding-top: 0;
	border-top: none;
}

.bchbc-post-detail-heading {
	margin: 0 0 0.75em;
	font-size: 1.15em;
	font-weight: 700;
}

.bchbc-post-detail-content {
	font-size: 1.05em;
	line-height: 1.7;
}

.bchbc-post-detail-content > :first-child {
	margin-top: 0;
}

.bchbc-post-detail-content > :last-child {
	margin-bottom: 0;
}

.bchbc-post-share-copy {
	margin: 0 0 1em;
	color: var( --bchbc-muted );
}

.bchbc-post-share-links {
	display: flex;
	gap: 0.75em;
	margin: 0;
}

.bchbc-post-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.4em;
	height: 2.4em;
	background: var( --bchbc-accent );
	color: #fff;
	border-radius: 50%;
}

.bchbc-post-share-btn:hover {
	background: color-mix( in srgb, var( --bchbc-accent ) 85%, black );
}

@media ( max-width: 800px ) {
	.bchbc-post-detail {
		display: flex;
		flex-direction: column;
	}
}
