/**
 * Explore page — compact hero + filter popups
 */

body.tdtv-explore .tdtv-archive-container {
	margin-bottom: 12px;
}

body.tdtv-explore .tdtv-archive-header.tdtv-explore-hero {
	padding: 18px 22px;
	margin-top: 8px;
	border-radius: 16px;
}

body.tdtv-explore .tdtv-explore-hero .tdtv-archive-eyebrow {
	margin-bottom: 8px;
	padding: 4px 10px;
	font-size: 10px;
}

body.tdtv-explore .tdtv-explore-hero .tdtv-archive-title {
	font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
	gap: 10px;
}

body.tdtv-explore .tdtv-explore-hero .tdtv-archive-count {
	font-size: 14px;
}

body.tdtv-explore .tdtv-explore-hero .tdtv-archive-tagline {
	display: none;
}

/* --------------------------------------------------------------------------
   Filter toolbar
   -------------------------------------------------------------------------- */

.tdtv-explore-toolbar {
	margin: 0 0 18px;
}

.tdtv-explore-toolbar__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.tdtv-explore-filter-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--tdtv-border, rgba(255, 255, 255, .1));
	border-radius: 12px;
	background: rgba(255, 255, 255, .03);
	color: var(--tdtv-text, #e8eaef);
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.tdtv-explore-filter-btn:hover {
	border-color: rgba(255, 221, 149, .35);
	color: var(--tdtv-accent, #ffdd95);
}

.tdtv-explore-filter-btn.is-active {
	border-color: rgba(255, 221, 149, .45);
	background: rgba(255, 221, 149, .1);
}

.tdtv-explore-filter-btn__label {
	font-weight: 600;
	color: var(--tdtv-muted, #9aa0ac);
}

.tdtv-explore-filter-btn__value {
	font-weight: 600;
	white-space: nowrap;
}

.tdtv-explore-filter-btn__chev,
.tdtv-explore-filter-btn .tdtv-icon {
	flex-shrink: 0;
	opacity: .75;
}

.tdtv-explore-toolbar__clear {
	margin-left: auto;
	padding: 8px 12px;
	font-size: 13px;
	font-weight: 600;
	color: var(--tdtv-muted, #9aa0ac);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tdtv-explore-toolbar__clear:hover {
	color: var(--tdtv-accent, #ffdd95);
}

/* --------------------------------------------------------------------------
   Filter popup
   -------------------------------------------------------------------------- */

.tdtv-explore-popup {
	position: fixed;
	inset: 0;
	z-index: 12000;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0;
}

.tdtv-explore-popup[hidden] {
	display: none !important;
}

body.tdtv-explore-popup-open {
	overflow: hidden;
}

.tdtv-explore-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .62);
	backdrop-filter: blur(4px);
}

.tdtv-explore-popup__sheet {
	position: relative;
	width: 100%;
	max-width: 520px;
	max-height: min(78vh, 640px);
	margin: 0 auto;
	border: 1px solid var(--tdtv-border, rgba(255, 255, 255, .1));
	border-radius: 20px 20px 0 0;
	background: var(--tdtv-surface, #141418);
	box-shadow: 0 -12px 40px rgba(0, 0, 0, .45);
	animation: tdtv-explore-sheet-in .22s ease-out;
}

@keyframes tdtv-explore-sheet-in {
	from {
		transform: translateY(12px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.tdtv-explore-popup__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px 12px;
	border-bottom: 1px solid var(--tdtv-border, rgba(255, 255, 255, .08));
}

.tdtv-explore-popup__title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: var(--tdtv-text, #e8eaef);
}

.tdtv-explore-popup__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	color: var(--tdtv-muted, #9aa0ac);
	transition: background .15s ease, color .15s ease;
}

.tdtv-explore-popup__close:hover {
	background: rgba(255, 255, 255, .06);
	color: var(--tdtv-text, #e8eaef);
}

.tdtv-explore-popup__body {
	padding: 8px 12px 20px;
	max-height: calc(min(78vh, 640px) - 64px);
	overflow: auto;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 221, 149, 0.35) var(--tdtv-bg, #0d0d10);
}

.tdtv-explore-popup__body::-webkit-scrollbar {
	width: 8px;
}

.tdtv-explore-popup__body::-webkit-scrollbar-track {
	background: transparent;
}

.tdtv-explore-popup__body::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.14);
	border-radius: 4px;
}

.tdtv-explore-popup__body::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 221, 149, 0.35);
}

.tdtv-explore-popup__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tdtv-explore-popup__list--grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 6px;
}

.tdtv-explore-popup__option {
	display: block;
	padding: 12px 14px;
	min-height: 44px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 500;
	color: var(--tdtv-text, #e8eaef);
	text-decoration: none;
	transition: background .12s ease, color .12s ease;
}

.tdtv-explore-popup__option:hover {
	background: rgba(255, 255, 255, .05);
	color: var(--tdtv-accent, #ffdd95);
}

.tdtv-explore-popup__option.is-active {
	background: rgba(255, 221, 149, .12);
	color: var(--tdtv-accent, #ffdd95);
	font-weight: 600;
}

.tdtv-explore-empty {
	grid-column: 1 / -1;
	margin: 24px 0;
	padding: 24px;
	text-align: center;
	color: var(--tdtv-muted, #9aa0ac);
}

.tdtv-explore-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	margin: 2px;
	padding: 0 10px;
	border-radius: 8px;
	font-size: 14px;
	text-decoration: none;
}

.tdtv-explore-pagination .page-numbers.current {
	background: rgba(255, 221, 149, .15);
	color: var(--tdtv-accent, #ffdd95);
}

body.tdtv-explore .tdtv-section-head {
	margin-top: 0;
}

@media (min-width: 768px) {
	.tdtv-explore-popup {
		align-items: center;
		padding: 24px;
	}

	.tdtv-explore-popup__sheet {
		border-radius: 20px;
		max-height: min(70vh, 560px);
	}

	.tdtv-explore-toolbar__row {
		gap: 10px;
	}
}

@media (max-width: 640px) {
	body.tdtv-explore .tdtv-archive-container {
		margin-bottom: 8px;
	}

	body.tdtv-explore .tdtv-explore-hero {
		padding: 14px 16px;
		margin-top: 4px;
		border-radius: 12px;
	}

	body.tdtv-explore .tdtv-explore-hero .tdtv-archive-title {
		font-size: 1.2rem;
	}

	body.tdtv-explore .tdtv-card-title {
		font-size: 12px;
		line-height: 1.25;
	}

	.tdtv-explore-toolbar {
		margin-bottom: 12px;
	}

	.tdtv-explore-toolbar__row {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
		overflow: visible;
		flex-wrap: wrap;
	}

	.tdtv-explore-filter-btn {
		flex: none;
		width: 100%;
		min-width: 0;
		max-width: none;
		padding: 10px 12px;
		justify-content: space-between;
		box-sizing: border-box;
	}

	.tdtv-explore-filter-btn__label {
		font-size: 11px;
	}

	.tdtv-explore-filter-btn__value {
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: none;
		flex: 1;
		min-width: 0;
		font-size: 12px;
	}

	.tdtv-explore-toolbar__clear {
		grid-column: 1 / -1;
		flex: none;
		margin-left: 0;
		width: 100%;
		text-align: center;
		padding: 10px 12px;
		border: 1px solid var(--tdtv-border, rgba(255, 255, 255, .1));
		border-radius: 12px;
		background: rgba(255, 255, 255, .02);
		text-decoration: none;
	}

	.tdtv-explore-popup__sheet {
		max-height: 85vh;
	}

	.tdtv-explore-popup__body {
		max-height: calc(85vh - 64px);
	}

	.tdtv-explore-popup__list--grid {
		grid-template-columns: 1fr;
	}
}
