/* Brand presentation for the portable JEO Video Gallery owner. */
:where(.jeo-video-gallery) {
	--jeo-video-gallery-current: color-mix(in srgb, var(--wp--preset--color--interactive) 9%, transparent);
	--jeo-video-gallery-muted: color-mix(in srgb, currentcolor 62%, transparent);
	--jeo-video-gallery-panel: transparent;
	--jeo-video-gallery-rule: color-mix(in srgb, currentcolor 18%, transparent);
	margin-block-end: 30px;
}

.jeo-video-gallery .jeo-video-gallery__items > .wp-block-heading {
	color: inherit;
	font-family: var(--wp--custom--typography--editorial-heading);
	font-size: 28px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 38px;
	margin: 0 0 40px;
}

.jeo-video-gallery__stage {
	background: #101418;
}

.jeo-video-gallery__stage lite-youtube {
	aspect-ratio: 16 / 9;
	max-width: none;
}

.jeo-video-gallery__poster {
	z-index: 0;
}

.jeo-video-gallery__stage .lyt-playbtn {
	z-index: 2;
}

.jeo-video-gallery__consent::after {
	background: rgb(8 12 16 / 34%);
	content: "";
	inset: 0;
	position: absolute;
	z-index: 1;
}

.jeo-video-gallery__consent-panel {
	background: rgb(18 23 29 / 94%);
	border: 1px solid rgb(255 255 255 / 18%);
	border-radius: 6px;
	box-shadow: 0 8px 24px rgb(0 0 0 / 24%);
	color: #f5f5f5;
	font-family: inherit;
	padding: 15px 16px 16px;
}

.jeo-video-gallery__consent-icon {
	background: #c4302b;
	color: #fff;
}

.jeo-video-gallery__consent-title {
	font-size: 14px;
	font-weight: 700;
	line-height: 19px;
}

.jeo-video-gallery__consent-description {
	color: rgb(245 245 245 / 82%);
	font-size: 13px;
	font-weight: 400;
	line-height: 18px;
}

.jeo-video-gallery__consent-button {
	background: var(--wp--preset--color--base);
	border: 2px solid var(--wp--preset--color--base);
	border-radius: 4px;
	color: var(--wp--preset--color--media-surface);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 18px;
	padding: 8px 14px;
}

.jeo-video-gallery__consent-button:hover,
.jeo-video-gallery__consent-button:focus-visible {
	background: var(--wp--preset--color--interactive);
	border-color: var(--wp--preset--color--interactive);
	color: #101418;
}

.jeo-video-gallery__consent-button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.jeo-video-gallery__consent-button:disabled,
.jeo-video-gallery__consent-button:disabled:hover {
	background: #e5e7e9;
	border-color: #e5e7e9;
	color: #4b5258;
}

.jeo-video-gallery__list .is-style-jeo-video-card {
	align-content: start;
	background: var(--jeo-video-gallery-panel);
	border-bottom: 1px solid var(--jeo-video-gallery-rule);
	display: grid;
	gap: 0 15px;
	grid-template-areas:
		"video title"
		"video description";
	grid-template-columns: minmax(110px, 3fr) minmax(0, 7fr);
	grid-template-rows: max-content 1fr;
	padding: 8px;
}

.jeo-video-gallery__list .is-style-jeo-video-card > p {
	color: var(--jeo-video-gallery-muted);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	grid-area: description;
	letter-spacing: 0;
	line-height: 18px;
	margin: 0 !important;
	max-width: none;
	text-align: left;
	width: 100%;
}

.jeo-video-gallery__list .is-style-jeo-video-card > p:first-of-type {
	color: inherit;
	font-size: 18px;
	font-weight: 400;
	grid-area: title;
	line-height: 23px;
	margin-block-end: 5px;
}

.jeo-video-gallery__list .is-style-jeo-video-card:hover,
.jeo-video-gallery__list .is-style-jeo-video-card:focus-visible,
.jeo-video-gallery__list .is-style-jeo-video-card.is-current {
	background: var(--jeo-video-gallery-current);
}

.jeo-video-gallery__list .is-style-jeo-video-card.is-current {
	box-shadow: inset 4px 0 var(--wp--preset--color--interactive);
}

.jeo-video-gallery__fallback-link {
	font-size: 14px;
	line-height: 20px;
}

.dark-theme .jeo-video-gallery:not(.has-text-color) {
	color: var(--wp--preset--color--base-2);
}

.dark-theme .jeo-video-gallery:not(.has-background) {
	background: var(--wp--preset--color--media-surface);
}

/* WordPress color utilities and the legacy dark-mode layer both use
 * !important. Preserve an explicit gallery text choice without overriding a
 * more specific color chosen directly on the inner Core Heading. */
.dark-theme .jeo-video-gallery.has-text-color .jeo-video-gallery__items > .wp-block-heading:not(.has-text-color) {
	color: inherit !important;
}

.dark-theme .jeo-video-gallery {
	--jeo-video-gallery-current: color-mix(in srgb, var(--wp--preset--color--interactive) 18%, transparent);
	--jeo-video-gallery-muted: color-mix(in srgb, currentcolor 68%, transparent);
	--jeo-video-gallery-panel: color-mix(in srgb, var(--wp--preset--color--base) 3%, transparent);
	--jeo-video-gallery-rule: color-mix(in srgb, currentcolor 20%, transparent);
}

.wp-block-cover .jeo-video-gallery:not(.has-text-color) {
	color: var(--wp--preset--color--base-2);
}

.wp-block-cover .jeo-video-gallery:not(.has-background) {
	background: transparent;
}

.wp-block-cover .jeo-video-gallery {
	--jeo-video-gallery-current: color-mix(in srgb, var(--wp--preset--color--interactive) 20%, transparent);
	--jeo-video-gallery-muted: color-mix(in srgb, currentcolor 78%, transparent);
	--jeo-video-gallery-panel: color-mix(in srgb, var(--wp--preset--color--base) 3%, transparent);
	--jeo-video-gallery-rule: color-mix(in srgb, currentcolor 24%, transparent);
}

/* The editor mirrors the public stage/list composition without instantiating
 * public playback or consent behavior. The stage is an honest, non-interactive
 * preview; the list remains the durable Core InnerBlocks surface. */
.editor-styles-wrapper .jeo-video-gallery {
	container-type: inline-size;
}

.editor-styles-wrapper .jeo-video-gallery__items {
	display: block;
	position: relative;
}

.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout {
	display: grid;
	gap: 12px 30px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks {
	width: 100%;
}

.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/heading"] {
	color: inherit;
	font-family: var(--wp--custom--typography--editorial-heading);
	font-size: 28px;
	font-weight: 700;
	grid-column: 1 / -1;
	line-height: 38px;
	margin: 0 0 40px;
	text-align: left;
}

.editor-styles-wrapper .jeo-video-gallery__editor-stage {
	aspect-ratio: 16 / 9;
	background:
		linear-gradient(140deg, rgb(49 174 118 / 18%), transparent 48%),
		#101418;
	border: 1px solid rgb(255 255 255 / 12%);
	color: #f5f5f5;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	left: 0;
	overflow: hidden;
	padding: 16px;
	position: absolute;
	top: 78px;
	width: calc(50% - 15px);
}

.editor-styles-wrapper .jeo-video-gallery__editor-stage::after {
	background: radial-gradient(circle, rgb(255 255 255 / 13%) 0 2px, transparent 3px);
	background-size: 16px 16px;
	content: "";
	inset: 0;
	opacity: 0.28;
	pointer-events: none;
	position: absolute;
}

.editor-styles-wrapper .jeo-video-gallery__editor-preview-label,
.editor-styles-wrapper .jeo-video-gallery__editor-preview-copy {
	position: relative;
	z-index: 1;
}

.editor-styles-wrapper .jeo-video-gallery__editor-preview-label {
	align-self: flex-start;
	background: rgb(255 255 255 / 12%);
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 18px;
	padding: 2px 8px;
	text-transform: uppercase;
}

.editor-styles-wrapper .jeo-video-gallery__editor-preview-copy {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.editor-styles-wrapper .jeo-video-gallery__editor-preview-provider,
.editor-styles-wrapper .jeo-video-gallery__editor-preview-description {
	color: rgb(245 245 245 / 72%);
	font-size: 12px;
	line-height: 16px;
}

.editor-styles-wrapper .jeo-video-gallery__editor-preview-title {
	font-size: 18px;
	line-height: 23px;
}

.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/group"] {
	align-self: start;
	background: var(--jeo-video-gallery-panel);
	border: 1px solid var(--jeo-video-gallery-rule);
	border-bottom-width: 1px;
	display: grid;
	gap: 3px 12px;
	grid-column: 2;
	grid-template-areas:
		"video title"
		"video description";
	grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
	grid-template-rows: max-content 1fr;
	margin: 0;
	min-width: 0;
	padding: 8px;
	position: relative;
}

.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/group"]:has(.jeo-video-gallery__editor-card-state.is-selected) {
	background: var(--jeo-video-gallery-current);
	box-shadow: inset 4px 0 var(--wp--preset--color--interactive);
}

.editor-styles-wrapper .jeo-video-gallery .is-style-jeo-video-card > [data-type="core/embed"] {
	grid-area: video;
	height: auto;
	margin: 0;
	min-height: 0;
	overflow: hidden;
	width: 100%;
}

.editor-styles-wrapper .jeo-video-gallery__editor-source {
	align-items: center;
	aspect-ratio: 16 / 9;
	background: #101418;
	color: #f5f5f5;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 58px;
	padding: 6px;
	position: relative;
	text-align: center;
}

.editor-styles-wrapper .jeo-video-gallery__editor-source-provider {
	font-size: 11px;
	font-weight: 700;
	line-height: 15px;
	margin-bottom: 4px;
	text-transform: uppercase;
}

.editor-styles-wrapper .jeo-video-gallery__editor-source-url {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.editor-styles-wrapper .jeo-video-gallery__edit-video.components-button {
	background: rgb(255 255 255 / 94%);
	border: 0;
	box-shadow: none;
	color: #191e23;
	font-size: 11px;
	height: 32px;
	line-height: 15px;
	min-height: 32px;
	padding: 4px 7px;
}

.editor-styles-wrapper .jeo-video-gallery__edit-video.components-button:hover,
.editor-styles-wrapper .jeo-video-gallery__edit-video.components-button:focus-visible {
	background: var(--wp--preset--color--interactive);
	color: #101418;
}

.editor-styles-wrapper .jeo-video-gallery__editor-card-state {
	display: none;
}

.editor-styles-wrapper .jeo-video-gallery .is-style-jeo-video-card > [data-type="core/embed"] .wp-block-embed__wrapper {
	aspect-ratio: 16 / 9;
	height: 100%;
	min-height: 0;
	position: relative;
}

.editor-styles-wrapper .jeo-video-gallery .is-style-jeo-video-card > [data-type="core/embed"] iframe {
	height: 100%;
	inset: 0;
	position: absolute;
	width: 100%;
}

.editor-styles-wrapper .jeo-video-gallery .is-style-jeo-video-card > [data-type="core/paragraph"] {
	align-self: start;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	grid-area: description;
	line-height: 18px;
	margin: 0;
	min-height: 0;
	text-align: left;
}

.editor-styles-wrapper .jeo-video-gallery .is-style-jeo-video-card > [data-type="core/paragraph"]:first-of-type {
	color: inherit;
	font-size: 18px;
	font-weight: 400;
	grid-area: title;
	line-height: 23px;
}

.editor-styles-wrapper .jeo-video-gallery__add-video {
	grid-column: 2;
}

.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout > .block-list-appender {
	grid-column: 2;
	justify-self: start;
	margin-block-start: 4px;
	position: relative;
}

@media (max-width: 782px) {
	.jeo-video-gallery__items > .wp-block-heading {
		font-size: 24px;
		line-height: 32px;
		margin-block-end: 20px;
	}

	.jeo-video-gallery__list .is-style-jeo-video-card {
		grid-template-columns: minmax(120px, 42%) minmax(0, 1fr);
	}

	.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/group"] {
		grid-template-columns: minmax(84px, 36%) minmax(0, 1fr);
	}
}

@media (max-width: 480px) {
	.jeo-video-gallery__consent {
		padding: 10px;
	}

	.jeo-video-gallery__consent-panel {
		max-width: 100%;
		padding: 12px;
	}

	.jeo-video-gallery__consent-description {
		margin-block: 4px 8px;
	}

	.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/group"] {
		grid-template-columns: 84px minmax(0, 1fr);
	}
}

@container (max-width: 520px) {
	.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/heading"],
	.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/group"],
	.editor-styles-wrapper .jeo-video-gallery__add-video,
	.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout > .block-list-appender {
		grid-column: 1;
	}

	.editor-styles-wrapper .jeo-video-gallery__editor-stage {
		top: 52px;
		width: 100%;
	}

	.editor-styles-wrapper .jeo-video-gallery__items > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/group"]:first-of-type {
		margin-top: calc(56.25cqw + 16px);
	}
}

@media (max-width: 420px) {
	.jeo-video-gallery__list .is-style-jeo-video-card {
		grid-template-areas:
			"video"
			"title";
		grid-template-columns: minmax(0, 1fr);
	}

	.jeo-video-gallery__list .is-style-jeo-video-card > p:first-of-type {
		margin-block-start: 8px;
	}

	.jeo-video-gallery__list .is-style-jeo-video-card > p:not(:first-of-type) {
		display: none;
	}
}
