/**
 * Gallery Styles
 * Masonry layout with Fancybox integration
 *
 * @package Clinic_Master
 */

.gallery-section {
	padding: 80px 0;
	background-color: #fff;
}

.gallery-section__container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

.gallery-section__title {
	font-size: 2.5rem;
	font-weight: 700;
	text-align: center;
	margin-bottom: 1rem;
	color: #1a1a1a;
}

.gallery-section__description {
	text-align: center;
	margin-bottom: 3rem;
	color: #666;
	font-size: 1.1rem;
	max-width: 700px;
	margin-left: auto;
	margin-right: auto;
}

/* Masonry Grid Container */
.gallery-grid {
	margin: 0 auto;
	position: relative;
}

/* Gallery items will be positioned by Masonry.js */
.gallery-grid::after {
	content: '';
	display: block;
	clear: both;
}

/* Grid sizer for Masonry column width calculation */
.gallery-grid__sizer,
.gallery-grid__gutter-sizer {
	width: 100%;
	visibility: hidden;
	opacity: 0;
	height: 0;
	margin: 0;
	padding: 0;
}

@media (min-width: 576px) {
	.gallery-grid__sizer,
	.gallery-grid__gutter-sizer {
		width: calc(50% - 10px);
	}
}

@media (min-width: 768px) {
	.gallery-grid__sizer,
	.gallery-grid__gutter-sizer {
		width: calc(33.333% - 14px);
	}
}

@media (min-width: 992px) {
	.gallery-grid__sizer {
		width: calc(25% - 15px);
	}

	.gallery-grid__gutter-sizer {
		width: 20px;
	}
}

/* Gallery Item */
.gallery-item {
	width: 100%;
	margin-bottom: 20px;
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	cursor: pointer;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Responsive widths - match grid sizer */
@media (min-width: 576px) {
	.gallery-item {
		width: calc(50% - 10px);
	}
}

@media (min-width: 768px) {
	.gallery-item {
		width: calc(33.333% - 14px);
	}
}

@media (min-width: 992px) {
	.gallery-item {
		width: calc(25% - 15px);
	}
}

.gallery-item img {
	width: 100%;
	height: auto;
	display: block;
}

.gallery-item:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item__link {
	display: block;
	width: 100%;
	text-decoration: none;
	position: relative;
}

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

.gallery-item:hover .gallery-item__image {
	transform: scale(1.05);
}

/* Overlay on hover */
.gallery-item__overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.4);
	opacity: 0;
	transition: opacity 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gallery-item:hover .gallery-item__overlay {
	opacity: 1;
}

.gallery-item__icon {
	color: #fff;
	font-size: 2rem;
	transform: scale(0.8);
	transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item__icon {
	transform: scale(1);
}

/* Loading state */
.gallery-grid.loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Empty state */
.gallery-empty {
	text-align: center;
	padding: 60px 20px;
	color: #999;
}

.gallery-empty__message {
	font-size: 1.2rem;
	margin-bottom: 1rem;
}

/* Fancybox customizations */
.fancybox__backdrop {
	background: rgba(0, 0, 0, 0.9);
}

.fancybox__nav {
	--fancybox-nav-width: 44px;
	--fancybox-nav-height: 44px;
}

.fancybox__button {
	--fancybox-color: #fff;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 50%;
	transition: background 0.3s ease;
}

.fancybox__button:hover {
	background: rgba(255, 255, 255, 0.2);
}

/* Responsive adjustments */
@media (max-width: 767px) {
	.gallery-section {
		padding: 60px 0;
	}

	.gallery-section__title {
		font-size: 2rem;
	}

	.gallery-section__description {
		font-size: 1rem;
		margin-bottom: 2rem;
	}

	.gallery-grid {
		column-gap: 15px;
		row-gap: 15px;
	}

	.gallery-item {
		margin-bottom: 15px;
	}
}
