/**
 * Generic Modal Component
 *
 * Reusable overlay dialog. Usage:
 *   <button data-ttsd-modal-open="my-modal-id">Open</button>
 *
 *   <div class="ttsd-modal" id="my-modal-id" aria-hidden="true" role="dialog" aria-modal="true">
 *       <div class="ttsd-modal__backdrop" data-ttsd-modal-close="1"></div>
 *       <div class="ttsd-modal__dialog" role="document">
 *           <button class="ttsd-modal__close" data-ttsd-modal-close="1">&times;</button>
 *           <h2 class="ttsd-modal__title">Title</h2>
 *           <div class="ttsd-modal__body">...</div>
 *       </div>
 *   </div>
 *
 * JS: initModals() in frontend.js drives open/close (click, Esc, backdrop).
 * Optional BEM modifier on the root element for theming specific modals,
 * e.g. `.ttsd-modal ttsd-modal--booking`.
 *
 * NOTE: Form control styling (inputs, selects, Contact Form 7) lives in
 * `modal-form.css` as a separate handle (`ttsd-modal-form`). Enqueue it
 * only on pages where the modal contains a form.
 */

.ttsd-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.ttsd-modal.is-open {
	display: flex;
}

body.ttsd-modal-open {
	overflow: hidden;
}

.ttsd-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(2px);
	cursor: pointer;
}

.ttsd-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 800px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	background: var(--ttsd-white, #ffffff);
	padding: 40px 36px 32px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	animation: ttsd-modal-pop 0.22s ease-out;
}

@keyframes ttsd-modal-pop {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ttsd-modal__close {
	position: absolute;
	top: 10px;
	right: 14px;
	width: 36px;
	height: 36px;
	padding: 0;
	font-size: 28px;
	line-height: 1;
	color: var(--ttsd-navy, #1a2a4a);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: color 0.2s ease, transform 0.2s ease;
}

.ttsd-modal__close:hover {
	color: var(--ttsd-gold, #c9a96e);
	transform: rotate(90deg);
}

.ttsd-modal__title {
	margin: 0 0 20px;
	font-size: 24px;
	font-weight: 600;
	color: var(--ttsd-navy, #1a2a4a);
	text-align: center;
	font-family: inherit;
}

.ttsd-modal__body {
	font-size: 15px;
	line-height: 1.6;
}

@media (max-width: 600px) {
	.ttsd-modal {
		padding: 12px;
	}
	.ttsd-modal__dialog {
		padding: 32px 20px 24px;
	}
}
