.dda-cg {
	--dda-cg-primary: #0072ae;
	--dda-cg-gap: clamp(22px, 3vw, 42px);
	--dda-cg-filter-border: rgba(0, 0, 0, 0.18);
	--dda-cg-filter-bg: #fff;
	--dda-cg-soft-bg: rgba(0, 114, 174, 0.08);
	position: relative;
	width: 100%;
}

.dda-cg *,
.dda-cg *::before,
.dda-cg *::after {
	box-sizing: border-box;
}

.dda-cg-filter {
	position: relative;
	z-index: 50;
	margin: 0 0 clamp(22px, 3vw, 38px);
}

.dda-cg-filter__bar {
	position: relative;
	z-index: 70;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.dda-cg-filter__toggle,
.dda-cg-filter__reset,
.dda-cg-load-more {
	appearance: none;
	border: 1px solid var(--dda-cg-filter-border);
	border-radius: 0;
	background: var(--dda-cg-filter-bg);
	color: inherit;
	cursor: pointer;
	font: inherit;
	line-height: 1.2;
	min-height: 44px;
	padding: 11px 18px;
	transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.dda-cg-filter__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-width: min(320px, 100%);
	text-align: left;
}

.dda-cg-filter__toggle::after {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform 0.2s ease;
}

.dda-cg-filter.is-open .dda-cg-filter__toggle {
	border-color: var(--dda-cg-primary);
	color: var(--dda-cg-primary);
}

.dda-cg-filter.is-open .dda-cg-filter__toggle::after {
	transform: rotate(225deg) translateY(-1px);
}

.dda-cg-filter__toggle:hover,
.dda-cg-filter__toggle:focus-visible,
.dda-cg-filter__reset:hover,
.dda-cg-filter__reset:focus-visible,
.dda-cg-load-more:hover,
.dda-cg-load-more:focus-visible {
	border-color: var(--dda-cg-primary);
	color: var(--dda-cg-primary);
	outline: none;
}

.dda-cg-filter__reset:disabled {
	cursor: default;
	opacity: 0.45;
}

.dda-cg-filter__reset:disabled:hover,
.dda-cg-filter__reset:disabled:focus-visible {
	border-color: var(--dda-cg-filter-border);
	color: inherit;
}

.dda-cg-filter__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	border-radius: 0;
	background: var(--dda-cg-primary);
	color: #fff;
	font-size: 0.85em;
	padding: 0 7px;
}

.dda-cg-filter__selected {
	position: relative;
	z-index: 70;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.dda-cg-filter__selected:empty {
	display: none;
}

.dda-cg-filter__selected-label {
	font-size: 0.92em;
	font-weight: 600;
	line-height: 1.2;
	color: var(--dda-cg-primary);
}

.dda-cg-filter__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 100%;
	border: 1px solid var(--dda-cg-primary);
	border-radius: 0;
	background: #fff;
	color: var(--dda-cg-primary);
	font-size: 0.9em;
	line-height: 1.2;
	padding: 7px 10px;
}

.dda-cg-filter__chip button {
	appearance: none;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	line-height: 1;
	padding: 0;
}

.dda-cg-filter__chip button:focus-visible {
	outline: 1px solid var(--dda-cg-primary);
	outline-offset: 2px;
}

.dda-cg-filter__overlay {
	position: fixed;
	inset: 0;
	z-index: 55;
	display: none;
	background: rgba(255, 255, 255, 0.68);
	cursor: default;
}

.dda-cg-filter.is-open .dda-cg-filter__overlay {
	display: block;
}

.dda-cg-filter__panel {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	z-index: 80;
	display: none;
	width: min(440px, calc(100vw - 32px));
	max-height: 430px;
	overflow: hidden;
	border: 1px solid var(--dda-cg-primary);
	border-radius: 0;
	background: var(--dda-cg-filter-bg);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.15);
	padding: 14px;
}

.dda-cg-filter.is-open .dda-cg-filter__panel {
	display: block;
}

.dda-cg-filter__search-label {
	display: block;
	margin: 0 0 12px;
}

.dda-cg-filter__search {
	width: 100%;
	min-height: 42px;
	border: 1px solid var(--dda-cg-filter-border);
	border-radius: 0;
	background: #fff;
	font: inherit;
	padding: 9px 14px;
}

.dda-cg-filter__search:focus {
	border-color: var(--dda-cg-primary);
	outline: none;
}

.dda-cg-filter__options {
	display: grid;
	gap: 2px;
	max-height: 324px;
	overflow: auto;
	overscroll-behavior: contain;
	padding-right: 4px;
}

.dda-cg-filter__option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	border-radius: 0;
	cursor: pointer;
	line-height: 1.25;
	padding: 9px 8px;
}

.dda-cg-filter__option:hover,
.dda-cg-filter__option:focus-within {
	background: var(--dda-cg-soft-bg);
}

.dda-cg-filter__option.is-selected {
	background: var(--dda-cg-soft-bg);
	color: var(--dda-cg-primary);
	font-weight: 600;
}

.dda-cg-filter__option input {
	flex: 0 0 auto;
	accent-color: var(--dda-cg-primary);
	margin-top: 0.15em;
}

.dda-cg-status {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.dda-cg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr));
	align-items: start;
	gap: var(--dda-cg-gap);
}

.dda-cg-card {
	min-width: 0;
}

.dda-cg-card__media {
	display: block;
	margin-bottom: 15px;
	text-decoration: none;
}

.dda-cg-card__image {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	border-radius: 0;
}

.dda-cg-card__title {
	font-size: clamp(18px, 1.45vw, 24px);
	font-weight: 500;
	line-height: 1.16;
	letter-spacing: 0.01em;
	margin: 0 0 10px;
	text-transform: none;
}

.dda-cg-card__title a {
	color: inherit;
	text-decoration: none;
}

.dda-cg-card__title a:hover,
.dda-cg-card__title a:focus-visible {
	color: var(--dda-cg-primary);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.dda-cg-card__excerpt {
	font-size: clamp(14px, 1vw, 16px);
	line-height: 1.55;
}

.dda-cg-card__excerpt p {
	margin: 0 0 0.7em;
}

.dda-cg-card__excerpt p:last-child {
	margin-bottom: 0;
}

.dda-cg-empty {
	padding: 30px 0;
	text-align: center;
}

.dda-cg-loader {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 28px 0 8px;
	color: var(--dda-cg-primary);
}

.dda-cg-loader[hidden],
.dda-cg-load-more[hidden],
.dda-cg-empty[hidden],
.dda-cg-filter__count[hidden] {
	display: none !important;
}

.dda-cg-loader__dot {
	width: 12px;
	height: 12px;
	border-radius: 0;
	border: 2px solid currentColor;
	border-top-color: transparent;
	animation: dda-cg-spin 0.8s linear infinite;
}

.dda-cg-load-more {
	display: none;
	margin: 28px auto 0;
}

.dda-cg.no-observer .dda-cg-load-more {
	display: block;
}

.dda-cg-sentinel {
	height: 1px;
}

@keyframes dda-cg-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 700px) {
	.dda-cg {
		--dda-cg-gap: 30px;
	}

	.dda-cg-filter {
		margin-bottom: 26px;
	}

	.dda-cg-filter__bar {
		display: grid;
		grid-template-columns: 1fr auto;
		gap: 8px;
	}

	.dda-cg-filter__toggle {
		width: 100%;
		min-width: 0;
	}

	.dda-cg-filter__reset {
		padding-inline: 14px;
	}

	.dda-cg-filter__selected {
		max-height: 96px;
		overflow: auto;
		padding-bottom: 2px;
	}

	.dda-cg-filter__panel {
		position: absolute;
		top: calc(100% + 10px);
		left: 0;
		width: 100%;
		max-height: min(70vh, 430px);
		box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
	}

	.dda-cg-filter__options {
		max-height: calc(min(70vh, 430px) - 84px);
	}
}
