/* Homepage image gallery grid (campus-life) + Interactivity lightbox */

.york-cms-custom-section.york-custom-section > .container:has(.uoy_image_gallery) {
	container-type: inline-size;
	container-name: campus-gallery;
}

.york-cms-custom-section.york-custom-section > .container > .p-large {
	max-width: 1044px;
}

.york-cms-custom-section.york-custom-section .uoy_image_gallery {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: 24px;
	width: 100%;
	margin-top: clamp(32px, calc(36 / 1440 * 100vw), 36px);
}

@container campus-gallery (min-width: 28rem) {
	.york-cms-custom-section.york-custom-section .uoy_image_gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}

@container campus-gallery (min-width: 33rem) {
	.york-cms-custom-section.york-custom-section .uoy_image_gallery {
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	}
}

@container campus-gallery (min-width: 66rem) {
	.york-cms-custom-section.york-custom-section .uoy_image_gallery {
		grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
	}
}

.york-cms-custom-section.york-custom-section .uoy_image_gallery_item > button {
	border: 0;
	padding: 0;
	background: transparent;
	border-radius: 18px;
	overflow: hidden;
	display: block;
	cursor: pointer;
	width: 100%;
	box-shadow: 4px 4px 1px 0 #00000040;
	transition: box-shadow 50ms ease;
}

.york-cms-custom-section.york-custom-section .uoy_image_gallery_item .uoy_image {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 18px;
	display: block;
	background: #d1ccbd;
	transition: transform .25s ease;
}

.york-cms-custom-section.york-custom-section .uoy_image_gallery_item > button:hover {
	box-shadow: 4px 4px 4px 0 #00000040;
}

.york-cms-custom-section.york-custom-section .uoy_image_gallery_item > button:hover .uoy_image {
	transform: scale(1.04);
}

.york-cms-custom-section.york-custom-section .uoy_image_gallery_item > button:focus-visible {
	outline: 3px solid #e0177f;
	outline-offset: 3px;
}

@supports not (container-type: inline-size) {
	@media screen and (min-width: 28rem) {
		.york-cms-custom-section.york-custom-section .uoy_image_gallery {
			grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
		}
	}
	@media screen and (min-width: 33rem) {
		.york-cms-custom-section.york-custom-section .uoy_image_gallery {
			grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
		}
	}
	@media screen and (min-width: 66rem) {
		.york-cms-custom-section.york-custom-section .uoy_image_gallery {
			grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
		}
	}
}

@media (max-width: 991px) {
	.york-cms-custom-section.york-custom-section .uoy_image_gallery_item .uoy_image,
	.york-cms-custom-section.york-custom-section .uoy_image_gallery_item > button {
		border-radius: 16px;
	}
}

/* ============================================================
   Lightbox — DOM + rules mirror campus #galleryModal / #popupCarousel
   ============================================================ */

.homepage-image-gallery-modal.custom-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: block !important;
	align-items: stretch;
	justify-content: stretch;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
	width: 100%;
	max-width: none;
	overflow: hidden;
	background: rgba(0, 0, 0, .75);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
}

.homepage-image-gallery-modal.custom-modal.active {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

.homepage-image-gallery-modal .modal-overlay {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: transparent;
}

.homepage-image-gallery-modal .modal-dialog {
	position: relative;
	z-index: 1;
	margin: 0;
	background: transparent;
	width: 100%;
	max-width: none;
	height: 100vh;
	max-height: 100vh;
	overflow: hidden;
	pointer-events: none;
}

.homepage-image-gallery-modal .modal-dialog.modal-fullscreen {
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
}

.homepage-image-gallery-modal .modal-content {
	pointer-events: auto;
	position: relative;
	z-index: 2;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	max-height: 100vh !important;
	max-height: 100dvh !important;
	overflow: hidden !important;
	min-height: 0;
	border-radius: 0 !important;
	animation: none !important;
}

.homepage-image-gallery-modal .gallery-modal-content.modal-body {
	position: relative;
	display: flex !important;
	flex-direction: column;
	padding: 0 !important;
	width: 100% !important;
	max-width: none !important;
	height: 100%;
	max-height: 100vh;
	overflow: hidden;
	min-height: 0;
	box-sizing: border-box;
}

.homepage-image-gallery-modal .custom-close {
	background: #ffd200;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	outline: none;
	box-shadow: none;
	position: fixed;
	top: 24px;
	right: 24px;
	z-index: 1060;
	cursor: pointer;
	color: #0b0c0c;
	padding: 0;
}

.homepage-image-gallery-modal .custom-close:hover {
	background: #ffe259;
}

.homepage-image-gallery-modal .custom-close i {
	color: #0b0c0c;
	font-size: 18px;
	line-height: 1;
}

/* = campus #popupCarousel */
.homepage-image-gallery-modal .gallery-popup-carousel {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 24px 88px;
	gap: 0;
	position: relative;
	width: 100%;
	height: 100%;
	max-height: 100vh;
	overflow: hidden;
	box-sizing: border-box;
	flex: 1 1 auto;
	min-height: 0;
}

.homepage-image-gallery-modal .carousel-inner {
	position: relative;
	width: auto;
	max-width: 100%;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 4px 24px rgba(0, 0, 0, .35);
	transform: none !important;
	transition: none !important;
}

.homepage-image-gallery-modal .carousel-item {
	display: none;
	float: none;
	margin-right: 0;
	width: 100%;
	max-width: 100%;
	text-align: center;
	transition: none !important;
}

.homepage-image-gallery-modal .carousel-item.active {
	display: block;
}

.homepage-image-gallery-modal .slider-img-wrapper {
	position: relative;
	border-radius: 18px 18px 0 0;
	overflow: hidden;
	line-height: 0;
	background: #111;
	display: block;
	width: 100%;
	max-width: 100%;
	height: 0;
	padding: 0;
	padding-bottom: min(56.6145%, calc(100vh - 120px)); /* 398/703 */
	aspect-ratio: auto;
	flex-shrink: 0;
}

.homepage-image-gallery-modal .popup-slider-img {
	position: absolute;
	inset: 0;
	border-radius: 18px 18px 0 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: cover;
	object-position: center top;
	margin: 0;
}

.homepage-image-gallery-modal .popup-caption {
	display: flex !important;
	align-items: center;
	flex-wrap: nowrap;
	justify-content: flex-start;
	gap: 12px;
	background: rgba(0, 0, 0, .72);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #fff !important;
	position: relative;
	flex-shrink: 0;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	padding: 12px 16px;
	font-size: 16px;
	line-height: 16px;
	font-weight: 400;
	text-align: start;
	border-radius: 0 0 18px 18px;
	box-sizing: border-box;
	overflow: hidden;
}

.homepage-image-gallery-modal .popup-caption-meta {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 12px;
}

.homepage-image-gallery-modal .popup-caption-icon {
	flex-shrink: 0;
	line-height: 1;
	display: inline-flex;
	color: #fff;
}

.homepage-image-gallery-modal .popup-caption-icon i {
	font-size: 14px;
}

.homepage-image-gallery-modal .popup-caption-counter {
	flex-shrink: 0;
	white-space: nowrap;
	font-weight: 400;
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	color: #fff;
}

.homepage-image-gallery-modal .popup-caption-divider {
	flex-shrink: 0;
	opacity: 0.9;
	color: #fff;
}

.homepage-image-gallery-modal .homepage-image-gallery-caption {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	max-width: 100%;
	font-weight: 400;
	color: #fff !important;
	text-align: start;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Kill Bootstrap stretch — controls must leave the flow */
.homepage-image-gallery-modal .carousel-control-prev,
.homepage-image-gallery-modal .carousel-control-next {
	position: fixed !important;
	top: 50% !important;
	bottom: auto !important;
	width: 48px !important;
	height: 48px !important;
	min-width: 48px !important;
	min-height: 48px !important;
	max-width: 48px !important;
	max-height: 48px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	background: transparent !important;
	opacity: 1 !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	transform: translateY(-50%);
	z-index: 5;
	cursor: pointer;
	flex: none !important;
}

.homepage-image-gallery-modal .carousel-control-prev {
	left: 24px !important;
	right: auto !important;
}

.homepage-image-gallery-modal .carousel-control-next {
	right: 24px !important;
	left: auto !important;
}

.homepage-image-gallery-modal .carousel-control-prev:hover,
.homepage-image-gallery-modal .carousel-control-next:hover,
.homepage-image-gallery-modal .carousel-control-prev:focus,
.homepage-image-gallery-modal .carousel-control-next:focus {
	background: transparent !important;
	opacity: 1 !important;
}

.homepage-image-gallery-modal .carousel-control-prev-icon,
.homepage-image-gallery-modal .carousel-control-next-icon,
.homepage-image-gallery-modal .carousel-control-prev::before,
.homepage-image-gallery-modal .carousel-control-next::before,
.homepage-image-gallery-modal .carousel-control-prev::after,
.homepage-image-gallery-modal .carousel-control-next::after {
	display: none !important;
	content: none !important;
	background: none !important;
	width: 0 !important;
	height: 0 !important;
}

.homepage-image-gallery-modal .custom-arrow {
	background: #ffd200;
	width: 48px;
	height: 48px;
	min-width: 48px;
	min-height: 48px;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 0;
	margin: 0;
}

.homepage-image-gallery-modal .custom-arrow:hover {
	background: #ffe259;
}

.homepage-image-gallery-modal .carousel-control-prev,
.homepage-image-gallery-modal .carousel-control-next,
.homepage-image-gallery-modal .custom-arrow,
.homepage-image-gallery-modal .custom-arrow i,
.homepage-image-gallery-modal .custom-arrow svg,
.homepage-image-gallery-modal .custom-arrow svg path {
	color: #000 !important;
}

.homepage-image-gallery-modal .custom-arrow svg path {
	fill: #000 !important;
}

.homepage-image-gallery-modal .custom-arrow i {
	color: #000 !important;
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
}

body.modal-open {
	overflow: hidden;
}

/* Desktop */
@media (min-width: 992px) {
	.homepage-image-gallery-modal .gallery-modal-content.modal-body {
		display: flex !important;
		align-items: center;
		justify-content: center;
	}

	.homepage-image-gallery-modal .gallery-popup-carousel {
		width: min(1200px, calc(100vw - 160px));
		margin: 0 auto;
		padding: 24px 80px;
		align-items: center;
		justify-content: center;
	}

	.homepage-image-gallery-modal .carousel-inner {
		width: 100%;
		max-width: min(1100px, calc(100vw - 200px));
	}

	.homepage-image-gallery-modal .slider-img-wrapper {
		width: 100%;
		max-width: none;
		margin: 0 auto;
		height: 0;
		padding-bottom: min(56.6145%, calc(100vh - 140px));
	}
}

/* Tablet + mobile (campus ≤991) */
@media (max-width: 991px) {
	.homepage-image-gallery-modal .gallery-modal-content.modal-body {
		position: relative;
		display: flex !important;
		flex-direction: column;
		align-items: center !important;
		justify-content: center !important;
		box-sizing: border-box;
	}

	.homepage-image-gallery-modal .custom-close {
		position: absolute;
		top: 16px;
		right: 16px;
		z-index: 1060;
	}

	.homepage-image-gallery-modal .gallery-popup-carousel {
		position: relative;
		width: 100%;
		margin: 0 auto;
		align-items: center;
		justify-content: center;
		flex-grow: 1 !important;
		height: auto;
		max-height: 100%;
		min-height: 0;
		padding: 0 60px;
		box-sizing: border-box;
		overflow: hidden;
	}

	.homepage-image-gallery-modal .carousel-inner {
		padding-bottom: 0;
		width: 100%;
		max-width: 100%;
	}

	.homepage-image-gallery-modal .slider-img-wrapper {
		display: block;
		width: 100%;
		max-width: 100%;
		height: 0;
		min-height: 0;
		padding-bottom: min(56.6145%, calc(100vh - 280px));
		border-radius: 18px 18px 0 0;
		flex-shrink: 0;
	}

	.homepage-image-gallery-modal .popup-slider-img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		margin: 0;
		border-radius: 18px 18px 0 0;
		object-fit: cover;
		object-position: center top;
	}

	.homepage-image-gallery-modal .popup-caption {
		border-radius: 0 0 18px 18px;
		flex-wrap: wrap;
		flex-shrink: 0;
		overflow: hidden;
		justify-content: flex-start;
		align-items: flex-start;
		align-content: flex-start;
		text-align: start;
		gap: 12px;
		padding: 16px;
	}

	.homepage-image-gallery-modal .popup-caption-meta {
		display: flex;
		align-items: flex-start;
		gap: 12px;
		flex: 0 0 100%;
		width: 100%;
	}

	.homepage-image-gallery-modal .popup-caption-meta .popup-caption-divider {
		display: none;
	}

	.homepage-image-gallery-modal .homepage-image-gallery-caption {
		flex: 1 1 100%;
		width: 100%;
		min-width: 0;
		margin: 0;
		padding: 0;
		font-size: 16px;
		line-height: 21px;
		white-space: normal;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 4;
		line-clamp: 4;
		overflow: hidden;
		text-overflow: ellipsis;
		max-height: 84px;
	}

	.homepage-image-gallery-modal .carousel-control-prev,
	.homepage-image-gallery-modal .carousel-control-next {
		position: absolute !important;
		top: auto !important;
		bottom: 48px !important;
		transform: translateY(50%);
		margin: 0 !important;
	}
}

@media (min-width: 768px) and (max-width: 991px) {
	.homepage-image-gallery-modal .gallery-modal-content.modal-body {
	}

	.homepage-image-gallery-modal .custom-close {
		top: 20px;
		right: 20px;
	}

	.homepage-image-gallery-modal .gallery-popup-carousel {
		width: 100%;
		max-width: 820px;
		padding: 24px;
	}

	.homepage-image-gallery-modal .carousel-inner {
		width: 100%;
		max-width: 703px;
		margin: 0 auto;
	}

	.homepage-image-gallery-modal .carousel-control-prev,
	.homepage-image-gallery-modal .carousel-control-next {
		position: absolute !important;
		top: auto !important;
		bottom: 52px !important;
		transform: translateY(50%);
		width: 48px !important;
		height: 48px !important;
	}

	.homepage-image-gallery-modal .carousel-control-prev {
		left: 24px !important;
		right: auto !important;
	}

	.homepage-image-gallery-modal .carousel-control-next {
		right: 24px !important;
		left: auto !important;
	}

	.homepage-image-gallery-modal .custom-arrow {
		width: 48px;
		height: 48px;
		min-width: 48px;
		min-height: 48px;
	}

	.homepage-image-gallery-modal .slider-img-wrapper {
		height: 0;
		padding-bottom: min(56.6145%, calc(100vh - 280px));
	}
}

@media (max-width: 767px) {
	.homepage-image-gallery-modal .gallery-modal-content.modal-body {
	}

	.homepage-image-gallery-modal .gallery-popup-carousel {
		padding: 0 24px;
		gap: 0;
		max-height: 100%;
		overflow: hidden;
	}

	.homepage-image-gallery-modal .carousel-control-prev,
	.homepage-image-gallery-modal .carousel-control-next {
		position: absolute !important;
		bottom: 48px !important;
		transform: translateY(50%);
		width: 48px !important;
		height: 48px !important;
		min-width: 48px !important;
		min-height: 48px !important;
		max-width: 48px !important;
		max-height: 48px !important;
	}

	.homepage-image-gallery-modal .carousel-control-prev {
		left: 24px !important;
	}

	.homepage-image-gallery-modal .carousel-control-next {
		right: 24px !important;
	}

	.homepage-image-gallery-modal .slider-img-wrapper {
		height: 0;
		padding-bottom: min(56.6145%, calc(100vh - 220px));
	}

	.homepage-image-gallery-modal .popup-slider-img {
		position: absolute;
		inset: 0;
		object-fit: cover;
		object-position: center top;
	}

	.homepage-image-gallery-modal .custom-close {
		position: absolute;
		width: 48px;
		height: 48px;
		top: 24px;
		right: 24px;
		background: #ffd200;
	}

	.homepage-image-gallery-modal .custom-close i {
		font-size: 14px;
	}

	.homepage-image-gallery-modal .custom-arrow {
		width: 48px;
		height: 48px;
		min-width: 48px;
		min-height: 48px;
	}

	.homepage-image-gallery-modal .custom-arrow i {
		font-size: 14px;
	}
}

/* Industry Partnerships Gallery: no bottom section padding (top padding stays) */
.york-cms-custom-section.york-custom-section.homepage-image-gallery--industry {
	padding-bottom: 0;
}
