/* SF Filter Gallery
   Deliberately neutral: inherits the theme's fonts and colours so it doesn't
   fight whatever theme it lands in. Override the variables below per project. */

.sfg {
	/* Brand tokens — sampled from the AHA Internships build.
	   Verify against Elementor > Site Settings > Global Colors. */
	--sfg-navy: #0b2a55;
	--sfg-blue: #3d8fd6;
	--sfg-cream: #f2f0ea;
	--sfg-body: #565656;
	--sfg-line: #dcd8cf;

	--sfg-cols: 3;
	--sfg-gap: 24px;
	--sfg-ratio: 4/3;
	--sfg-radius: 10px;
	--sfg-btn-radius: 8px;
	--sfg-btn-bg: transparent;
	--sfg-btn-fg: var(--sfg-navy);
	--sfg-btn-border: var(--sfg-line);
	--sfg-btn-active-bg: var(--sfg-blue);
	--sfg-btn-active-fg: #fff;
	--sfg-duration: 250ms;
}

/* --- Filter bar --------------------------------------------------------- */

.sfg__filter {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-bottom: calc(var(--sfg-gap) * 1.5);
}

.sfg__btn {
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	padding: 14px 26px;
	cursor: pointer;
	color: var(--sfg-btn-fg);
	background: var(--sfg-btn-bg);
	border: 1px solid var(--sfg-btn-border);
	border-radius: var(--sfg-btn-radius);
	transition: background-color var(--sfg-duration), color var(--sfg-duration), border-color var(--sfg-duration);
}

.sfg__btn:hover,
.sfg__btn:focus-visible {
	color: var(--sfg-blue);
	border-color: var(--sfg-blue);
}

.sfg__btn.is-active {
	background: var(--sfg-btn-active-bg);
	border-color: var(--sfg-btn-active-bg);
	color: var(--sfg-btn-active-fg);
}

/* --- Grid --------------------------------------------------------------- */

.sfg__grid {
	display: grid;
	grid-template-columns: repeat(var(--sfg-cols), minmax(0, 1fr));
	gap: var(--sfg-gap);
}

.sfg--masonry .sfg__grid {
	display: block;
	column-count: var(--sfg-cols);
	column-gap: var(--sfg-gap);
}

.sfg__item {
	margin: 0;
	position: relative;
	overflow: hidden;
	border-radius: var(--sfg-radius);
}

.sfg--masonry .sfg__item {
	break-inside: avoid;
	margin-bottom: var(--sfg-gap);
}

.sfg__item.is-hidden {
	display: none;
}

.sfg__link {
	display: block;
	line-height: 0;
	cursor: zoom-in;
}

.sfg__img {
	display: block;
	width: 100%;
	height: 100%;
	transition: transform var(--sfg-duration) ease-out;
}

.sfg--grid .sfg__img {
	aspect-ratio: var(--sfg-ratio);
	object-fit: cover;
}

.sfg--masonry .sfg__img {
	height: auto;
}

.sfg__item:hover .sfg__img {
	transform: scale(1.03);
}

.sfg__caption {
	font-size: 14px;
	line-height: 1.5;
	color: var(--sfg-body);
	padding-top: 12px;
}

/* --- Lightbox ----------------------------------------------------------- */

.sfg-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(11, 42, 85, 0.94);
	opacity: 0;
	transition: opacity var(--sfg-duration, 220ms);
}

.sfg-lb.is-open {
	opacity: 1;
}

.sfg-lb__img {
	max-width: 92vw;
	max-height: 86vh;
	object-fit: contain;
}

.sfg-lb__caption {
	position: absolute;
	bottom: 1.25rem;
	left: 50%;
	transform: translateX(-50%);
	max-width: 80vw;
	text-align: center;
	color: #fff;
	font-size: 0.875rem;
	opacity: 0.75;
}

.sfg-lb__btn {
	position: absolute;
	background: none;
	border: 0;
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	padding: 0.75rem;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity var(--sfg-duration, 220ms);
}

.sfg-lb__btn:hover,
.sfg-lb__btn:focus-visible {
	opacity: 1;
}

.sfg-lb__close { top: 0.5rem; right: 0.75rem; }
.sfg-lb__prev  { left: 0.5rem;  top: 50%; transform: translateY(-50%); }
.sfg-lb__next  { right: 0.5rem; top: 50%; transform: translateY(-50%); }

/* --- Responsive & a11y -------------------------------------------------- */

@media (max-width: 900px) {
	.sfg { --sfg-cols: 2; }
}

@media (max-width: 560px) {
	.sfg { --sfg-cols: 1; }
}

.sfg :focus-visible,
.sfg-lb :focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.sfg *,
	.sfg-lb * {
		transition: none !important;
		transform: none !important;
	}
}
