/* ==========================================================================
   Viva Glam theme styles
   - Colors/type/spacing come from theme.json presets.
   - Motion is opt-in: everything animated sits behind
     prefers-reduced-motion: no-preference, and nothing autoplays > 5s (WCAG 2.2.2).
   ========================================================================== */

:root {
	--vg-radius: 20px;
	--vg-shadow: 0 18px 40px -18px rgb(61 17 55 / 0.35);
	--vg-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--vg-focus: var(--wp--preset--color--rose);
}

/* ---------- Accessibility basics ---------- */

:where(a, button, input, select, textarea, summary, iframe, [tabindex]):focus-visible {
	outline: 3px solid var(--vg-focus);
	outline-offset: 3px;
	border-radius: 4px;
}

/* Gold focus ring wherever the background is dark. */
.vg-hero,
.vg-page-hero,
.vg-cta,
.vg-footer,
.wp-block-navigation__responsive-container.is-menu-open {
	--vg-focus: var(--wp--preset--color--gold);
}

.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--plum);
	color: var(--wp--preset--color--white);
	font-weight: 600;
	z-index: 100000;
}

/* Comfortable targets (WCAG 2.5.8 asks for 24px; aim higher). */
.wp-block-navigation-item__content,
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-height: 44px;
	min-width: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

img {
	height: auto;
	max-width: 100%;
}

/* Sections butt up against each other; spacing comes from their own padding. */
.wp-site-blocks > main,
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* ---------- Header ---------- */

.vg-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0);
	z-index: 50;
	background: rgb(255 248 243 / 0.92);
	backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--wp--preset--color--blush);
}

.vg-logo {
	font-weight: 800;
	font-size: clamp(1.05rem, 0.9rem + 1vw, 1.5rem);
	line-height: 1.1;
	margin: 0;
}

.vg-logo a {
	color: var(--wp--preset--color--plum);
	text-decoration: none;
}

.vg-nav .wp-block-navigation-item__content {
	color: var(--wp--preset--color--plum);
	text-decoration: none;
	position: relative;
}

/* Animated underline on hover/focus (desktop nav only). */
.vg-nav:not(.is-menu-open) .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0.25rem;
	right: 0.25rem;
	bottom: 0.4rem;
	height: 2px;
	background: var(--wp--preset--color--rose);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s var(--vg-ease);
}

.vg-nav .wp-block-navigation-item__content:hover::after,
.vg-nav .wp-block-navigation-item__content:focus-visible::after,
.vg-nav .current-menu-item > .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

.vg-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: var(--wp--preset--color--cream);
	font-size: var(--wp--preset--font-size--x-large);
	font-family: var(--wp--preset--font-family--display);
}

/* On narrow screens the Book button moves into the overlay menu. */
.vg-header .vg-nav .vg-nav-book {
	display: none;
}

@media (max-width: 599px) {
	.vg-header .vg-nav .is-menu-open .vg-nav-book {
		display: block;
	}
}

@media (max-width: 479px) {
	.vg-header .vg-header__cta {
		display: none;
	}
}

/* ---------- Hero ---------- */

.vg-hero,
.vg-page-hero,
.vg-cta {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	color: var(--wp--preset--color--white);
	background: linear-gradient(120deg, #3d1137 0%, #5c1a52 40%, #a3245e 75%, #3d1137 100%);
	background-size: 220% 220%;
	background-position: 0% 50%;
}

/* Soft spotlight that follows the pointer (set by reveal.js) and two glow blobs. */
.vg-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(circle at var(--mx, 70%) var(--my, 30%), rgb(242 199 110 / 0.22), transparent 40%),
		radial-gradient(circle at 15% 85%, rgb(248 228 234 / 0.16), transparent 35%);
	transition: background-position 0.2s;
}

.vg-hero::after,
.vg-cta::after {
	content: "";
	position: absolute;
	z-index: -1;
	width: min(60vw, 520px);
	aspect-ratio: 1;
	right: -12%;
	top: -20%;
	border-radius: 50%;
	background: radial-gradient(circle, rgb(242 199 110 / 0.35), transparent 65%);
	filter: blur(20px);
}

.vg-eyebrow {
	color: var(--wp--preset--color--gold);
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
}

.vg-shimmer {
	color: var(--wp--preset--color--gold);
	background: linear-gradient(100deg, #f2c76e 20%, #fff8f3 45%, #f2c76e 70%);
	background-size: 250% 100%;
	background-position: 100% 0;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	font-style: italic;
}

.vg-hero__media {
	position: relative;
}

.vg-hero__photo img {
	border: 10px solid var(--wp--preset--color--white);
	border-radius: 6px;
	box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.55);
	transform: rotate(2.5deg);
	transition: transform 0.6s var(--vg-ease);
}

.vg-hero__media:hover .vg-hero__photo img {
	transform: rotate(0deg) scale(1.02);
}

.vg-hero .is-style-outline .wp-block-button__link {
	border: 2px solid currentColor;
	background: transparent;
}

.vg-hero .is-style-outline .wp-block-button__link:is(:hover, :focus-visible) {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--plum);
}

/* Gentle glow on the main call-to-action buttons. */
.vg-btn-glow .wp-block-button__link {
	box-shadow: 0 0 0 0 rgb(242 199 110 / 0.6);
	transition: box-shadow 0.3s, transform 0.3s var(--vg-ease);
}

.vg-btn-glow .wp-block-button__link:is(:hover, :focus-visible) {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--plum);
	box-shadow: 0 0 0 8px rgb(242 199 110 / 0.25);
	transform: translateY(-2px);
}

/* Inner page title band. */
.vg-page-hero h1 {
	margin: 0;
}

.vg-main > .vg-page-hero {
	margin-block-start: 0;
}

/* ---------- Bands, cards, prices ---------- */

.vg-main > .alignfull:first-child,
.vg-main .entry-content > .alignfull:first-child {
	margin-block-start: 0;
}

.vg-main .entry-content > .alignfull + .alignfull,
.vg-footer {
	margin-block-start: 0;
}

.vg-cards {
	gap: var(--wp--preset--spacing--40);
}

.vg-card {
	position: relative;
	overflow: hidden;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--blush);
	border-radius: var(--vg-radius);
	padding: var(--wp--preset--spacing--40);
	transition: transform 0.4s var(--vg-ease), box-shadow 0.4s var(--vg-ease);
}

.vg-card > :first-child {
	margin-top: 0;
}

/* Shine sweep across the card on hover. */
.vg-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(110deg, transparent 35%, rgb(248 228 234 / 0.7) 50%, transparent 65%);
	transform: translateX(-100%);
	pointer-events: none;
}

.vg-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--vg-shadow);
}

.vg-card:hover::after {
	transform: translateX(100%);
	transition: transform 0.9s var(--vg-ease);
}

.vg-price {
	font-weight: 700;
	color: var(--wp--preset--color--rose);
	margin-top: auto;
}

/* Menu-style rows: label on the left, price on the right, dotted leader between. */
.vg-price-list {
	list-style: none;
	padding: 0;
	margin: 0.75rem 0 0;
}

.vg-price-list li {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	padding: 0.35rem 0;
}

.vg-price-list li::after {
	content: "";
	order: 1;
	flex: 1;
	border-bottom: 2px dotted var(--wp--preset--color--blush);
	min-width: 1rem;
}

.vg-price-list .vg-price {
	order: 2;
	white-space: nowrap;
	margin: 0;
}

.vg-price-note {
	color: var(--wp--preset--color--muted);
	margin-top: 0.75rem;
}

.vg-cta::after {
	left: -15%;
	right: auto;
	top: auto;
	bottom: -40%;
}

.vg-rounded img {
	border-radius: var(--vg-radius);
}

/* ---------- Before / after slider ---------- */

.vg-ba {
	margin: 0;
}

.vg-ba__frame {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}

.vg-ba__after,
.vg-ba__before {
	position: relative;
}

.vg-ba__after {
	order: 2;
}

.vg-ba__img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: 12px;
}

.vg-ba__tag {
	position: absolute;
	top: 0.75rem;
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	background: rgb(34 20 31 / 0.85);
	color: var(--wp--preset--color--white);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	pointer-events: none;
}

.vg-ba__tag--before {
	left: 0.75rem;
}

.vg-ba__tag--after {
	right: 0.75rem;
}

.vg-ba__handle {
	display: none;
}

.vg-ba__range[hidden] {
	display: none;
}

.vg-ba figcaption {
	margin-top: 0.75rem;
	text-align: center;
}

/* Enhanced: stacked photos, the before layer clipped at --pos. */
.vg-ba.is-enhanced .vg-ba__frame {
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: var(--vg-radius);
	box-shadow: var(--vg-shadow);
}

.vg-ba.is-enhanced .vg-ba__after,
.vg-ba.is-enhanced .vg-ba__before {
	position: absolute;
	inset: 0;
}

.vg-ba.is-enhanced .vg-ba__img {
	height: 100%;
	border-radius: 0;
}

.vg-ba.is-enhanced .vg-ba__before {
	clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}

.vg-ba.is-enhanced .vg-ba__handle {
	display: block;
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--pos, 50%);
	width: 3px;
	transform: translateX(-50%);
	background: var(--wp--preset--color--white);
	pointer-events: none;
}

.vg-ba.is-enhanced .vg-ba__handle::after {
	content: "‹ ›";
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--plum);
	font-weight: 800;
	font-size: 1.1rem;
	box-shadow: 0 4px 14px rgb(0 0 0 / 0.3);
	transition: transform 0.3s var(--vg-ease);
}

/* The native range input covers the photo so dragging anywhere works. */
.vg-ba.is-enhanced .vg-ba__range {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: ew-resize;
	touch-action: pan-y;
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
}

/* Full-height invisible track and thumb so a click or drag anywhere moves the divider. */
.vg-ba.is-enhanced .vg-ba__range::-webkit-slider-runnable-track {
	height: 100%;
}

.vg-ba.is-enhanced .vg-ba__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 44px;
	height: 100%;
}

.vg-ba.is-enhanced .vg-ba__range::-moz-range-track {
	height: 100%;
}

.vg-ba.is-enhanced .vg-ba__range::-moz-range-thumb {
	width: 44px;
	height: 100%;
	border: 0;
}

.vg-ba__frame:has(.vg-ba__range:focus-visible) {
	outline: 3px solid var(--vg-focus);
	outline-offset: 4px;
}

.vg-ba__frame:has(.vg-ba__range:is(:hover, :focus-visible)) .vg-ba__handle::after {
	transform: translate(-50%, -50%) scale(1.12);
}

.vg-ba-grid {
	margin-block: var(--wp--preset--spacing--50);
}

/* ---------- Gallery ---------- */

.vg-gallery.wp-block-gallery img {
	border-radius: 14px;
	transition: transform 0.5s var(--vg-ease), filter 0.5s;
}

.vg-gallery.wp-block-gallery .wp-block-image:hover img {
	transform: scale(1.03);
	filter: saturate(1.15);
}

/* ---------- Reviews ---------- */

.vg-reviews__empty {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--blush);
	border-radius: var(--vg-radius);
	padding: var(--wp--preset--spacing--40);
	text-align: center;
}

.vg-reviews__stars {
	color: var(--wp--preset--color--rose);
	font-size: 1.75rem;
	letter-spacing: 0.15em;
	margin: 0;
}

.vg-reviews__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
}

/* Trustindex sliders lay slides out off-screen; clip them so the page never scrolls sideways. */
.vg-reviews {
	min-width: 0;
	overflow-x: clip;
}

/* Trustindex widgets: keep them on-brand and readable. */
.vg-reviews .ti-widget {
	font-family: var(--wp--preset--font-family--body) !important;
}

/* ---------- Visit ---------- */

.vg-map iframe {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	border: 0;
	border-radius: var(--vg-radius);
	box-shadow: var(--vg-shadow);
}

.vg-info--hours {
	margin: 0;
	max-width: 22rem;
}

/* One row per day group: days left, time right; wraps to two lines on narrow screens. */
.vg-hours__row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	column-gap: 1rem;
	padding-block: 0.45rem;
	border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.vg-hours__row:last-child {
	border-bottom: 0;
}

.vg-hours__row dt {
	font-weight: 600;
}

.vg-hours__row dd {
	margin: 0;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.vg-hours__row.is-closed {
	opacity: 0.7;
}

.vg-hours__row.is-closed dd {
	font-style: italic;
}

address.vg-info {
	font-style: normal;
}

/* ---------- Footer ---------- */

.vg-footer .vg-logo a {
	color: var(--wp--preset--color--gold);
}

.vg-footer .wp-block-navigation a {
	color: var(--wp--preset--color--gold);
	text-decoration: underline;
}

/* ---------- Legal pages ---------- */

.vg-legal-note {
	border-left: 4px solid var(--wp--preset--color--rose);
	background: var(--wp--preset--color--blush);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	border-radius: 0 12px 12px 0;
}

/* ---------- Booking mount ---------- */

.vg-booking-fallback > :first-child {
	margin-top: 0;
}

.vg-booking-fallback {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--blush);
	border-radius: var(--vg-radius);
	padding: var(--wp--preset--spacing--50);
}

/* ==========================================================================
   Motion (only when the visitor hasn't asked for reduced motion)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}

	/* One-time intro animations, each under 5 seconds. */
	.vg-hero,
	.vg-page-hero {
		animation: vg-gradient 4.5s var(--vg-ease) both;
	}

	.vg-hero::after {
		animation: vg-float 4.5s var(--vg-ease) both;
	}

	.vg-shimmer {
		animation: vg-shimmer 2.4s 0.6s var(--vg-ease) both;
	}

	.vg-hero__copy > * {
		animation: vg-rise 0.9s var(--vg-ease) both;
	}

	.vg-hero__copy > :nth-child(2) { animation-delay: 0.1s; }
	.vg-hero__copy > :nth-child(3) { animation-delay: 0.2s; }
	.vg-hero__copy > :nth-child(4) { animation-delay: 0.3s; }

	.vg-hero__media {
		animation: vg-pop 1.1s 0.25s var(--vg-ease) both;
	}

	/* Scroll-driven reveals where supported (no JS needed). */
	@supports (animation-timeline: view()) {
		.vg-reveal {
			animation: vg-rise linear both;
			animation-timeline: view();
			animation-range: entry 0% cover 22%;
		}

		/* Header tightens and gains a shadow as the page scrolls. */
		.vg-header__inner {
			animation: vg-shrink linear both;
			animation-timeline: scroll(root);
			animation-range: 0 180px;
		}
	}

	/* IntersectionObserver fallback (reveal.js adds .vg-js). */
	@supports not (animation-timeline: view()) {
		.vg-js .vg-reveal {
			transition: opacity 0.8s var(--vg-ease), transform 0.8s var(--vg-ease);
		}

		.vg-js .vg-reveal:not(.is-visible) {
			opacity: 0;
			transform: translateY(28px);
		}
	}
}

@keyframes vg-gradient {
	from { background-position: 100% 50%; }
	to { background-position: 0% 50%; }
}

@keyframes vg-float {
	from { transform: translate(-30%, 25%) scale(0.6); opacity: 0; }
	to { transform: none; opacity: 1; }
}

@keyframes vg-shimmer {
	from { background-position: 100% 0; }
	to { background-position: 0% 0; }
}

@keyframes vg-rise {
	from { opacity: 0; transform: translateY(32px); }
	to { opacity: 1; transform: none; }
}

@keyframes vg-pop {
	from { opacity: 0; transform: translateY(24px) rotate(-3deg) scale(0.94); }
	to { opacity: 1; transform: none; }
}

@keyframes vg-shrink {
	to {
		padding-top: 0.4rem;
		padding-bottom: 0.4rem;
		box-shadow: 0 10px 30px -18px rgb(61 17 55 / 0.45);
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.vg-hero__photo img {
		transform: none;
	}
}

/* Eyebrow on light backgrounds uses rose (gold fails contrast on cream). */
.vg-eyebrow--light {
	color: var(--wp--preset--color--rose);
}

.vg-portrait img {
	box-shadow: var(--vg-shadow);
}

/* Recent-work grid: uniform portrait tiles; 2 columns on phones, 4 from tablet up. */
.vg-work.wp-block-gallery {
	margin-block: var(--wp--preset--spacing--50);
}

.vg-work.wp-block-gallery.is-cropped .wp-block-image img {
	aspect-ratio: 4 / 5;
	height: auto;
	object-fit: cover;
}

@media (max-width: 599px) {
	.vg-work.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
		width: calc(50% - var(--wp--style--unstable-gallery-gap, 16px) / 2);
	}
}

/* Real photos are portrait; keep the hero frame from growing too tall. */
.vg-hero__photo img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
	max-height: 34rem;
	width: 100%;
}
