/**
 * Event Carousels.
 *
 * Tiles, heading and buttons come from the theme's homepage events block
 * (.news-sec / .news-list in style.css, responsive.css, brand-override.css).
 * This file only adds what a carousel needs: track, gutters, navigation,
 * light variant. Everything is scoped to .dapto-evc.
 */

.dapto-evc {
	--evc-royal: #0F2142;
	--evc-canary: #FBEF5F;
	overflow: hidden;
}

.dapto-evc--carousel { padding: 60px 0; }
.dapto-evc--dark  { background-color: var(--evc-royal); }
.dapto-evc--light { background-color: #fff; }
.dapto-evc--light .news-sec-heding h2 { color: var(--evc-royal); }

/* Stacked carousels with the same background read as one block. */
.dapto-evc--dark + .dapto-evc--dark,
.dapto-evc--light + .dapto-evc--light { padding-top: 0; }

/* Track: same gutters as .news-list-wrap / .news-list at each breakpoint. */
.dapto-evc__track { margin: 25px -22.5px 0; }

/* The theme reserves 50px below each tile for a multi-row grid. Carousels
   need only a small gap before their controls or the following heading. */
.dapto-evc--carousel .dapto-evc__slide { padding-bottom: 24px; }

/* View All buttons link to sections by #id: keep the heading clear of the
   sticky header. */
.dapto-evc { scroll-margin-top: 110px; }

/* Before Slick loads: same 3-across grid, no layout jump. */
.dapto-evc__track:not(.slick-initialized) {
	display: flex;
	overflow: hidden;
}
.dapto-evc__track:not(.slick-initialized) .dapto-evc__slide { flex: 0 0 33.333%; }

.dapto-evc .slick-track { display: flex; }
.dapto-evc .slick-slide { height: auto; float: none; }
.dapto-evc .slick-slide:focus { outline: none; }

/* Grid display (What's On page): every event, rows of 3, last row centred
   like the theme's .news-list-wrap. */
.dapto-evc__track.dapto-evc__grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	overflow: visible;
}
.dapto-evc__track.dapto-evc__grid .dapto-evc__slide {
	flex: 0 0 33.333%;
	width: 33.333%;
	max-width: 33.333%;
}
.dapto-evc--grid .dapto-evc__view-all { margin-top: 0; }

/* Keyboard users get the hover panel too. */
.dapto-evc .news-list-bg:focus-within .news-list-cont-wrap { opacity: 1; }

/* Keep the overlay and mobile caption legible on their light background. */
.dapto-evc--poster .news-list-cont h3,
.dapto-evc--poster .news-list-cont p { color: var(--evc-royal); }

/* ---------------------------------------------------------------------------
   Card style (tile_style = card): image, then date / title / button.
   Gutters match .news-list so both styles line up the same way.
   ------------------------------------------------------------------------ */
.dapto-evc--card .dapto-evc__slide {
	padding: 0 22.5px 50px;
	box-sizing: border-box;
}

.dapto-evc__card {
	position: relative;
	height: 100%;
	padding-bottom: 106px; /* room for the theme's bottom-pinned .btn-wrap */
	background-color: #fff;
	color: var(--evc-royal);
}
.dapto-evc--light .dapto-evc__card {
	background-color: var(--evc-royal);
	color: #fff;
}

/* Event images are square-ish posters: use the poster tile's ratio instead of
   the theme's landscape 68.5% so nothing gets cropped. */
.dapto-evc__card .event-image {
	display: block;
	height: auto;
	padding-bottom: 0;
	aspect-ratio: 12 / 13;
	background-color: rgba(15, 33, 66, 0.08);
}

/* Title size comes from brand-override.css (h3: 2rem / 1.5rem, !important). */
.dapto-evc .dapto-evc__card h3 { line-height: 1.25; }

/* Theme gives .btn-wrap width:100% (overflows the card once it's pinned at
   left:28px) and caps it at 202px / 150px (wraps "FIND OUT MORE").
   Size the button to its label instead. */
.dapto-evc .dapto-evc__card .btn-wrap { width: auto; max-width: none; right: auto; }
.dapto-evc .dapto-evc__card .btn-wrap .btn { white-space: nowrap; }
.dapto-evc__card:hover .event-image:before { opacity: 0.25; }

.dapto-evc__card .event-date {
	display: block;
	font-size: 15px;
	color: inherit;
	opacity: 0.85;
}
.dapto-evc--light .dapto-evc__card .event-date { color: var(--evc-canary); opacity: 1; }

.dapto-evc .dapto-evc__card h3,
.dapto-evc .dapto-evc__card h3 a { color: inherit; }
.dapto-evc .dapto-evc__card h3 a:hover { opacity: 0.75; }

.dapto-evc__card .btn-wrap .btn:hover,
.dapto-evc__card .btn-wrap .btn:focus {
	background-color: var(--evc-royal);
	color: #fff;
}
.dapto-evc--light .dapto-evc__card .btn-wrap .btn:hover,
.dapto-evc--light .dapto-evc__card .btn-wrap .btn:focus {
	background-color: #fff;
	color: var(--evc-royal);
}

/* Navigation: arrows either side of the dots, centred under the tiles. */
.dapto-evc__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
}
.dapto-evc__nav:empty { display: none; }

/* Override the theme's global (vertical, absolutely positioned) dots,
   including the `.home ul.slick-dots ...` variants. */
.dapto-evc .dapto-evc__nav ul.slick-dots {
	position: static;
	display: flex;
	align-items: center;
	gap: 14px;
	width: auto;
	margin: 0;
	padding: 0;
	transform: none;
	list-style: none;
}
.dapto-evc .dapto-evc__nav ul.slick-dots li,
.dapto-evc .dapto-evc__nav ul.slick-dots li:last-child { margin: 0; }

.dapto-evc .dapto-evc__nav ul.slick-dots li button { background-color: #fff; opacity: 0.35; }
.dapto-evc .dapto-evc__nav ul.slick-dots li.slick-active button { background-color: #fff; opacity: 1; }
.dapto-evc .dapto-evc__nav ul.slick-dots li button:before { border: 1px solid #fff; }

.dapto-evc--light .dapto-evc__nav ul.slick-dots li button,
.dapto-evc--light .dapto-evc__nav ul.slick-dots li.slick-active button { background-color: var(--evc-royal); }
.dapto-evc--light .dapto-evc__nav ul.slick-dots li button:before { border-color: var(--evc-royal); }

.dapto-evc__arrow {
	position: relative;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: background-color 0.3s ease, border-color 0.3s ease;
}
.dapto-evc__arrow:before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 10px;
	height: 10px;
	border-top: 2px solid #fff;
	border-right: 2px solid #fff;
	transform: translate(-65%, -50%) rotate(45deg);
}
.dapto-evc__arrow--prev:before { transform: translate(-35%, -50%) rotate(-135deg); }
.dapto-evc__arrow:hover,
.dapto-evc__arrow:focus-visible { background-color: var(--evc-canary); border-color: var(--evc-canary); }
.dapto-evc__arrow:hover:before,
.dapto-evc__arrow:focus-visible:before { border-color: var(--evc-royal); }
.dapto-evc__arrow.slick-disabled { opacity: 0.3; cursor: default; }
.dapto-evc__arrow.slick-hidden { display: none; }

.dapto-evc--light .dapto-evc__arrow { border-color: var(--evc-royal); }
.dapto-evc--light .dapto-evc__arrow:before { border-color: var(--evc-royal); }

.dapto-evc__view-all { text-align: center; }

/* Shortcode placed inside the theme's "Shortcode" section: that section
   already provides the container, background and spacing. */
.welcome-cont-wrap .dapto-evc {
	padding: 20px 0 0;
	background-color: transparent;
}
.welcome-cont-wrap .dapto-evc > .main {
	max-width: none;
	width: auto;
	padding: 0;
}

/* Theme: .news-list padding 0 15px 30px */
@media (max-width: 1200px) {
	.dapto-evc__track { margin: 15px -15px 0; }
	.dapto-evc--card .dapto-evc__slide { padding: 0 15px 30px; }
	.dapto-evc__card { padding-bottom: 90px; }
}

/* Carousel: 2 across (matches slick breakpoint 992 in carousel.js). */
@media (max-width: 991px) {
	.dapto-evc__track:not(.slick-initialized) .dapto-evc__slide { flex-basis: 50%; }
	.dapto-evc__track.dapto-evc__grid .dapto-evc__slide { width: 50%; max-width: 50%; }
}

/* Theme: .news-list padding 0 10px 20px; hover panel replaced by text below. */
@media (max-width: 767px) {
	.dapto-evc--carousel { padding: 40px 0; }
	.dapto-evc--carousel .dapto-evc__slide { padding-bottom: 16px; }
	.dapto-evc__track { margin: 15px -10px 0; }
	.dapto-evc--card .dapto-evc__slide { padding: 0 10px 20px; }
}

/* Theme makes .event-contain .btn-wrap static here (responsive.css),
   so the card no longer needs room for a pinned button. */
@media (max-width: 575px) {
	.dapto-evc__card { padding-bottom: 0; }
}

/* Theme: .news-list padding 0 0 6vw. Carousel: 1 across, swipe. */
@media (max-width: 640px) {
	.dapto-evc__track { margin: 15px 0 0; }
	.dapto-evc--card .dapto-evc__slide { padding: 0 0 6vw; }
	.dapto-evc__track:not(.slick-initialized) .dapto-evc__slide { flex-basis: 100%; }
	.dapto-evc__track.dapto-evc__grid .dapto-evc__slide { width: 100%; max-width: 100%; }
	.dapto-evc { scroll-margin-top: 80px; }
	/* Don't stretch slides, so adaptiveHeight (carousel.js) can size to each one. */
	.dapto-evc .slick-track { align-items: flex-start; }
}
