/* gallery.css — gallery page: filter pills, masonry grid, lightbox, instagram strip.
   loads after pages.css. */

.gallery-head { text-align: center; margin-bottom: 2.2rem; }
.gallery-head .pills { justify-content: center; margin-top: 1.6rem; }

.masonry {
	columns: 3 260px;
	column-gap: 1.1rem;
	/* whole-grid crossfade on filter change: gallery.js adds .is-switching to
	   fade out, swaps items while invisible (hides the reflow), then fades back */
	opacity: 1;
	transition: opacity .26s var(--ease-out);
}
.masonry.is-switching { opacity: 0; }
.masonry-item {
	break-inside: avoid;
	margin: 0 0 1.1rem;
	position: relative;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--line-soft);
	/* ring (0 → 4px) + shadow via box-shadow so they animate smoothly; border is
	   the only line at rest (matches the cards) */
	box-shadow: 0 0 0 0 var(--gold), 0 0 0 0 transparent;
	transition: border-color .5s var(--ease-out),
	            box-shadow .5s var(--ease-out);
}
.masonry-item:hover, .masonry-item:focus-within {
	border-color: var(--gold);
	box-shadow: 0 0 0 4px var(--gold), var(--shadow);
}
.masonry-item.is-hidden { display: none; }
@media (prefers-reduced-motion: reduce) {
	.masonry, .masonry-item { transition: none; }
}
.masonry-item a { display: block; position: relative; }
.masonry-item img {
	width: 100%;
	transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-2) var(--ease-out);
}
.masonry-item a::after {
	content: "\f00e";   /* fa-magnifying-glass-plus */
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	font-size: 1.5rem;
	color: var(--yellow);
	background: rgba(34, 22, 16, .5);
	opacity: 0;
	transition: opacity var(--dur-1) var(--ease-out);
}
.masonry-item a:hover::after, .masonry-item a:focus-visible::after { opacity: 1; }
.masonry-item a:hover img { transform: scale(1.04); }

/* lightbox (a <dialog> built by gallery.js): fullscreen centred image, grey
   close circle top-right, bare side arrows, thumbnail strip along the bottom */
.lightbox {
	position: fixed;
	inset: 0;
	margin: 0;
	border: 0;
	padding: 0;
	width: 100vw;
	height: 100dvh;
	max-width: none;
	max-height: none;
	background: transparent;
}
.lightbox[open] {
	display: grid;
	grid-template-rows: 1fr auto;
}
.lightbox::backdrop { background: rgba(24, 15, 10, .95); }

.lightbox figure {
	margin: 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 3.5rem clamp(3.2rem, 8vw, 6rem) .5rem;
}
.lightbox img {
	display: block;
	max-width: 100%;
	max-height: calc(100dvh - 220px);
	width: auto;
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
}
.lightbox figcaption {
	text-align: center;
	color: var(--sand);
	margin-top: .7rem;
	font-size: var(--fs-small);
}

/* close: grey circle, top-right */
.lightbox__close {
	position: fixed;
	top: 1.2rem;
	right: 1.2rem;
	z-index: 2;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: grid;
	place-content: center;
	background: rgba(120, 120, 120, .5);
	color: #fff;
	font-size: 1.2rem;
	transform-origin: center;
	transition: background .4s var(--ease-out), transform .4s var(--ease-out);
}
.lightbox__close:hover, .lightbox__close:focus-visible {
	background: rgba(120, 120, 120, .75);
	transform: scale(1.08);
}

/* prev/next: no chrome, just the arrow */
.lightbox__arrow {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	padding: 1.2rem .9rem;
	background: transparent;
	color: var(--cream);
	font-size: 1.9rem;
	line-height: 1;
	opacity: .8;
	transition: opacity .3s var(--ease-out), color .3s var(--ease-out);
}
.lightbox__arrow--prev { left: clamp(.3rem, 2vw, 1.5rem); }
.lightbox__arrow--next { right: clamp(.3rem, 2vw, 1.5rem); }
.lightbox__arrow:hover, .lightbox__arrow:focus-visible { opacity: 1; color: var(--yellow); }

/* thumbnail strip: every photo, scrollable */
.lightbox__strip {
	display: flex;
	gap: .6rem;
	overflow-x: auto;
	padding: .9rem clamp(1rem, 4vw, 2rem) 1.3rem;
	scrollbar-width: thin;
	scrollbar-color: var(--brown-lite) transparent;
}
.lightbox__thumb {
	flex: 0 0 auto;
	width: 72px;
	height: 72px;
	padding: 0;
	border-radius: 10px;
	overflow: hidden;
	border: 2px solid transparent;
	opacity: .5;
	transition: opacity .3s var(--ease-out), border-color .3s var(--ease-out);
}
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb:hover { opacity: .85; }
.lightbox__thumb.is-active { opacity: 1; border-color: var(--yellow); }

/* instagram strip */
.ig-strip { overflow: hidden; }
.ig-strip__track {
	display: flex;
	gap: 1rem;
	overflow-x: auto;
	scrollbar-width: none;
	scroll-snap-type: x proximity;
	cursor: grab;
}
.ig-strip__track::-webkit-scrollbar { display: none; }
.ig-strip__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.ig-tile {
	position: relative;
	flex: 0 0 clamp(180px, 22vw, 260px);
	aspect-ratio: 1;
	border-radius: var(--radius);
	overflow: hidden;
	scroll-snap-align: start;
	border: 1px solid var(--line-soft);
}
.ig-tile img { width: 100%; height: 100%; object-fit: cover; }
.ig-tile::after {
	content: "@afrohairtrends";
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	color: var(--gold);
	font-weight: 600;
	font-size: .95rem;
	background: rgba(34, 22, 16, .55);
	opacity: 0;
	transition: opacity var(--dur-1) var(--ease-out);
}
.ig-tile:hover::after, .ig-tile:focus-visible::after { opacity: 1; }
