/**
 * Camp styling — single-Camp detail (Frontend\CampDetailsShortcode /
 * templates/camp-details.php) and the Camp list/filter view
 * (Frontend\CampsShortcode / templates/camp-list.php). Self-contained — does
 * not depend on `bchbc-events.css` or `bchbc-projects.css` being loaded, even
 * though the visual language deliberately matches them (same brand-color
 * variables, same card/badge/filter conventions) for a consistent look across
 * Events, Projects and Camps.
 *
 * @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-heading-font: var( --e-global-typography-primary-font-family, Georgia, 'Times New Roman', serif );
	/* Soft blue-grey — deliberately distinct from --bchbc-primary so the area
	   badge never reads as another action button. */
	--bchbc-badge-bg: #e4e9ec;
	--bchbc-badge-text: #45535c;
}

/* ---- Shared bits ---- */

/* Wraps the card's badges so several areas stay on one row and wrap together
   — a Camp can be ticked into more than one area. */
.bchbc-camp-area-badges {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.4em;
}

.bchbc-camp-area-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;
	border-radius: 999px;
}

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

.bchbc-event-icon {
	flex-shrink: 0;
	color: var( --bchbc-primary );
}

.bchbc-camp-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.7em 1.3em;
	background: var( --bchbc-accent );
	color: #fff;
	font-size: 0.85em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	text-decoration: none;
	border-radius: 999px;
}

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

.bchbc-camp-btn .bchbc-event-icon {
	color: currentColor;
}

/* ---- Camp list/filter view ---- */

.bchbc-camps-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-camps-filters {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	gap: 1.5em;
	align-items: flex-end;
}

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

.bchbc-camps-filter--search {
	flex: 1 1 220px;
}

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

.bchbc-camps-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;
}

/* The icon sits inside the field rather than beside it, so the search input
   still fills the available width on a narrow screen. */
.bchbc-camps-search-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.bchbc-camps-search-wrap .bchbc-events-search-icon {
	position: absolute;
	left: 0.8em;
	color: var( --bchbc-muted );
	pointer-events: none;
}

.bchbc-camps-search-wrap input[type="search"] {
	width: 100%;
	padding: 0.65em 0.9em 0.65em 2.5em;
	background: #fff;
	color: inherit;
	font-size: 1em;
	border: 1px solid var( --bchbc-border-color );
	border-radius: 8px;
}

.bchbc-camps-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-camps-filter-submit:hover {
	background: color-mix( in srgb, var( --bchbc-accent ) 85%, black );
}

.bchbc-camps-filter-submit .bchbc-event-icon {
	color: currentColor;
}

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

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

.bchbc-camps-count {
	margin: 0 0 0.75em;
	font-family: var( --bchbc-heading-font );
	font-size: 1.4em;
	font-weight: 700;
}

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

.bchbc-camp-list {
	display: flex;
	flex-direction: column;
	gap: 1.25em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bchbc-camp-list-item {
	position: relative;
	display: flex;
	align-items: stretch;
	gap: 1.25em;
	padding: 1.25em;
	background: #fff;
	border: 1px solid var( --bchbc-border-color );
	border-radius: 14px;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

/* Subtle hover: border + shadow + a small upward shift — the whole card is
   clickable (see the title link's stretched-link ::after below), so this also
   functions as the hover affordance for that. */
.bchbc-camp-list-item: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-camp-list-thumb {
	flex: 0 0 200px;
}

/* 3 / 4 to match `.bchbc-project-list-thumb-img` exactly — Camps and Projects
   cards sit on the same site and should not disagree about thumbnail shape.
   The placeholder below carries the identical ratio, so a Camp with no photo
   makes a card the same height as one with. */
.bchbc-camp-list-thumb-img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border-radius: 10px;
}

.bchbc-camp-list-thumb-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 3 / 4;
	background: color-mix( in srgb, var( --bchbc-primary ) 12%, white );
	border-radius: 10px;
}

.bchbc-camp-list-thumb-placeholder-img {
	max-width: 90%;
	max-height: 90%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.bchbc-camp-list-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.5em;
	min-width: 0;
}

/* A flex column's default `align-items: stretch` overrides a child's own
   sizing on the cross axis regardless of its `display` — without these, the
   badge and the meta line stretch to the card's full width instead of hugging
   their own text. */
.bchbc-camp-list-body .bchbc-camp-area-badges,
.bchbc-camp-list-body .bchbc-camp-meta-item {
	align-self: flex-start;
}

.bchbc-camp-list-title {
	margin: 0;
	font-family: var( --bchbc-heading-font );
	font-size: 1.5em;
}

.bchbc-camp-list-title a {
	color: inherit;
	text-decoration: none;
}

.bchbc-camp-list-title a:hover {
	text-decoration: underline;
}

/* Makes the whole card clickable via one real, accessible link (the title's
   `<a>`) instead of duplicate anchors to the same destination. */
.bchbc-camp-list-title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

.bchbc-camp-list-summary {
	margin: 0;
	color: var( --bchbc-muted );
}

.bchbc-camp-list-links {
	position: relative;
	/* Sits above the title link's stretched-link overlay (::after, z-index: 1)
	   so View Camp stays independently clickable. */
	z-index: 2;
	margin: 0.25em 0 0;
}

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

.bchbc-camps-load-more {
	display: inline-flex;
	align-items: center;
	padding: 0.75em 1.6em;
	background: var( --bchbc-primary );
	color: #fff;
	font-size: 0.9em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	text-decoration: none;
	border-radius: 999px;
}

.bchbc-camps-load-more:hover {
	background: color-mix( in srgb, var( --bchbc-primary ) 85%, black );
	color: #fff;
}

@media ( max-width: 700px ) {
	.bchbc-camp-list-item {
		flex-direction: column;
	}

	.bchbc-camp-list-thumb {
		flex: 0 0 auto;
	}

	/* Same override the Project cards use at their own breakpoint: once the
	   card stacks, the thumbnail spans the full card width, and a 3 / 4
	   portrait at that width would push the title most of a screen down. */
	.bchbc-camp-list-thumb-img,
	.bchbc-camp-list-thumb-placeholder {
		aspect-ratio: 16 / 9;
	}
}

/* ---- Camp detail (single Camp) ---- */

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

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

.bchbc-camp-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em 1.25em;
}

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

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

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

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

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

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

.bchbc-camp-gallery {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 140px, 1fr ) );
	gap: 0.75em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bchbc-camp-gallery-item a {
	display: block;
}

.bchbc-camp-gallery-item img {
	display: block;
	width: 100%;
	height: 140px;
	object-fit: cover;
	border-radius: 10px;
}

.bchbc-camp-link-list {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bchbc-camp-link-item a {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	color: var( --bchbc-primary );
	font-weight: 600;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.bchbc-camp-link-item a:hover {
	text-decoration: underline;
}

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

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

.bchbc-camp-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-camp-share-btn:hover {
	background: color-mix( in srgb, var( --bchbc-accent ) 85%, black );
}

.bchbc-camp-share-btn .bchbc-event-icon {
	color: currentColor;
}

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

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

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	border: 0;
}
