/**
 * Momen Tamu gallery styles (Phase 7D) — loaded ONLY on the
 * /momen-tamu/{token} route, alongside folkthemes-momen-guest.css.
 *
 * Scope: this file styles ONLY the gallery section + its lightbox. It does
 * not touch the approved Phase 7C upload card and does not touch any global
 * customer modal styles. Reuses the Phase 7C design tokens.
 */

.folkt-momen-page .folkt-momen-gallery {
	width: 100%;
	max-width: 960px;
	margin: 32px auto 0;
	padding: 0 4px;
}

.folkt-momen-page .folkt-momen-gallery-head {
	text-align: center;
	margin-bottom: 18px;
}

.folkt-momen-page .folkt-momen-gallery-title {
	font-size: 20px;
	line-height: 1.3;
	color: var(--folk-text-dark, #111827);
	margin: 0 0 4px;
	font-weight: 700;
}

.folkt-momen-page .folkt-momen-gallery-sub {
	font-size: 13px;
	color: var(--folk-muted, #6b7280);
	margin: 0;
	line-height: 1.55;
}

/* ---------- Responsive grid ---------- */

.folkt-momen-page .folkt-momen-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.folkt-momen-item {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	margin: 0;
	border: 1px solid var(--folk-card-border, #e2e8e5);
	border-radius: var(--folk-radius-md, 10px);
	background: var(--folk-card-bg, #ffffff);
	overflow: hidden;
	cursor: pointer;
	aspect-ratio: 1 / 1;
	box-shadow: var(--folk-shadow-subtle);
	transition: transform .12s ease, box-shadow .12s ease;
}

.folkt-momen-item:hover {
	transform: translateY(-1px);
	box-shadow: var(--folk-shadow-card);
}

.folkt-momen-item:focus-visible {
	outline: 2px solid var(--folk-brand, #25b9ba);
	outline-offset: 2px;
}

.folkt-momen-item img,
.folkt-momen-item video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #eef2f1;
}

.folkt-momen-item--video .folkt-momen-item-badge {
	position: absolute;
	right: 6px;
	bottom: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 9999px;
	background: rgba(17, 24, 39, .72);
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .02em;
	pointer-events: none;
}

/* ---------- Loading skeleton (no layout jump) ---------- */

.folkt-momen-item--skeleton {
	background: linear-gradient(100deg, #eef2f1 30%, #f7faf9 50%, #eef2f1 70%);
	background-size: 220% 100%;
	animation: folkt-momen-shimmer 1.25s ease-in-out infinite;
	border-color: var(--folk-card-border, #e2e8e5);
	cursor: default;
}

@keyframes folkt-momen-shimmer {
	0%   { background-position: 130% 0; }
	100% { background-position: -30% 0; }
}

@media (prefers-reduced-motion: reduce) {
	.folkt-momen-item--skeleton {
		animation: none;
	}
}

/* ---------- Empty / error states ---------- */

.folkt-momen-page .folkt-momen-gallery-empty,
.folkt-momen-page .folkt-momen-gallery-error {
	background: var(--folk-card-bg, #ffffff);
	border: 1px solid var(--folk-card-border, #e2e8e5);
	border-radius: var(--folk-radius-lg, 16px);
	box-shadow: var(--folk-shadow-card);
	padding: 32px 22px;
	text-align: center;
	color: var(--folk-muted, #6b7280);
}

.folkt-momen-page .folkt-momen-gallery-empty .folkt-momen-empty-icon {
	color: var(--folk-brand, #25b9ba);
	margin-bottom: 10px;
}

.folkt-momen-page .folkt-momen-empty-title {
	font-size: 15px;
	font-weight: 700;
	color: var(--folk-text-dark, #111827);
	margin: 0 0 6px;
}

.folkt-momen-page .folkt-momen-empty-body {
	font-size: 13px;
	margin: 0;
	line-height: 1.55;
}

.folkt-momen-page .folkt-momen-gallery-retry {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 14px;
	min-height: 38px;
	padding: 8px 16px;
	border: 1px solid var(--folk-brand, #25b9ba);
	border-radius: 10px;
	background: var(--folk-brand, #25b9ba);
	color: #ffffff;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.folkt-momen-page .folkt-momen-gallery-retry:hover {
	background: var(--folk-brand-dark, #1d9697);
	border-color: var(--folk-brand-dark, #1d9697);
}

/* ---------- Load more ---------- */

.folkt-momen-page .folkt-momen-gallery-more {
	display: flex;
	justify-content: center;
	margin-top: 18px;
}

.folkt-momen-page .folkt-momen-more-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 42px;
	padding: 9px 20px;
	border: 1px solid var(--folk-brand-border, #bce8e8);
	border-radius: 12px;
	background: var(--folk-card-bg, #ffffff);
	color: var(--folk-brand-dark, #1d9697);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}

.folkt-momen-page .folkt-momen-more-btn:hover:not(:disabled) {
	background: var(--folk-brand-subtle, #e9f8f8);
	border-color: var(--folk-brand, #25b9ba);
}

.folkt-momen-page .folkt-momen-more-btn:disabled {
	opacity: .7;
	cursor: wait;
}

.folkt-momen-more-spinner {
	width: 14px;
	height: 14px;
	border: 2px solid var(--folk-brand-border, #bce8e8);
	border-top-color: var(--folk-brand, #25b9ba);
	border-radius: 50%;
	animation: folkt-momen-spin .7s linear infinite;
}

@keyframes folkt-momen-spin {
	to { transform: rotate(360deg); }
}

.folkt-momen-gallery-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Lightbox (Momen-scoped only) ---------- */

.folkt-momen-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 16px;
	background: rgba(15, 23, 32, .92);
}

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

.folkt-momen-lightbox-title {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.folkt-momen-lightbox-media {
	max-width: min(100%, 900px);
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.folkt-momen-lightbox-media img {
	max-width: 100%;
	max-height: 86vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
	background: #111827;
}

.folkt-momen-lightbox-media video {
	max-width: 100%;
	max-height: 86vh;
	width: auto;
	height: auto;
	border-radius: 8px;
	background: #000000;
}

.folkt-momen-lightbox-close,
.folkt-momen-lightbox-nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	flex: 0 0 auto;
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 9999px;
	background: rgba(255, 255, 255, .12);
	color: #ffffff;
	cursor: pointer;
	transition: background .15s ease;
}

.folkt-momen-lightbox-close:hover,
.folkt-momen-lightbox-nav:hover {
	background: rgba(255, 255, 255, .24);
}

.folkt-momen-lightbox-close:focus-visible,
.folkt-momen-lightbox-nav:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

.folkt-momen-lightbox-close {
	position: absolute;
	top: max(16px, env(safe-area-inset-top));
	right: max(16px, env(safe-area-inset-right));
}

.folkt-momen-lightbox-nav--hidden {
	visibility: hidden;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
	.folkt-momen-page .folkt-momen-gallery {
		margin-top: 24px;
	}

	.folkt-momen-page .folkt-momen-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.folkt-momen-page .folkt-momen-gallery-title {
		font-size: 18px;
	}

	.folkt-momen-lightbox {
		gap: 6px;
		padding: 8px;
	}

	.folkt-momen-lightbox-close,
	.folkt-momen-lightbox-nav {
		width: 38px;
		height: 38px;
	}
}
