/*
 * Base: reset, element typography, links, focus, buttons and forms.
 * Element-level rules only, so this file also styles the block editor canvas.
 */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--tz-header-h) + var(--tz-space-s));
}

body {
	margin: 0;
	background: var(--tz-bg);
	color: var(--tz-text);
	font-family: var(--tz-font-body);
	font-size: var(--tz-step-0);
	line-height: var(--tz-leading);
	font-kerning: normal;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Set on body only, so components with their own line-height are not overridden. */
html:lang(ja) body {
	line-height: var(--tz-leading-ja);
	line-break: strict;
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

img,
video {
	height: auto;
}

/* Headings: Shippori Mincho B1, tight leading, balanced lines. */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	font-family: var(--tz-font-display);
	font-weight: 700;
	line-height: var(--tz-leading-tight);
	letter-spacing: 0.005em;
	text-wrap: balance;
	overflow-wrap: break-word;
}

:lang(ja) :is(h1, h2, h3, h4, h5, h6) {
	line-height: 1.45;
	letter-spacing: 0.02em;
	font-feature-settings: "palt";
	word-break: auto-phrase;
}

h1 {
	font-size: var(--tz-step-4);
	font-weight: 800;
}

h2 {
	font-size: var(--tz-step-3);
}

h3 {
	font-size: var(--tz-step-2);
}

h4 {
	font-size: var(--tz-step-1);
}

h5,
h6 {
	font-size: var(--tz-step-0);
}

p {
	margin: 0;
	text-wrap: pretty;
}

small {
	font-size: var(--tz-step--1);
}

strong,
b {
	font-weight: 700;
}

address {
	font-style: normal;
}

/* Links: body-coloured text, a persimmon underline that thickens on hover. */
a {
	color: inherit;
	text-decoration-line: underline;
	text-decoration-color: var(--tz-link-underline);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
	transition: text-decoration-thickness var(--tz-duration) var(--tz-ease);
}

a:hover {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 3px solid var(--tz-focus);
	outline-offset: 3px;
	border-radius: 1px;
}

hr {
	height: 0;
	margin: 0;
	border: 0;
	border-top: 1px solid var(--tz-line);
}

abbr[title] {
	text-decoration: underline dotted;
	cursor: help;
}

code,
kbd,
pre,
samp {
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	font-size: 0.9em;
}

::selection {
	background: var(--tz-kaki);
	color: #f6f3ea;
}

/*
 * Buttons: one solid persimmon action; everything else is quieter.
 * Core block and global styles may print after this file, so block selectors carry
 * a "body" prefix to win on specificity rather than on load order.
 */
.tz-button,
body .wp-block-button__link,
body .wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--tz-space-2xs);
	min-height: 3rem;
	padding: 0.75rem 1.5rem;
	border: 1px solid var(--tz-action-bg);
	border-radius: var(--tz-radius);
	background: var(--tz-action-bg);
	color: var(--tz-action-text);
	font-family: var(--tz-font-body);
	font-size: var(--tz-step-0);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--tz-duration) var(--tz-ease), border-color var(--tz-duration) var(--tz-ease), color var(--tz-duration) var(--tz-ease);
}

.tz-button:hover,
body .wp-block-button__link:hover,
body .wp-element-button:hover {
	border-color: var(--tz-action-bg-hover);
	background: var(--tz-action-bg-hover);
	color: var(--tz-action-text);
}

.tz-button--ghost,
body .is-style-outline > .wp-block-button__link,
body .wp-block-button__link.is-style-outline {
	border-color: currentColor;
	background: transparent;
	color: var(--tz-text);
}

.tz-button--ghost:hover,
body .is-style-outline > .wp-block-button__link:hover,
body .wp-block-button__link.is-style-outline:hover {
	border-color: var(--tz-text);
	background: var(--tz-text);
	color: var(--tz-bg);
}

/* Forms (Contact Form 7 and search) */
input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"]),
select,
textarea {
	width: 100%;
	min-height: 3rem;
	padding: 0.625rem 0.875rem;
	border: 1px solid var(--tz-line-strong);
	border-radius: var(--tz-radius);
	background: var(--tz-surface);
	color: var(--tz-text);
	font: inherit;
	font-size: max(1rem, var(--tz-step-0));
}

textarea {
	min-height: 9rem;
	resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
	width: 1.125rem;
	height: 1.125rem;
	accent-color: var(--tz-action-bg);
}

label {
	font-weight: 500;
}

input[type="submit"],
button[type="submit"] {
	min-height: 3rem;
	padding: 0.75rem 1.75rem;
	border: 1px solid var(--tz-action-bg);
	border-radius: var(--tz-radius);
	background: var(--tz-action-bg);
	color: var(--tz-action-text);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

input[type="submit"]:hover,
button[type="submit"]:hover {
	background: var(--tz-action-bg-hover);
}

::placeholder {
	color: var(--tz-text-muted);
	opacity: 1;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	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;
	}
}
