/**
 * Blog Category Dropdown Filter — default styling.
 * Closed trigger matches a simple bordered select; open menu is a white
 * panel with dark text. Contrast and focus styles target WCAG AA.
 */

.bcd-category-filter {
	--bcd-gap: 24px;
	--bcd-radius: 6px;
	--bcd-border-color: #000000;
	--bcd-badge-bg: #1e3a5f;
	--bcd-badge-color: #ffffff;
	--bcd-menu-bg: #ffffff;
	--bcd-menu-border: #cccccc;
	--bcd-menu-text: #333333;
	--bcd-menu-muted: #666666;
	--bcd-menu-hover: #f5f5f5;
	--bcd-focus: #0b57d0;
	--bcd-link: #0b57d0;
	--bcd-meta: #595959;
	position: relative;
	width: 100%;
}

@media ( prefers-reduced-motion: reduce ) {
	.bcd-category-filter *,
	.bcd-category-filter *::before,
	.bcd-category-filter *::after {
		transition: none !important;
		animation: none !important;
	}
}

/* Dropdown */
.bcd-select-wrap {
	position: relative;
	display: block;
	max-width: 320px;
	width: 100%;
	margin: 0 0 var(--bcd-gap);
	z-index: 5;
	box-sizing: border-box;
	/* Layout shell only — never look like a second empty field. */
	border: 0;
	background: transparent;
	box-shadow: none;
	padding: 0;
}

.bcd-select-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 12px 16px;
	border: 1px solid var(--bcd-border-color);
	border-radius: 0;
	background: #fff;
	background-image: none;
	box-shadow: none;
	color: #111;
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 18px;
	font-weight: 400;
	letter-spacing: normal;
	line-height: 1.3;
	text-align: left;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

/* Beat Divi / theme chrome in the Visual Builder and front end. */
.bcd-category-filter .bcd-select-wrap .bcd-select-trigger,
.et-db #et-boc .et-l .bcd-category-filter .bcd-select-trigger {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	background-color: #fff !important;
	background-image: none !important;
	box-shadow: none !important;
	height: auto !important;
	min-height: 48px !important;
	padding: 12px 16px !important;
	border-radius: 0 !important;
	font-weight: 400 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

.bcd-select-trigger:focus {
	outline: 3px solid var(--bcd-focus);
	outline-offset: 2px;
}

.bcd-select-trigger:focus:not( :focus-visible ) {
	outline: none;
}

.bcd-select-trigger:focus-visible {
	outline: 3px solid var(--bcd-focus);
	outline-offset: 2px;
}

.bcd-select-label {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bcd-select-chevron {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	color: #111;
	line-height: 0;
	transition: transform 0.15s ease;
}

.bcd-select-chevron svg {
	display: block;
	width: 12px;
	height: 8px;
}

.bcd-select-wrap.is-open .bcd-select-chevron {
	transform: rotate(180deg);
}

.bcd-select-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 40;
	box-sizing: border-box;
	width: 100%;
	min-width: 100%;
	max-width: none;
	max-height: min(420px, 70vh);
	margin: 0;
	padding: 6px 0;
	overflow-x: hidden;
	overflow-y: auto;
	list-style: none;
	border: 1px solid var(--bcd-menu-border);
	border-radius: 12px;
	background: var(--bcd-menu-bg);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
	color: var(--bcd-menu-text);
}

.bcd-select-menu,
.bcd-select-menu li {
	list-style: none;
	list-style-type: none;
}

.bcd-select-menu[hidden] {
	display: none !important;
}

.bcd-select-option {
	display: flex;
	align-items: center;
	gap: 10px;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 10px 14px;
	color: var(--bcd-menu-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.35;
	cursor: pointer;
}

.bcd-select-option:hover {
	background: var(--bcd-menu-hover);
}

.bcd-select-option:focus {
	outline: none;
}

.bcd-select-option:focus-visible {
	outline: 2px solid var(--bcd-focus);
	outline-offset: -2px;
	background: var(--bcd-menu-hover);
}

.bcd-select-check {
	flex-shrink: 0;
	display: block;
	width: 16px;
	height: 16px;
	opacity: 0;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3.2 3.2L13 4.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 14px 14px;
}

.bcd-select-option.is-selected .bcd-select-check {
	opacity: 1;
}

.bcd-select-option-label {
	flex: 1;
	min-width: 0;
}

/* Native select kept in DOM for JS value sync — never visible under Divi. */
.bcd-category-filter select.bcd-select,
.et-db #et-boc .et-l .bcd-category-filter select.bcd-select {
	display: none !important;
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

/* Grid */
.bcd-grid {
	display: grid;
	gap: var(--bcd-gap);
	grid-template-columns: repeat( 1, 1fr );
	transition: opacity 0.15s ease;
}

.bcd-category-filter.bcd-loading .bcd-grid {
	opacity: 0.5;
	pointer-events: none;
}

.bcd-error-message {
	grid-column: 1 / -1;
	padding: 30px;
	text-align: center;
	color: #8a1f1c;
	background: #fdf2f2;
	border: 1px solid #e0a4a2;
	border-radius: var(--bcd-radius);
}

.bcd-grid--cols-2 {
	grid-template-columns: repeat( 2, 1fr );
}

.bcd-grid--cols-3 {
	grid-template-columns: repeat( 3, 1fr );
}

.bcd-grid--cols-4 {
	grid-template-columns: repeat( 4, 1fr );
}

@media ( max-width: 980px ) {
	.bcd-grid--cols-3,
	.bcd-grid--cols-4 {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 600px ) {
	.bcd-grid--cols-2,
	.bcd-grid--cols-3,
	.bcd-grid--cols-4 {
		grid-template-columns: 1fr;
	}
}

/* Card */
.bcd-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #c8c8c8;
	border-radius: var(--bcd-radius);
	background: #fff;
}

.bcd-card__image-link {
	display: block;
	line-height: 0;
}

.bcd-card__image {
	width: 100%;
	height: auto;
	display: block;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.bcd-card__body {
	position: relative;
	padding: 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.bcd-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-self: flex-start;
	margin-bottom: 10px;
}

.bcd-card__badge {
	display: inline-block;
	padding: 7px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.25;
	text-transform: uppercase;
	text-decoration: none;
	background: var(--bcd-badge-bg);
	color: var(--bcd-badge-color);
}

a.bcd-card__badge:hover,
a.bcd-card__badge:focus-visible {
	color: var(--bcd-badge-color);
	text-decoration: none;
	opacity: 0.88;
}

a.bcd-card__badge:focus-visible {
	outline: 3px solid var(--bcd-focus);
	outline-offset: 2px;
}

.bcd-card__title {
	margin: 0 0 8px;
	font-size: 20px;
	line-height: 1.3;
}

.bcd-card__title a {
	color: #111;
	text-decoration: none;
}

.bcd-card__title a:hover,
.bcd-card__title a:focus-visible {
	text-decoration: underline;
}

.bcd-card__title a:focus-visible {
	outline: 3px solid var(--bcd-focus);
	outline-offset: 2px;
}

.bcd-card__meta {
	margin-bottom: 10px;
	font-size: 14px;
	color: var(--bcd-meta);
}

.bcd-card__meta-sep {
	margin: 0 6px;
}

.bcd-card__excerpt {
	margin-bottom: 14px;
	font-size: 15px;
	line-height: 1.6;
	color: #333333;
}

.bcd-card__readmore {
	margin-top: auto;
	align-self: flex-start;
	color: var(--bcd-link);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.bcd-card__readmore .bcd-new-tab-icon {
	display: inline-block;
	margin-left: 0.35em;
	vertical-align: -1px;
}

.bcd-card__readmore:hover,
.bcd-card__readmore:focus-visible {
	color: #0842a0;
}

.bcd-card__readmore:focus-visible {
	outline: 3px solid var(--bcd-focus);
	outline-offset: 2px;
}

/* Visually hidden — WCAG new-tab announcement (opens in a new tab). */
.bcd-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* No posts / load more */
.bcd-no-posts {
	grid-column: 1 / -1;
	padding: 40px 0;
	text-align: center;
	color: var(--bcd-meta);
}

.bcd-load-more {
	display: block;
	min-height: 44px;
	margin: var(--bcd-gap) auto 0;
	padding: 12px 28px;
	border: 2px solid #333;
	border-radius: var(--bcd-radius);
	background: #fff;
	color: #111;
	cursor: pointer;
	font-size: 15px;
}

.bcd-load-more:hover {
	background: #f5f5f5;
}

.bcd-load-more:focus-visible {
	outline: 3px solid var(--bcd-focus);
	outline-offset: 2px;
}

.bcd-load-more:disabled {
	opacity: 0.6;
	cursor: default;
}
