/* ==========================================================================
   Gallery Position Switcher — Frontend Styles
   ========================================================================== */

.gps-wrap {
	--gps-ink: #1a1f1a;
	--gps-ink-muted: #6b6b66;
	--gps-accent: #2d4a2d;
	--gps-border: #e0ddd5;
	--gps-card: #ffffff;
	--gps-overlay: rgba(10, 12, 10, 0.92);
	position: relative;
	font-family: inherit;
	color: var(--gps-ink);
}

.gps-wrap *,
.gps-wrap *::before,
.gps-wrap *::after { box-sizing: border-box; }

/* ---------- Switcher bar ---------- */
.gps-switcher-bar {
	display: flex;
	justify-content: flex-start;
	margin-bottom: 28px;
}

.gps-switcher {
	display: inline-flex;
	padding: 4px;
	background: var(--gps-card);
	border: 1px solid var(--gps-border);
	border-radius: 999px;
	gap: 2px;
}

.gps-switch {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 0;
	background: transparent;
	color: var(--gps-ink-muted);
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	padding: 8px 14px;
	border-radius: 999px;
	cursor: pointer;
	transition: color .2s ease, background-color .2s ease, transform .15s ease;
	line-height: 1;
}

.gps-switch:hover { color: var(--gps-ink); }
.gps-switch:focus-visible { outline: 2px solid var(--gps-accent); outline-offset: 2px; }

.gps-switch.is-active {
	background: var(--gps-ink);
	color: #fff;
}

.gps-switch svg { flex-shrink: 0; }

/* ---------- Stage layout ---------- */
.gps-stage {
	display: grid;
	gap: 64px;
	align-items: center;
	transition: opacity .35s ease;
}

.gps-stage.gps-layout-left {
	grid-template-columns: 1fr 1fr;
	grid-template-areas: "gallery content";
}

.gps-stage.gps-layout-right {
	grid-template-columns: 1fr 1fr;
	grid-template-areas: "content gallery";
}

.gps-stage.gps-layout-top {
	grid-template-columns: 1fr;
	grid-template-areas: "gallery" "content";
}

.gps-content { grid-area: content; min-width: 0; }
.gps-gallery { grid-area: gallery; min-width: 0; }

.gps-stage.gps-is-transitioning { opacity: 0; }

/* View Transitions API support */
@supports (view-transition-name: foo) {
	.gps-stage { view-transition-name: gps-stage; }
}

/* ---------- Content ---------- */
.gps-heading {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 600;
	line-height: 1.1;
	margin: 0 0 14px;
	color: var(--gps-ink);
	letter-spacing: -0.01em;
}

.gps-subheading {
	font-size: 0.95rem;
	color: var(--gps-ink-muted);
	margin: 0 0 18px;
	letter-spacing: 0.02em;
	line-height: 1.5;
}

.gps-paragraph {
	font-size: 1rem;
	line-height: 1.7;
	color: var(--gps-ink-muted);
	margin: 0 0 28px;
	max-width: 52ch;
}

.gps-content[style*="text-align: center"] .gps-paragraph,
.gps-content[style*="text-align:center"] .gps-paragraph { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.gps-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: flex-start;
}

.gps-btn {
	display: inline-block;
	padding: 12px 26px;
	border-radius: 999px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	letter-spacing: 0.02em;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
	line-height: 1.4;
}

.gps-btn:hover { transform: translateY(-1px); }
.gps-btn:focus-visible { outline: 2px solid var(--gps-accent); outline-offset: 2px; }

.gps-btn-primary {
	background: var(--gps-accent);
	color: #fff;
}
.gps-btn-primary:hover { background: #1f3520; color: #fff; }

.gps-btn-secondary {
	background: transparent;
	color: var(--gps-ink);
	border-color: var(--gps-border);
}
.gps-btn-secondary:hover { border-color: var(--gps-ink); color: var(--gps-ink); }

/* ---------- Gallery ---------- */
.gps-gallery {
	position: relative;
	aspect-ratio: 16 / 10;
	width: 100%;
}

.gps-slides {
	position: relative;
	width: 100%;
	height: 100%;
}

.gps-slide {
	position: absolute;
	inset: 0;
	border-radius: 18px;
	overflow: hidden;
	opacity: 0;
	transform: scale(.94);
	transition: opacity .55s cubic-bezier(.22,1,.36,1), transform .55s cubic-bezier(.22,1,.36,1);
	pointer-events: none;
	cursor: zoom-in;
	box-shadow: 0 20px 40px -22px rgba(20, 30, 20, .35);
	background: #f0eee9;
}

.gps-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gps-slide.is-active {
	opacity: 1;
	transform: scale(1) translateX(0) rotate(0);
	pointer-events: auto;
	z-index: 3;
}

/* Stacked card effect — peek of adjacent images */
.gps-has-stack .gps-slide.is-next {
	opacity: 1;
	transform: scale(.95) translateX(4%) rotate(3deg);
	z-index: 2;
}

.gps-has-stack .gps-slide.is-prev {
	opacity: 1;
	transform: scale(.95) translateX(-4%) rotate(-3deg);
	z-index: 1;
}

.gps-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border-radius: 18px;
	border: 1px dashed var(--gps-border);
	color: var(--gps-ink-muted);
	font-size: 14px;
	text-align: center;
	padding: 24px;
	background: #fafaf7;
}

/* ---------- Arrows ---------- */
.gps-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.95);
	color: var(--gps-ink);
	cursor: pointer;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0,0,0,.15);
	transition: transform .2s ease, background-color .2s ease;
}

.gps-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.gps-arrow:focus-visible { outline: 2px solid var(--gps-accent); outline-offset: 2px; }

.gps-prev { left: 14px; }
.gps-next { right: 14px; }

/* ---------- Dots ---------- */
.gps-dots {
	position: absolute;
	bottom: -28px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	z-index: 5;
}

.gps-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 0;
	background: rgba(0, 0, 0, .2);
	cursor: pointer;
	padding: 0;
	transition: background-color .2s ease, transform .2s ease;
}

.gps-dot:hover { background: rgba(0, 0, 0, .35); }
.gps-dot:focus-visible { outline: 2px solid var(--gps-accent); outline-offset: 2px; }
.gps-dot.is-active { background: var(--gps-accent); transform: scale(1.3); }

/* ---------- Lightbox ---------- */
.gps-lightbox {
	position: fixed;
	inset: 0;
	background: var(--gps-overlay);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	animation: gps-fade-in .25s ease;
}

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

@keyframes gps-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.gps-lb-figure {
	margin: 0;
	max-width: 90vw;
	max-height: 70vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.gps-lb-image {
	max-width: 100%;
	max-height: 65vh;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.gps-lb-caption {
	color: rgba(255,255,255,.7);
	font-size: 13px;
	letter-spacing: 0.02em;
}

.gps-lb-close,
.gps-lb-prev,
.gps-lb-next {
	position: absolute;
	background: rgba(255, 255, 255, .1);
	color: #fff;
	border: 0;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color .2s ease, transform .15s ease;
	backdrop-filter: blur(8px);
}

.gps-lb-close:hover,
.gps-lb-prev:hover,
.gps-lb-next:hover {
	background: rgba(255, 255, 255, .22);
}

.gps-lb-close:focus-visible,
.gps-lb-prev:focus-visible,
.gps-lb-next:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.gps-lb-close { top: 24px; right: 24px; }
.gps-lb-prev  { left: 24px;  top: 50%; transform: translateY(-50%); }
.gps-lb-next  { right: 24px; top: 50%; transform: translateY(-50%); }
.gps-lb-prev:hover { transform: translateY(-50%) scale(1.08); }
.gps-lb-next:hover { transform: translateY(-50%) scale(1.08); }

.gps-lb-thumbs {
	position: absolute;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	max-width: 90vw;
	overflow-x: auto;
	padding: 8px;
	scrollbar-width: thin;
}

.gps-lb-thumbs::-webkit-scrollbar { height: 4px; }
.gps-lb-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 2px; }

.gps-lb-thumb {
	width: 64px;
	height: 64px;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	opacity: .55;
	transition: opacity .2s ease, transform .15s ease;
	flex-shrink: 0;
	border: 2px solid transparent;
	background: transparent;
	padding: 0;
}

.gps-lb-thumb:hover { opacity: .85; }
.gps-lb-thumb.is-active { opacity: 1; border-color: #fff; }
.gps-lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.gps-stage { gap: 40px; }
}

@media (max-width: 768px) {
	.gps-stage,
	.gps-stage.gps-layout-left,
	.gps-stage.gps-layout-right,
	.gps-stage.gps-layout-top {
		grid-template-columns: 1fr;
		grid-template-areas: "gallery" "content";
		gap: 32px;
	}

	.gps-switcher-bar { justify-content: center; }
	.gps-switch span { display: none; }
	.gps-switch { padding: 8px 12px; }

	.gps-arrow { width: 38px; height: 38px; }
	.gps-prev { left: 8px; }
	.gps-next { right: 8px; }

	.gps-lb-thumb { width: 50px; height: 50px; }
	.gps-lb-close { top: 14px; right: 14px; }
}

@media (max-width: 480px) {
	.gps-heading { font-size: 1.75rem; }
	.gps-buttons { gap: 8px; }
	.gps-btn { padding: 10px 20px; font-size: 13px; }
	.gps-lb-thumbs { bottom: 12px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.gps-stage,
	.gps-slide,
	.gps-arrow,
	.gps-dot,
	.gps-btn,
	.gps-switch,
	.gps-lightbox { transition: none !important; animation: none !important; }
}
