:root {
	--pg-accent: #1b4965;
	--pg-accent-active: #145374;
	--pg-accent-bg: #e0f2fe;
	--pg-text: #1e293b;
	--pg-muted: #64748b;
	--pg-radius: 12px;
	--pg-grid-gap: 28px;
	--pg-card-ratio: 4 / 3;
	--pg-card-shadow: 0 1px 3px rgba( 15, 23, 42, 0.06 ), 0 10px 28px rgba( 15, 23, 42, 0.08 );
	--pg-card-shadow-hover: 0 6px 14px rgba( 15, 23, 42, 0.1 ), 0 22px 48px rgba( 15, 23, 42, 0.16 );
}

.pg-root {
	--pg-columns: 3;

	color: var( --pg-text );
}

.pg-root *,
.pg-lightbox,
.pg-lightbox * {
	box-sizing: border-box;
}

/* Filter pills */

.pg-filters {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0 0 32px;
}

/* Per-device filter visibility. "Mobile" = <= 600px, the same breakpoint
   where the grid collapses to one column. Pure CSS on purpose: no UA
   sniffing, cache-safe, unaffected by Delay-JS optimizers. */
@media ( min-width: 601px ) {
	.pg-filters-desktop-off .pg-filters {
		display: none !important;
	}
}

@media ( max-width: 600px ) {
	.pg-filters-mobile-off .pg-filters {
		display: none !important;
	}
}

.pg-pill {
	font: inherit;
	font-weight: 600;
	font-size: 14px;
	padding: 10px 22px;
	border-radius: 999px;
	border: 2px solid var( --pg-accent ) !important;
	background: #fff !important;
	color: var( --pg-accent ) !important;
	cursor: pointer;
	box-shadow: none !important;
	text-shadow: none !important;
	text-transform: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.pg-pill:hover {
	background: var( --pg-accent-bg ) !important;
	color: var( --pg-accent ) !important;
}

.pg-pill.is-active {
	background: var( --pg-accent-active ) !important;
	border-color: var( --pg-accent-active ) !important;
	color: #fff !important;
}

/* Grid */

.pg-grid {
	display: grid;
	grid-template-columns: repeat( var( --pg-columns ), 1fr );
	gap: var( --pg-grid-gap, 28px );
}

@media ( max-width: 900px ) {
	.pg-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 600px ) {
	.pg-grid {
		grid-template-columns: 1fr;
	}
}

.pg-card {
	min-width: 0;
	background: #fff;
	border: 1px solid rgba( 15, 23, 42, 0.06 );
	border-radius: var( --pg-radius );
	box-shadow: var( --pg-card-shadow );
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Hover effect is user-selectable (Projects > Gallery Settings). */
.pg-hover-lift .pg-card:hover,
.pg-hover-lift-zoom .pg-card:hover {
	transform: translateY( -6px );
	box-shadow: var( --pg-card-shadow-hover );
}

.pg-hover-lift-zoom .pg-card:hover .pg-slide img,
.pg-hover-lift-zoom .pg-card:hover .pg-slide video {
	transform: scale( 1.05 );
}

.pg-card.is-hidden {
	display: none;
}

/* Card media carousel */

.pg-card-carousel {
	position: relative;
	aspect-ratio: var( --pg-card-ratio, 4 / 3 );
	overflow: hidden;
	background: #0f172a;
	touch-action: pan-y;
	user-select: none;
}

.pg-carousel-track {
	display: flex;
	height: 100%;
	will-change: transform;
}

.pg-carousel-track.pg-no-transition {
	transition: none !important;
}

.pg-slide {
	position: relative;
	flex: 0 0 100%;
	height: 100%;
}

.pg-slide img,
.pg-slide video,
.pg-slide-placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier( 0.22, 0.61, 0.36, 1 );
}

.pg-slide-placeholder {
	background: #334155;
}

.pg-play-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.55 );
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	pointer-events: none;
}

/* While a card video is autoplaying, the play badge would sit on top of the
   moving picture — hide it; it comes back when the video pauses/ends. */
.pg-slide.is-playing .pg-play-badge {
	display: none;
}

.pg-carousel-arrow {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 50%;
	border: none;
	background: rgba( 255, 255, 255, 0.8 ) !important;
	color: var( --pg-text ) !important;
	box-shadow: 0 2px 10px rgba( 15, 23, 42, 0.2 ) !important;
	backdrop-filter: blur( 4px );
	-webkit-backdrop-filter: blur( 4px );
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	line-height: 1;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.pg-card-carousel:hover .pg-carousel-arrow,
.pg-card-carousel:focus-within .pg-carousel-arrow {
	opacity: 1;
}

/* Touchscreens have no hover state, so keep the arrows visible there. */
@media ( hover: none ) {
	.pg-carousel-arrow {
		opacity: 1;
	}
}

.pg-carousel-arrow.pg-prev {
	left: 10px;
}

.pg-carousel-arrow.pg-next {
	right: 10px;
}

.pg-carousel-dots {
	position: absolute;
	bottom: 10px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	gap: 6px;
}

.pg-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.6 );
	cursor: pointer;
}

.pg-dot.is-active {
	background: #fff;
	width: 16px;
	border-radius: 3px;
}

/* Card body */

.pg-card-body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.pg-badge {
	align-self: flex-start;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var( --pg-accent ) !important;
	background: var( --pg-accent-bg ) !important;
	border: 1px solid rgba( 15, 23, 42, 0.05 );
	padding: 4px 12px;
	border-radius: 999px;
	box-shadow: none !important;
	text-shadow: none !important;
}

.pg-card-title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.pg-card-location {
	margin: 0;
	font-size: 14px;
	color: var( --pg-muted );
}

.pg-card-excerpt {
	margin: 0;
	font-size: 14px;
	color: var( --pg-muted );
	flex: 1;
	overflow-wrap: anywhere;
}

.pg-view-details {
	align-self: flex-start;
	margin-top: 10px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font: inherit;
	font-weight: 600;
	font-size: 14px;
	color: var( --pg-accent ) !important;
	background: transparent !important;
	border: 2px solid var( --pg-accent ) !important;
	border-radius: 999px;
	box-shadow: none !important;
	text-shadow: none !important;
	padding: 8px 18px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.pg-view-details .pg-view-arrow {
	display: inline-block;
	transition: transform 0.2s ease;
}

.pg-view-details:hover,
.pg-view-details:focus-visible {
	background: var( --pg-accent ) !important;
	color: #fff !important;
	text-decoration: none;
}

.pg-view-details:hover .pg-view-arrow {
	transform: translateX( 3px );
}

.pg-empty {
	text-align: center;
	color: var( --pg-muted );
}

/* Lightbox */

.pg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba( 15, 23, 42, 0.82 );
	display: flex;
	align-items: flex-start;
	justify-content: center;
	overflow-y: auto;
	padding: 40px 16px;
}

.pg-lightbox[hidden] {
	display: none;
}

body.pg-lightbox-open {
	overflow: hidden;
}

.pg-lightbox-panel {
	background: #fff;
	border-radius: var( --pg-radius );
	max-width: 1100px;
	width: 100%;
	padding: 24px;
	color: var( --pg-text );
	box-shadow: 0 24px 64px rgba( 15, 23, 42, 0.35 );
}

.pg-lightbox-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font: inherit;
	font-weight: 700;
	font-size: 14px;
	color: #fff !important;
	background: var( --pg-accent-active ) !important;
	border: none;
	box-shadow: none !important;
	text-shadow: none !important;
	border-radius: 999px;
	padding: 10px 20px;
	cursor: pointer;
	margin-bottom: 20px;
}

.pg-lightbox-body {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 32px;
}

.pg-lightbox-body > * {
	min-width: 0;
}

@media ( max-width: 800px ) {
	.pg-lightbox-body {
		grid-template-columns: 1fr;
	}
}

.pg-lightbox-media-main {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #0f172a;
	border-radius: var( --pg-radius );
	overflow: hidden;
	touch-action: pan-y;
}

.pg-lightbox-media-main img,
.pg-lightbox-media-main video,
.pg-lightbox-media-main iframe,
.pg-lightbox-media-inner,
.pg-lightbox-media-inner > * {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	aspect-ratio: auto !important;
	object-fit: cover;
	border: none;
	display: block;
	margin: 0;
}

.pg-lightbox-thumbs {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 10px;
	margin-top: 12px;
}

.pg-lightbox-thumb {
	position: relative;
	aspect-ratio: 1;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	border: 3px solid transparent;
	padding: 0;
	background: #334155;
}

.pg-lightbox-thumb.is-active {
	border-color: var( --pg-accent-active ) !important;
}

.pg-lightbox-thumb img,
.pg-lightbox-thumb video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pg-lightbox-thumb .pg-play-badge {
	width: 32px;
	height: 32px;
	font-size: 12px;
}

.pg-lightbox-info .pg-badge {
	margin-bottom: 12px;
}

.pg-lightbox-info h2 {
	margin: 0 0 8px;
	font-size: 28px;
	font-weight: 800;
	overflow-wrap: anywhere;
}

.pg-lightbox-info .pg-card-location {
	margin-bottom: 16px;
	font-size: 15px;
}

.pg-lightbox-info .pg-lightbox-description {
	color: var( --pg-muted );
	line-height: 1.7;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.pg-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 50%;
	border: none;
	background: rgba( 255, 255, 255, 0.85 ) !important;
	color: var( --pg-text ) !important;
	box-shadow: none !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	line-height: 1;
	z-index: 1;
}

.pg-lightbox-nav.pg-prev {
	left: 12px;
}

.pg-lightbox-nav.pg-next {
	right: 12px;
}

/* Respect users who turn off animations at the OS level. */
@media ( prefers-reduced-motion: reduce ) {
	.pg-card,
	.pg-slide img,
	.pg-slide video,
	.pg-view-details,
	.pg-view-details .pg-view-arrow {
		transition: none;
	}

	.pg-hover-lift .pg-card:hover,
	.pg-hover-lift-zoom .pg-card:hover {
		transform: none;
	}

	.pg-hover-lift-zoom .pg-card:hover .pg-slide img,
	.pg-hover-lift-zoom .pg-card:hover .pg-slide video {
		transform: none;
	}
}

/* Small phones: reclaim space and scale text down a bit. */
@media ( max-width: 600px ) {
	.pg-lightbox {
		padding: 16px 8px;
	}

	.pg-lightbox-panel {
		padding: 16px;
	}

	.pg-lightbox-thumbs {
		gap: 6px;
	}

	.pg-lightbox-info h2 {
		font-size: 22px;
	}

	.pg-card-title {
		font-size: 18px;
	}
}

/* ------------------------------------------------------------------ *
 * Link mode (v1.4.0): trimmed cards that link out instead of opening
 * the lightbox. .pg-mode-link is set on the gallery root.
 * ------------------------------------------------------------------ */
.pg-mode-link .pg-card {
	position: relative;
}

/* whole-card click: invisible overlay above everything on the card */
.pg-card-overlay {
	position: absolute;
	inset: 0;
	z-index: 5;
}

.pg-card--linked {
	cursor: pointer;
}

/* title-as-link keeps the title's own styling */
.pg-title-link {
	color: inherit;
	text-decoration: none;
}

.pg-title-link:hover,
.pg-title-link:focus-visible {
	color: var( --pg-accent );
	text-decoration: none;
}

/* the button is an <a> in link mode; keep the button look */
a.pg-view-details {
	text-decoration: none;
}
