/*
 * Northfield Gallery front-end styles.
 * Brand colours: override these variables in the theme's CSS
 * (Appearance > Customize > Additional CSS) to match the site exactly.
 */
.nfg {
	--nfg-accent: #1d3c78;
	--nfg-accent-contrast: #ffffff;
	--nfg-highlight: #f2a900;
	--nfg-orange: #f47c3c;
	--nfg-text: #1f2937;
	--nfg-muted: #6b7280;
	--nfg-card-bg: #ffffff;
	--nfg-border: #e5e7eb;
	--nfg-radius: 12px;
	--nfg-gap: 24px;
	--nfg-min-card: 260px;
	color: var(--nfg-text);
	margin: 0 auto;
	max-width: 1200px;
	padding: 0 16px;
	box-sizing: border-box;
}
.nfg *, .nfg *::before, .nfg *::after { box-sizing: border-box; }

.nfg-title { text-align: center; margin: 0 0 24px; }

/* Tabs */
.nfg-tabs { display: flex; justify-content: center; gap: 8px; margin: 0 0 20px; flex-wrap: wrap; }
.nfg-tab {
	appearance: none; border: 2px solid var(--nfg-accent); background: transparent; color: var(--nfg-accent);
	font: inherit; font-weight: 600; padding: 10px 28px; border-radius: 999px; cursor: pointer;
	display: inline-flex; align-items: center; gap: 8px; transition: background .15s, color .15s;
}
.nfg-tab:hover { background: rgba(29, 60, 120, .08); }
.nfg-tab.is-active { background: var(--nfg-accent); color: var(--nfg-accent-contrast); }
.nfg-tab-count { font-size: .8em; opacity: .8; }
.nfg-tab:focus-visible, .nfg-chip:focus-visible, .nfg-card:focus-visible { outline: 3px solid var(--nfg-highlight); outline-offset: 2px; }

/* Category chips */
.nfg-filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.nfg-chip {
	appearance: none; border: 1px solid var(--nfg-border); background: #fff; color: var(--nfg-text);
	font: inherit; font-size: .9em; padding: 6px 14px; border-radius: 999px; cursor: pointer;
}
.nfg-chip.is-active { border-color: var(--nfg-highlight); background: var(--nfg-highlight); color: #1f2937; }

/* Grid + cards */
.nfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--nfg-min-card), 100%), 1fr)); gap: var(--nfg-gap); }
.nfg-card {
	appearance: none; border: 1px solid var(--nfg-border); background: var(--nfg-card-bg); color: inherit;
	font: inherit; text-align: left; padding: 0; margin: 0; cursor: pointer; border-radius: var(--nfg-radius);
	overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(0,0,0,.06);
	transition: transform .2s, box-shadow .2s;
}
.nfg-card[hidden] { display: none; }
.nfg-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.nfg-thumb { position: relative; display: block; aspect-ratio: 4 / 3; background: #eef1f6; overflow: hidden; }
.nfg-card--video .nfg-thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1d3c78, #0b1730); }
.nfg-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.nfg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.nfg-card:hover .nfg-thumb img { transform: scale(1.04); }
.nfg-badge {
	position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.65); color: #fff;
	font-size: .78em; padding: 3px 10px; border-radius: 999px;
}
.nfg-play {
	position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; transform: translate(-50%, -50%);
	background: rgba(220, 0, 0, .9); border-radius: 12px; transition: background .2s;
}
.nfg-play::after {
	content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%);
	border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff;
}
.nfg-card:hover .nfg-play { background: #e00; }
.nfg-card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.nfg-card-title { font-weight: 700; font-size: 1.05em; color: var(--nfg-accent); line-height: 1.3; }
.nfg-card-date { font-size: .85em; color: var(--nfg-muted); }
.nfg-card-desc { font-size: .92em; color: var(--nfg-text); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nfg-empty { text-align: center; color: var(--nfg-muted); padding: 40px 0; }

/* Lightbox */
html.nfg-noscroll { overflow: hidden; }
.nfg-lightbox {
	position: fixed; inset: 0; z-index: 99999; background: rgba(8, 12, 24, .97);
	display: grid; grid-template-columns: 64px 1fr 64px; grid-template-rows: 1fr auto; align-items: center;
}
.nfg-lightbox[hidden] { display: none; }
.nfg-lb-stage { grid-column: 2; grid-row: 1; height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 0 8px; min-width: 0; }
.nfg-lb-img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.nfg-lb-video { width: min(100%, 1100px); aspect-ratio: 16 / 9; max-height: calc(100vh - 140px); }
.nfg-lb-video iframe, .nfg-lb-video video { width: 100%; height: 100%; border: 0; border-radius: 6px; background: #000; }
.nfg-lb-foot { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: space-between; gap: 16px; color: #e5e7eb; padding: 12px 24px 20px; font-size: .95em; }
.nfg-lb-counter { white-space: nowrap; opacity: .8; }
.nfg-lb-close, .nfg-lb-nav { appearance: none; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; border-radius: 50%; line-height: 1; padding: 0; }
.nfg-lb-close:hover, .nfg-lb-nav:hover { background: rgba(255,255,255,.25); }
.nfg-lb-close { position: absolute; top: 14px; right: 16px; width: 44px; height: 44px; font-size: 30px; z-index: 2; }
.nfg-lb-nav { width: 48px; height: 48px; font-size: 34px; justify-self: center; grid-row: 1; }
.nfg-lb-prev { grid-column: 1; }
.nfg-lb-next { grid-column: 3; }
.nfg-lb-nav[hidden] { visibility: hidden; display: block; }

@media (max-width: 640px) {
	.nfg { --nfg-gap: 16px; }
	.nfg-lightbox { grid-template-columns: 0 1fr 0; }
	.nfg-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.45); }
	.nfg-lb-prev { left: 8px; }
	.nfg-lb-next { right: 8px; }
	.nfg-tab { padding: 8px 20px; }
}
@media (prefers-reduced-motion: reduce) {
	.nfg-card, .nfg-thumb img { transition: none; }
}

/* When placed inside a theme .container (e.g. the Gallery page template) */
.container > .nfg { max-width: none; padding: 0; }
.nfg-section { padding: 30px 0 50px; }

/* Stacked layout: Photos section, then Videos section */
.nfg--sections .nfg-panel + .nfg-panel { margin-top: 56px; }
.nfg--sections .nfg-filters { justify-content: flex-start; margin-bottom: 32px; }

/* Section heading: bold black title with orange bar, orange subtitle */
.nfg-section-head { margin: 0 0 28px; text-align: left; }
.nfg-section-title {
	position: relative;
	margin: 0;
	padding-left: 18px;
	font-family: 'Poppins', sans-serif;
	font-weight: 700;
	font-size: 44px;
	line-height: 1.15;
	color: #000;
	text-align: left;
}
.nfg-section-title::before {
	content: "";
	position: absolute;
	left: 0;
	top: 12%;
	bottom: 12%;
	width: 6px;
	border-radius: 2px;
	background: var(--nfg-orange);
}
.nfg-section-subtitle {
	margin: 4px 0 0 18px;
	font-family: 'Poppins', sans-serif;
	font-weight: 400;
	font-size: 18px;
	line-height: 1.4;
	color: var(--nfg-orange);
}
@media (max-width: 640px) {
	.nfg-section-title { font-size: 32px; padding-left: 14px; }
	.nfg-section-title::before { width: 5px; }
	.nfg-section-subtitle { font-size: 15px; margin-left: 14px; }
}
