/* ========================================
   Magic Modal - Trigger Image Styles
   ======================================== */

.cs-cta {
	position: relative;
	display: block;
	overflow: hidden;
}

.cs-cta-wrap {
	position: relative;
	display: block;
}

.cs-cta-wrap.has-inner-border::before {
	content: '';
	position: absolute;
	top: 10px;
	right: 10px;
	bottom: 10px;
	left: 10px;
	pointer-events: none;
	z-index: 2;
}

.cs-cta-img {
	position: relative;
	width: 100%;
	overflow: hidden;
}

.cs-cta-img img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.3s ease;
}

.cs-cta:hover .cs-cta-img img {
	transform: scale(1.05);
}

.cs-cta-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.3);
	transition: opacity 0.3s ease;
	pointer-events: none;
	z-index: 1;
}

.cs-cta:hover .cs-cta-overlay {
	opacity: 0.7;
}

.cs-cta-content {
	position: absolute;
	left: 0;
	width: 100%;
	padding: 20px;
	z-index: 2;
	pointer-events: none;
}

.cs-cta-content.title-v-top {
	top: 0;
	bottom: auto;
	transform: none;
}

.cs-cta-content.title-v-middle {
	top: 50%;
	bottom: auto;
	transform: translateY(-50%);
}

.cs-cta-content.title-v-bottom {
	top: auto;
	bottom: 0;
	transform: none;
}

.cs-cta-title {
	margin: 0;
	color: #ffffff;
	font-size: 24px;
	font-weight: 600;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cs-cta-link {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 3;
	text-indent: -9999px;
}

/* ========================================
   Modal Overlay & Container
   ======================================== */

.mm-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.8);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	overflow-y: auto;
	padding: 20px;
}

.mm-modal-overlay.mm-modal-active {
	opacity: 1;
	visibility: visible;
}

.mm-modal-content {
	position: relative;
	background-color: #ffffff;
	border-radius: 8px;
	max-width: 1200px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	transform: scale(0.9);
	transition: transform 0.3s ease;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.mm-modal-overlay.mm-modal-active .mm-modal-content {
	transform: scale(1);
}

/* ========================================
   Modal Close Button
   ======================================== */

.mm-modal-close {
	position: absolute;
	top: 15px;
	right: 15px;
	font-size: 30px;
	font-weight: bold;
	color: #333333;
	cursor: pointer;
	z-index: 10;
	line-height: 1;
	transition: color 0.3s ease, transform 0.3s ease;
	background: none;
	border: none;
	padding: 5px 10px;
}

.mm-modal-close:hover,
.mm-modal-close:focus {
	color: #000000;
	transform: rotate(90deg);
}

/* ========================================
   Modal Body
   ======================================== */

.mm-modal-body {
	position: relative;
}

.mm-modal-title {
	margin: 0 0 20px 0;
	padding: 0;
	font-size: 28px;
	font-weight: 700;
	color: #333333;
	line-height: 1.3;
}

/* ========================================
   Modal Text Content
   ======================================== */

.mm-modal-text {
	margin-bottom: 30px;
}

.mm-modal-text p:last-child {
	margin-bottom: 0;
}

/* ========================================
   Gallery/Carousel
   ======================================== */

.mm-modal-gallery {
	position: relative;
	margin-top: 30px;
}

.mm-gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 15px;
}

.mm-gallery-carousel {
	display: flex;
	gap: 15px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: thin;
}

.mm-gallery-carousel::-webkit-scrollbar {
	height: 8px;
}

.mm-gallery-carousel::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.mm-gallery-carousel::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 4px;
}

.mm-gallery-carousel::-webkit-scrollbar-thumb:hover {
	background: #555;
}

.mm-gallery-carousel[data-visible="1"] .mm-gallery-item {
	min-width: 100%;
	flex: 0 0 100%;
}

.mm-gallery-carousel[data-visible="2"] .mm-gallery-item {
	min-width: calc(50% - 7.5px);
	flex: 0 0 calc(50% - 7.5px);
}

.mm-gallery-carousel[data-visible="3"] .mm-gallery-item {
	min-width: calc(33.333% - 10px);
	flex: 0 0 calc(33.333% - 10px);
}

.mm-gallery-carousel[data-visible="4"] .mm-gallery-item {
	min-width: calc(25% - 11.25px);
	flex: 0 0 calc(25% - 11.25px);
}

.mm-gallery-carousel[data-visible="5"] .mm-gallery-item {
	min-width: calc(20% - 12px);
	flex: 0 0 calc(20% - 12px);
}

.mm-gallery-carousel[data-visible="6"] .mm-gallery-item {
	min-width: calc(16.666% - 12.5px);
	flex: 0 0 calc(16.666% - 12.5px);
}

.mm-gallery-item {
	position: relative;
	overflow: hidden;
	border-radius: 4px;
	cursor: pointer;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mm-gallery-item:hover {
	transform: translateY(-5px);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.mm-gallery-item-aspect {
	position: relative;
	width: 100%;
	overflow: hidden;
}

.mm-gallery-item-aspect img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mm-gallery-item img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.3s ease;
}

.mm-gallery-item:hover img {
	transform: scale(1.1);
}

/* ========================================
   Gallery Navigation Buttons
   ======================================== */

.mm-gallery-prev,
.mm-gallery-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background-color: rgba(255, 255, 255, 0.9);
	border: none;
	font-size: 30px;
	font-weight: bold;
	color: #333333;
	cursor: pointer;
	padding: 10px 15px;
	border-radius: 4px;
	transition: background-color 0.3s ease, color 0.3s ease;
	z-index: 5;
	line-height: 1;
}

.mm-gallery-prev:hover,
.mm-gallery-next:hover {
	background-color: rgba(255, 255, 255, 1);
	color: #000000;
}

.mm-gallery-prev {
	left: 10px;
}

.mm-gallery-next {
	right: 10px;
}

/* ========================================
   Responsive Styles
   ======================================== */

@media (max-width: 768px) {
	.mm-modal-content {
		width: 95%;
		max-height: 95vh;
		padding: 30px 20px;
	}

	.mm-modal-close {
		top: 10px;
		right: 10px;
		font-size: 24px;
	}

	.mm-gallery-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.mm-gallery-carousel[data-visible="3"] .mm-gallery-item,
	.mm-gallery-carousel[data-visible="4"] .mm-gallery-item,
	.mm-gallery-carousel[data-visible="5"] .mm-gallery-item,
	.mm-gallery-carousel[data-visible="6"] .mm-gallery-item {
		min-width: calc(50% - 7.5px);
		flex: 0 0 calc(50% - 7.5px);
	}

	.cs-cta-title {
		font-size: 18px;
	}

	.mm-gallery-prev,
	.mm-gallery-next {
		font-size: 24px;
		padding: 8px 12px;
	}
}

@media (max-width: 480px) {
	.mm-modal-content {
		padding: 20px 15px;
	}

	.mm-gallery-grid {
		grid-template-columns: repeat(1, 1fr);
		gap: 8px;
	}

	.mm-gallery-carousel[data-visible="2"] .mm-gallery-item,
	.mm-gallery-carousel[data-visible="3"] .mm-gallery-item,
	.mm-gallery-carousel[data-visible="4"] .mm-gallery-item,
	.mm-gallery-carousel[data-visible="5"] .mm-gallery-item,
	.mm-gallery-carousel[data-visible="6"] .mm-gallery-item {
		min-width: 100%;
		flex: 0 0 100%;
	}

	.cs-cta-content {
		padding: 15px;
	}

	.cs-cta-title {
		font-size: 16px;
	}
}

/* ========================================
   Accessibility
   ======================================== */

.mm-modal-close:focus,
.mm-gallery-prev:focus,
.mm-gallery-next:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

body.mm-modal-open {
	overflow: hidden;
}

/* ========================================
   Animation Utilities
   ======================================== */

@keyframes mmFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

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

.mm-modal-overlay.mm-modal-active {
	animation: mmFadeIn 0.3s ease;
}

.mm-modal-overlay.mm-modal-active .mm-modal-content {
	animation: mmSlideUp 0.3s ease;
}
