/* ==========================================================================
   UCAB Events Manager — Frontend styles
   Premium editorial cricket-heritage design system.
   Every selector is scoped under .ucab- so nothing leaks into the theme
   or Elementor, and nothing from the theme should be able to break this.
   ========================================================================== */

.ucab-events,
.ucab-single,
.ucab-gallery,
.ucab-lightbox {
	--ucab-navy: #071C2C;
	--ucab-navy-deep: #061827;
	--ucab-ivory: #F5F2EA;
	--ucab-white: #FFFFFF;
	--ucab-muted: #6F7C86;
	--ucab-gold: #C9A35B;
	--ucab-border: rgba(7, 28, 44, 0.12);
	--ucab-space: clamp(20px, 5vw, 60px);
	--ucab-page-pad: clamp(22px, 7vw, 110px);

	font-family: "Montserrat", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
	color: var(--ucab-navy);
	box-sizing: border-box;
}

.ucab-events *,
.ucab-single *,
.ucab-gallery *,
.ucab-lightbox * {
	box-sizing: border-box;
}

.ucab-events h1, .ucab-events h2, .ucab-events h3,
.ucab-single h1, .ucab-single h2, .ucab-single h3 {
	font-family: "Cormorant Garamond", Georgia, serif;
	margin: 0;
	line-height: 1.15;
}

.ucab-empty {
	color: var(--ucab-muted);
	font-style: italic;
	padding: 40px var(--ucab-page-pad);
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.ucab-events *,
	.ucab-single *,
	.ucab-gallery *,
	.ucab-lightbox * {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* --------------------------------------------------------------------
   Event card — compact, editorial, premium
   -------------------------------------------------------------------- */

.ucab-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--ucab-white);
	border-radius: 20px;
	overflow: hidden;
	border: 1px solid var(--ucab-border);
	box-shadow: 0 8px 24px rgba(7, 28, 44, 0.05);
	transition: box-shadow 450ms ease, transform 450ms ease;
}

.ucab-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 20px 44px rgba(7, 28, 44, 0.12);
}

.ucab-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 3px;
	height: 46px;
	background: var(--ucab-gold);
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity 400ms ease, transform 400ms ease;
	z-index: 2;
}

.ucab-card:hover::before {
	opacity: 1;
	transform: translateY(0);
}

.ucab-card__media {
	display: block;
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--ucab-ivory);
}

.ucab-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 650ms ease;
}

.ucab-card__image--placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--ucab-navy), var(--ucab-navy-deep));
}

.ucab-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(7, 28, 44, 0) 60%, rgba(7, 28, 44, 0.16) 100%);
	opacity: 0;
	transition: opacity 500ms ease;
}

.ucab-card:hover .ucab-card__media::after {
	opacity: 1;
}

.ucab-card:hover .ucab-card__image {
	transform: scale(1.04);
}

.ucab-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: clamp(22px, 2.2vw, 32px);
	gap: 8px;
}

.ucab-card__category {
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ucab-gold);
	font-weight: 600;
}

.ucab-card__title {
	font-size: clamp(20px, 2.1vw, 26px);
	font-weight: 600;
	line-height: 1.22;
	min-height: 2.4em;
}

.ucab-card__title a {
	color: var(--ucab-navy);
	text-decoration: none;
}

.ucab-card__title a:hover {
	color: var(--ucab-navy-deep);
	text-decoration: underline;
	text-decoration-color: var(--ucab-gold);
	text-underline-offset: 4px;
}

.ucab-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	padding: 8px 0;
	border-top: 1px solid var(--ucab-border);
	border-bottom: 1px solid var(--ucab-border);
}

.ucab-card__meta-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ucab-card__meta-label {
	font-size: 10px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ucab-muted);
}

.ucab-card__meta-value {
	font-size: 13px;
	font-weight: 500;
	color: var(--ucab-navy);
}

.ucab-card__excerpt {
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--ucab-muted);
	margin: 0;
	flex: 1 1 auto;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ucab-events .ucab-card__button {
	margin-top: auto;
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--ucab-navy);
	color: var(--ucab-white);
	text-decoration: none;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 12px 20px;
	border-radius: 3px;
	transition: background 300ms ease;
}

.ucab-card__button span {
	display: inline-block;
	transition: transform 300ms ease;
}

.ucab-events .ucab-card__button:hover {
	background: var(--ucab-navy-deep);
	color: var(--ucab-gold);
}

.ucab-card__button:hover span {
	transform: translateX(4px);
}

/* --------------------------------------------------------------------
   Events list / slider
   -------------------------------------------------------------------- */

.ucab-events {
	position: relative;
	padding: clamp(12px, 2vw, 28px) var(--ucab-page-pad) clamp(32px, 5vw, 56px);
}

.ucab-events__inner {
	max-width: 1200px;
	margin: 0 auto;
}

.ucab-events__viewport {
	overflow: hidden;
}

.ucab-events__track {
	display: flex;
	gap: clamp(20px, 2.6vw, 36px);
	transition: transform 700ms cubic-bezier(0.65, 0, 0.35, 1);
	will-change: transform;
}

.ucab-events__slide {
	flex: 0 0 calc(50% - clamp(10px, 1.3vw, 18px));
	min-width: 0;
}

/* A single event has nothing to slide against — show it full width
   instead of stranding one card at half width next to empty space.
   (No transform override needed here: the slider JS itself never runs
   for a single-event listing, so .ucab-events__track never gets an
   inline transform in this case.) */
.ucab-events[data-count="1"] .ucab-events__slide {
	flex: 0 0 100%;
	max-width: 620px;
	margin: 0 auto;
}

.ucab-events__controls {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 18px;
}

.ucab-events__nav {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid var(--ucab-border);
	background: var(--ucab-white);
	color: var(--ucab-navy);
	font-size: 14px;
	cursor: pointer;
	transition: background 250ms ease, color 250ms ease, border-color 250ms ease;
}

.ucab-events__nav:hover {
	background: var(--ucab-navy);
	color: var(--ucab-white);
	border-color: var(--ucab-gold);
}

.ucab-events__nav:focus-visible,
.ucab-card__button:focus-visible,
.ucab-card__title a:focus-visible,
.ucab-gallery__item:focus-visible,
.ucab-lightbox button:focus-visible {
	outline: 2px solid var(--ucab-gold);
	outline-offset: 2px;
}

/* Tablet keeps two cards visible (spec: "2 cards if space permits"),
   just with tighter spacing; only mobile drops to one card per view. */
@media (max-width: 680px) {
	.ucab-events__slide {
		flex: 0 0 100%;
	}
}

/* --------------------------------------------------------------------
   Single event hero — the event's own featured image as a cinematic,
   full-width, edge-to-edge background behind the existing site header.
   -------------------------------------------------------------------- */

.ucab-single {
	display: block;
}

.ucab-single__hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	/* Full-bleed technique: escapes any theme/page-builder max-width
	   content container so the hero always reaches the true left/right
	   viewport edges, regardless of what wraps this template's <main>. */
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	min-height: clamp(560px, 70vh, 760px);
	overflow: hidden;
	background: var(--ucab-navy);
	isolation: isolate;
}

.ucab-single__hero-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	animation: ucabHeroZoom 9s ease-out forwards;
}

.ucab-single__hero--no-image .ucab-single__hero-bg {
	background-image: none;
	background: linear-gradient(135deg, var(--ucab-navy), var(--ucab-navy-deep));
	animation: none;
}

.ucab-single__hero-overlay {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(6, 24, 39, 0.55) 0%, rgba(6, 24, 39, 0.08) 28%, rgba(6, 24, 39, 0.12) 55%, rgba(6, 24, 39, 0.88) 100%);
}

.ucab-single__hero-inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: clamp(120px, 16vw, 180px) var(--ucab-page-pad) clamp(50px, 6vw, 90px);
}

.ucab-single__category {
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ucab-gold);
	font-weight: 700;
	margin: 0 0 16px;
	opacity: 0;
	animation: ucabFadeUp 800ms ease-out 150ms forwards;
}

.ucab-single__title {
	font-size: clamp(32px, 4.6vw, 56px);
	font-weight: 600;
	color: var(--ucab-white);
	text-shadow: 0 2px 18px rgba(6, 24, 39, 0.45);
	margin-bottom: 26px;
	max-width: 16ch;
	opacity: 0;
	animation: ucabFadeUp 800ms ease-out 320ms forwards;
}

.ucab-single__meta {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(24px, 4vw, 56px);
	padding-top: 22px;
	border-top: 1px solid rgba(245, 242, 234, 0.28);
	opacity: 0;
	animation: ucabFadeUp 800ms ease-out 500ms forwards;
}

.ucab-single__meta-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ucab-single__meta-label {
	font-size: 10.5px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ucab-gold);
}

.ucab-single__meta-value {
	font-size: 15px;
	font-weight: 500;
	color: var(--ucab-white);
	text-shadow: 0 1px 10px rgba(6, 24, 39, 0.4);
}

@keyframes ucabHeroZoom {
	from { transform: scale(1.06); }
	to { transform: scale(1); }
}

@keyframes ucabFadeUp {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

.ucab-single__body {
	background: var(--ucab-ivory);
}

.ucab-single__content {
	max-width: 1200px;
	margin: 0 auto;
	padding: clamp(44px, 6vw, 76px) var(--ucab-page-pad) clamp(10px, 2vw, 20px);
}

.ucab-single__content-inner {
	max-width: 760px;
	margin: 0 auto;
	font-size: 16px;
	line-height: 1.85;
	color: #29343d;
}

.ucab-single__content-inner p {
	margin: 0 0 1.4em;
}

@media (max-width: 680px) {
	.ucab-single__hero-inner {
		padding-top: clamp(100px, 24vw, 140px);
	}
	.ucab-single__title {
		max-width: none;
	}
}

/* --------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------- */

.ucab-gallery {
	background: var(--ucab-ivory);
	max-width: 1200px;
	margin: 0 auto;
	padding: clamp(10px, 2vw, 24px) var(--ucab-page-pad) clamp(60px, 8vw, 100px);
}

.ucab-gallery__heading {
	font-size: clamp(26px, 3vw, 36px);
	margin-bottom: 28px;
	position: relative;
	padding-bottom: 16px;
}

.ucab-gallery__heading::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 56px;
	height: 2px;
	background: var(--ucab-gold);
}

.ucab-gallery__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: 220px;
	gap: 14px;
}

.ucab-gallery__item {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 16px;
	overflow: hidden;
	cursor: pointer;
	background: var(--ucab-ivory);
	grid-column: span 1;
	grid-row: span 1;
}

.ucab-gallery__item--large {
	grid-column: span 2;
	grid-row: span 2;
}

.ucab-gallery__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 600ms ease;
}

.ucab-gallery__item::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(7, 28, 44, 0.55), rgba(7, 28, 44, 0));
	opacity: 0;
	transition: opacity 400ms ease;
}

.ucab-gallery__item:hover::before,
.ucab-gallery__item:focus-visible::before {
	opacity: 1;
}

.ucab-gallery__item:hover img,
.ucab-gallery__item:focus-visible img {
	transform: scale(1.04);
}

.ucab-gallery__caption {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 14px;
	color: var(--ucab-white);
	font-size: 13px;
	text-align: left;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 350ms ease, transform 350ms ease;
}

.ucab-gallery__item:hover .ucab-gallery__caption,
.ucab-gallery__item:focus-visible .ucab-gallery__caption {
	opacity: 1;
	transform: translateY(0);
}

@media (max-width: 900px) {
	.ucab-gallery__grid {
		grid-template-columns: repeat(2, 1fr);
		grid-auto-rows: 180px;
	}
}

@media (max-width: 520px) {
	.ucab-gallery__grid {
		grid-template-columns: 1fr;
		grid-auto-rows: 220px;
	}
	.ucab-gallery__item--large {
		grid-column: span 1;
		grid-row: span 1;
	}
}

/* --------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------- */

.ucab-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(6, 24, 39, 0.94);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px;
}

.ucab-lightbox[hidden] {
	display: none;
}

.ucab-lightbox__figure {
	max-width: min(1100px, 92vw);
	max-height: 88vh;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

.ucab-lightbox__image {
	max-width: 100%;
	max-height: 76vh;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ucab-lightbox__caption {
	color: var(--ucab-ivory);
	font-size: 14px;
	text-align: center;
	max-width: 700px;
}

.ucab-lightbox-close,
.ucab-lightbox-prev,
.ucab-lightbox-next {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(7, 28, 44, 0.45);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(245, 242, 234, 0.28);
	color: var(--ucab-white);
	cursor: pointer;
	border-radius: 50%;
	padding: 0;
	transition: background 250ms ease, border-color 250ms ease, transform 250ms ease;
}

.ucab-lightbox-close svg,
.ucab-lightbox-prev svg,
.ucab-lightbox-next svg {
	width: 18px;
	height: 18px;
	display: block;
}

.ucab-lightbox-close {
	top: 22px;
	right: 22px;
	width: 44px;
	height: 44px;
}

.ucab-lightbox-prev,
.ucab-lightbox-next {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
}

.ucab-lightbox-prev {
	left: 20px;
}

.ucab-lightbox-next {
	right: 20px;
}

.ucab-lightbox-close:hover,
.ucab-lightbox-prev:hover,
.ucab-lightbox-next:hover {
	background: rgba(7, 28, 44, 0.7);
	border-color: var(--ucab-gold);
	transform: scale(1.06);
}

.ucab-lightbox-prev:hover,
.ucab-lightbox-next:hover {
	transform: translateY(-50%) scale(1.06);
}

@media (max-width: 640px) {
	.ucab-lightbox-prev,
	.ucab-lightbox-next {
		width: 42px;
		height: 42px;
	}
	.ucab-lightbox-prev { left: 8px; }
	.ucab-lightbox-next { right: 8px; }
}
