/* Sticker Nation Recent Work — frontend */

.sn-rw {
	position: relative;
	margin: 2rem 0;
	--sn-rw-gap: 8px;
	--sn-rw-radius: 6px;
}

.sn-rw__title {
	margin: 0 0 0.5rem;
	font-size: 1.5rem;
	line-height: 1.2;
}

.sn-rw__intro {
	margin: 0 0 1.25rem;
	font-size: 1rem;
	line-height: 1.55;
	color: #555;
}

.sn-rw__title + .sn-rw__intro {
	margin-top: 0;
}

.sn-rw__track {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--sn-rw-gap);
}

.sn-rw--grid .sn-rw__track {
	grid-template-columns: repeat(var(--sn-rw-cols, 4), 1fr);
}

@media (max-width: 700px) {
	.sn-rw--grid .sn-rw__track {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 420px) {
	.sn-rw--grid .sn-rw__track {
		grid-template-columns: repeat(2, 1fr);
	}
}

.sn-rw--carousel .sn-rw__track {
	display: flex;
	gap: var(--sn-rw-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 4px;
}
.sn-rw--carousel .sn-rw__track::-webkit-scrollbar {
	display: none;
}

.sn-rw--carousel .sn-rw__item {
	flex: 0 0 calc((100% - var(--sn-rw-gap) * 3) / 4);
	scroll-snap-align: start;
}

@media (max-width: 900px) {
	.sn-rw--carousel .sn-rw__item {
		flex-basis: calc((100% - var(--sn-rw-gap) * 2) / 3);
	}
}
@media (max-width: 600px) {
	.sn-rw--carousel .sn-rw__item {
		flex-basis: calc((100% - var(--sn-rw-gap)) / 2);
	}
}

.sn-rw__item {
	position: relative;
	margin: 0;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--sn-rw-radius);
	background: #f3f3f3;
}

/* Thumbs mode — small auto-fitting tiles, ideal for below a main product
 * image where you want a compact strip of customer photos. */
.sn-rw--thumbs.sn-rw--grid .sn-rw__track {
	grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
	gap: 6px;
}
.sn-rw--thumbs {
	--sn-rw-radius: 4px;
	margin: 1rem 0;
}
.sn-rw--thumbs .sn-rw__overlay {
	padding: 6px 8px;
}
.sn-rw--thumbs .sn-rw__overlay-caption {
	display: none;
}
.sn-rw--thumbs .sn-rw__overlay-meta {
	font-size: 0.62rem;
}
.sn-rw--thumbs .sn-rw__overlay-product {
	display: none;
}
.sn-rw--thumbs .sn-rw__badge {
	top: 4px;
	right: 4px;
	padding: 3px 6px;
	font-size: 9.5px;
}

.sn-rw__link {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	text-decoration: none;
	color: #fff;
}

/* The lightbox trigger is a <button>, so reset theme button styles same way
 * as the carousel nav arrows — otherwise themes inflate it with padding. */
button.sn-rw__link {
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	font: inherit;
	cursor: pointer;
	text-align: left;
}

.sn-rw__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	opacity: 1;
	transition: transform 0.4s ease, opacity 0.3s ease;
}

.sn-rw__img.sn-rw__img--pending {
	opacity: 0;
}

.sn-rw__link:hover .sn-rw__img,
.sn-rw__link:focus-visible .sn-rw__img {
	transform: scale(1.05);
}

/* Date badge — always visible, top-right corner. Green pill for fresh
 * (<14 days), subtle dark pill for older items. */
.sn-rw__badge {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	padding: 4px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.02em;
	color: #fff;
	background: rgba(0, 0, 0, 0.65);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	pointer-events: none;
	white-space: nowrap;
}

.sn-rw__badge--fresh {
	background: #16a34a;
	box-shadow: 0 1px 6px rgba(22, 163, 74, 0.4);
}

/* Full hover overlay — caption + product + date with a clock glyph. */
.sn-rw__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 12px 14px;
	color: #fff;
	background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.5) 45%, transparent 100%);
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.sn-rw__link:hover .sn-rw__overlay,
.sn-rw__link:focus-visible .sn-rw__overlay {
	opacity: 1;
}

.sn-rw__overlay-caption {
	margin: 0 0 8px;
	font-size: 0.875rem;
	line-height: 1.35;
	font-weight: 500;
	color: #fff;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sn-rw__overlay-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 0.72rem;
	line-height: 1.2;
}

.sn-rw__overlay-product {
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
	opacity: 0.95;
}

.sn-rw__overlay-date {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex: 0 0 auto;
	font-weight: 400;
	white-space: nowrap;
	opacity: 0.9;
	font-style: normal;
}

/* Clock icon as a CSS mask so it inherits currentColor. */
.sn-rw__overlay-date::before {
	content: "";
	display: inline-block;
	width: 11px;
	height: 11px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zm0 12.5a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11zM8.5 4H7v4.5l3.4 2 .8-1.3L8.5 7.7V4z'/></svg>") no-repeat center / contain;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zm0 12.5a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11zM8.5 4H7v4.5l3.4 2 .8-1.3L8.5 7.7V4z'/></svg>") no-repeat center / contain;
}

/* Carousel nav arrows — desktop only.
 * Specificity raised to `.sn-rw .sn-rw__nav` and every box-affecting property
 * explicitly reset so theme button styles can't inflate us into an oval. */
.sn-rw .sn-rw__nav {
	/* Reset against theme button styles. */
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	font-family: inherit;
	font-weight: 400;
	line-height: 1;
	text-shadow: none;
	text-decoration: none;
	letter-spacing: 0;

	/* Position. */
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;

	/* Lock shape: width + min/max + aspect-ratio means nothing can stretch it. */
	display: none; /* hidden by default; flipped to flex on desktop below */
	width: 44px;
	min-width: 44px;
	max-width: 44px;
	height: 44px;
	min-height: 44px;
	max-height: 44px;
	flex: 0 0 44px;
	aspect-ratio: 1 / 1;
	border-radius: 50%;

	/* Center the arrow glyph regardless of font. */
	align-items: center;
	justify-content: center;
	text-align: center;

	/* Look. */
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 22px;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.sn-rw .sn-rw__nav--prev { left: 10px; }
.sn-rw .sn-rw__nav--next { right: 10px; }

@media (hover: hover) and (min-width: 700px) {
	.sn-rw--carousel .sn-rw__nav {
		display: flex;
	}
}

.sn-rw .sn-rw__nav:hover {
	background: rgba(0, 0, 0, 0.85);
	transform: translateY(-50%) scale(1.08);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.sn-rw .sn-rw__nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.sn-rw .sn-rw__nav:active {
	transform: translateY(-50%) scale(0.96);
}

/* Touch devices have no hover — show a slim always-on bottom strip with
 * just product + date. The full caption stays hidden so we don't obscure
 * the image. */
@media (hover: none) {
	.sn-rw__overlay {
		opacity: 1;
		background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 55%);
	}
	.sn-rw__overlay-caption {
		display: none;
	}
}

/* Unlinked items (current-product page) — overlay always visible. */
.sn-rw__overlay--static {
	opacity: 1;
	background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
}

/* Lazy-load skeleton + spinner. Shown while an item's image is pending. */
.sn-rw__item--loading {
	background: #e9e9e9;
}

.sn-rw__item--loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	border-radius: 50%;
	border: 3px solid rgba(0, 0, 0, 0.12);
	border-top-color: #16a34a;
	animation: sn-rw-spin 0.8s linear infinite;
	z-index: 1;
}

@keyframes sn-rw-spin {
	to { transform: rotate(360deg); }
}

/* ========================================================================
 * Lightbox — vanilla overlay opened from sn-rw__lightbox-trigger buttons.
 * Built fresh per-instance (one global #sn-rw-lightbox div re-used across
 * any galleries on the page).
 * ====================================================================== */
.sn-rw-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.92);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	padding: 40px 60px 80px;
	box-sizing: border-box;
}

.sn-rw-lightbox--open {
	display: flex;
	animation: sn-rw-lb-fade-in 0.18s ease;
}

@keyframes sn-rw-lb-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.sn-rw-lightbox__stage {
	position: relative;
	max-width: min(900px, 100%);
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

.sn-rw-lightbox__img {
	max-width: 100%;
	max-height: calc(100vh - 200px);
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	background: #111;
}

.sn-rw-lightbox__info {
	color: #fff;
	font-size: 0.9rem;
	line-height: 1.4;
	text-align: center;
	max-width: 700px;
}

.sn-rw-lightbox__caption {
	margin: 0 0 4px;
	font-weight: 500;
}

.sn-rw-lightbox__meta {
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.8rem;
}

.sn-rw-lightbox__meta a {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sn-rw-lightbox__close,
.sn-rw-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	width: 48px;
	height: 48px;
	min-width: 48px;
	min-height: 48px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, transform 0.15s ease;
}

.sn-rw-lightbox__close {
	top: 16px;
	right: 16px;
	transform: none;
	font-size: 28px;
}

.sn-rw-lightbox__nav--prev { left: 16px; }
.sn-rw-lightbox__nav--next { right: 16px; }

.sn-rw-lightbox__close:hover,
.sn-rw-lightbox__nav:hover {
	background: rgba(255, 255, 255, 0.22);
}

.sn-rw-lightbox__nav:hover {
	transform: translateY(-50%) scale(1.06);
}

@media (max-width: 600px) {
	.sn-rw-lightbox {
		padding: 30px 12px 70px;
	}
	.sn-rw-lightbox__nav {
		width: 40px;
		height: 40px;
		min-width: 40px;
		min-height: 40px;
		font-size: 18px;
	}
	.sn-rw-lightbox__nav--prev { left: 8px; }
	.sn-rw-lightbox__nav--next { right: 8px; }
}

/* When body has the open-lock class, prevent background scroll. */
body.sn-rw-lightbox-open {
	overflow: hidden;
}

