/*
 * DTC: Videos - carousel + grid of self-rendered video cards, plus the shared
 * player dialog.
 *
 * Cards are rendered by the widget (no Elementor loop-item template), so all of the
 * card design lives here. It deliberately mirrors .dtc-nc in news-feed.css, because
 * on the News page this section sits directly beneath the news and whitepaper cards.
 *
 * The !important load throughout is landmine #3: the Elementor global kit styles
 * bare elements (and especially <button>) and wins on specificity otherwise.
 */

.dtc-videos {
	--dtc-videos-gap: 30px;
	position: relative;
	width: 100%;
}

/* ── Card ─────────────────────────────────────────────────────────────── */
.dtc-vc {
	display: flex;
	flex-direction: column;
	gap: 0;
	height: 100%;
	min-height: 320px;
	padding: 0 !important;
	background: #223a5c linear-gradient(90deg, rgba(64, 148, 209, 0.14) 0%, rgba(34, 58, 92, 0.14) 100%) !important;
	backdrop-filter: blur(18px);
	border: 1px solid #4094d1 !important;
	border-radius: 20px !important;
	overflow: hidden;
	color: #fff;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.dtc-vc:hover {
	transform: translateY(-4px);
	box-shadow: 0 20px 46px rgba(9, 26, 51, 0.55);
}

/* The whole thumbnail is the play control. A real <button> so it is keyboard
   reachable and carries an accessible name, with the kit's button styling forced
   off. */
.dtc-vc__trigger {
	position: relative;
	display: block !important;
	width: 100%;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: none !important;
	background-image: none !important;
	box-shadow: none !important;
	cursor: pointer;
	flex: 0 0 auto;
	overflow: hidden;
}
.dtc-vc__trigger:focus-visible {
	outline: 2px solid #6ec1e4;
	outline-offset: -4px;
}

/* Fixed aspect box. The feed mixes 16:9 maxresdefault thumbnails with 4:3
   hqdefault fallbacks for older uploads, so without cover at least one card
   letterboxes. */
.dtc-vc__media {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	background-color: #0a1a30;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: transform 0.35s ease;
}
.dtc-vc__trigger:hover .dtc-vc__media {
	transform: scale(1.04);
}

.dtc-vc__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(64, 148, 209, 0.85);
	border: 1px solid #4094d1;
	box-shadow: 0 0 40px 0 rgba(64, 148, 209, 0.55);
	color: #fff;
	pointer-events: none;
	transition: background 0.2s ease, transform 0.2s ease;
}
.dtc-vc__play svg {
	width: 30px;
	height: 30px;
	margin-left: 3px; /* optical centring of the triangle */
}
.dtc-vc__trigger:hover .dtc-vc__play,
.dtc-vc__trigger:focus-visible .dtc-vc__play {
	background: #4094d1;
	transform: translate(-50%, -50%) scale(1.08);
}

.dtc-vc__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 20px;
	padding: 20px;
	flex: 1 1 auto;
}
.dtc-vc__date {
	align-self: flex-start;
	font-family: 'Instrument Sans', sans-serif;
	font-size: 10px;
	line-height: 30px;
	font-weight: 700;
	text-transform: uppercase;
	color: #fff !important;
	background: rgba(64, 148, 209, 0.55) !important;
	border: 1px solid #4094d1 !important;
	border-radius: 4px !important;
	padding: 0 10px !important;
}
.dtc-vc__title {
	font-family: 'Instrument Sans', sans-serif;
	font-size: 18px !important;
	line-height: 25px !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	color: #fff !important;
	margin: 0 !important;
}
.dtc-vc__excerpt {
	font-family: 'Instrument Sans', sans-serif;
	font-size: 15px !important;
	line-height: 22.5px !important;
	font-weight: 500 !important;
	color: #fff !important;
	margin: 0 !important;
}

/* ── Grid ─────────────────────────────────────────────────────────────── */
.dtc-videos-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr)); /* overridden by the Columns control */
	gap: var(--dtc-videos-gap, 30px);
	grid-auto-rows: 1fr;
	align-items: stretch;
}

/* Column count steps at the site's native breakpoints, matching the news feed and
   the main-site product carousel: 3 above Laptop (>1366), 2 down to Mobile
   Landscape (881-1366), 1 at Mobile Landscape and below (<=880). !important beats
   the Elementor Columns control, which steps at 1024/767. */
@media (max-width: 1366px) {
	.dtc-videos-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}
@media (max-width: 880px) {
	.dtc-videos-grid {
		grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
	}
}

/* ── Carousel ─────────────────────────────────────────────────────────── */
.dtc-videos--carousel .dtc-videos-swiper {
	overflow: hidden;
}
.dtc-videos--carousel .swiper-slide {
	height: auto;
	display: flex;
}
.dtc-videos--carousel .swiper-slide > .dtc-vc {
	width: 100%;
}

/* Bare white chevrons sitting OUTSIDE the cards, matching the news feed and the
 * main-site product carousel. They are <button>s, so the theme paints them with its
 * global button gradient; force it off.
 *
 * Note the -50px offset means the widget expects its container to provide a gutter.
 * In a full-bleed Elementor container with no horizontal padding the arrows will
 * overlap the first and last cards - give the container the site's normal padding
 * rather than changing these values, so the arrows stay consistent with the other
 * carousels. */
.dtc-videos-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #fff !important;
	font-size: 46px !important;
	line-height: 1;
	cursor: pointer;
	opacity: 0.8;
	transition: opacity 0.2s ease, color 0.2s ease;
}
.dtc-videos-arrow:hover {
	opacity: 1;
	color: #6ec1e4;
}
/* Keyboard-only focus ring. Invisible on mouse, so the resting look still matches
   the sibling carousels. */
.dtc-videos-arrow:focus-visible {
	outline: 2px solid #6ec1e4;
	outline-offset: 2px;
}
.dtc-videos-arrow--prev { left: -50px; }
.dtc-videos-arrow--next { right: -50px; }
.dtc-videos-arrow.swiper-button-disabled {
	opacity: 0.3;
	pointer-events: none;
}
@media (max-width: 1200px) {
	.dtc-videos-arrow--prev { left: -8px; }
	.dtc-videos-arrow--next { right: -8px; }
}

/* ── Player dialog ────────────────────────────────────────────────────── */
/* Type-qualified to raise specificity over the Elementor kit, the same way
   dialog.dsp-video-modal is on the product page. */
dialog.dtc-video-player {
	position: fixed;
	padding: 0 !important;
	border: 1px solid #4094d1 !important;
	border-radius: 20px !important;
	background: #0a1a30 !important;
	max-width: min(1100px, 94vw);
	width: 100%;
	overflow: visible;
	color: #fff;
}
dialog.dtc-video-player::backdrop {
	background: rgba(4, 12, 24, 0.88);
}
.dtc-video-player__frame {
	aspect-ratio: 16 / 9;
	width: 100%;
	border-radius: 20px;
	overflow: hidden;
}
.dtc-video-player__frame iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}
.dtc-video-player__close {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 2;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0 !important;
	border: 1px solid #4094d1 !important;
	border-radius: 50% !important;
	background: #223a5c !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #fff !important;
	font-size: 26px !important;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}
.dtc-video-player__close:hover {
	background: #4094d1 !important;
}
.dtc-video-player__close:focus-visible {
	outline: 2px solid #6ec1e4;
	outline-offset: 2px;
}
@media (max-width: 600px) {
	.dtc-video-player__close {
		top: -12px;
		right: -6px;
		width: 34px;
		height: 34px;
		font-size: 22px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dtc-vc,
	.dtc-vc__media,
	.dtc-vc__play,
	.dtc-videos-arrow,
	.dtc-video-player__close {
		transition: none !important;
	}
	.dtc-vc:hover {
		transform: none;
	}
	.dtc-vc__trigger:hover .dtc-vc__media {
		transform: none;
	}
}
