/* ==========================================================================
   SMI Gallery — Frontend
   Matches the established SMI design system:
   navy-to-blue gradient, dotted texture, ambient glow orbs, glass-morphism
   cards, Montserrat, coral (#ff6b5b) / cyan (#4fd1e8) accents.
   ========================================================================== */

.smi-gallery-wrap,
.smi-gallery-hero,
.smi-gallery-body,
.smi-gallery-lightbox {
	font-family: Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	box-sizing: border-box;
}
.smi-gallery-wrap *,
.smi-gallery-hero *,
.smi-gallery-lightbox * {
	box-sizing: border-box;
}

:root {
	--smi-navy: #0a1830;
	--smi-navy-2: #12294f;
	--smi-blue: #2669cb;
	--smi-coral: #ff6b5b;
	--smi-cyan: #4fd1e8;
}

/* ---------- Chips ---------- */
.smi-gallery-chip {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	backdrop-filter: blur(6px);
}
.smi-gallery-chip-coral { background: rgba(255, 107, 91, 0.16); color: #ff6b5b; border: 1px solid rgba(255, 107, 91, 0.35); }
.smi-gallery-chip-cyan  { background: rgba(79, 209, 232, 0.14); color: #4fd1e8; border: 1px solid rgba(79, 209, 232, 0.35); }

/* ---------- Landing grid ---------- */
.smi-gallery-albums-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 28px;
	padding: 8px 0 48px;
}

.smi-gallery-album-card {
	position: relative;
	display: block;
	text-decoration: none;
	border-radius: 18px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(10px);
	transition: transform 0.35s ease, border-color 0.35s ease;
	opacity: 0;
	transform: translateY(24px);
}
.smi-gallery-album-card.is-visible {
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.6s ease, transform 0.6s ease;
}
.smi-gallery-album-card:hover {
	transform: translateY(-6px);
	border-color: rgba(79, 209, 232, 0.4);
}

.smi-gallery-album-cover {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: linear-gradient(135deg, var(--smi-navy), var(--smi-navy-2));
}
.smi-gallery-album-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s ease;
}
.smi-gallery-album-card:hover .smi-gallery-album-cover img {
	transform: scale(1.06);
}
.smi-gallery-album-cover-empty {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--smi-navy), var(--smi-navy-2));
}
.smi-gallery-album-cover .smi-gallery-chip {
	position: absolute;
	top: 12px;
	right: 12px;
}

.smi-gallery-album-meta {
	padding: 16px 18px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.smi-gallery-album-title {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	color: #f4f7fb;
	line-height: 1.3;
}

/* ---------- Hero (single album page) ---------- */
.smi-gallery-hero {
	position: relative;
	overflow: hidden;
	margin-top: -90px;
	padding-top: 90px;
	background: linear-gradient(160deg, var(--smi-navy) 0%, var(--smi-navy-2) 70%);
	color: #f4f7fb;
}
.smi-gallery-hero-texture {
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
	background-size: 22px 22px;
	opacity: 0.5;
	pointer-events: none;
}
.smi-gallery-hero-glow {
	position: absolute;
	border-radius: 50%;
	filter: blur(80px);
	opacity: 0.35;
	pointer-events: none;
	animation: smiGalleryDrift 14s ease-in-out infinite alternate;
}
.smi-gallery-hero-glow-a {
	width: 380px;
	height: 380px;
	top: -120px;
	left: -80px;
	background: var(--smi-coral);
}
.smi-gallery-hero-glow-b {
	width: 420px;
	height: 420px;
	bottom: -160px;
	right: -100px;
	background: var(--smi-cyan);
	animation-delay: -6s;
}
@keyframes smiGalleryDrift {
	from { transform: translate(0, 0); }
	to   { transform: translate(30px, -20px); }
}

.smi-gallery-hero-inner {
	position: relative;
	max-width: 960px;
	margin: 0 auto;
	padding: 140px 24px 72px;
	text-align: left;
}
.smi-gallery-back-link {
	display: inline-block;
	margin-bottom: 20px;
	font-size: 14px;
	font-weight: 600;
	color: #cfe4f5;
	text-decoration: none;
	opacity: 0.85;
}
.smi-gallery-back-link:hover { opacity: 1; color: var(--smi-cyan); }

.smi-gallery-hero-title {
	font-size: clamp(32px, 5vw, 52px);
	font-weight: 700;
	margin: 0 0 14px;
	letter-spacing: -0.01em;
}
.smi-gallery-hero-description {
	font-size: 16px;
	line-height: 1.6;
	color: rgba(244, 247, 251, 0.8);
	max-width: 620px;
	margin-bottom: 18px;
}

/* ---------- Body / masonry grid ---------- */
.smi-gallery-body {
	background: linear-gradient(180deg, var(--smi-navy-2) 0%, var(--smi-navy) 100%);
	padding-bottom: 40px;
}
.smi-gallery-body .smi-gallery-wrap {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 24px;
}

.smi-gallery-masonry {
	column-count: 3;
	column-gap: 16px;
	padding: 12px 0 60px;
}
@media (max-width: 900px) { .smi-gallery-masonry { column-count: 2; } }
@media (max-width: 560px) { .smi-gallery-masonry { column-count: 1; } }

.smi-gallery-tile {
	display: block;
	width: 100%;
	break-inside: avoid;
	margin-bottom: 16px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.04);
	cursor: zoom-in;
	opacity: 0;
	transform: translateY(20px);
}
.smi-gallery-tile.is-visible {
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.5s ease, transform 0.5s ease;
}
.smi-gallery-tile img {
	width: 100%;
	display: block;
	transition: transform 0.5s ease, filter 0.5s ease;
}
.smi-gallery-tile:hover img {
	transform: scale(1.04);
	filter: brightness(1.05);
}

.smi-gallery-notice {
	color: rgba(244, 247, 251, 0.7);
	font-family: Montserrat, sans-serif;
	padding: 40px 0;
}

/* ---------- Lightbox ---------- */
.smi-gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(6, 12, 24, 0.92);
	backdrop-filter: blur(6px);
}
.smi-gallery-lightbox.is-open { display: flex; }

.smi-gallery-lightbox-figure {
	max-width: 88vw;
	max-height: 84vh;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.smi-gallery-lightbox-figure img {
	max-width: 88vw;
	max-height: 76vh;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.smi-gallery-lightbox-figure figcaption {
	margin-top: 12px;
	color: rgba(244, 247, 251, 0.75);
	font-size: 14px;
	text-align: center;
}

.smi-gallery-lightbox-close,
.smi-gallery-lightbox-prev,
.smi-gallery-lightbox-next {
	position: absolute;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.16);
	color: #f4f7fb;
	border-radius: 50%;
	cursor: pointer;
	backdrop-filter: blur(6px);
	transition: background 0.2s ease, border-color 0.2s ease;
}
.smi-gallery-lightbox-close:hover,
.smi-gallery-lightbox-prev:hover,
.smi-gallery-lightbox-next:hover {
	background: rgba(79, 209, 232, 0.18);
	border-color: rgba(79, 209, 232, 0.4);
}
.smi-gallery-lightbox-close {
	top: 24px;
	right: 24px;
	width: 42px;
	height: 42px;
	font-size: 22px;
	line-height: 1;
}
.smi-gallery-lightbox-prev,
.smi-gallery-lightbox-next {
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	font-size: 26px;
}
.smi-gallery-lightbox-prev { left: 20px; }
.smi-gallery-lightbox-next { right: 20px; }

.smi-gallery-lightbox-counter {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 13px;
	color: rgba(244, 247, 251, 0.7);
	letter-spacing: 0.03em;
}

@media (prefers-reduced-motion: reduce) {
	.smi-gallery-album-card,
	.smi-gallery-tile,
	.smi-gallery-hero-glow {
		animation: none !important;
		transition: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
}
