/* Popup banner slider — Indies Theme. Visuals match the original promo popup. */
.thm-popup[hidden] { display: none !important; }

.thm-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	transition: opacity .3s ease;
}
.thm-popup.is-open { opacity: 1; }

.thm-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .85);
}

.thm-popup__dialog {
	position: relative;
	width: 90%;
	max-width: 450px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: auto;
	background: #fff;
	border-radius: 20px;
	transform: translateY(20px);
	transition: transform .4s ease-out;
	overscroll-behavior: contain;
}
.thm-popup.is-open .thm-popup__dialog { transform: translateY(0); }
.thm-popup__dialog:focus { outline: none; }

/* Slides are stacked in one grid cell: height = tallest slide, so switching
   slides never makes the dialog jump. */
.thm-popup__stage { display: grid; }
.thm-popup__slide {
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden;
	transition: opacity .45s ease, visibility .45s;
}
.thm-popup__slide.is-active { opacity: 1; visibility: visible; }

/* Fixed aspect ratio (from slide 1, set inline as --thm-ratio). Taller-than-
   screen images are letterboxed instead of pushing the button off-screen. */
.thm-popup__media {
	overflow: hidden;
	background: #f3f3f3;
	aspect-ratio: var(--thm-ratio, 4 / 5);
	max-height: calc(100vh - 200px);
	max-height: calc(100dvh - 200px);
}
.thm-popup__media a,
.thm-popup__media picture { display: block; width: 100%; height: 100%; }
.thm-popup__img,
.thm-popup__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform .3s;
}
.thm-popup__media img:hover { transform: scale(1.02); }

.thm-popup__body { padding: 18px 20px 0; text-align: center; }
.thm-popup__title {
	margin: 0 0 6px;
	font-family: 'Rokkitt', serif;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.25;
	color: #111827;
}
.thm-popup__desc { margin: 0; font-size: .9rem; line-height: 1.55; color: #4b5563; }

.thm-popup__footer { padding: 20px; text-align: center; background: #fff; }
.thm-popup__cta {
	display: inline-block;
	width: 100%;
	padding: 15px 0;
	background: rgb(var(--brand-accent, 197 160 89));
	color: #fff !important;
	text-decoration: none !important;
	font-weight: 700;
	letter-spacing: 2px;
	border-radius: 10px;
	transition: all .3s;
	box-shadow: 0 4px 15px rgb(var(--brand-accent, 197 160 89) / .4);
}
.thm-popup__cta:hover,
.thm-popup__cta:focus-visible {
	filter: brightness(.92);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgb(var(--brand-accent, 197 160 89) / .6);
}

.thm-popup__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 9999px;
	background: rgba(0, 0, 0, .45); /* stays visible on light images */
	color: #fff;
	font-size: 26px;
	line-height: 34px;
	text-shadow: 0 0 5px rgba(0, 0, 0, .6);
	cursor: pointer;
	transition: background .2s;
}
.thm-popup__close:hover { background: rgba(0, 0, 0, .7); }

.thm-popup__nav {
	position: absolute;
	top: 38%; /* refined by popup.js to the centre of the image area */
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 9999px;
	background: rgba(255, 255, 255, .85);
	color: #111;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
	cursor: pointer;
	transition: background .2s;
}
.thm-popup__nav:hover { background: #fff; }
.thm-popup__nav--prev { left: 10px; }
.thm-popup__nav--next { right: 10px; }

.thm-popup__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 0 20px 16px;
}
.thm-popup__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 9999px;
	background: #d1d5db;
	cursor: pointer;
	transition: width .25s, background .25s;
}
.thm-popup__dot.is-active { width: 22px; background: rgb(var(--brand-accent, 197 160 89)); }

.thm-popup button:focus-visible,
.thm-popup a:focus-visible { outline: 2px solid rgb(var(--brand-accent, 197 160 89)); outline-offset: 2px; }

@media (max-width: 480px) {
	.thm-popup__dialog { width: 100%; }
	.thm-popup__footer { padding: 16px; }
	.thm-popup__nav { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
	.thm-popup, .thm-popup__dialog, .thm-popup__slide, .thm-popup__media img { transition: none; }
}
