/* Gallery grid tiles (moved from gallery.php for valid HTML + caching) */

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 25px;
	margin-top: 30px;
}

.gallery-tile {
	position: relative;
	border-radius: 15px;
	overflow: hidden;
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
	transition: all 0.4s ease;
	background: #fff;
	aspect-ratio: 4 / 3;
}

.gallery-tile:hover {
	transform: translateY(-8px) scale(1.02);
	box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.gallery-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

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

.tile-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
	color: white;
	padding: 30px 20px 20px;
	transform: translateY(100%);
	transition: transform 0.4s ease;
}

.gallery-tile:hover .tile-overlay {
	transform: translateY(0);
}

.tile-content h4 {
	margin: 0 0 8px 0;
	font-size: 18px;
	font-weight: 600;
	color: white;
}

.tile-content p {
	margin: 0;
	font-size: 14px;
	opacity: 0.9;
	line-height: 1.4;
}

@media (max-width: 768px) {
	.gallery-grid {
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
		gap: 20px;
	}

	.tile-overlay {
		transform: translateY(0);
		background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
	}

	.tile-content h4 {
		font-size: 16px;
	}

	.tile-content p {
		font-size: 13px;
	}

	/* Reduce motion on phones: still show overlay, lighter hover */
	.gallery-tile:hover {
		transform: translateY(-4px);
	}
}

@media (max-width: 480px) {
	.gallery-grid {
		grid-template-columns: 1fr;
		gap: 15px;
	}

	.gallery-tile {
		aspect-ratio: 3 / 2;
	}
}

.gallery-item {
	animation: fadeInUp 0.6s ease forwards;
}

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

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }
.gallery-item:nth-child(9) { animation-delay: 0.9s; }

@media (prefers-reduced-motion: reduce) {
	.gallery-tile,
	.gallery-tile img,
	.tile-overlay {
		transition: none;
	}
	.gallery-item {
		animation: none;
	}
}
