.afs-sorter {
	--afs-accent: #2563eb;
	--afs-border: #e5e7eb;
	--afs-text: #111827;
	--afs-muted: #6b7280;
	position: relative;
}

.afs-toolbar {
	display: flex;
	justify-content: flex-end;
	margin-block-end: 1.25rem;
}

.afs-dropdown {
	position: relative;
	width: min(100%, 230px);
	z-index: 5;
}

.afs-dropdown__toggle,
.afs-dropdown__option {
	align-items: center;
	background: #fff;
	color: var(--afs-text);
	cursor: pointer;
	display: flex;
	font: inherit;
	gap: .65em;
	min-height: 44px;
	text-align: start;
	width: 100%;
}

.afs-dropdown__toggle {
	border: 1px solid var(--afs-border);
	border-radius: 8px;
	justify-content: space-between;
	padding: .65rem .85rem;
}

.afs-dropdown__selection {
	align-items: center;
	display: flex;
	gap: .65em;
}

.afs-dropdown__icon {
	align-items: center;
	color: var(--afs-accent);
	display: inline-flex;
	flex: 0 0 auto;
	justify-content: center;
	width: 1.1em;
}

.afs-dropdown__icon svg {
	display: block;
	height: 1em;
	width: 1em;
}

.afs-dropdown__chevron {
	font-size: 1.2em;
	line-height: 1;
	transition: transform .2s ease;
}

.afs-sorter.is-open .afs-dropdown__chevron {
	transform: rotate(180deg);
}

.afs-dropdown__menu {
	background: #fff;
	border: 1px solid var(--afs-border);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
	inset-inline: 0;
	margin-block-start: .4rem;
	overflow: hidden;
	position: absolute;
	top: 100%;
}

.afs-dropdown__menu[hidden] {
	display: none;
}

.afs-dropdown__option {
	border: 0;
	padding: .65rem .85rem;
	text-decoration: none;
}

.afs-dropdown__option:visited {
	color: inherit;
}

.afs-editor-notice {
	background: #fff8e5;
	border-inline-start: 4px solid #f0b849;
	margin: 0;
	padding: .8rem 1rem;
}

.afs-dropdown__option:hover,
.afs-dropdown__option:focus-visible,
.afs-dropdown__option[aria-checked="true"] {
	background: #f3f4f6;
}

.afs-dropdown__toggle:focus-visible,
.afs-dropdown__option:focus-visible {
	outline: 2px solid var(--afs-accent);
	outline-offset: 2px;
}

.afs-results {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	transition: opacity .2s ease;
}

.afs-sorter.is-loading .afs-results {
	opacity: .45;
	pointer-events: none;
}

.afs-sorter.is-loading::after {
	animation: afs-spin .7s linear infinite;
	border: 3px solid rgba(37, 99, 235, .2);
	border-top-color: var(--afs-accent);
	border-radius: 50%;
	content: '';
	height: 32px;
	inset-inline-start: calc(50% - 16px);
	position: absolute;
	top: 50%;
	width: 32px;
	z-index: 4;
}

.afs-card {
	background: #fff;
	border: 1px solid var(--afs-border);
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
}

.afs-card__image {
	aspect-ratio: 16 / 10;
	display: block;
	overflow: hidden;
}

.afs-card__image img {
	display: block;
	height: 100%;
	object-fit: cover;
	transition: transform .3s ease;
	width: 100%;
}

.afs-card:hover .afs-card__image img {
	transform: scale(1.03);
}

.afs-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 1.15rem;
}

.afs-card__title {
	font-size: 1.15rem;
	line-height: 1.5;
	margin: 0;
}

.afs-card__title a {
	color: var(--afs-text);
	text-decoration: none;
}

.afs-card__title a:hover {
	color: var(--afs-accent);
}

.afs-card__meta {
	color: var(--afs-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: .82rem;
	gap: .45rem .85rem;
	margin-block-start: .65rem;
}

.afs-card__excerpt {
	color: #4b5563;
	font-size: .95rem;
	line-height: 1.75;
	margin: .8rem 0 0;
}

.afs-status {
	color: #b91c1c;
	margin-block-end: .75rem;
}

.afs-status:empty {
	display: none;
}

.afs-empty {
	grid-column: 1 / -1;
	margin: 0;
	text-align: center;
}

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

@media (max-width: 1024px) {
	.afs-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.afs-dropdown { width: 100%; }
	.afs-results { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.afs-dropdown__chevron,
	.afs-card__image img,
	.afs-results { transition: none; }
}
