/* ============================================================
   Scoped CSS — Project Gallery (templates/project-gallery.php)
   Enqueued conditionally in functions.php (handle: tc-gallery)
   Lightbox = Fancybox v5 (self-hosted: css/fancybox.css + js/fancybox.umd.js)
   ============================================================ */

/* Filter buttons */
.tc-gallery-filter {
	opacity: 0.65;
}

.tc-gallery-filter.active {
	opacity: 1;
}

/* Grid items — hover/focus affordance: gentle zoom + magnifier badge */
.tc-gallery-item {
	cursor: pointer;
}

.tc-gallery-thumb img {
	transition: transform 0.35s ease;
}

.tc-gallery-thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.25);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.tc-gallery-zoom {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.8);
	z-index: 1;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--tc-accent);
	color: #fff;
	font-size: 1.1rem;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.tc-gallery-item:hover .tc-gallery-thumb img,
.tc-gallery-item:focus-visible .tc-gallery-thumb img {
	transform: scale(1.05);
}

.tc-gallery-item:hover .tc-gallery-thumb::after,
.tc-gallery-item:focus-visible .tc-gallery-thumb::after {
	opacity: 1;
}

.tc-gallery-item:hover .tc-gallery-zoom,
.tc-gallery-item:focus-visible .tc-gallery-zoom {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.tc-gallery-item:hover .tc-gallery-caption {
	color: var(--tc-primary);
}

@media (prefers-reduced-motion: reduce) {
	.tc-gallery-thumb img,
	.tc-gallery-thumb::after,
	.tc-gallery-zoom {
		transition: none;
	}

	.tc-gallery-item:hover .tc-gallery-thumb img,
	.tc-gallery-item:focus-visible .tc-gallery-thumb img {
		transform: none;
	}
}

.tc-gallery-caption {
	background: var(--tc-light);
	color: var(--tc-secondary);
	transition: color 0.25s ease;
}

.tc-gallery-cell.tc-hidden {
	display: none;
}

/* Fancybox brand alignment: square corners to match the design language */
.fancybox__content {
	border-radius: 0;
}

/* Lightbox photo credit — second line under the caption title.
   Set from the tc_gallery_credit attachment meta in gallery-grid.php. */
.fancybox__caption .tc-gallery-credit {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.8125rem;
	line-height: 1.3;
	opacity: 0.75;
}

/* Controls must stay visible — guard against theme resets and idle fade */
.fancybox__container .f-button {
	opacity: 1;
	visibility: visible;
}

.fancybox__container.is-idle .fancybox__toolbar,
.fancybox__container.is-idle .fancybox__nav,
.fancybox__container.is-idle .fancybox__thumbs {
	opacity: 1;
	visibility: visible;
}
