/* UShorts gallery — 9:16 cards, responsive grid (GATE-005). */

/* Elementor flex row — shortcode widget intrinsic width (GATE-005 regression). */
.elementor-widget-shortcode:has(.ushorts[data-ushorts-root]) {
	width: 100%;
	min-width: 0;
	flex: 1 1 100%;
}

.ushorts,
.ushorts *,
.ushorts *::before,
.ushorts *::after {
	box-sizing: border-box;
}

.ushorts-gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
}

.ushorts-gallery__item {
	min-width: 0;
	max-width: 100%;
}

.ushorts .ushorts-card {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	text-align: left;
	color: inherit;
	font: inherit;
}

.ushorts .ushorts-card:focus {
	outline: none;
}

.ushorts .ushorts-card:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.ushorts .ushorts-card__media {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
	border-radius: 7px;
	background-color: #111;
	background-size: cover !important;
	background-position: center !important;
	background-repeat: no-repeat !important;
	aspect-ratio: 9 / 16;
}

.ushorts[data-ushorts-root] .ushorts-gallery .ushorts-card .ushorts-card__media > img.ushorts-card__image,
.ushorts .ushorts-card__media .ushorts-card__image,
.ushorts .ushorts-gallery .ushorts-card__image {
	position: absolute !important;
	top: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	z-index: 1;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: none !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	object-fit: cover !important;
	object-position: center !important;
}

.ushorts .ushorts-card__title {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 3;
	display: -webkit-box;
	margin: 0;
	padding: 1.25rem 0.5rem 0.5rem;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.82) 72%);
	color: #fff;
	font-size: 0.8125rem;
	line-height: 1.3;
	font-weight: 600;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	text-overflow: ellipsis;
	pointer-events: none;
}

.ushorts .ushorts-card__play {
	position: absolute;
	top: 42%;
	left: 50%;
	z-index: 2;
	width: 3rem;
	height: 3rem;
	margin: 0;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.55);
	pointer-events: none;
	transform: translate(-50%, -50%);
}

.ushorts-card__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 55%;
	width: 0;
	height: 0;
	margin: -0.55rem 0 0 -0.35rem;
	border-style: solid;
	border-width: 0.55rem 0 0.55rem 0.9rem;
	border-color: transparent transparent transparent #fff;
}

@media (min-width: 768px) {
	.ushorts-gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1200px) {
	.ushorts-gallery {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

/* Modal — responsive video + description (GATE-006). */

body.ushorts-modal-open {
	overflow: hidden;
}

.ushorts-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
}

.ushorts-modal[hidden] {
	display: none;
}

.ushorts-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
}

.ushorts-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 56rem);
	max-height: calc(100vh - 2rem);
	background: #111;
	color: #fff;
	border-radius: 0.5rem;
	overflow: hidden;
	box-sizing: border-box;
}

.ushorts-modal__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	cursor: pointer;
	font: inherit;
	line-height: 1;
}

.ushorts-modal__close:focus {
	outline: none;
}

.ushorts-modal__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.ushorts-modal__close-icon {
	font-size: 1.5rem;
	line-height: 1;
}

.ushorts-modal__body {
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
	padding: 2.75rem 1rem 1rem;
	box-sizing: border-box;
}

.ushorts-modal__layout {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.ushorts-modal__video-column {
	flex: 0 0 auto;
}

.ushorts-modal__video-shell {
	width: 100%;
	max-width: 20rem;
	margin: 0 auto;
	aspect-ratio: 9 / 16;
	overflow: hidden;
	background: #000;
}

.ushorts-modal__iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.ushorts-modal__text-column {
	overflow: visible;
	min-width: 0;
}

.ushorts-modal__title {
	margin: 0 0 0.75rem;
	font-size: 1.125rem;
	line-height: 1.35;
}

.ushorts-modal__description {
	white-space: pre-wrap;
	overflow: visible;
	font-size: 0.95rem;
	line-height: 1.5;
}

@media (min-width: 768px) {
	.ushorts-modal__body {
		overflow: hidden;
		padding: 2.75rem 1rem 1rem;
	}

	.ushorts-modal__layout {
		flex-direction: row;
		align-items: stretch;
		min-height: 0;
	}

	.ushorts-modal__video-column {
		flex: 0 0 auto;
	}

	.ushorts-modal__video-shell {
		height: min(70vh, 640px);
		width: calc(min(70vh, 640px) * 9 / 16);
		max-width: none;
		margin: 0;
	}

	.ushorts-modal__text-column {
		flex: 1 1 0;
		max-height: min(70vh, 640px);
		overflow-y: auto;
		padding-right: 0.25rem;
	}

	.ushorts-modal__description {
		overflow: visible;
	}
}
