/* ==========================================================================
   Homepage YouTube video carousel
   Used by default-new.asp / default2.asp (markup written by displayVideoCarousel
   in commonlib.asp, injected inside .prefootercontainer between .prefootertop
   and .prefootermiddle)
   ========================================================================== */

.videocarouselcontainer {
	width: 100%;
	background-color: #006225;
	padding: 40px 0;
	box-sizing: border-box;
	overflow: hidden;
}

/* default2.asp variant - same section, photo background instead of flat green */
.videocarouselcontainer.vc-bgimage {
	background-color: #006225; /* shows while the photo loads / behind transparent areas */
	background-image: url("../images/istockphoto-2158963873-1024x1024.webp");
	background-position: center top;
	background-repeat: no-repeat;
	background-size: cover;
}

/* row of arrow - video - arrow */
.videocarouselcontainer .videocarousel {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
}

/* the arrows sit either side of the player and never shrink */
.videocarouselcontainer .vc-arrow {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	margin: 0 18px;
	padding: 0;
	border: 0;
	background-color: transparent;
	background-repeat: no-repeat;
	background-position: center center;
	background-size: 26px 26px;
	cursor: pointer;
	transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.videocarouselcontainer .vc-arrow:hover {
	opacity: 0.8;
	transform: scale(1.1);
}

.videocarouselcontainer .vc-arrow:focus {
	outline: 1px solid #ffffff;
	outline-offset: 3px;
}

.videocarouselcontainer .vc-prev { background-image: url("../theme/images/arrow-left.png"); }
.videocarouselcontainer .vc-next { background-image: url("../theme/images/arrow-right.png"); }

/* the player itself */
.videocarouselcontainer .vc-viewport {
	flex: 1 1 auto;
	max-width: 900px;
	overflow: hidden;
}

.videocarouselcontainer .vc-track {
	display: flex;
	transition: -webkit-transform 0.45s ease-in-out;
	transition: transform 0.45s ease-in-out;
}

.videocarouselcontainer .vc-slide {
	flex: 0 0 100%;
	max-width: 100%;
	min-width: 0;
}

/* responsive 16:9 wrapper so the embedded player scales with the column */
.videocarouselcontainer .vc-video {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	height: 0;
	background-color: #000000;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.videocarouselcontainer .vc-video iframe,
.videocarouselcontainer .vc-video object,
.videocarouselcontainer .vc-video embed {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* small tablets / large phones */
@media (max-width: 768px) {
	.videocarouselcontainer { padding: 30px 0; }
	.videocarouselcontainer .videocarousel { padding: 0 12px; }
	.videocarouselcontainer .vc-arrow { margin: 0 10px; }
}

/* phones */
@media (max-width: 480px) {
	.videocarouselcontainer { padding: 22px 0; }
	.videocarouselcontainer .videocarousel { padding: 0 6px; }
	.videocarouselcontainer .vc-arrow {
		width: 20px;
		height: 20px;
		margin: 0 5px;
		background-size: 20px 20px;
	}
	.videocarouselcontainer .vc-video { box-shadow: none; }
}

/* ==========================================================================
   In-column variant (default-new3.asp): the carousel sits inside #maincontent,
   beside the floated .rightcontent, instead of being a full-bleed band in the
   pre-footer. No background and no band padding - the container is sized like
   .pagetext so it fills the wide left column at every breakpoint.
   ========================================================================== */

#maincontent .videocarouselcontainer {
	width: 656px; /* #maincontent 1000px less .rightcontent 324px, as used by .pagetext */
	float: left;
	margin: 0 0 20px 0;
	padding: 0;
	background-color: transparent;
	background-image: none;
	overflow: hidden; /* clips whichever slide is translated out of view */
}

/* in this position the player spans the column edge to edge and the arrows sit on top
   of it rather than taking up space either side */
#maincontent .videocarouselcontainer .videocarousel {
	position: relative; /* anchor for the overlaid arrows */
	max-width: 100%;
	margin: 0;
	padding: 0;
}

/* no arrow / player / arrow row any more - the viewport simply fills the container */
#maincontent .videocarouselcontainer .vc-viewport { max-width: none; }

#maincontent .videocarouselcontainer .vc-arrow {
	position: absolute;
	top: 50%;
	margin: 0; /* would otherwise offset these absolutely positioned arrows */
	transform: translateY(-50%);
	z-index: 1; /* keeps taps landing on the arrow instead of passing through to the player */
	filter: drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.45)); /* so they stay legible over bright footage */
}

#maincontent .videocarouselcontainer .vc-prev { left: 6px; }
#maincontent .videocarouselcontainer .vc-next { right: 6px; }

/* grow on hover, keeping the vertical centring transform intact */
#maincontent .videocarouselcontainer .vc-arrow:hover { transform: translateY(-50%) scale(1.1); }

/* 768px - 1000px layout (styles.css): left column narrows to 504px */
@media only screen and (min-width: 768px) and (max-width: 1000px) {
	#maincontent .videocarouselcontainer { width: 504px; }
}

/* below 768px .rightcontent drops underneath, so the carousel goes full width */
@media only screen and (max-width: 767px) {
	#maincontent .videocarouselcontainer {
		width: 94%;
		margin: 0 3% 20px 3%;
		float: none;
		clear: both;
	}
}
