/* =========================================================================
   Sea Winds — lightbox.css
   Premium fullscreen photo lightbox
   ========================================================================= */

.sw-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99990;
	background: rgba(13, 13, 13, 0.97);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
	-webkit-user-select: none;
	user-select: none;
}

.sw-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.sw-lightbox__stage {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sw-lightbox__img {
	max-width: 90vw;
	max-height: 90vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	opacity: 1;
	transition: opacity 0.3s var(--ease);
	pointer-events: none;
	-webkit-user-drag: none;
	user-select: none;
}

.sw-lightbox__img.is-fading {
	opacity: 0;
}

/* Controls */
.sw-lightbox__close,
.sw-lightbox__nav {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--gold);
	background: rgba(17, 17, 17, 0.5);
	border: 1px solid var(--gold-line);
	border-radius: 50%;
	transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.sw-lightbox__close:hover,
.sw-lightbox__nav:hover {
	background: var(--gold);
	color: var(--charcoal);
	border-color: var(--gold);
}

.sw-lightbox__close {
	top: 24px;
	right: 24px;
	width: 48px;
	height: 48px;
}

.sw-lightbox__close svg,
.sw-lightbox__nav svg {
	width: 24px;
	height: 24px;
}

.sw-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 54px;
	height: 54px;
}

.sw-lightbox__nav--prev {
	left: 24px;
}

.sw-lightbox__nav--next {
	right: 24px;
}

.sw-lightbox__counter {
	position: absolute;
	top: 32px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	font-family: var(--font-body);
	font-size: 13px;
	letter-spacing: 0.14em;
	color: var(--warm-white);
	background: rgba(17, 17, 17, 0.5);
	border: 1px solid var(--gold-line);
	padding: 8px 16px;
	border-radius: 100px;
}

/* Prevent any right-click save inside the lightbox. */
.sw-lightbox * {
	-webkit-user-select: none;
	user-select: none;
}

@media (max-width: 768px) {
	.sw-lightbox__nav {
		width: 44px;
		height: 44px;
	}
	.sw-lightbox__nav--prev { left: 12px; }
	.sw-lightbox__nav--next { right: 12px; }
	.sw-lightbox__close { top: 16px; right: 16px; width: 42px; height: 42px; }
	.sw-lightbox__counter { top: 20px; }
}

/* =========================================================================
   Two-tier project lightbox (project-modal.js)
   ========================================================================= */

/* Tier 1 — project modal: a centered 75% white panel on a dimmed backdrop. */
.sw-pmodal {
	position: fixed;
	inset: 0;
	z-index: 99992;
	background: rgba(13, 13, 13, 0.72);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}

.sw-pmodal.is-open {
	opacity: 1;
	visibility: visible;
}

.sw-pmodal__panel {
	width: 75vw;
	height: 75vh;
	max-width: 1200px;
	background: var(--warm-white);
	border: 1px solid var(--gold);
	border-radius: 24px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
	transform: scale(0.97);
	transition: transform 0.35s var(--ease);
}

.sw-pmodal.is-open .sw-pmodal__panel {
	transform: scale(1);
}

.sw-pmodal__head {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 22px 28px;
	border-bottom: 1px solid rgba(201, 169, 110, 0.3);
}

.sw-pmodal__title {
	font-family: var(--font-head);
	font-size: 26px;
	color: var(--charcoal);
	margin: 0;
}

.sw-pmodal__scroll {
	flex: 1;
	overflow-y: auto;
	padding: 26px;
	-webkit-overflow-scrolling: touch;
}

.sw-pmodal__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.sw-pmodal__cell {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 14px;
	background: #ececec;
	border: 1px solid rgba(201, 169, 110, 0.2);
	padding: 0;
	cursor: pointer;
	transition: border-color 0.3s var(--ease);
}

.sw-pmodal__cell img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s var(--ease);
}

.sw-pmodal__cell:hover {
	border-color: var(--gold);
}

.sw-pmodal__cell:hover img {
	transform: scale(1.05);
}

/* Close button sits on the white panel — light-appropriate styling.
   Scoped selector so it wins over the shared dark control style below. */
.sw-pmodal__head .sw-pmodal__close {
	background: transparent;
	border-color: rgba(201, 169, 110, 0.5);
}

.sw-pmodal__head .sw-pmodal__close:hover {
	background: var(--gold);
	border-color: var(--gold);
	color: #fff;
}

/* Shared round controls for both tiers. */
.sw-pmodal__close,
.sw-pviewer__close,
.sw-pviewer__nav {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: var(--gold);
	background: rgba(17, 17, 17, 0.5);
	border: 1px solid var(--gold-line);
	transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.sw-pmodal__close:hover,
.sw-pviewer__close:hover,
.sw-pviewer__nav:hover {
	background: var(--gold);
	color: var(--charcoal);
	border-color: var(--gold);
}

.sw-pmodal__close svg,
.sw-pviewer__close svg,
.sw-pviewer__nav svg {
	width: 22px;
	height: 22px;
}

/* Tier 2 — fullscreen single-photo viewer. */
.sw-pviewer {
	position: fixed;
	inset: 0;
	z-index: 99995;
	background: rgba(13, 13, 13, 0.97);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}

.sw-pviewer.is-open {
	opacity: 1;
	visibility: visible;
}

.sw-pviewer__stage {
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sw-pviewer__img {
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	border-radius: 6px;
	opacity: 1;
	transition: opacity 0.25s var(--ease);
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
}

.sw-pviewer__img.is-fading {
	opacity: 0;
}

.sw-pviewer__close {
	position: absolute;
	top: 24px;
	right: 24px;
}

.sw-pviewer__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 54px;
	height: 54px;
}

.sw-pviewer__nav--prev { left: 24px; }
.sw-pviewer__nav--next { right: 24px; }

.sw-pviewer__counter {
	position: absolute;
	top: 30px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 13px;
	letter-spacing: 0.14em;
	color: var(--warm-white);
	background: rgba(17, 17, 17, 0.5);
	border: 1px solid var(--gold-line);
	padding: 8px 16px;
	border-radius: 100px;
}

@media (max-width: 900px) {
	.sw-pmodal__panel { width: 88vw; height: 82vh; }
	.sw-pmodal__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
	.sw-pmodal { padding: 12px; }
	.sw-pmodal__panel { width: 94vw; height: 88vh; border-radius: 18px; }
	.sw-pmodal__grid { grid-template-columns: 1fr; }
	.sw-pmodal__head { padding: 16px 18px; }
	.sw-pmodal__title { font-size: 20px; }
	.sw-pmodal__scroll { padding: 16px; }
	.sw-pviewer__nav { width: 44px; height: 44px; }
	.sw-pviewer__nav--prev { left: 12px; }
	.sw-pviewer__nav--next { right: 12px; }
	.sw-pviewer__close { top: 16px; right: 16px; }
}
