/* ==========================================================================
   Surf the Sky - Frontend Styles
   Inspired by haimvemavet.com
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* Reset within gallery scope */
.sts-gallery,
.sts-gallery *,
.sts-gallery *::before,
.sts-gallery *::after {
	box-sizing: border-box;
}

.sts-gallery {
	--sts-bg: #ffffff;
	--sts-text: rgba(0, 0, 0, 0.85);
	--sts-text-muted: rgba(0, 0, 0, 0.75);
	--sts-marquee-height: 70px;
	--sts-columns: 4;
	--sts-gap: 4px;
	--sts-font: 'Space Mono', 'Courier New', monospace;

	position: relative;
	background: var(--sts-bg);
	color: var(--sts-text);
	font-family: var(--sts-font);
	min-height: 100vh;
	padding-bottom: var(--sts-marquee-height);
	opacity: 0;
	transition: opacity 0.9s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sts-gallery.sts-is-loaded {
	opacity: 1;
}

.sts-gallery--fullscreen {
	position: fixed;
	inset: 0;
	z-index: 99999;
	overflow-y: auto;
}

/* Masonry Grid */
.sts-masonry {
	column-count: var(--sts-columns);
	column-gap: var(--sts-gap);
	padding: var(--sts-gap);
}

.sts-masonry__item {
	break-inside: avoid;
	margin-bottom: var(--sts-gap);
	position: relative;
}

.sts-masonry__trigger {
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	line-height: 0;
}

.sts-masonry__trigger img {
	width: 100%;
	height: auto;
	display: block;
	transition: opacity 0.3s ease;
}

/* Tattooed state - slightly darkened */
.sts-masonry__item--tattooed .sts-masonry__trigger > img:first-child {
	opacity: 0.45;
}

.sts-masonry__item--tattooed:hover .sts-masonry__trigger > img:first-child {
	opacity: 0;
}

.sts-masonry__hover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.sts-masonry__item--tattooed:hover .sts-masonry__hover {
	opacity: 1;
}

.sts-masonry__trigger:active {
	opacity: 0.7;
}

/* Lightbox */
.sts-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sts-lightbox[hidden] {
	display: none;
}

.sts-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: var(--sts-bg);
}

.sts-lightbox__content {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 80px 100px;
}

.sts-lightbox__image-wrap {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-height: calc(100vh - 160px);
	overflow: hidden;
}

.sts-lightbox__image {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.sts-lightbox__close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	color: rgba(0, 0, 0, 0.4);
	transition: color 0.2s;
	z-index: 2;
}

.sts-lightbox__close:hover {
	color: var(--sts-text);
}

.sts-lightbox__close svg {
	width: 24px;
	height: 24px;
}

.sts-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.08);
	cursor: pointer;
	color: rgba(0, 0, 0, 0.5);
	transition: background 0.2s, color 0.2s;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sts-lightbox__nav:hover {
	background: rgba(0, 0, 0, 0.15);
	color: var(--sts-text);
}

.sts-lightbox__nav svg {
	width: 20px;
	height: 20px;
}

.sts-lightbox__nav--prev {
	left: 20px;
}

.sts-lightbox__nav--next {
	right: 20px;
}

.sts-lightbox__talk {
	position: absolute;
	bottom: calc(var(--sts-marquee-height) + 20px);
	left: 50%;
	transform: translateX(-50%);
	font-family: var(--sts-font);
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--sts-text-muted);
	text-decoration: none;
	padding: 12px 24px;
	border: none;
	background: none;
	cursor: pointer;
	transition: opacity 0.2s;
	z-index: 2;
}

.sts-lightbox__talk:hover {
	opacity: 0.6;
}

/* Marquee Strip */
.sts-marquee {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: var(--sts-marquee-height);
	background: var(--sts-bg);
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	overflow: hidden;
	z-index: 100001;
	display: flex;
	align-items: center;
}

.sts-marquee__inner {
	display: flex;
	width: max-content;
	flex-wrap: nowrap;
	will-change: transform;
	backface-visibility: hidden;
}

.sts-marquee__group {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	gap: 3em;
	padding-right: 3em;
	white-space: nowrap;
	font-size: clamp(0.75rem, 2vw, 1.1rem);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--sts-text-muted);
}

/* Legacy class alias */
.sts-marquee__segment {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	gap: 3em;
	padding-right: 3em;
	white-space: nowrap;
	font-size: clamp(0.75rem, 2vw, 1.1rem);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--sts-text-muted);
}

.sts-marquee__item {
	display: inline-flex;
	align-items: center;
}

.sts-marquee__link {
	color: inherit;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	transition: opacity 0.2s;
}

.sts-marquee__link:hover {
	opacity: 0.6;
}

.sts-marquee__text {
	display: inline-block;
}

.sts-icon {
	width: 1.2em;
	height: 1.2em;
	display: inline-block;
	vertical-align: middle;
}

.sts-marquee__clock {
	display: inline-block;
}

/* Responsive */
@media (max-width: 1200px) {
	.sts-gallery {
		--sts-columns: 3;
	}
}

@media (max-width: 768px) {
	.sts-gallery {
		--sts-columns: 2;
		--sts-marquee-height: 56px;
	}

	.sts-lightbox__content {
		padding: 50px 16px 80px;
	}

	.sts-lightbox__nav {
		width: 36px;
		height: 36px;
	}

	.sts-lightbox__nav--prev {
		left: 8px;
	}

	.sts-lightbox__nav--next {
		right: 8px;
	}

	.sts-lightbox__talk {
		font-size: 0.9rem;
		bottom: calc(var(--sts-marquee-height) + 12px);
	}
}

@media (max-width: 480px) {
	.sts-gallery {
		--sts-columns: 2;
		--sts-gap: 2px;
	}
}

/* Body lock when lightbox open */
body.sts-lightbox-open {
	overflow: hidden;
}
