/**
 * Hot Springs Inn Popup — front-end styles.
 *
 * All proportions (padding, type scale, spacing, button size) are derived
 * directly from the supplied Popup.svg artwork, which uses a 600x500
 * artboard. Values are expressed as px fallbacks first, then overridden
 * with cqw (container query width) equivalents so the whole popup scales
 * fluidly while keeping the original design's proportions intact, right
 * down to small phone screens. Colors, width, and min-height are pulled
 * from admin settings via the CSS custom properties set on #hsi-popup-overlay
 * (see class-hsi-popup-public.php).
 */

/* ---------------------------------------------------------------------
 * Overlay
 * ------------------------------------------------------------------- */

.hsi-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background-color: rgba(0, 0, 0, 0.6);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease;
	box-sizing: border-box;
}

.hsi-popup-overlay[hidden] {
	display: none;
}

.hsi-popup-overlay.is-visible {
	opacity: 1;
	visibility: visible;
}

body.hsi-popup-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------------
 * Popup panel
 * ------------------------------------------------------------------- */

.hsi-popup {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--hsi-width, 600px);
	min-height: var(--hsi-min-height, 500px);
	max-height: 90vh;
	overflow-y: auto;
	background-color: var(--hsi-bg, #1e1e1e);
	color: var(--hsi-text, #ffffff);
	border-radius: 0;
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 8px 20px rgba(0, 0, 0, 0.3);
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	container-type: inline-size;
	container-name: hsi-popup;
	/* Vertically centers the content block so any leftover space from
	   min-height (e.g. when text is shorter than the original design)
	   splits evenly above and below, instead of collecting at the bottom. */
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.hsi-popup-overlay.is-visible .hsi-popup {
	opacity: 1;
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
	.hsi-popup-overlay,
	.hsi-popup {
		transition: none !important;
	}
}

/* ---------------------------------------------------------------------
 * Close button (matches SVG: white "x", top-right, ~20px inset)
 * ------------------------------------------------------------------- */

.hsi-popup-close,
#hsi-popup-overlay .hsi-popup-close,
#hsi-popup-overlay button.hsi-popup-close {
	position: absolute;
	top: 20px;
	top: clamp(12px, 3cqw, 20px);
	right: 20px;
	right: clamp(12px, 3cqw, 20px);
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	background-color: transparent !important;
	border: 0 !important;
	border-width: 0 !important;
	border-style: none !important;
	border-radius: 50% !important;
	box-shadow: none !important;
	cursor: pointer;
	color: #ffffff !important;
	font-size: 31px !important;
	line-height: 1;
	padding: 0 !important;
	outline: none !important;
	appearance: none;
	-webkit-appearance: none;
	transition: background-color 0.2s ease;
}

.hsi-popup-close:hover,
.hsi-popup-close:focus,
.hsi-popup-close:focus-visible,
#hsi-popup-overlay .hsi-popup-close:hover,
#hsi-popup-overlay .hsi-popup-close:focus,
#hsi-popup-overlay .hsi-popup-close:focus-visible {
	background-color: rgba(255, 255, 255, 0.12) !important;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
}

.hsi-popup-close span {
	color: #ffffff !important;
}

/* ---------------------------------------------------------------------
 * Content
 * ------------------------------------------------------------------- */

.hsi-popup-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 56px 48px;
	padding: clamp(32px, 9.33cqw, 56px) clamp(24px, 13.3cqw, 60px);
}

.hsi-popup-headline,
#hsi-popup-overlay .hsi-popup-headline,
#hsi-popup-overlay h2.hsi-popup-headline {
	margin: 0 0 24px;
	margin-bottom: clamp(16px, 4cqw, 24px);
	font-family: 'Shippori Mincho', 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif !important;
	font-weight: 700 !important;
	font-size: 38px;
	font-size: clamp(24px, 8cqw, 48px);
	line-height: 1.2;
	color: var(--hsi-text, #ffffff);
}

.hsi-popup-links {
	list-style: none;
	margin: 0 0 40px;
	margin-bottom: clamp(24px, 6.67cqw, 40px);
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
	gap: clamp(10px, 2.33cqw, 14px);
	width: 100%;
}

.hsi-popup-links a {
	display: inline-block;
	font-size: 19px;
	font-size: clamp(15px, 3.17cqw, 19px);
	line-height: 1.5;
	color: var(--hsi-text, #ffffff);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 0.2s ease, border-color 0.2s ease;
}

/* Font hardening kept in its own rule (font-family/weight only) so it
   can't out-specificity the :hover / :focus-visible color changes below. */
#hsi-popup-overlay .hsi-popup-links a {
	font-family: 'Open Sans', Arial, sans-serif !important;
	font-weight: 400 !important;
}

.hsi-popup-links a:hover,
.hsi-popup-links a:focus-visible,
#hsi-popup-overlay .hsi-popup-links a:hover,
#hsi-popup-overlay .hsi-popup-links a:focus-visible {
	color: var(--hsi-button, #b08051) !important;
	border-bottom-color: currentColor;
}

.hsi-popup-links a:focus-visible {
	outline: 2px solid var(--hsi-text, #ffffff);
	outline-offset: 3px;
}

/* ---------------------------------------------------------------------
 * CTA button
 * ------------------------------------------------------------------- */

.hsi-popup-button {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	max-width: 440px;
	min-height: 62px;
	min-height: clamp(48px, 10.46cqw, 62px);
	padding: 12px 28px;
	background-color: var(--hsi-button, #b08051);
	color: #ffffff;
	font-size: 15px;
	font-size: clamp(12px, 2.6cqw, 15px);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 0;
	transition: background-color 0.25s ease, transform 0.1s ease;
}

/* Font hardening kept in its own rule (font-family/weight only) so it
   can't out-specificity the :hover / :focus-visible state below. */
#hsi-popup-overlay .hsi-popup-button {
	font-family: 'Open Sans', Arial, sans-serif !important;
	font-weight: 600 !important;
}

.hsi-popup-button:hover,
.hsi-popup-button:focus-visible,
#hsi-popup-overlay .hsi-popup-button:hover,
#hsi-popup-overlay .hsi-popup-button:focus-visible {
	background-color: #5f3c21 !important;
	color: #ffffff !important;
}

.hsi-popup-button:active {
	transform: scale(0.98);
}

.hsi-popup-button:focus-visible {
	outline: 2px solid var(--hsi-text, #ffffff);
	outline-offset: 3px;
}

.hsi-popup-chevron {
	flex-shrink: 0;
	width: 14px;
	height: 14px;
}

/* ---------------------------------------------------------------------
 * Small-screen refinements
 * ------------------------------------------------------------------- */

@media (max-width: 380px) {
	.hsi-popup-overlay {
		padding: 12px;
	}
}
