/**
 * Location Slider Widget — Picklemall Widgets
 */

/* ── Outer wrapper ────────────────────────────────────────────────────────── */

.pm-loc {
	position: relative;
	width: 100%;
	overflow: hidden;
	padding-bottom: 0;
}

/* ── Title ────────────────────────────────────────────────────────────────── */

.pm-loc-header {
	text-align: center;
	padding: clamp(2rem, 5vw, 4rem) 1rem 0;
}

.pm-loc-title {
	font-family: var(--pm-font-header, 'A Love of Thunder', serif);
	font-size: 48px;
	color: var(--pm-color-dark, #1a3030);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	line-height: 1.1;
	margin: 0;
}

/* Graffiti span inside the title */
.pm-loc-title-graffiti {
	font-family: var(--pm-font-graffiti, 'Permanent Marker', cursive);
	color: var(--pm-color-orange, #E85D22);
	text-transform: none;
	letter-spacing: 0.01em;
	display: inline;
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */

.pm-loc-tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.25rem 1rem;
	padding: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 5vw, 5rem);
}

.pm-loc-tab {
	position: relative;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.55rem 2rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	/* preserve JS-equalized width */
	min-width: 130px;
	min-height: 2.8em;
}

/* Brush background image — fades in on hover / active */
.pm-loc-tab-brush {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: fill;
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
	user-select: none;
}

.pm-loc-tab:hover .pm-loc-tab-brush,
.pm-loc-tab.is-active .pm-loc-tab-brush {
	opacity: 1;
}

/* Tab label text */
.pm-loc-tab-label {
	position: relative;
	z-index: 1;
	font-family: var(--pm-font-header, 'A Love of Thunder', serif);
	font-size: clamp(1rem, 1.4vw, 1.35rem);
	color: var(--pm-color-dark, #1a3030);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	white-space: nowrap;
	transition: color 0.2s ease;
	display: inline-block;
}

/* Reserve the graffiti-font width invisibly so the tab never resizes
   when the font switches on hover / active. The ::after renders the
   same text in graffiti font at zero height — the browser measures
   its width but never paints it. */
.pm-loc-tab-label::after {
	content: attr(data-label);
	font-family: var(--pm-font-graffiti, 'Permanent Marker', cursive);
	font-size: inherit;
	text-transform: none;
	letter-spacing: normal;
	display: block;
	height: 0;
	overflow: hidden;
	visibility: hidden;
	pointer-events: none;
}

/* On hover / active → graffiti font + white text */
.pm-loc-tab:hover .pm-loc-tab-label,
.pm-loc-tab.is-active .pm-loc-tab-label {
	font-family: var(--pm-font-graffiti, 'Permanent Marker', cursive);
	color: #fff;
	text-transform: none;
}

/* ── Slider viewport ──────────────────────────────────────────────────────── */

.pm-loc-slider {
	position: relative;
	width: 100%;
	/* max-width: 1440px; */
	margin-left: auto;
	margin-right: auto;
	height: clamp(380px, 52vw, 680px);
	overflow: hidden;
}

/* ── Individual slide ─────────────────────────────────────────────────────── */

/* Default: parked off-screen to the right */
.pm-loc-slide {
	position: absolute;
	inset: 0;
	overflow: hidden;
	/* prevents brush of off-screen slides from bleeding into view */
	transform: translateX(100%);
	transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
	pointer-events: none;
}

/* Active slide sits at origin */
.pm-loc-slide.is-active {
	transform: translateX(0);
	pointer-events: auto;
}

/* Leaving slide exits to the left (next direction) */
.pm-loc-slide.is-leaving {
	/* !important overrides is-active during the concurrent transition */
	transform: translateX(-100%) !important;
	pointer-events: none;
}

/* Leaving slide exits to the right (prev direction) */
.pm-loc-slide.is-leaving-right {
	transform: translateX(100%) !important;
	pointer-events: none;
}

/* Entering from the left — snaps off-screen left with no transition so the
   next frame can animate it in from that position (prev direction) */
.pm-loc-slide.is-enter-from-left {
	transform: translateX(-100%);
	transition: none !important;
}

/* ── Slide image (masked by frame.svg) ───────────────────────────────────── */

.pm-loc-slide-image-wrap {
	position: absolute;
	inset: 0;
	/* mask-image is set inline via PHP so the URL resolves correctly */
	mask-size: cover;
	mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-size: cover;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
}

/* picture element must also fill the wrap so the img inside inherits correctly */
.pm-loc-slide-image-wrap picture {
	position: absolute;
	inset: 0;
	display: block;
}

.pm-loc-slide-img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100% !important;
	object-fit: cover !important;
	object-position: center;
}

/* ── AI badge — top-right corner of each slide ───────────────────────────── */

.pm-loc-slide-ai-badge {
	position: absolute;
	top: 5%;
	right: 5%;
	height: 40px !important;
	z-index: 4;
	pointer-events: none;
	user-select: none;
}

/* ── Brush background — covers name, hours, and button ───────────────────── */

/* The brush SVG is a direct child of .pm-loc-slide, absolutely anchored
   to the bottom-left so it spans behind all three content elements.
   No negative offsets — overflow: hidden on .pm-loc-slide clips the rest. */
.pm-loc-slide-brush {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 50%;
	min-width: 280px;
	height: 100%;
	object-fit: fill;
	/* stretch to cover full slide height regardless of content */
	z-index: 2;
	pointer-events: none;
	user-select: none;
}

/* ── Slide content overlay (on top of brush) ─────────────────────────────── */

.pm-loc-slide-content {
	position: absolute;
	bottom: 0;
	left: 0;
	z-index: 3;
	width: 50%;
	min-width: 280px;
	box-sizing: border-box;
	padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 3.5rem) clamp(1.75rem, 3.5vw, 3rem);
}

.pm-loc-slide-name {
	font-family: var(--pm-font-header, 'A Love of Thunder', serif);
	font-size: clamp(1.75rem, 3vw, 3rem);
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin: 0 0 0.35rem;
	line-height: 1.1;
}

.pm-loc-slide-hours {
	font-size: clamp(0.875rem, 1.2vw, 1rem);
	color: rgba(255, 255, 255, 0.92);
	margin: 0;
	line-height: 1.45;
}

.pm-loc-slide-hours strong {
	font-weight: 700;
}

/* ── Detail content (always visible, flows inside .pm-loc-slide-content) ──── */

.pm-loc-slide-detail-body {
	padding: 0.5rem 0 0.75rem;
	color: rgba(255, 255, 255, 0.92);
	line-height: 1.7;
}

.pm-loc-slide-detail-body h1,
.pm-loc-slide-detail-body h2,
.pm-loc-slide-detail-body h3,
.pm-loc-slide-detail-body h4 {
	color: #fff;
	margin-top: 0;
	line-height: 1.2;
}

.pm-loc-slide-detail-body p {
	font-size: clamp(0.875rem, 1.2vw, 1rem);
	margin: 0 0 0.5rem;
}

.pm-loc-slide-detail-body a {
	color: var(--pm-color-orange, #E85D22);
	text-decoration: underline;
}

/* CTA button sits below the detail block */
.pm-loc-slide-content .pm-loc-slide-cta {
	margin-top: 1rem;
	display: inline-flex;
}

/* ── Slide navigation arrows (mobile only) ────────────────────────────────── */

.pm-loc-nav {
	display: none;
	/* hidden on desktop; shown inside the mobile media query */
}

@media (max-width: 768px) {
	.pm-loc-nav {
		display: flex;
	}
}

/* Shared styles (applied at all sizes, visibility controlled above) */
.pm-loc-nav {
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 2rem;
}

.pm-loc-nav-btn {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	line-height: 0;
	transition: opacity 0.2s ease;
}

.pm-loc-nav-btn:hover {
	opacity: 0.7;
}

.pm-loc-nav-arrow {
	width: 60px;
	height: auto;
	display: block;
	filter: brightness(0) invert(1);
}

/* Flip the same SVG to point right for next */
.pm-loc-nav-arrow--next {
	transform: rotate(180deg);
}

/* ── Slide dots (optional progress indicator) ─────────────────────────────── */

.pm-loc-dots {
	position: absolute;
	bottom: clamp(1rem, 2vw, 1.5rem);
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 0.4rem;
	z-index: 3;
}

.pm-loc-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.5);
	border: none;
	padding: 0;
	cursor: pointer;
	transition: background 0.25s ease, transform 0.25s ease;
}

.pm-loc-dot.is-active {
	background: #fff;
	transform: scale(1.35);
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {

	.pm-loc-tabs {
		flex-wrap: wrap;
		justify-content: center;
		padding: 1.25rem 1rem;
		gap: 0.25rem 0.5rem;
	}

	.pm-loc-tab {
		min-width: 110px;
		padding: 0.5rem 1.25rem;
	}

	.pm-loc-slider {
		height: clamp(500px, 120vw, 680px);
	}

	.pm-loc-slide-img {
		height: 100%;
		object-fit: cover;
	}

	.pm-loc-slide-brush,
	.pm-loc-slide-content {
		width: 100%;
		min-width: 0;
	}

	.pm-loc-slide-brush {
		object-fit: cover;
		/* crop to fill the narrower width, ensuring the brush fully covers the content */
		min-height: 50%;
		/* ensure at least half the slide is covered */
	}

	.pm-loc-slide-name {
		font-size: clamp(1.5rem, 6vw, 2.25rem);
	}

	.pm-loc-slide-hours {
		font-size: 0.875rem;
	}
}

@media (max-width: 480px) {

	.pm-loc-title {
		font-size: clamp(2rem, 8vw, 3rem);
	}

	.pm-loc-slider {
		height: 500px;
	}

	.pm-loc-slide-img {
		height: 400px !important;
		object-fit: cover;
	}

	.pm-loc-slide-content {
		padding: 1rem 1.25rem 1.25rem;
	}
}