/* ==========================================================================
   Reset + Japanese base typography — docs/11 §3, NF-08.
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	font-family: var(--font-ja);
	font-size: 16px;
	color: var(--c-text);
	background-color: var(--c-bg);
	line-height: var(--lh-body);
	letter-spacing: var(--ls-body);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	/* Natural Japanese line breaking (no orphaned punctuation at line ends) */
	line-break: strict;
	word-break: normal;
	overflow-wrap: anywhere;
	scroll-padding-top: calc(var(--header-h) + var(--admin-bar-h) + var(--space-4));
}

@media (min-width: 768px) {
	html {
		font-size: 17px;
	}
}

body {
	min-height: 100vh;
	/* NF-02: no horizontal scroll. Use clip (not hidden) so the sticky header keeps working. */
	overflow-x: clip;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, dl, dd, figure, blockquote, address {
	margin: 0;
	padding: 0;
}

h1, h2, h3, h4, h5, h6 {
	font-weight: 700;
	line-height: var(--lh-heading);
	letter-spacing: var(--ls-heading);
	word-break: auto-phrase; /* Chrome: break Japanese headings by phrase */
	text-wrap: balance;
}

/* Body text (p, li, dd, FAQ questions, tables…) wraps NATURALLY: each line fills the width, then
   breaks (design feedback 4/11 — no phrase-based or balanced breaks, they look choppy).
   No lone last character: zenworth_no_orphan() keeps the last 2–3 characters together (all browsers).
   Headings (above) still break by phrase. */

ul[role="list"],
ol[role="list"] {
	list-style: none;
}

address {
	font-style: normal;
}

img,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
	text-underline-offset: 0.2em;
}

button,
input,
select,
textarea {
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
}

[hidden] {
	display: none !important;
}

/* Line breaks that exist on one viewport only (zenworth_lines(): {sp} / {pc}) */
/* Last characters of a paragraph kept together (zenworth_no_orphan()) */
.u-nowrap {
	white-space: nowrap;
}

.u-br-sp {
	display: none;
}

@media (max-width: 767.98px) {
	.u-br-sp {
		display: inline;
	}

	.u-br-pc {
		display: none;
	}
}

/* Japanese headings broken ONLY at <wbr>/<br> (keeps phrases like 「生産性を、」 intact) */
.u-keep {
	word-break: keep-all;
	overflow-wrap: anywhere;
}

.u-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
