/*
Theme Name: Astro House
Description: A standalone block theme for the Astro House website.
Author: Astro House
Requires at least: 7.1
Requires PHP: 7.4
Version: 0.1.1
License: GPL-2.0-or-later
Text Domain: astro-house
Tags: full-site-editing, block-patterns, custom-colors, custom-logo, custom-menu, editor-style, wide-blocks, accessibility-ready
*/

/* Low-specificity safeguards shared by ordinary content and plugin applications. */
:where(.wp-site-blocks *:focus-visible) {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

:where(.wp-site-blocks pre) {
	overflow-x: auto;
}

.wp-site-blocks {
	overflow-wrap: break-word;
}

/* Locked global header, translated from the desktop and mobile references. */
.astro-house-header {
	background: rgb(250 248 245 / 96%);
	border-bottom: 1px solid var(--wp--preset--color--hairline);
}

.astro-house-header__inner {
	box-sizing: border-box;
	gap: var(--wp--preset--spacing--20);
	min-height: 144px;
	padding-block: 24px;
	padding-inline: clamp(0px, 3vw, 44px);
}

.astro-house-brand {
	flex: 0 0 auto;
	margin: 0;
}

.astro-house-brand a,
.astro-house-brand img {
	display: block;
}

.astro-house-brand img {
	height: 96px;
	max-width: none;
	width: auto;
}

.astro-house-header__actions {
	gap: clamp(16px, 2.5vw, 32px);
}

.astro-house-menu-link {
	color: var(--wp--preset--color--muted);
	font-family: var(--astro-font-functional);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
}

.astro-house-menu-link:hover,
.astro-house-menu-link:focus-visible {
	color: var(--wp--preset--color--primary);
}

.astro-house-header__navigation,
.astro-house-menu-panel {
	display: flex;
}

.astro-house-menu-panel {
	align-items: center;
	gap: clamp(16px, 2.5vw, 32px);
}

.astro-house-menu-link > span:last-child,
.astro-house-menu-toggle,
.astro-house-language {
	display: none;
}

.astro-house-stay {
	flex: 0 0 auto;
}

/* Public header: the static site-locale indicator ("EN ▾") is visible on desktop and mobile. It is not interactive and
   never reflects a Guest Session. Desktop order (DOM order): EXPLORE, CONTACT, EN, MY STAY. On mobile it leaves the top row
   (MY STAY | menu) and appears inside the hamburger panel instead. */
.astro-house-language:not(.astro-house-language--selector) {
	align-items: center;
	color: var(--wp--preset--color--charcoal);
	display: inline-flex;
	flex: 0 0 auto;
	font-family: var(--astro-font-functional);
	font-size: 0.6875rem;
	font-weight: 500;
	gap: 0.2rem;
	letter-spacing: 0.08em;
	line-height: 1;
	white-space: nowrap;
}

/* G5B guest-language selector: shown on desktop and mobile once a Guest Session exists. */
.astro-house-language.astro-house-language--selector {
	align-items: center;
	display: inline-flex;
	flex: 0 0 auto;
}

/*
 * Desktop language dropdown. Closed: plain "EN ▾" text (no border, no fill). Open: a light floating list, no form
 * chrome. Mobile uses the hamburger chooser instead, so this whole control is hidden below 782px.
 */
.astro-house-language--selector {
	position: relative;
}

.astro-house-language__trigger {
	align-items: center;
	appearance: none;
	background: transparent;
	border: 0;
	border-radius: var(--wp--custom--radius--small);
	color: var(--wp--preset--color--charcoal);
	cursor: pointer;
	display: inline-flex;
	font-family: var(--astro-font-functional);
	font-size: 0.75rem;
	font-weight: 500;
	gap: 6px;
	letter-spacing: 0.08em;
	line-height: 1;
	min-height: 32px;
	padding: 0 4px;
	transition: color 200ms ease;
}

.astro-house-language__chevron {
	border-bottom: 1.4px solid #6e6a64;
	border-right: 1.4px solid #6e6a64;
	display: inline-block;
	height: 5px;
	margin-top: -3px;
	transform: rotate(45deg);
	transition: transform 160ms ease, border-color 200ms ease;
	width: 5px;
}

.astro-house-language__trigger[aria-expanded="true"] .astro-house-language__chevron {
	margin-top: 2px;
	transform: rotate(225deg);
}

.astro-house-language__trigger:hover,
.astro-house-language__trigger[aria-expanded="true"] {
	color: var(--wp--preset--color--primary);
}

.astro-house-language__trigger:hover .astro-house-language__chevron,
.astro-house-language__trigger[aria-expanded="true"] .astro-house-language__chevron {
	border-color: var(--wp--preset--color--primary);
}

.astro-house-language__trigger:focus-visible,
.astro-house-language__item:focus-visible {
	color: var(--wp--preset--color--primary);
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

.astro-house-language__menu {
	background: #fffdfa;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgb(39 38 36 / 10%), 0 1px 3px rgb(39 38 36 / 6%);
	list-style: none;
	margin: 0;
	min-width: 7.5rem;
	padding: 6px;
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 60;
}

.astro-house-language__menu[hidden] {
	display: none;
}

.astro-house-language__menu li {
	margin: 0;
}

.astro-house-language__item {
	align-items: center;
	appearance: none;
	background: transparent;
	border: 0;
	border-radius: 6px;
	color: var(--wp--preset--color--charcoal);
	cursor: pointer;
	display: flex;
	font-family: var(--astro-font-functional);
	font-size: 0.75rem;
	font-weight: 500;
	gap: 8px;
	letter-spacing: 0.08em;
	line-height: 1;
	min-height: 34px;
	padding: 0 12px 0 10px;
	text-align: left;
	width: 100%;
}

.astro-house-language__item::before {
	background: transparent;
	border-radius: 50%;
	content: "";
	flex: 0 0 5px;
	height: 5px;
	width: 5px;
}

.astro-house-language__item[aria-checked="true"] {
	color: var(--wp--preset--color--primary);
}

.astro-house-language__item[aria-checked="true"]::before {
	background: var(--wp--preset--color--primary);
}

.astro-house-language__item:hover {
	background: rgb(250 241 232 / 80%);
	color: var(--wp--preset--color--primary);
}

.astro-house-stay .wp-block-button__link {
	background: transparent;
	border: 1px solid rgb(39 38 36 / 45%);
	border-radius: var(--wp--custom--radius--small);
	color: var(--wp--preset--color--charcoal);
	font-family: var(--astro-font-functional);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	line-height: 1.2;
	padding: 8px 14px;
	text-decoration: none;
	transition: border-color 200ms ease, color 200ms ease;
	white-space: nowrap;
}

.astro-house-stay .wp-block-button__link:hover {
	background: transparent;
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.astro-house-stay .wp-block-button__link:focus-visible {
	background: transparent;
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.astro-house-stay__star {
	color: var(--wp--preset--color--primary);
	display: inline-block;
	transform-origin: center;
	transition: transform 200ms ease;
}

.astro-house-stay .wp-block-button__link:hover .astro-house-stay__star,
.astro-house-stay .wp-block-button__link:focus-visible .astro-house-stay__star {
	transform: scale(1.15);
}

/* Source-derived footer composition from the locked Stitch references. */
.astro-house-footer {
	background: #fbf9f5;
	border-top: 1px solid rgb(231 227 220 / 60%);
	box-sizing: border-box;
	color: var(--wp--preset--color--charcoal);
	margin-block: 3rem 0;
	padding: 2.5rem clamp(2rem, 4vw, 4rem);
	width: 100%;
}

.astro-house-footer .astro-house-footer__inner {
	align-items: center;
	box-sizing: border-box;
	display: grid;
	gap: 2rem;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	margin-inline: auto;
	max-width: 80rem;
	padding: 0;
	width: 100%;
}

.astro-house-footer__brand,
.astro-house-footer__copyright {
	margin: 0;
}

.astro-house-footer__brand {
	font-family: var(--astro-font-editorial);
	font-size: 1.125rem;
	font-weight: 400;
	justify-self: start;
	letter-spacing: 0.025em;
}

.astro-house-footer__brand a,
.astro-house-footer__navigation .wp-block-navigation-item__content {
	color: inherit;
	text-decoration: none;
	transition: color 200ms ease;
}

.astro-house-footer__brand a:hover,
.astro-house-footer__brand a:focus-visible,
.astro-house-footer__navigation .wp-block-navigation-item__content:hover,
.astro-house-footer__navigation .wp-block-navigation-item__content:focus-visible {
	color: var(--wp--preset--color--primary);
}

.astro-house-footer__navigation {
	color: var(--wp--preset--color--muted);
	font-family: var(--astro-font-functional);
	font-size: 0.75rem;
	font-weight: 500;
	justify-self: center;
	letter-spacing: 0.1em;
	margin: 0;
	text-transform: uppercase;
}

.astro-house-footer__navigation .wp-block-navigation__container {
	flex-wrap: nowrap;
	gap: 0;
}

.astro-house-footer__navigation .wp-block-navigation-item + .wp-block-navigation-item::before {
	color: var(--wp--preset--color--soft);
	content: "·";
	font-size: 0.625rem;
	margin-inline: 1.5rem;
}

.astro-house-footer__copyright {
	color: var(--wp--preset--color--soft);
	font-family: var(--astro-font-functional);
	font-size: 0.75rem;
	font-weight: 300;
	justify-self: end;
	letter-spacing: 0.025em;
	white-space: nowrap;
}

@media (max-width: 781px) {
	.astro-house-header {
		backdrop-filter: blur(12px);
		position: sticky;
		top: 0;
		z-index: 40;
	}

	.admin-bar .astro-house-header {
		top: 46px;
	}

	.astro-house-header__inner {
		min-height: 82px;
		padding-block: 14px;
		padding-inline: 0;
	}

	.astro-house-brand img {
		height: 54px;
	}

	.astro-house-header__actions {
		gap: 8px;
	}

	.astro-house-stay {
		order: 1;
	}

	/* Mobile top row: MY STAY | menu. No language item in the row: the public EN lives inside the hamburger panel and the
	   guest chooser (guest surfaces) is also in the panel. */
	.astro-house-language:not(.astro-house-language--selector),
	.astro-house-language.astro-house-language--selector {
		display: none;
	}

	.astro-house-header__navigation {
		order: 3;
	}

	.astro-house-menu-toggle {
		align-items: center;
		appearance: none;
		background: transparent;
		border: 0;
		border-radius: var(--wp--custom--radius--small);
		color: var(--wp--preset--color--charcoal);
		cursor: pointer;
		display: flex;
		flex: 0 0 44px;
		flex-direction: column;
		gap: 6px;
		height: 44px;
		justify-content: center;
		padding: 0;
		width: 44px;
	}

	.astro-house-menu-toggle > span {
		background: currentColor;
		display: block;
		height: 1.5px;
		transform-origin: center;
		transition: opacity 160ms ease, transform 160ms ease;
		width: 20px;
	}

	.astro-house-header__navigation.is-open .astro-house-menu-toggle > span:first-child {
		transform: translateY(7.5px) rotate(45deg);
	}

	.astro-house-header__navigation.is-open .astro-house-menu-toggle > span:nth-child(2) {
		opacity: 0;
	}

	.astro-house-header__navigation.is-open .astro-house-menu-toggle > span:last-child {
		transform: translateY(-7.5px) rotate(-45deg);
	}

	.astro-house-menu-panel {
		display: none;
	}

	.astro-house-header__navigation.is-open .astro-house-menu-panel {
		align-items: stretch;
		background: var(--wp--preset--color--linen);
		border-bottom: 1px solid var(--wp--preset--color--hairline);
		bottom: auto;
		box-shadow: 0 0.75rem 1.5rem rgb(39 38 36 / 8%);
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		gap: 0;
		left: 0;
		margin-inline: auto;
		max-width: 28rem;
		padding: 0.375rem 1.25rem 0.75rem;
		position: absolute;
		right: 0;
		top: 100%;
		width: 100%;
		z-index: 30;
	}

	.astro-house-menu-link {
		align-items: center;
		border-bottom: 1px solid var(--wp--preset--color--hairline);
		color: var(--wp--preset--color--charcoal);
		display: flex;
		font-family: var(--astro-font-editorial);
		font-size: 1.5rem; /* navigation scale: editorial, but clearly a menu, not a hero */
		font-weight: 400;
		justify-content: space-between;
		letter-spacing: 0;
		line-height: 1.25;
		padding-block: 0.625rem;
		text-decoration: none;
		text-transform: none;
		width: 100%;
	}

	.astro-house-menu-link > span:last-child {
		color: var(--wp--preset--color--primary);
		display: inline;
		font-family: var(--astro-font-functional);
		font-size: 0.8125rem;
	}

	.astro-house-footer {
		background: var(--wp--preset--color--linen);
		margin-block-start: 0;
		margin-inline: auto;
		max-width: 28rem;
		padding: 2.5rem 1.25rem;
	}

	.astro-house-footer .astro-house-footer__inner {
		align-items: center;
		display: flex;
		flex-direction: column;
		gap: 0;
		justify-content: center;
		text-align: center;
	}

	.astro-house-footer__brand {
		font-size: 1.5rem;
		justify-self: auto;
		margin-bottom: 1rem;
	}

	.astro-house-footer__navigation {
		justify-self: auto;
		letter-spacing: 0.05em;
		margin-bottom: 1.5rem;
	}

	.astro-house-footer__navigation .wp-block-navigation-item + .wp-block-navigation-item::before {
		margin-inline: 1.25rem;
	}

	.astro-house-footer__copyright {
		justify-self: auto;
		letter-spacing: 0.05em;
	}
}

@media (min-width: 783px) and (max-width: 960px) {
	.astro-house-header__inner {
		min-height: 112px;
		padding-block: 16px;
	}

	.astro-house-brand img {
		height: 72px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.astro-house-stay__star {
		transition-duration: 0.01ms;
	}

	.astro-house-menu-toggle > span {
		transition-duration: 0.01ms;
	}

	.astro-house-stay .wp-block-button__link:hover .astro-house-stay__star,
	.astro-house-stay .wp-block-button__link:focus-visible .astro-house-stay__star {
		transform: none;
	}
}

/*
 * Plugin application boundary: WordPress limits direct children of constrained post content to the 720px
 * content size, which would cap the Member Portal inside the reading column. Any wrapper that directly holds a
 * portal root is released so the plugin's own width contract (.amp-portal max-width) applies.
 */
.wp-block-post-content :has(> .amp-portal-wrap) {
	max-width: none;
}

/*
 * Stay page canvas (templates/page-stay.html). The shared header/footer are unchanged; this wrapper owns the
 * only horizontal gutter, so the Member Portal inside must not add its own. Gutters follow the canonical
 * My Stay reference (20px, 40px from 640px); the portal supplies its own max-width.
 */
.wp-site-blocks > .astro-house-stay-canvas {
	box-sizing: border-box;
	padding-block: clamp(2.5rem, 4vw, 3.5rem) clamp(4rem, 6vw, 5rem);
	padding-inline: 1.25rem;
}

@media (min-width: 640px) {
	.wp-site-blocks > .astro-house-stay-canvas {
		padding-inline: 2.5rem;
	}
}

/*
 * Guest header (parts/guest-header.html): My Stay, Guide and future Services. Reuses the public header geometry,
 * menu controller and G5B language selector; only the navigation content and desktop composition differ
 * (reference: HOME, MY STAY, GUIDE, SERVICES | language; mobile: MY STAY, language, menu).
 */
@media (min-width: 782px) {
	.astro-house-header--guest .astro-house-stay {
		display: none;
	}

	.astro-house-header--guest .astro-house-menu-link.is-current {
		border-bottom: 2px solid var(--wp--preset--color--primary);
		color: var(--wp--preset--color--primary);
		font-weight: 600;
		padding-bottom: 4px;
	}

	.astro-house-header--guest .astro-house-language {
		align-items: center;
		border-inline-start: 1px solid var(--wp--preset--color--hairline);
		color: var(--wp--preset--color--charcoal);
		display: inline-flex;
		flex: 0 0 auto;
		font-family: var(--astro-font-functional);
		font-size: 0.6875rem;
		font-weight: 500;
		gap: 0.2rem;
		letter-spacing: 0.08em;
		padding-inline-start: 16px;
	}
}

@media (max-width: 781px) {
	.astro-house-header--guest .astro-house-menu-link.is-current {
		color: var(--wp--preset--color--primary);
	}
}

/* Public hamburger: static site-locale indicator (not the Guest Session chooser). Mobile only, like the chooser. */
@media (max-width: 781px) {
	.astro-house-menu-language--public .astro-house-menu-language__current {
		color: var(--wp--preset--color--charcoal);
		font-family: var(--astro-font-functional);
		font-size: 0.8125rem;
		font-weight: 500;
		letter-spacing: 0.06em;
		line-height: 1;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		padding: 0 6px;
	}
}

/*
 * CJK optical tuning (KO/JA/ZH) against the EN/VI baseline. Regional Noto families stay; weight, tracking and size are
 * reduced where the Latin UI uses wide-tracked uppercase or medium weight, because CJK glyphs carry more ink at the
 * same numeric size. Scoped to the header (any page whose own document language is CJK) and to guest-surface footers: the
 * Homepage body is not touched, and no rule keys off a guest session.
 */
:is(:root:lang(ko), :root:lang(ja), :root:lang(zh)) .astro-house-header :is(.astro-house-menu-link, .astro-house-stay .wp-block-button__link, .astro-house-language__trigger, .astro-house-language__item, .astro-house-language) {
	font-weight: 400;
	letter-spacing: 0.03em;
}

:is(:root:lang(ko), :root:lang(ja), :root:lang(zh)) .astro-house-header .astro-house-menu-link {
	font-size: 0.75rem;
}

:is(:root:lang(ko), :root:lang(ja), :root:lang(zh)) body.astro-house-guest-surface .astro-house-footer__navigation {
	font-weight: 400;
	letter-spacing: 0.04em;
}

:is(:root:lang(ko), :root:lang(ja), :root:lang(zh)) body.astro-house-guest-surface .astro-house-footer__copyright {
	font-weight: 400;
	letter-spacing: 0.01em;
}

/* The brand name is Latin in every language. */
:is(:root:lang(ko), :root:lang(ja), :root:lang(zh)) body.astro-house-guest-surface .astro-house-footer__brand {
	font-family: var(--astro-font-latin-display);
}

@media (max-width: 781px) {
	:is(:root:lang(ko), :root:lang(ja), :root:lang(zh)) .astro-house-header .astro-house-menu-link {
		font-weight: 400;
		letter-spacing: 0;
		line-height: 1.35;
	}
}

/* Mobile hamburger language chooser (EN VI KO JA ZH). Hidden on desktop, where the quiet select is used. */
.astro-house-menu-language {
	display: none;
}

@media (max-width: 781px) {
	.astro-house-menu-language {
		align-items: center;
		display: flex;
		gap: 12px;
		justify-content: space-between;
		padding-block: 0.75rem 0.25rem;
	}

	.astro-house-menu-language__label {
		color: var(--wp--preset--color--muted);
		font-family: var(--astro-font-functional);
		font-size: 0.6875rem;
		font-weight: 500;
		letter-spacing: 0.14em;
		line-height: 1.2;
		text-transform: uppercase;
	}

	.astro-house-menu-language__options {
		display: flex;
		gap: 2px;
	}

	.astro-house-menu-language__option {
		appearance: none;
		background: transparent;
		border: 0;
		border-radius: var(--wp--custom--radius--small);
		box-shadow: inset 0 -2px 0 transparent;
		color: var(--wp--preset--color--charcoal);
		cursor: pointer;
		font-family: var(--astro-font-functional);
		font-size: 0.8125rem;
		font-weight: 500;
		letter-spacing: 0.06em;
		line-height: 1;
		min-height: 44px;
		min-width: 40px;
		padding: 0 6px;
	}

	.astro-house-menu-language__option[aria-pressed="true"] {
		box-shadow: inset 0 -2px 0 var(--wp--preset--color--primary);
		color: var(--wp--preset--color--primary);
	}

	.astro-house-menu-language__option:focus-visible {
		outline: 2px solid var(--wp--preset--color--primary);
		outline-offset: 1px;
	}

	.astro-house-menu-language__option:disabled {
		opacity: 0.6;
	}
}

:is(:root:lang(ko), :root:lang(ja), :root:lang(zh)) .astro-house-menu-language__label {
	font-weight: 400;
	letter-spacing: 0.06em;
}
/* G6VT: optical refinement. Functional CJK keeps 400 where Plus Jakarta uses 500; synthetic weights are disabled. */
:is(:root:lang(ko), :root:lang(ja), :root:lang(zh)) .astro-house-header {
	font-synthesis-weight: none;
}

:is(:root:lang(ko), :root:lang(ja), :root:lang(zh)) body.astro-house-guest-surface .astro-house-footer {
	font-synthesis-weight: none;
}
/* G6VT-R1: subtle optical lift for CJK functional text (EN/VI is the hierarchy reference). */
:is(:root:lang(ko), :root:lang(ja), :root:lang(zh)) .astro-house-header .astro-house-menu-link {
	font-size: 0.7875rem;
}

:is(:root:lang(ko), :root:lang(ja), :root:lang(zh)) body.astro-house-guest-surface :is(.astro-house-footer__navigation, .astro-house-footer__copyright) {
	font-size: 0.78rem;
}
