/**
 * Global utilities + CSS custom properties
 * Pulled from design/index.html :root + global utility blocks.
 *
 * Loaded site-wide via /inc/enqueue.php.
 * Used by all custom blocks for shared chrome (.container, .btn, .mono).
 */

html {
	scroll-behavior: smooth;
	scroll-padding-top: 72px; /* clear fixed nav when jumping to anchors */
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

:root {
	/* Soft/mute derivations — not in theme.json palette since they're rgba */
	--tsuyo-ink-soft:    rgba(10, 10, 10, 0.65);
	--tsuyo-ink-mute:    rgba(10, 10, 10, 0.55);
	--tsuyo-white-soft:  #FAFAF7;
	--tsuyo-white-mute:  #FAFAF7;
	--tsuyo-line-light:  rgba(10, 10, 10, 0.10);
	--tsuyo-line-dark:   rgba(255, 255, 255, 0.14);

	/* Layout */
	--tsuyo-container:   1360px;
	--tsuyo-gutter:      clamp(20px, 4vw, 32px);
	--tsuyo-pad-y:       clamp(64px, 9vw, 96px);
}

/* Container */

.container {
	width: 100%;
	max-width: var(--tsuyo-container);
	margin-inline: auto;
	padding-inline: var(--tsuyo-gutter);
}

/* Mono utility */

.mono {
	font-family: var(--wp--preset--font-family--mono);
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 13px;
	font-weight: 500;
}

/* Buttons */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: 16px;
	letter-spacing: 0.125em;
	text-transform: uppercase;
	padding: 20px 28px;
	border-radius: 0;
	border: 1px solid transparent;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition-property: background-color, color, border-color, scale, translate;
	transition-duration: 200ms;
	transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.btn:hover {
	translate: 0 -1px;
}

@media (prefers-reduced-motion: reduce) {
	.btn { transition: none; }
	.btn:hover { translate: 0 0; }
}

.btn--primary {
	background: var(--wp--preset--color--red);
	color: var(--wp--preset--color--paper);
}
.btn--primary:hover  { background: var(--wp--preset--color--red-dim); color: var(--wp--preset--color--paper); }
.btn--primary:active { scale: 0.96; }

@media (prefers-reduced-motion: reduce) {
	.btn--primary::before {
		animation: none;
		opacity: 0.4;
	}
}

.btn--ghost-light {
	background: transparent;
	color: var(--wp--preset--color--paper);
	border: 1px solid var(--tsuyo-white-soft);
}
.btn--ghost-light:hover {
	border-color: var(--wp--preset--color--paper);
	background: rgba(255, 255, 255, 0.08);
}

.btn--nav   { padding: 8px 16px; font-size: 13px; letter-spacing: 0.1em; }
.btn--block { width: 100%; padding: 22px 28px; font-size: 16px; }

.btn:focus-visible {
	outline: 2px solid var(--wp--preset--color--paper);
	outline-offset: 4px;
}

/* ── Sections ─────────────────────────────────────────────── */

.section {
	padding-top: var(--tsuyo-pad-y);
	padding-bottom: var(--tsuyo-pad-y);
}

/* Section reveal animation removed — see tsuyo-front.js note. */
.section--dark  { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper); }
.section--bone  { background: var(--wp--preset--color--bone); }
.section--paper { background: var(--wp--preset--color--paper); }

/* ── Display headings (used by H2 in about/services/etc.) ─ */

.h2 {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: clamp(52px, 7.5vw, 80px);
	line-height: 0.94;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	margin: 0;
	text-wrap: pretty;
	word-break: normal;
	overflow-wrap: normal;
	hyphens: none;
}

.h3 {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	font-size: 22px;
	line-height: 1.3;
	margin: 0;
}

/* ── Heading row (label + kicker + h2 pattern) ────────────── */

.heading-row {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 64px;
	margin-bottom: 64px;
	align-items: start;
}
.heading-row__label {
	border-top: 1px solid var(--wp--preset--color--ink);
	padding-top: 14px;
	width: 80px;
	color: var(--tsuyo-ink-soft);
}
.heading-row__right { display: flex; flex-direction: column; gap: 18px; }
.heading-row__kicker { color: var(--tsuyo-ink-soft); }

.section--dark .heading-row__label  { border-top-color: var(--wp--preset--color--paper); color: var(--tsuyo-white-soft); }
.section--dark .heading-row__kicker { color: var(--tsuyo-white-soft); }

/* Centered variant — used by FAQ */
.heading-row--center {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 18px;
	max-width: 780px;
	margin-left: auto;
	margin-right: auto;
}
.heading-row--center .heading-row__label { display: none; }
.heading-row--center .heading-row__right { align-items: center; }

/* ── Mobile global rescaling ──────────────────────────────── */

@media (max-width: 767px) {
	.h2 { font-size: 40px; line-height: 1; max-width: 16ch; }
	.h3 { font-size: clamp(15px, 3.8vw, 18px); }

	.heading-row {
		grid-template-columns: 1fr;
		gap: 12px;
		margin-bottom: clamp(28px, 6vw, 40px);
	}
	.heading-row__label { width: auto; padding-top: 10px; }
	.heading-row__right { gap: 10px; }
}

/* ── Booking modal ───────────────────────────────────────── */

.tsuyo-book-modal[hidden] { display: none; }
.tsuyo-book-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(12px, 3vw, 32px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
	            visibility 0s linear 220ms;
}
.tsuyo-book-modal.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
	            visibility 0s linear 0s;
}

.tsuyo-book-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.tsuyo-book-modal__panel {
	position: relative;
	width: min(720px, 100%);
	height: min(86vh, 820px);
	background: transparent;
	overflow: visible;
	transform: translateY(8px) scale(0.985);
	transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.tsuyo-book-modal.is-open .tsuyo-book-modal__panel {
	transform: translateY(0) scale(1);
}

.tsuyo-book-modal__close {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border: 0;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--wp--preset--color--ink, #1a1a1a);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	transition: background 160ms ease, transform 160ms ease;
}
.tsuyo-book-modal__close:hover,
.tsuyo-book-modal__close:focus-visible {
	background: #fff;
	transform: scale(1.06);
	outline: none;
}
.tsuyo-book-modal__close svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.tsuyo-book-modal__iframe {
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 12px;
	display: block;
	background: var(--wp--preset--color--paper, #fff);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

/* Lock body scroll when modal is open. */
html.tsuyo-book-modal-open,
body.tsuyo-book-modal-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.tsuyo-book-modal,
	.tsuyo-book-modal__panel {
		transition: none;
	}
	.tsuyo-book-modal__panel {
		transform: none;
	}
}
