/**
 * Shared dialog. Scoped to .h-modal so other pages keep their own layers.
 */

.h-modal {
	position: fixed;
	inset: 0;
	z-index: 80;
	display: flex;
	align-items: center;
	justify-content: center;
	padding:
		max(1rem, env(safe-area-inset-top))
		max(1rem, env(safe-area-inset-right))
		max(1rem, env(safe-area-inset-bottom))
		max(1rem, env(safe-area-inset-left));
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.45s var(--ease), visibility 0.45s;
}

.h-modal.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.h-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 17, 14, 0.62);
}

.h-modal-dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(100%, 34rem);
	max-height: 100%;
	overflow: auto;
	padding: 1.15rem 1.35rem 1.6rem;
	background: var(--background);
	color: var(--text);
	transform: translateY(12px);
	transition: transform 0.5s var(--ease);
}

.h-modal.is-open .h-modal-dialog {
	transform: none;
}

.h-modal-dialog.is-wide {
	width: min(100%, 52rem);
}

.h-modal-close {
	position: sticky;
	top: 0;
	z-index: 2;
	align-self: flex-end;
	margin: 0 0 0.4rem;
	padding: 0.35rem 0 0.35rem 1rem;
	background: var(--background);
	color: var(--text-muted);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	font-size: 0.62rem;
}

.h-modal-close:hover,
.h-modal-close:focus-visible {
	color: var(--text);
}

.h-modal-heading {
	font-family: var(--font-serif);
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 400;
	letter-spacing: -0.03em;
	line-height: 0.96;
}

.single-services .h-modal-heading {
	margin-bottom: 1.6rem; }

.event-terms ul {
	list-style: circle;
    padding-left: 20px;
}	
.h-modal-lead,
.h-modal-status {
	margin-top: 0.9rem;
	max-width: 36ch;
	line-height: 1.6;
	color: var(--text-muted);
}

.h-modal-status.is-error {
	color: var(--text);
}

.h-form {
	display: flex;
	flex-direction: column;
	gap: 1.15rem;
	margin-top: 1.5rem;
}

.h-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.15rem;
}

.h-field {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	min-width: 0;
	border-bottom: 1px solid var(--border-strong);
	padding-bottom: 0.65rem;
}

.h-field span {
	font-size: 0.62rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--text-muted);
}

.h-field input,
.h-field select,
.h-field textarea {
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	box-shadow: none;
	font-family: var(--font-serif);
	font-size: 1.2rem;
	letter-spacing: -0.02em;
	color: var(--text);
	min-height: 2.2rem;
	appearance: none;
}

.h-field textarea {
	min-height: 5.5rem;
	resize: vertical;
	line-height: 1.45;
}

.h-field.is-invalid,
.h-check.is-invalid {
	border-bottom-color: var(--accent);
}

.h-check {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--text-muted);
}

.h-check input {
	width: 1rem;
	height: 1rem;
	margin-top: 0.2rem;
	flex-shrink: 0;
	accent-color: var(--background-dark);
}

.h-check a {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.h-form .btn {
	align-self: flex-start;
	margin-top: 0.4rem;
}

.h-form .btn:disabled {
	opacity: 0.55;
	pointer-events: none;
}

.h-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.menu-choices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.85rem;
	margin-top: 1.6rem;
}

.chat-choices {
	grid-template-columns: 1fr;
}

.menu-choice {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 1.3rem;
	border: 1px solid var(--border-strong);
	color: inherit;
	transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

a.menu-choice:hover {
	background: var(--background-dark);
	color: var(--text-on-dark);
}

a.menu-choice:hover p {
	color: var(--text-on-dark-muted);
}

.menu-choice strong {
	font-family: var(--font-serif);
	font-size: clamp(1.7rem, 3vw, 2.4rem);
	font-weight: 400;
	letter-spacing: -0.03em;
	line-height: 1;
}

.menu-choice p {
	margin-top: 0.7rem;
	color: var(--text-muted);
	line-height: 1.5;
	transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

@media (max-width: 720px) {
	.h-modal {
		align-items: stretch;
		padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
	}

	.h-modal-dialog,
	.h-modal-dialog.is-wide,
	.h-modal-dialog.is-reading {
		width: 100%;
	}

	.h-form-row,
	.menu-choices {
		grid-template-columns: 1fr;
	}

	.h-field input,
	.h-field select,
	.h-field textarea {
		font-size: clamp(1.5rem, 2.2vw, 2.05rem);
		padding-left: 16px;
	}

	.h-form .btn {
		width: 100%;
	}

	.menu-choice {
		min-height: 7.5rem;
	}
}

@media (min-width: 721px) {
	.h-modal-dialog {
		width: min(100%, 42rem);
		padding: clamp(1.8rem, 4vw, 2.8rem);
	}

	.h-modal-dialog.is-wide {
		width: min(100%, 52rem);
	}

	.h-modal-dialog.is-reading {
		width: min(100%, 74rem);
		padding: clamp(2.2rem, 4vw, 3.4rem) clamp(2.6rem, 5vw, 4.5rem);
	}

	.h-modal-close {
		position: absolute;
		top: 1.15rem;
		right: 1.4rem;
		margin: 0;
		background: transparent;
	}

	.h-modal-heading {
		margin-bottom: 1.6rem;
		padding-right: 5rem;
	}

	.h-modal-lead,
	.h-modal-status {
		margin-top: 0;
		margin-bottom: 1.4rem;
	}

	.h-form {
		gap: 1.3rem;
		margin-top: 0;
	}

	.h-form-row {
		gap: 1.4rem;
	}

	.h-field {
		gap: 0.5rem;
	}

	.h-field input,
	.h-field select,
	.h-field textarea {
		padding: 0.2rem 15px;
		font-size: 1.35rem;
	}

	.h-form .btn {
		margin-top: 0.35rem;
	}
}

.event-terms p {
	margin: 0;
	max-width: 68ch;
	font-size: 1.125rem;
	line-height: 1.75;
	color: var(--text);
}

.event-terms p + p {
	margin-top: 1.2rem;
}

.lightbox {
	position: fixed;
	inset: 0;
	z-index: 70;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(14, 11, 9, 0.94);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.6s var(--ease), visibility 0.6s;
}

.lightbox.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.lightbox-stage {
	position: absolute;
	inset: 0;
	z-index: 1;
	overflow: hidden;
	touch-action: none;
	cursor: grab;
}

.lightbox.is-dragging .lightbox-stage {
	cursor: grabbing;
}

.lightbox-track {
	display: flex;
	height: 100%;
	width: 100%;
	will-change: transform;
}

.lightbox-slide {
	display: flex;
	flex: 0 0 100%;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-width: 100%;
}

.lightbox-slide img {
	max-width: min(92vw, 1400px);
	max-height: 86vh;
	width: auto;
	height: auto;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}

.lightbox-close,
.lightbox-nav {
	position: absolute;
	z-index: 2;
	color: var(--text-on-dark);
	min-width: 3rem;
	min-height: 3rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-size: 0.68rem;
}

.lightbox-close {
	top: 1.2rem;
	right: var(--space-page);
}

.lightbox-nav {
	top: 50%;
	transform: translateY(-50%);
}

.lightbox-prev { left: var(--space-page); }
.lightbox-next { right: var(--space-page); }

.lightbox-count {
	position: absolute;
	left: 50%;
	bottom: 1.4rem;
	transform: translateX(-50%);
	font-size: 0.62rem;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--text-on-dark-muted);
}

@media (max-width: 720px) {
	.lightbox-nav {
		top: auto;
		bottom: 1.1rem;
		transform: none;
	}

	.lightbox-slide img {
		max-height: 74vh;
	}
}

@media (prefers-reduced-motion: reduce) {
	.h-modal,
	.h-modal-dialog,
	.lightbox,
	.lightbox-track {
		transition: none;
	}
}
