/* ==========================================================================
   Gallery v2 (flag `photo-gallery-v2`)
   - .sg   the resort/holiday gallery (component_gallery), scgb-gallery.js
   - .sgl  the PhotoSwipe caption bar
   - .pgx  the filterable photos page (v2_component_photo_gallery), photos-bridge.js

   Loaded only on pages that render one of these, never in bundle.css.
   ========================================================================== */

/* `hidden` must win. scgb-member also ships this rule, but it's what keeps an
   unlaunched feature off the page, so it's not left to another plugin. */
.sg[hidden],
.pgx[hidden],
.sg [hidden],
.pgx [hidden],
.sg-host--solo[hidden] { display: none !important; }

/* Nothing from the editor and no member photographs (yet): no empty frame.
   A section the editor hid ships for member photos only, so with none it
   drops its padding too, rather than leaving a gap. */
.sg--empty,
.sg-host--solo:has(.sg--empty) { display: none !important; }

/* --------------------------------------------------------------------------
   Carousel
   -------------------------------------------------------------------------- */

.sg {
	--sg-radius: 6px;
	--sg-ratio: 3 / 2;
	position: relative;
	margin: 0 auto;
	max-width: 1140px;
}

@media (min-width: 992px) {
	.sg { --sg-ratio: 16 / 9; }
}

.sg-stage { position: relative; }

.sg-track {
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	border-radius: var(--sg-radius);
	background: #0e1a24;
	aspect-ratio: var(--sg-ratio);
	outline: none;
}

.sg-track::-webkit-scrollbar { display: none; }

.sg-track:focus-visible { box-shadow: 0 0 0 3px var(--sk-primary, #0b5cad); }

.sg-slide {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	margin: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	position: relative;
}

.sg-open {
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
}

.sg-slide .sg-img,
.sg-slide img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

/* Buttons: 44px targets, visible against any photograph. */
.sg-nav,
.sg-expand {
	position: absolute;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: #10202e;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .22);
	cursor: pointer;
	transition: opacity .15s ease, transform .15s ease;
}

.sg-nav svg,
.sg-expand svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sg-nav { top: 50%; transform: translateY(-50%); }
.sg-prev { left: 12px; }
.sg-next { right: 12px; }
.sg-nav:disabled { opacity: 0; pointer-events: none; }
.sg-nav:hover { transform: translateY(-50%) scale(1.06); }

.sg-expand { top: 12px; right: 12px; width: 40px; height: 40px; }
.sg-expand svg { width: 18px; height: 18px; }

.sg--single .sg-nav,
.sg--single .sg-count,
.sg--single .sg-thumbs { display: none; }

/* Phones swipe; arrows only crowd a small photo. */
@media (hover: none) and (max-width: 767px) {
	.sg-nav { display: none; }
}

.sg-count {
	position: absolute;
	z-index: 2;
	right: 12px;
	bottom: 12px;
	margin: 0;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 13px;
	line-height: 1.5;
	font-variant-numeric: tabular-nums;
}

.sg-badge {
	position: absolute;
	z-index: 2;
	left: 12px;
	bottom: 12px;
	max-width: calc(100% - 120px);
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 13px;
	line-height: 1.5;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Report: top-left over the photo, white like the badge. Outside the track,
   which clips horizontally, so its form can open downward over the photo. */
.sg-report {
	position: absolute;
	z-index: 3;
	left: 12px;
	top: 12px;
}

.sg-report .ph-report-open,
.sg-report .ph-report-done {
	font-size: 12.5px;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

.sg-report .ph-report-form { left: 0; right: auto; }

/* Thumbnails */
.sg-thumbs {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	padding: 2px 2px 4px;
	overflow-x: auto;
	scrollbar-width: thin;
	scroll-snap-type: x proximity;
}

.sg-thumb {
	flex: 0 0 auto;
	width: 88px;
	height: 58px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	overflow: hidden;
	background: #dfe5ea;
	opacity: .62;
	cursor: pointer;
	scroll-snap-align: start;
	outline-offset: 2px;
	transition: opacity .15s ease;
}

.sg-thumb:hover,
.sg-thumb:focus-visible { opacity: .9; }

.sg-thumb.is-active {
	opacity: 1;
	box-shadow: 0 0 0 2px var(--sk-primary, #0b5cad);
}

.sg-thumb-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

@media (max-width: 575px) {
	.sg-thumb { width: 64px; height: 44px; }
	.sg-track { border-radius: 0; }
}

.sg-caption { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
	.sg-nav, .sg-expand, .sg-thumb { transition: none; }
}

/* --------------------------------------------------------------------------
   Lightbox caption (PhotoSwipe element `scgb-caption`)
   -------------------------------------------------------------------------- */

.pswp__scgb-caption {
	position: absolute;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	width: min(720px, calc(100% - 32px));
	padding: 10px 14px;
	border-radius: 8px;
	background: rgba(0, 0, 0, .62);
	color: #fff;
	font-size: 14px;
	line-height: 1.45;
	text-align: center;
	pointer-events: auto;
}

.sgl-cap { margin: 0 0 4px; }
.sgl-cap:last-child { margin: 0; }

.sgl-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px 10px;
	margin: 0;
	font-size: 13px;
}

.sgl-credit { opacity: .85; }

.sgl-act {
	font: inherit;
	padding: 2px 10px;
	border: 1px solid rgba(255, 255, 255, .45);
	border-radius: 999px;
	background: none;
	color: #fff;
	text-decoration: none;
	cursor: pointer;
}

.sgl-act:hover,
.sgl-act:focus-visible { background: rgba(255, 255, 255, .16); color: #fff; }

/* --------------------------------------------------------------------------
   Photos page
   -------------------------------------------------------------------------- */

.pgx { --pgx-row-h: 240px; --pgx-gap: 8px; }

@media (max-width: 991px) { .pgx { --pgx-row-h: 190px; } }
@media (max-width: 575px) { .pgx { --pgx-row-h: 140px; --pgx-gap: 4px; } }

.pgx-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 24px;
	margin-bottom: 18px;
}

.pgx-heading { margin: 0 0 4px; }

.pgx-sub { margin: 0; color: var(--sk-gray-75, #5b6670); }
.pgx-count { font-weight: 600; color: var(--sk-body-text, #1d2a35); }
.pgx-count:not(:empty) + .pgx-intro::before { content: " · "; }

.pgx-add {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 4px;
	background: var(--sk-primary, #0b5cad);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.pgx-add:hover, .pgx-add:focus-visible { color: #fff; opacity: .92; }

/* Filter bar */
.pgx-bar { margin: 0 0 10px; padding: 4px 0; }

.pgx-toggle {
	display: none;
	font: inherit;
	font-weight: 600;
	padding: 9px 16px;
	border: 1px solid var(--sk-border, #d5dbe0);
	border-radius: 999px;
	background: var(--sk-white, #fff);
	cursor: pointer;
}

.pgx-panel {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
}

.pgx-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	min-width: 180px;
	flex: 1 1 180px;
	max-width: 260px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--sk-gray-75, #5b6670);
}

.pgx-field select {
	font: inherit;
	font-size: 15px;
	font-weight: 400;
	color: var(--sk-body-text, #1d2a35);
	height: 44px;
	padding: 0 10px;
	border: 1px solid var(--sk-border, #d5dbe0);
	border-radius: 6px;
	background-color: var(--sk-white, #fff);
}

.pgx-field select:disabled { opacity: .55; }

.pgx-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	flex: 1 1 100%;
}

.pgx-chip {
	font: inherit;
	font-size: 13.5px;
	padding: 5px 12px;
	border: 1px solid var(--sk-border, #d5dbe0);
	border-radius: 999px;
	background: var(--sk-white, #fff);
	color: var(--sk-body-text, #1d2a35);
	cursor: pointer;
}

.pgx-chip.is-on {
	border-color: var(--sk-primary, #0b5cad);
	background: var(--sk-primary, #0b5cad);
	color: #fff;
}

.pgx-active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin: 0 0 14px;
}

.pgx-pill {
	font: inherit;
	font-size: 13.5px;
	padding: 5px 10px 5px 12px;
	border: 0;
	border-radius: 999px;
	background: #e7eef5;
	color: var(--sk-body-text, #1d2a35);
	cursor: pointer;
}

.pgx-pill::after { content: "×"; margin-left: 8px; font-weight: 700; }

.pgx-clear {
	font: inherit;
	font-size: 13.5px;
	border: 0;
	padding: 0 4px;
	background: none;
	color: var(--sk-primary, #0b5cad);
	text-decoration: underline;
	cursor: pointer;
}

@media (max-width: 767px) {
	.pgx-toggle { display: inline-block; }
	.pgx-panel { display: none; margin-top: 12px; }
	.pgx-panel.is-open { display: flex; }
	.pgx-field { max-width: none; flex-basis: 100%; }
}

/* Justified rows: each cell grows by its aspect ratio, so rows fill the width
   with nothing cropped much and no layout pass in JS. */
.pgx-grid {
	display: flex;
	flex-wrap: wrap;
	gap: var(--pgx-gap);
}

.pgx-grid[aria-busy="true"] { opacity: .55; transition: opacity .2s ease; }

.pgx-cell {
	position: relative;
	height: var(--pgx-row-h);
	min-width: 0;
}

.pgx-filler { flex-grow: 10; height: 0; }

.pgx-open {
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: 4px;
	background: #dfe5ea;
	cursor: zoom-in;
}

.pgx-open img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .3s ease;
}

.pgx-open:hover img { transform: scale(1.03); }

.pgx-credit {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 18px 10px 7px;
	background: linear-gradient(transparent, rgba(0, 0, 0, .6));
	color: #fff;
	font-size: 12.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0;
	transition: opacity .15s ease;
	pointer-events: none;
}

.pgx-cell:hover .pgx-credit,
.pgx-cell:focus-within .pgx-credit { opacity: 1; }

@media (hover: none) {
	.pgx-credit { opacity: 1; }
}

/* Report overlays the cell, top-right, like the rail. */
.pgx-cell .ph-report {
	position: absolute;
	right: 8px;
	top: 6px;
	z-index: 2;
	opacity: 0;
	transition: opacity .15s ease;
}

.pgx-cell:hover .ph-report,
.pgx-cell:focus-within .ph-report { opacity: 1; }

.pgx-cell .ph-report-open,
.pgx-cell .ph-report-done {
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
}

.pgx-status { margin: 16px 0 0; color: var(--sk-gray-75, #5b6670); font-size: 14px; }

.pgx-more-wrap { text-align: center; margin-top: 18px; }

.pgx-more {
	font: inherit;
	font-weight: 600;
	min-height: 44px;
	padding: 10px 26px;
	border: 1px solid var(--sk-primary, #0b5cad);
	border-radius: 999px;
	background: var(--sk-white, #fff);
	color: var(--sk-primary, #0b5cad);
	cursor: pointer;
}

.pgx-more:disabled { opacity: .55; cursor: default; }

@media (prefers-reduced-motion: reduce) {
	.pgx-open img, .pgx-credit, .pgx-cell .ph-report, .pgx-grid[aria-busy="true"] { transition: none; }
	.pgx-open:hover img { transform: none; }
}
