/*
 * Nyappu Design System — scoped foundation (Visual tokens v2: docs/visual-direction.md §4–§6, §10).
 * Do not attach .nyappu-ui to SWELL global wrappers. Each Nyappu template opts in.
 * Warm white, restrained chrome: one background, one surface, one accent. Photography carries the colour.
 *
 * Shape tokens (border width, radius stages, elevation) live on :root like the motion tokens in nyappu-motion.css,
 * so every template — including ones outside .nyappu-ui such as the Shop main — shares one definition (GAP-030).
 */

:root {
	--ny-border-width: 1px;
	/*
	 * Radius stages (docs/design-principles.md §5, docs/visual-direction-v2.md §6). Never mix stages inside one component.
	 *   small   4–8px  labels, small controls, CTA           (5px)
	 *   frame   8px    current image frames — the top of the small stage. Area / Shop polish moves photos to large.
	 *   medium  12px   surface panes, interactive UI
	 *   large   18px   photos, gallery
	 *   round   pill   status chip only; never repeated metadata
	 */
	--ny-radius-small: 5px;
	--ny-radius-frame: 8px;
	--ny-radius-medium: 12px;
	--ny-radius-large: 18px;
	--ny-radius-round: 999px;
	/*
	 * Elevation: exactly one level (v2 §6 range 0 2px 12px 6% … 0 8px 24px 8%). Only for UI that really floats —
	 * open menu, sticky summary, hovered photo card, overlay. Never on resting sections or cards; never with a border.
	 */
	--ny-elevation: 0 2px 12px rgb(43 41 38 / 6%);
}

.nyappu-ui {
	--ny-color-bg: #faf8f4;
	--ny-color-surface: #f2eee7;
	--ny-color-surface-subtle: var(--ny-color-surface);
	--ny-color-text: #2a2724;
	--ny-color-text-muted: #6b645c;
	--ny-color-border: #e5dfd5;
	--ny-color-link: #315f7d;
	--ny-color-link-hover: #23475e;
	--ny-color-cta: #2f6b63;
	--ny-color-positive: #3a7d5c;
	--ny-color-negative: #a95049;
	--ny-color-focus: #2f6b63;

	--ny-font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Yu Gothic", Meiryo, system-ui, sans-serif;
	--ny-font-body: 16px;
	--ny-font-small: 14px;
	--ny-font-caption: 12px;
	--ny-font-label: 13px;
	--ny-leading-ui: 1.65;
	--ny-leading-body: 1.75;
	--ny-weight-body: 400;
	--ny-weight-heading: 600;
	--ny-weight-strong: 700;
	--ny-tracking-heading: .02em;
	--ny-tracking-wordmark: .07em;

	--ny-space-1: 4px;
	--ny-space-2: 8px;
	--ny-space-3: 12px;
	--ny-space-4: 16px;
	--ny-space-5: 24px;
	--ny-space-6: 32px;
	--ny-space-7: 48px;
	--ny-space-8: 64px;

	/* Section rhythm: pick by content. Not every section gets the same padding. */
	--ny-section-compact: 48px;
	--ny-section-normal: 72px;
	--ny-section-editorial: 96px;

	--ny-container-wide: 1080px;
	--ny-container-reading: 760px;
	--ny-gutter-mobile: 16px;
	--ny-gutter-desktop: 28px;
	--ny-image-card: 4 / 3;
	--ny-tap-target: 44px;

	font-family: var(--ny-font-sans);
	color: var(--ny-color-text);
	font-size: var(--ny-font-body);
	line-height: var(--ny-leading-ui);
	word-break: normal;
	overflow-wrap: break-word;
}

/* Headings: proportional kana spacing gives the type its identity. Body text keeps default spacing. */
.nyappu-ui :where(h1, h2) {
	font-feature-settings: "palt" 1;
	/*
	 * Tighter kana changes line breaks. Break between phrases where supported, never start a line
	 * with small kana, and avoid a single orphaned character on the last line.
	 */
	line-break: strict;
	word-break: auto-phrase;
	text-wrap: pretty;
}

/* Shared primitives. Their markup is opt-in; existing templates are not restyled globally. */
.nyappu-ui .nyappu-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ny-space-1) 0;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: var(--ny-font-label);
	line-height: 1.5;
	color: var(--ny-color-text-muted);
}

.nyappu-ui .nyappu-breadcrumb li + li::before {
	content: "›";
	margin: 0 var(--ny-space-2);
	color: #aaa39b;
}

.nyappu-ui .nyappu-text-link,
.nyappu-ui .nyappu-breadcrumb a {
	color: var(--ny-color-link);
	text-decoration: none;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
.nyappu-ui .nyappu-text-link:hover,
.nyappu-ui .nyappu-text-link:focus-visible,
.nyappu-ui .nyappu-breadcrumb a:hover,
.nyappu-ui .nyappu-breadcrumb a:focus-visible { text-decoration: underline; }

.nyappu-ui .nyappu-primary-cta,
.nyappu-ui .nyappu-secondary-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--ny-tap-target);
	padding: var(--ny-space-2) var(--ny-space-4);
	border: var(--ny-border-width) solid var(--ny-color-cta);
	border-radius: var(--ny-radius-small);
	font-weight: 600;
	text-decoration: none;
}

.nyappu-ui .nyappu-primary-cta {
	color: #fff;
	background: var(--ny-color-cta);
}

.nyappu-ui .nyappu-secondary-cta {
	color: var(--ny-color-cta);
	background: var(--ny-color-bg);
}

.nyappu-ui .nyappu-image-frame {
	overflow: hidden;
	border-radius: var(--ny-radius-frame);
	background: var(--ny-color-surface-subtle);
}

.nyappu-ui .nyappu-photo-caption,
.nyappu-ui .nyappu-image-credit {
	font-size: var(--ny-font-caption);
	line-height: 1.55;
	color: var(--ny-color-text-muted);
}

.nyappu-ui .nyappu-placeholder {
	background: var(--ny-color-surface-subtle);
	color: var(--ny-color-text-muted);
}

.nyappu-ui .nyappu-metadata {
	font-size: var(--ny-font-small);
	line-height: 1.6;
	color: var(--ny-color-text-muted);
}

.nyappu-ui .nyappu-divider-section {
	border-top: var(--ny-border-width) solid var(--ny-color-border);
}

.nyappu-ui :where(a, button, [tabindex]):focus-visible {
	outline: 2px solid var(--ny-color-focus);
	outline-offset: 3px;
}

@media (min-width: 768px) {
	.nyappu-ui {
		--ny-gutter-mobile: var(--ny-gutter-desktop);
		--ny-section-compact: 64px;
		--ny-section-normal: 96px;
		--ny-section-editorial: 120px;
	}
}
