/* Filterable Gallery Grid — front-end styles */

.fgg-wrapper {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0;
	box-sizing: border-box;
	font-family: 'Roboto Condensed', Arial, Helvetica, sans-serif;
}
.fgg-wrapper *, .fgg-wrapper *::before, .fgg-wrapper *::after { box-sizing: border-box; }

/* Form controls (select, button) don't inherit font-family by default in most
   browsers' user-agent stylesheets, so it has to be declared explicitly on
   each one rather than relying on inheritance from .fgg-wrapper. */
.fgg-wrapper select,
.fgg-wrapper button,
.fgg-filter-label,
.fgg-no-more {
	font-family: 'Roboto Condensed', Arial, Helvetica, sans-serif !important;
}

/* ---- Filter bar ---- */
.fgg-filters {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 22px;
}
.fgg-filter-label {
	font-weight: 700;
	color: var(--fgg-navy, #1e2a5e);
	text-transform: uppercase;
	font-size: 18px;
	letter-spacing: 0.5px;
	cursor: pointer;
	padding-right: 10px;
}
.fgg-select-wrap { position: relative; display: inline-block; }
.fgg-select-wrap select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-color: var(--fgg-navy, #1e2a5e);
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'><path d='M5 7l5 5 5-5z'/></svg>");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 14px;
	color: #fff;
	border: none;
	border-radius: 24px;
	padding: 11px 56px 11px 20px;
	width: auto;
	max-width: none;
	white-space: nowrap;
	font-weight: 700;
	font-size: 18px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
}
.fgg-select-wrap select:focus { outline: 2px solid var(--fgg-tan, #c49a6c); }

/* ---- Grid container ---- */
.fgg-grid {
	--fgg-columns: 3;
	width: 100% !important;
	box-sizing: border-box;
	gap: 12px;
}

/* Grid layout: uniform tiles */
.fgg-layout-grid.fgg-grid {
	display: grid;
	grid-template-columns: repeat(var(--fgg-columns), 1fr);
	grid-auto-rows: 220px;
}
.fgg-layout-grid .fgg-item img { width: 100%; height: 100%; object-fit: cover; }

/* Masonry layout: CSS columns (pure CSS, no JS libraries needed) */
.fgg-layout-masonry.fgg-grid {
	display: block;
	column-count: var(--fgg-columns);
	column-gap: 12px;
}
.fgg-layout-masonry .fgg-item {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	margin-bottom: 12px;
	display: inline-block;
	width: 100%;
}
.fgg-layout-masonry .fgg-item img { width: 100%; display: block; }

/* Justified layout: JS computes explicit width/height per row */
.fgg-layout-justified.fgg-grid {
	display: flex;
	flex-wrap: wrap;
}
.fgg-layout-justified .fgg-item {
	margin: 0 6px 6px 0;
	overflow: hidden;
	flex: 0 0 auto;
}
.fgg-layout-justified .fgg-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Shared item styling */
.fgg-item {
	position: relative;
	overflow: hidden;
	border-radius: 4px;
	cursor: pointer;
	background: #eaeaea;
}
.fgg-item img { transition: transform .35s ease; }
.fgg-item:hover img { transform: scale(1.05); }

/* ---- Load more ---- */
.fgg-load-more-wrap { text-align: center; margin-top: 30px; }
.fgg-load-more {
	display: none;
	background: var(--fgg-tan, #c49a6c);
	color: #fff;
	border: none;
	padding: 14px 42px;
	border-radius: 28px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	font-size: 14px;
	cursor: pointer;
	transition: filter .2s ease;
}
.fgg-load-more:hover:not([disabled]) { filter: brightness(0.9); }
.fgg-load-more[disabled] { opacity: 0.6; cursor: default; }
.fgg-no-more { color: #888; font-size: 14px; margin-top: 10px; }

/* ---- Lightbox ---- */
.fgg-lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.9);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
}
.fgg-lightbox-overlay img { max-width: 90vw; max-height: 85vh; }
.fgg-lightbox-close, .fgg-lightbox-prev, .fgg-lightbox-next {
	position: absolute;
	background: none;
	border: none;
	color: #fff;
	font-size: 38px;
	line-height: 1;
	cursor: pointer;
	padding: 8px;
}
.fgg-lightbox-close { top: 16px; right: 24px; }
.fgg-lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.fgg-lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
	.fgg-layout-grid.fgg-grid { grid-template-columns: repeat(2, 1fr); }
	.fgg-layout-masonry.fgg-grid { column-count: 2; }
}
@media (max-width: 480px) {
	.fgg-layout-grid.fgg-grid { grid-template-columns: 1fr; }
	.fgg-layout-masonry.fgg-grid { column-count: 1; }
}
/* Filter bar gets its own, wider breakpoint: below 480px it's guaranteed to
   need stacking, but anything from ~480-640px is too narrow to fit both
   pills on one line yet wasn't narrow enough to trigger the mobile layout —
   that in-between zone is what caused the uncentered wrap when resizing a
   desktop window rather than viewing on an actual phone. */
@media (max-width: 640px) {
	.fgg-filters {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 10px;
	}
	.fgg-select-wrap,
	.fgg-select-wrap select {
		width: 100%;
		max-width: 280px;
	}
}
