/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/* =========================================================================
   Video Grid + Card
   Reusable across archive, taxonomy, related, search. Class names match
   the Bricks Global Classes (BEM-style) registered on those elements.
   ========================================================================= */

/* --- Grid: responsive column count + explicit gap --- */
.video-grid__wrapper {
	display: grid;
	grid-template-columns: var(--grid-1);
	gap: var(--space-m);
}

@media (min-width: 768px) {
	.video-grid__wrapper { grid-template-columns: var(--grid-2); }
}

@media (min-width: 992px) {
	.video-grid__wrapper { grid-template-columns: var(--grid-3); }
}

@media (min-width: 1366px) {
	.video-grid__wrapper { grid-template-columns: var(--grid-4); }
}

/* --- Card: override the pure-white bg, set up for stretched link + hover ---
   `article.video-card` bumps specificity above the Bricks Global Class output
   (which uses the bare `.video-card` selector) so the bg override wins
   regardless of inline-style load order. */
article.video-card {
	background-color: var(--base-ultra-light);
}

.video-card {
	position: relative;
	transition:
		transform .2s ease,
		box-shadow .2s ease,
		border-color .2s ease;
}

/* Stretched link — the image's <a> covers the whole card so any pixel
   clicks through to the single. Keeps semantics clean (one link per card)
   without duplicating a linked title. */
.video-card a[href]::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* Hover / focus feedback --- */
.video-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(13, 13, 13, .08);
}

.video-card:focus-within {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

/* Image subtly zooms on card hover. `overflow: hidden` is already on
   .video-card via its Bricks Global Class. */
.video-card__img {
	transition: transform .3s ease;
}

.video-card:hover .video-card__img {
	transform: scale(1.03);
}

/* Play-icon overlay — sits on the poster area only (aspect 16/9, top of card),
   fades in on hover. `pointer-events: none` keeps the stretched-link click
   target intact. SVG is inline via data URI — no extra HTTP request, no
   Media-Library coupling. Chalk circle + Midnight triangle, matching brand. */
.video-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	aspect-ratio: 16 / 9;
	background-color: rgba(13, 13, 13, .35);
	background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='11' fill='%23F5F5F0' fill-opacity='.95'/><path d='M10 8v8l6-4z' fill='%230D0D0D'/></svg>");
	background-position: center;
	background-repeat: no-repeat;
	background-size: 56px auto;
	opacity: 0;
	transition: opacity .25s ease;
	pointer-events: none;
	z-index: 2;
}

.video-card:hover::before {
	opacity: 1;
}

/* --- Line-clamp: lock card heights so rows stay even --- */
.video-card__heading {
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.video-card__description {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* =========================================================================
   Home Notice — dismissable banner between header and Latest Release
   Hide-when-content-empty is handled by a Bricks Condition on the section.
   Dismissal is JS-driven (home-notice.js), keyed by a hash of the visible
   content, so updating the text auto-re-shows the banner for everyone.
   ========================================================================= */

.home-notice {
	padding-block: var(--space-xs);
	background-color: var(--base-light-trans-40);
	color: var(--base);
}

.home-notice__container {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-m);
}

.home-notice__content {
	flex: 1 1 auto;
	font-family: "JetBrains";
	font-weight: 500;
	font-size: var(--text-s);
	line-height: 1.5;
}

.home-notice__content p {
	margin: 0;
}

.home-notice__content p + p {
	margin-top: var(--space-xs);
}

.home-notice__content a {
	color: var(--primary);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.home-notice__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	color: var(--base);
	background: transparent;
	border: 0;
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: color .15s ease, background .15s ease;
}
.home-notice__close:hover {
	color: var(--primary);
}
.home-notice__close:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

/* =========================================================================
   Video Single — Info section responsive stack
   The 3:1 two-column layout (title/description | Categories aside) is set
   via a Bricks Global Class (.video-info__container). On narrow viewports
   the right column squeezes until the taxonomy values truncate off-screen.
   Stack at ≤767px. Doubled selector beats Bricks' inline CSS cascade.
   ========================================================================= */

@media (max-width: 767px) {
	.video-info__container.video-info__container {
		grid-template-columns: 1fr;
		grid-gap: var(--space-m);
	}
}

/* =========================================================================
   Browse Filter + Active Filters + Empty State
   Single consolidated block. Uses doubled class selectors (e.g.
   `.browse-filter.browse-filter` or compound selectors) to bump specificity
   above any Bricks or ACSS rule. All styling lives here — Bricks Global
   Classes for browse-* should remain empty.
   ========================================================================= */

/* ----- FILTER BAR CONTAINER ----- */

.browse-filter {
	position: sticky;
	top: 0;
	z-index: 10;
	background-color: var(--base-ultra-light);
	border-bottom: 1px solid var(--base-light);
}

/* ----- PAGE HEADER (shared with video-archive + video-taxonomy) ----- */

/* On narrow viewports the "Member Videos" h1 and its "26 Videos" count
   share a single flex row that wraps mid-line — awkward. Stack them
   vertically instead at ≤767px so each gets its own line. */
@media (max-width: 767px) {
	/* Doubled class name — Bricks emits inline-style CSS for Global Classes
	   later in the cascade than this external sheet, so equal-specificity
	   rules lose. Doubling raises specificity to (0,2,0) and wins cleanly. */
	.page-header__heading-wrapper.page-header__heading-wrapper {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ----- FORM GRID (3 cols: search | facets | clear) ----- */
/* Compound selector .browse-filter .browse-filter__form beats Bricks 
   .brxe-block at 0-2-0 > 0-1-0 specificity. */

.browse-filter .browse-filter__form {
	display: grid;
	grid-template-columns: 2fr auto auto;
	gap: var(--space-m);
	align-items: center;
	width: 100%;
	flex-direction: unset;
}

/* Prevent grid items from stretching to the cell's full height —
   when facets wrap to 2 rows, the search was inflating with them. */
.browse-filter .browse-filter__form > * {
	align-self: center;
}

@media (max-width: 991px) {
	.browse-filter .browse-filter__form {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 767px) {
	.browse-filter .browse-filter__form {
		grid-template-columns: 1fr auto;
	}
}

/* ----- SEARCH INPUT (wrapper + inner Bricks wrapper + input) ----- */

.browse-filter .browse-filter__search {
	position: relative;
	width: 100%;
	flex-direction: unset;
}

.browse-filter__search-input,
.browse-filter__search-input.brxe-filter-search {
	position: relative;
	width: 100%;
	background-color: var(--base-ultra-light);
	border: 1px solid var(--base-light);
	border-radius: var(--radius-m);
	overflow: hidden;
}

.browse-filter__search-input:focus-within,
.browse-filter__search-input.brxe-filter-search:focus-within {
	border-color: var(--primary);
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

.browse-filter__search-input input[type="search"] {
	box-sizing: border-box;
	width: 100%;
	height: 44px;
	padding-block: 0;
	padding-inline: calc(var(--space-m) * 2.5) var(--space-m);
	font-size: var(--text-s);
	line-height: 44px;
	color: var(--base);
	background-color: transparent;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%234A4A4A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left var(--space-m) center;
	border: 0;
	outline: none;
	font-family: inherit;
}

.browse-filter__search-input input[type="search"]::placeholder {
	color: var(--base-semi-dark);
}

/* Hide Bricks' auto-injected search-clear icon */
.browse-filter__search-input .icon {
	display: none !important;
}

/* ----- FACETS GROUP (horizontal flex) ----- */

.browse-filter .browse-filter__facets {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: var(--space-s);
	width: auto;
	align-items: center;
}

@media (max-width: 991px) {
	.browse-filter .browse-filter__facets {
		justify-content: flex-start;
	}
}

@media (max-width: 767px) {
	.browse-filter .browse-filter__facets {
		display: none;
	}
}

/* Individual facet wrapper (holds a select) */
.browse-filter .browse-filter__facet {
	position: relative;
	width: auto;
	flex-direction: unset;
}

/* Hide the facet that matches the current taxonomy archive.
   On /hair-color/blonde/ the Hair Color dropdown is redundant and would
   clash with the path-segment filter if used. Piggybacks on WP's native
   tax-<slug> body class (added automatically by body_class() on term
   archives). Covers desktop + sheet facets in one go. */
body.tax-hair-color .browse-filter__facet--hair-color,
body.tax-bust-size .browse-filter__facet--bust-size,
body.tax-body-type .browse-filter__facet--body-type,
body.tax-pubic-style .browse-filter__facet--pubic-style,
body.tax-scene-finish .browse-filter__facet--scene-finish {
	display: none;
}

/* The actual <select> element */
.browse-filter .browse-filter__facet-select,
.browse-filter select.browse-filter__facet-select {
	appearance: none;
	-webkit-appearance: none;
	height: 44px;
	padding: 0 calc(var(--space-m) * 2) 0 var(--space-s);
	font-size: var(--text-s);
	font-family: inherit;
	color: var(--base);
	background-color: var(--base-ultra-light);
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230D0D0D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right var(--space-m) center;
	background-size: 18px 18px;
	border: 1px solid var(--base-light);
	border-radius: var(--radius-m);
	cursor: pointer;
	min-width: 110px;
}

.browse-filter .browse-filter__facet-select:focus {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
	border-color: var(--primary);
}

/* Active state — Bricks marks the empty "All" option with class="placeholder";
   any selected option that isn't the placeholder means the filter is active. */
.browse-filter .browse-filter__facet-select:has(option:checked:not(.placeholder)) {
	background-color: var(--primary);
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23F5F5F0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-size: 18px 18px;
	color: var(--text-light);
	border-color: var(--primary);
}

/* ----- CLEAR-ALL TEXT LINK (filter bar) ----- */

.browse-filter .browse-filter__clear {
	font-size: var(--text-s);
	font-weight: 500;
	color: var(--base-semi-dark);
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
	padding: var(--space-s) var(--space-m);
	width: auto;
	transition: color 0.15s ease;
}

.browse-filter .browse-filter__clear:hover {
	color: var(--primary);
}

@media (max-width: 767px) {
	.browse-filter .browse-filter__clear {
		display: none;
	}
}

/* ----- MOBILE TOGGLE ----- */

.browse-filter .browse-filter__mobile-toggle {
	display: none;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: var(--space-xs);
	width: auto;
	/* Match the search input's visual weight — 44px tall, modest padding,
	   body-font size instead of inheriting a display-size default. */
	height: 44px;
	padding: 0 var(--space-m);
	font-size: var(--text-s);
	font-weight: 500;
	color: var(--base);
	background-color: var(--base-ultra-light);
	border: 1px solid var(--base-light);
	border-radius: var(--radius-m);
}

.browse-filter .browse-filter__mobile-toggle:hover {
	border-color: var(--primary);
	color: var(--primary);
}

/* Scope the icon size — the SVG in the button was inheriting Bricks' default
   button-icon sizing, which paints a ~40px hamburger on mobile. */
.browse-filter .browse-filter__mobile-toggle svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

@media (max-width: 767px) {
	.browse-filter .browse-filter__mobile-toggle {
		display: inline-flex;
	}
}

/* ----- BOTTOM SHEET (mobile modal) ----- */

.browse-filter__sheet-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background-color: var(--black-trans-60);
	z-index: 50;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.browse-filter__sheet-overlay[data-open="true"] {
	display: block;
	opacity: 1;
}

.browse-filter__sheet {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 51;
	height: 85vh;
	max-height: 85vh;
	background-color: var(--base-ultra-light);
	border-top-left-radius: var(--radius-xl);
	border-top-right-radius: var(--radius-xl);
	box-shadow: 0 -8px 32px var(--black-trans-20);
	transform: translateY(100%);
	transition: transform 0.3s ease;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.browse-filter__sheet[data-open="true"] {
	transform: translateY(0);
}

.browse-filter__sheet .browse-filter__sheet-handle {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	padding: var(--space-s) 0 var(--space-xs);
	flex-shrink: 0;
	width: 100%;
}

.browse-filter__sheet-handle-bar {
	width: 40px;
	height: 4px;
	background-color: var(--base-light);
	border-radius: var(--radius-xl);
}

.browse-filter__sheet .browse-filter__sheet-header {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-s) var(--space-l) var(--space-m);
	border-bottom: 1px solid var(--base-light);
	flex-shrink: 0;
	width: 100%;
}

.browse-filter__sheet-title {
	font-size: var(--h3);
	font-weight: 600;
	color: var(--base);
	margin: 0;
}

.browse-filter__sheet-close {
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: transparent;
	border: 0;
	border-radius: var(--radius-50);
	color: var(--base-semi-dark);
	cursor: pointer;
}

.browse-filter__sheet-close:hover {
	background-color: var(--base-light);
	color: var(--base);
}

.browse-filter__sheet-search {
	padding: var(--space-m) var(--space-l);
	background-color: var(--base-ultra-light);
	border-bottom: 1px solid var(--base-light);
	flex-shrink: 0;
	width: 100%;
}

.browse-filter__sheet-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: var(--space-l);
	width: 100%;
}

.browse-filter__sheet-facets {
	display: flex;
	flex-direction: column;
	gap: var(--space-m);
	width: 100%;
}

.browse-filter__sheet-facet {
	display: flex;
	flex-direction: column;
	width: 100%;
}

.browse-filter__sheet-facet-label {
	display: block;
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: var(--text-xs);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--base-semi-dark);
	margin-bottom: var(--space-xs);
}

.browse-filter__facet-select--in-sheet {
	width: 100%;
	font-size: var(--text-m);
	padding-block: var(--space-xs);
}

.browse-filter__sheet .browse-filter__sheet-footer {
	display: flex;
	flex-direction: row;
	gap: var(--space-s);
	padding: var(--space-m) var(--space-l);
	border-top: 1px solid var(--base-light);
	background-color: var(--base-ultra-light);
	flex-shrink: 0;
	width: 100%;
}

.browse-filter__sheet-footer-clear {
	flex: 0 0 auto;
	width: auto;
	padding: var(--space-s) var(--space-m);
	font-size: var(--text-m);
	font-weight: 500;
	color: var(--base-semi-dark);
	background: transparent;
	border: 1px solid var(--base-light);
	border-radius: var(--radius-m);
	cursor: pointer;
}

.browse-filter__sheet-footer-clear:hover {
	color: var(--primary);
	border-color: var(--primary);
}

.browse-filter__sheet-footer-apply {
	flex: 1 1 auto;
	width: auto;
}

/* ----- ACTIVE-FILTER CHIPS SECTION ----- */

.browse-active-filters {
	background-color: var(--base-ultra-light);
	border-bottom: 1px solid var(--base-light);
}

/* Hide the whole section when there are no active filter chips to show.
   Bricks' own CSS hides the empty <ul>, but the section's "Active:" label
   and "Clear All Filters" button stay visible, creating an empty band.
   `:has()` re-evaluates when AJAX filter changes add/remove <li> children,
   so this stays accurate without JS. */
.browse-active-filters:has(.browse-active-filters__list:empty) {
	display: none;
}

.browse-active-filters .browse-active-filters__container {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-xs);
}

.browse-active-filters__label {
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: var(--text-xs);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--base-semi-dark);
	margin: 0 var(--space-xs) 0 0;
	width: auto;
}

.browse-active-filters .browse-active-filters__list {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: var(--space-xs);
	list-style: none;
	margin: 0;
	padding: 0;
	width: auto;
}

.browse-active-filters__item {
	display: inline-flex;
	width: auto;
}

.browse-active-filters__chip {
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	gap: var(--space-xs);
	width: auto;
	min-width: 80px;
	padding: var(--space-xs) var(--space-s);
	font-size: var(--text-s);
	color: var(--text-light);
	background-color: var(--base);
	border: 0;
	border-radius: var(--radius-xl);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.browse-active-filters__chip:hover {
	background-color: var(--primary);
}

.browse-active-filters__chip-x {
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
}

.browse-active-filters__clear-all {
	margin-left: auto;
	width: auto;
	padding: var(--space-xs) var(--space-s);
	font-size: var(--text-s);
	font-weight: 500;
	color: var(--base-semi-dark);
	background: transparent;
	border: 0;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.15s ease;
}

.browse-active-filters__clear-all:hover {
	color: var(--primary);
}

@media (max-width: 767px) {
	.browse-active-filters__clear-all {
		margin-left: 0;
		width: 100%;
		text-align: left;
	}
}

/* ----- EMPTY STATE -----
   Show .browse-empty only when the video grid returned 0 results.
   Bricks always emits a .brx-query-trail element inside the loop wrapper
   carrying data-max-pages — it's literally "0" when no posts matched.
   :has() re-evaluates when Bricks AJAX-swaps the grid innerHTML on filter
   change, so this stays accurate without JS.

   NOTE: we intentionally do NOT hide .video-grid itself — Bricks' JS binds
   to that element for filter AJAX, and display:none on an ancestor would
   break event delegation to the filter-select elements. Collapsing the
   empty grid's visible footprint is handled by .video-grid__wrapper:empty
   below instead. */
.browse-empty {
	display: none;
}

.video-grid:has(.brx-query-trail[data-max-pages="0"]) ~ .browse-empty {
	display: block;
}

/* Collapse the grid's visible padding when the loop is empty — the
   .video-grid__wrapper (the <ul>) has no <li> children in that case. */
.video-grid__wrapper:empty {
	display: none;
}

.browse-empty__heading {
	font-size: var(--h2);
	font-weight: 600;
	color: var(--base);
}

.browse-empty__text {
	font-size: var(--text-m);
	color: var(--base-semi-dark);
}

.browse-empty__action {
	display: inline-block;
	width: auto;
}

/* ----- REDUCED MOTION ----- */

@media (prefers-reduced-motion: reduce) {
	.browse-filter__sheet-overlay,
	.browse-filter__sheet,
	.browse-active-filters__chip,
	.browse-active-filters__clear-all,
	.browse-filter .browse-filter__clear {
		transition: none;
	}
}
