/* ==========================================================================
   Videos Landing Page
   Design tokens from handoff doc — scoped under .etb-videos-page.
   ========================================================================== */

/* Map handoff tokens to BuddyBoss variables with sensible fallbacks */
.etb-videos-page {
	--etb-orange:            #FA4616;
	--etb-yellow:            #FED141;
	--etb-thumb-bg:          #1C1C1C;
	--etb-avatar-bg:         rgba(250, 70, 22, 0.09);
	--etb-active-filter-bg:  rgba(250, 70, 22, 0.08);
	--etb-active-chip-bg:    rgba(250, 70, 22, 0.10);
	--etb-active-chip-bdr:   rgba(250, 70, 22, 0.30);
	--etb-filter-panel-bg:   rgba(0, 0, 0, 0.025);

	/* Border tokens — fall back to BuddyBoss variable then hard values */
	--color-border-secondary: var(--bb-content-border-color, rgba(0, 0, 0, 0.14));
	--color-border-tertiary:  rgba(0, 0, 0, 0.08);

	/* Text tokens */
	--color-text-primary:   var(--bb-body-text-color, #1a1a1a);
	--color-text-tertiary:  rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   Header box-shadow (matches Podcasts page)
   ========================================================================== */

body.page-template-template-videos-landing .site-header {
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.etb-videos-hero {
	padding: 1.75rem 0 1.5rem;
}

.etb-breadcrumb {
	font-size: 16px;
	color: var(--color-text-tertiary);
	margin: 0 0 0.5rem;
}

.etb-breadcrumb a {
	color: var(--color-text-tertiary);
	text-decoration: none;
}

.etb-breadcrumb a:hover {
	color: var(--etb-orange);
}

.etb-videos-hero h1 {
	font-size: 34px;
	font-weight: 700;
	margin: 0 0 0.4rem;
	line-height: 1.2;
}

.etb-subtitle {
	font-size: 24px;
	font-weight: 400;
	color: #000;
	line-height: 1.4;
	margin: 0;
}

/* ==========================================================================
   Featured card
   ========================================================================== */

.etb-featured-card {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	border: none;
	border-radius: 20px;
	overflow: hidden;
	background: #fff;
	box-shadow: 1px 1px 12px -3px rgba(0, 0, 0, 0.2);
	margin-bottom: 2rem;
	text-decoration: none;
	color: inherit;
}

.etb-featured-thumbnail {
	background: var(--etb-thumb-bg);
	aspect-ratio: 16 / 9;
	position: relative;
	overflow: hidden;
	display: block;
	text-decoration: none;
}

.etb-featured-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.etb-badge-featured {
	position: absolute;
	top: 9px;
	left: 9px;
	background: var(--etb-yellow);
	color: #1a1a1a;
	font-size: 12px;
	font-weight: 500;
	padding: 2px 8px;
	border-radius: 8px;
	z-index: 1;
}

.etb-featured-meta {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.etb-featured-title {
	font-size: 22px;
	font-weight: 500;
	margin: 0;
	line-height: 1.4;
}

.etb-featured-title a {
	color: inherit;
	text-decoration: none;
}

.etb-featured-title a:hover {
	color: var(--etb-orange);
}

.etb-featured-excerpt {
	font-size: 17px;
	color: var(--color-text-tertiary);
	margin: 0;
	line-height: 1.6;
}

/* ==========================================================================
   Book tags (shared by featured + grid cards)
   ========================================================================== */

.etb-book-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.etb-book-tag {
	display: inline-block;
	background: var(--etb-orange);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	padding: 2px 8px;
	border-radius: 8px;
	text-transform: none;
	line-height: 1.4;
}

/* ==========================================================================
   Author (shared)
   ========================================================================== */

.etb-author {
	display: flex;
	align-items: center;
	gap: 10px;
}

.etb-avatar {
	width: 35px;
	height: 35px;
	border-radius: 50%;
	background: var(--etb-avatar-bg);
	color: var(--etb-orange);
	font-size: 11px;
	font-weight: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.etb-avatar-sm {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--etb-avatar-bg);
	color: var(--etb-orange);
	font-size: 11px;
	font-weight: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

/* Photo avatars — object-fit keeps them circular on both landing and single pages */
img.etb-avatar-photo {
	object-fit: cover;
	background: var(--etb-avatar-bg);
}

.etb-author-name {
	font-size: 16px;
	color: var(--color-text-tertiary);
}

/* ==========================================================================
   Duration badge (shared)
   ========================================================================== */

.etb-duration {
	position: absolute;
	bottom: 10px;
	right: 7px;
	background: rgb(0, 0, 0);
	color: rgba(255, 255, 255, 0.88);
	font-size: 12px;
	padding: 3px 10px;
	border-radius: 5px;
	line-height: 1.5;
	z-index: 1;
}

/* ==========================================================================
   Play buttons
   ========================================================================== */

.etb-play-btn {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.70);
	background: rgba(0, 0, 0, 0.50);
	display: flex;
	align-items: center;
	justify-content: center;
}

.etb-play-btn::after {
	content: '';
	display: block;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 10px 0 10px 18px;
	border-color: transparent transparent transparent rgba(255, 255, 255, 0.90);
	margin-left: 4px;
}

.etb-play-btn-sm {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.70);
	background: rgba(0, 0, 0, 0.50);
	display: flex;
	align-items: center;
	justify-content: center;
}

.etb-play-btn-sm::after {
	content: '';
	display: block;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 9px 0 9px 16px;
	border-color: transparent transparent transparent rgba(255, 255, 255, 0.90);
	margin-left: 3px;
}

/* ==========================================================================
   Search + Filter unit
   ========================================================================== */

.etb-filter-unit {
	border: 0.5px solid var(--color-border-secondary);
	border-radius: 12px;
	overflow: hidden;
}

/* Default state: no bottom margin (chips row absent) */
.etb-filter-unit {
	margin-bottom: 1.75rem;
}

/* When chips are visible JS adds .has-chips to the unit and removes margin
   since .etb-active-chips itself carries the 1.75rem bottom margin */
.etb-filter-unit.has-chips {
	margin-bottom: 0;
}

/* Search row */
.etb-search-row {
	padding: 9px 14px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.etb-search-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	color: var(--color-text-tertiary);
}

.etb-search-input {
	flex: 1;
	border: none;
	outline: none;
	background: transparent;
	font-size: 16px;
	color: var(--color-text-primary);
	min-width: 0;
}

.etb-search-input::placeholder {
	color: var(--color-text-tertiary);
}

.etb-kbd {
	font-size: 10px;
	color: var(--color-text-tertiary);
	background: rgba(0, 0, 0, 0.05);
	border: 0.5px solid var(--color-border-secondary);
	border-radius: 4px;
	padding: 2px 5px;
	flex-shrink: 0;
	font-family: inherit;
	white-space: nowrap;
}

/* Filter row */
.etb-filter-row {
	border-top: 0.5px solid var(--color-border-tertiary);
	padding: 7px 14px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

/* Filter funnel icon — own column, aligned with first button row */
.etb-filter-label {
	color: var(--color-text-tertiary);
	flex-shrink: 0;
	display: block;
	/* (button line-height ~22px + top/bottom padding 5px each = 32px; funnel is 18px) → (32-18)/2 = 7px */
	margin-top: 7px;
}

/* Buttons + count — wrap freely; second row stays indented by funnel column */
.etb-filter-buttons {
	flex: 1;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 7px;
	min-width: 0;
}

/* Video count stays on the far right of its row */
.etb-filter-buttons .etb-video-count {
	margin-left: auto;
	flex-shrink: 0;
}

/* Filter button — default */
.etb-filter-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 16px;
	font-weight: 400;
	padding: 5px 11px;
	border: 0.5px solid var(--color-border-secondary);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.05);
	color: var(--color-text-primary);
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	white-space: nowrap;
	outline: none;
}

.etb-filter-btn:hover,
.etb-filter-btn:focus {
	background: var(--etb-active-filter-bg);
	border-color: var(--etb-orange);
	color: var(--etb-orange);
}

/* Filter button — active (has selections) */
.etb-filter-btn.is-active {
	background: var(--etb-active-filter-bg);
	border: 1px solid var(--etb-orange);
	color: var(--etb-orange);
}

/* Count badge inside active filter button */
.etb-filter-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--etb-orange);
	color: #fff;
	border-radius: 10px;
	padding: 0 5px;
	font-size: 10px;
	min-width: 16px;
	line-height: 1.6;
}

/* Chevron icon — rotate when panel is open */
.etb-chevron {
	width: 10px;
	height: 10px;
	flex-shrink: 0;
	transition: transform 0.2s;
}

.etb-filter-btn[aria-expanded="true"] .etb-chevron {
	transform: rotate(180deg);
}

/* Video count — right-aligned */
.etb-video-count {
	margin-left: auto;
	font-size: 13px;
	color: var(--color-text-tertiary);
	white-space: nowrap;
}

/* ==========================================================================
   Filter panel
   ========================================================================== */

.etb-filter-panel {
	border-top: 0.5px solid var(--color-border-tertiary);
	background: var(--etb-filter-panel-bg);
	padding: 12px 14px;
}

.etb-filter-panel[hidden] {
	display: none;
}

.etb-panel-search {
	width: 100%;
	padding: 6px 10px;
	font-size: 13px;
	border: 0.5px solid var(--color-border-secondary);
	border-radius: 6px;
	background: #fff;
	color: var(--color-text-primary);
	outline: none;
	margin-bottom: 10px;
	box-sizing: border-box;
}

.etb-panel-search::placeholder {
	color: var(--color-text-tertiary);
}

.etb-filter-checkboxes {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 4px 16px;
}

.etb-check-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	cursor: pointer;
	padding: 3px 0;
	color: var(--color-text-primary);
}

.etb-check-label input[type="checkbox"] {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	accent-color: var(--etb-orange);
	cursor: pointer;
}

.etb-check-label.is-hidden {
	display: none;
}

.etb-hidden-terms {
	display: contents;
}

.etb-hidden-terms[hidden] {
	display: none;
}

.etb-show-more-terms {
	grid-column: 1 / -1;
	background: none;
	border: none;
	color: var(--etb-orange);
	font-size: 13px;
	cursor: pointer;
	padding: 4px 0 0;
	text-align: left;
	outline: none;
}

.etb-show-more-terms:hover,
.etb-show-more-terms:focus {
	background: none;
	color: var(--color-text-primary);
}

/* ==========================================================================
   Active filter chips
   ========================================================================== */

.etb-active-chips {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 1.75rem;
	margin-top: 0.75rem;
}

.etb-active-chips[hidden] {
	display: none;
}

.etb-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--etb-active-chip-bg);
	color: var(--etb-orange);
	border: 1px solid var(--etb-active-chip-bdr);
	border-radius: 20px;
	padding: 3px 10px;
	font-size: 13px;
	cursor: pointer;
	line-height: 1.4;
	transition: background 0.15s;
}

.etb-chip:hover {
	background: var(--etb-orange);
	color: #fff;
	border-color: var(--etb-orange);
}

.etb-chip-x {
	font-size: 14px;
	line-height: 1;
	opacity: 0.7;
}

.etb-clear-all {
	font-size: 13px;
	color: var(--color-text-tertiary);
	text-decoration: underline;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	margin-left: 2px;
	transition: color 0.15s;
}

.etb-clear-all:hover {
	background: none;
	color: var(--color-text-primary);
	text-decoration: none;
}

/* ==========================================================================
   Video grid
   ========================================================================== */

.etb-video-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin-bottom: 2rem;
}

/* Grid card */
.etb-video-card {
	border: none;
	border-radius: 20px;
	overflow: hidden;
	background: #fff;
	box-shadow: 1px 1px 12px -3px rgba(0, 0, 0, 0.2);
	transition: transform 0.3s ease;
}

.etb-video-card:hover {
	transform: translateY(-5px);
}

.etb-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.etb-card-thumbnail {
	background: var(--etb-thumb-bg);
	aspect-ratio: 16 / 9;
	position: relative;
	overflow: hidden;
}

.etb-card-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.etb-card-meta {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.etb-video-card h3 {
	font-size: 17px;
	font-weight: 500;
	margin: 2px 0 5px;
	line-height: 1.3;
	color: var(--color-text-primary);
}

/* ==========================================================================
   Load more
   ========================================================================== */

.etb-load-more {
	text-align: center;
	padding-bottom: 2.5rem;
}

.etb-load-more[hidden] {
	display: none;
}

#etb-load-more-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	padding: 12px 20px;
	background: #000;
	color: #fff;
	border: 2px solid #000;
	border-radius: 10px;
	cursor: pointer;
	margin-bottom: 0.5rem;
	transition: background 0.3s ease, color 0.3s ease;
}

#etb-load-more-btn:hover:not(:disabled),
#etb-load-more-btn:focus:not(:disabled) {
	background: #fff;
	color: #000;
}

#etb-load-more-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

#etb-showing-count {
	font-size: 13px;
	color: var(--color-text-tertiary);
	margin: 0;
}

/* ==========================================================================
   Loading state
   ========================================================================== */

/* ==========================================================================
   No results message
   ========================================================================== */

.etb-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 48px 32px;
	background: rgba(0, 0, 0, 0.05);
	border-radius: 10px;
}

.etb-no-results p {
	font-size: 20px;
	color: var(--color-text-primary);
	line-height: 1.6;
	max-width: 550px;
	margin: auto;
}

/* ==========================================================================
   Loading state
   ========================================================================== */

.etb-video-grid.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
	.etb-video-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.etb-featured-card {
		grid-template-columns: 1fr;
	}

	.etb-featured-thumbnail {
		aspect-ratio: 16 / 9;
	}

	.etb-filter-checkboxes {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 600px) {
	.etb-video-grid {
		grid-template-columns: 1fr;
	}

	.etb-filter-checkboxes {
		grid-template-columns: 1fr;
	}

	.etb-filter-buttons {
		gap: 5px;
	}

	.etb-filter-btn {
		font-size: 14px;
		padding: 5px 9px;
	}

	.etb-filter-row {
		gap: 7px;
	}

	.etb-kbd {
		display: none;
	}
}
