/*
 * Schusei layout layer — containers, site header, navigation structure,
 * main region, footer. Structural rules only; the nav-toggle's visual polish
 * lives in components.css.
 * Depends on tokens.css + base.css. Introduced in Phase 3A. Mobile-first.
 */

/* --------------------------------------------------------- width containers */
/* Each container centres its content and holds the page gutter. Use the one
   that matches the content: text < content < wide < full. */
.schusei-container,
.schusei-w-text,
.schusei-w-content,
.schusei-w-wide,
.schusei-w-full {
	width: 100%;
	margin-inline: auto;
	padding-inline: var(--sch-gutter);
}

.schusei-w-text {
	max-width: var(--sch-width-text);
}

.schusei-w-content {
	max-width: var(--sch-width-content);
}

.schusei-w-wide {
	max-width: var(--sch-width-wide);
}

.schusei-w-full {
	max-width: var(--sch-width-full);
}

/* ------------------------------------------------------------- skip link */
.schusei-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: var(--sch-z-skip-link);
	padding: var(--sch-space-2xs) var(--sch-space-sm);
	background: var(--sch-bg-elevated);
	color: var(--sch-text);
	text-decoration: none;
}

.schusei-skip-link:focus {
	left: var(--sch-space-2xs);
	top: var(--sch-space-2xs);
}

/* ----------------------------------------------------------- site header */
.schusei-site-header {
	position: sticky;
	top: 0;
	z-index: var(--sch-z-header);
	background-color: var(--sch-bg);
	border-bottom: 1px solid var(--sch-border);
}

.schusei-header-inner {
	width: 100%;
	max-width: var(--sch-width-wide);
	margin-inline: auto;
	padding-inline: var(--sch-header-gutter);
	min-height: var(--sch-header-height);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--sch-space-sm) var(--sch-space-md);
}

/* text branding — a step above nav in size/weight, and the widest tracking
   in the system, so the identity reads as a quiet auteur/production mark
   rather than merely another uppercase UI label (see tokens.css). */
.schusei-site-title {
	font-size: var(--sch-text-wordmark);
	font-weight: 500;
	letter-spacing: var(--sch-tracking-wordmark);
	text-transform: uppercase;
	line-height: 1;
}

.schusei-site-title a {
	text-decoration: none;
	color: var(--sch-text);
}

.schusei-site-title a:hover,
.schusei-site-title a:focus-visible {
	color: var(--sch-accent-warm);
}

/* ------------------------------------------------------------ navigation */
.schusei-primary-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--sch-space-2xs);
	padding-bottom: var(--sch-space-md);
}

.schusei-primary-nav a {
	display: inline-block;
	padding-block: var(--sch-space-3xs);
	font-size: var(--sch-text-nav);
	letter-spacing: var(--sch-tracking-wide);
	text-transform: uppercase;
	text-decoration: none;
	color: var(--sch-text-secondary);
}

.schusei-primary-nav a:hover,
.schusei-primary-nav a:focus-visible {
	color: var(--sch-text);
}

/* current item — quiet: brighten + a hairline, never a block/button look */
.schusei-primary-nav .current-menu-item > a,
.schusei-primary-nav .current_page_item > a,
.schusei-primary-nav .current-menu-parent > a,
.schusei-primary-nav a[aria-current] {
	color: var(--sch-text);
	border-bottom: 1px solid var(--sch-accent-warm);
}

/* -------------------------------------------------- mobile-first nav state */
/* No-JS: the navigation is always visible and stacks under the branding. */
.schusei-primary-nav {
	flex-basis: 100%;
}

/* JS present: collapse on small screens; the toggle button controls it. */
.js .schusei-primary-nav {
	display: none;
}

.js .schusei-primary-nav.is-open {
	display: block;
	animation: schusei-nav-in var(--sch-duration-base) var(--sch-ease);
}

@keyframes schusei-nav-in {
	from {
		opacity: 0;
		transform: translateY(-0.25rem);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.js .schusei-primary-nav.is-open {
		animation: none;
	}
}

/* ---------------------------------------------------- page-entry fade */
/* One quiet settle when a page arrives — opacity only, no movement, no
   layout effect. Pure CSS: it runs on render with no JS, so a no-JS or
   JS-failed load still gets it and still ends visible (opacity computes
   to 1 if the animation is unsupported). Header and footer are static. */
@keyframes schusei-page-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

.schusei-main {
	animation: schusei-page-in 400ms var(--sch-ease) both;
}

@media (prefers-reduced-motion: reduce) {
	.schusei-main {
		animation: none;
	}
}

/* ------------------------------------------------------ desktop layout */
@media (min-width: 48em) {
	.schusei-header-inner {
		flex-wrap: nowrap;
	}

	.schusei-primary-nav,
	.js .schusei-primary-nav,
	.js .schusei-primary-nav.is-open {
		display: block;
		flex-basis: auto;
		animation: none;
	}

	.schusei-primary-nav__list {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: flex-end;
		gap: clamp(var(--sch-space-md), 2.5vw, var(--sch-space-lg));
		padding-bottom: 0;
	}
}

/* --------------------------------------------------------------- main */
.schusei-main {
	flex: 1 0 auto;
	width: 100%;
	max-width: var(--sch-width-content);
	margin-inline: auto;
	padding-inline: var(--sch-gutter);
	padding-block: var(--sch-space-xl);
}

.schusei-entry-content {
	max-width: var(--sch-measure);
}

.schusei-entry-content > * + * {
	margin-top: var(--sch-space-md);
}

/* --------------------------------------------------------------- footer */
.schusei-site-footer {
	flex-shrink: 0;
	border-top: 1px solid var(--sch-border);
	background-color: var(--sch-bg);
}

.schusei-footer-inner {
	width: 100%;
	max-width: var(--sch-width-wide);
	margin-inline: auto;
	padding-inline: var(--sch-gutter);
	padding-block: var(--sch-space-lg);
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--sch-space-2xs) var(--sch-space-md);
	font-size: var(--sch-text-small);
	color: var(--sch-text-secondary);
}

.schusei-footer-inner a {
	color: var(--sch-text-secondary);
	text-decoration: none;
}

.schusei-footer-inner a:hover,
.schusei-footer-inner a:focus-visible {
	color: var(--sch-text);
}

.schusei-footer-brand {
	font-size: var(--sch-text-micro);
	letter-spacing: var(--sch-tracking-wider);
	text-transform: uppercase;
	color: var(--sch-text-secondary);
}

/* ------------------------------------------------------ footer legal row */
/* Phase 5A. One quiet line of Store policy links under the copyright.
   Deliberately not a nav block: micro text, wraps, no borders, no headings.
   Emitted (footer.php) only when at least one of the Pages exists. */
.schusei-footer-legal {
	width: 100%;
	max-width: var(--sch-width-wide);
	margin-inline: auto;
	margin-top: calc(-1 * var(--sch-space-sm));
	padding-inline: var(--sch-gutter);
	padding-bottom: var(--sch-space-lg);
}

.schusei-footer-legal__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--sch-space-3xs) var(--sch-space-md);
	font-size: var(--sch-text-micro);
	letter-spacing: var(--sch-tracking-wide);
	text-transform: uppercase;
}

.schusei-footer-legal__list a {
	display: inline-block;
	padding-block: var(--sch-space-2xs);
	color: var(--sch-text-secondary);
	text-decoration: none;
}

.schusei-footer-legal__list a:hover,
.schusei-footer-legal__list a:focus-visible {
	color: var(--sch-text);
}
