/* ==========================================================================
   Base components used by the site skeleton.
   Page-specific components (card-grid, steps, compare, accordion…) are added
   per page once the design comps are available (docs/_design/).
   ========================================================================== */

/* --- Headings ----------------------------------------------------------- */
.c-heading-1 {
	font-size: var(--fs-h1);
}

.c-heading-2 {
	font-size: var(--fs-h2);
}

.c-heading-3 {
	font-size: var(--fs-h3);
}

/* --- Eyebrow + section head (CHALLENGES / APPROACH / …) ------------------ */
.c-eyebrow {
	font-family: var(--font-en);
	font-size: var(--fs-eyebrow);
	font-weight: 600;
	letter-spacing: var(--ls-eyebrow);
	text-transform: uppercase;
	color: var(--c-primary);
}

.c-section-head {
	margin-bottom: var(--head-gap);
}

.c-section-head--center {
	text-align: center;
}

.c-section-head .c-heading-2 {
	margin-top: 6px;
}

.c-section-head__lead {
	margin-top: var(--space-6);
	font-size: var(--fs-text);
	line-height: var(--lh-text);
}

/* --- Button (primary / secondary / on-dark / header; tap area ≥ 44px) --- */
.c-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	min-width: 196px;
	min-height: 49px;
	padding: var(--space-2) var(--space-8);
	font-size: var(--fs-text);
	font-weight: 500;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.c-btn--primary,
.c-btn--header {
	background-color: var(--c-primary);
	color: var(--c-on-dark);
}

.c-btn--primary:hover,
.c-btn--header:hover {
	background-color: var(--c-primary-dark);
}

.c-btn--secondary {
	background-color: var(--c-bg);
	color: var(--c-primary);
	border-color: var(--c-primary);
}

.c-btn--secondary:hover {
	background-color: var(--c-surface);
}

.c-btn--on-dark {
	background-color: var(--c-bg);
	color: var(--c-primary);
}

.c-btn--on-dark:hover {
	background-color: var(--c-surface);
}

.c-btn--on-dark:focus-visible {
	outline-color: var(--c-on-dark);
}

.c-btn--lg {
	min-width: 300px;
	min-height: 62px;
	font-size: 18px;
}

/* Small: 200 × 43, 30px side padding (Figma 「/contact-complete」 ホームに戻る) */
.c-btn--sm {
	min-width: 200px;
	min-height: 43px;
	padding-block: 0;
	padding-inline: 30px;
}

/* Header CTA: 144 × 40 in Figma; full-width inside the mobile drawer */
.c-btn--header {
	flex-shrink: 0;
	min-height: 52px;
}

@media (min-width: 1024px) {
	.c-btn--lg {
		min-height: 66px;
	}

	.c-btn--header {
		min-width: 144px;
		min-height: 40px;
		padding-inline: 30px;
	}
}

/* --- Subpage hero ------------------------------------------------------- */
.c-page-hero {
	padding-block: var(--space-12) var(--space-16);
}

.c-page-hero__lead {
	margin-top: var(--space-6);
	max-width: var(--container-narrow);
	color: var(--c-text-muted);
}

.c-page-hero__actions {
	margin-top: var(--space-8);
}

/* Band variant (Figma 「/improvement」「/company」 2/11).
   PC 1440: off-white band 464 tall, padding 60 / 80, eyebrow 20/700 blue, H1 40/700 (lh 56),
   lead 17 (lh 27.2), button 300 × 62 (18px), infinity graphic 539 × 239 bleeding off the
   bottom-right corner.
   SP 375 (Figma SP): 20px gutters, padding 64 / 75, eyebrow 18, H1 30 (lh 42), lead 16,
   16 between them, 40 to the button 212 × 49 (14px), graphic 336 wide. */
.c-page-hero--band {
	/* SP = Figma SP */
	--ph-side: 20px;
	--ph-pad-top: 64px;
	--ph-pad-bottom: 75px;
	--ph-eyebrow-size: 18px;
	--ph-title-size: 30px;
	--ph-lead-size: 16px;
	--ph-gap: var(--space-4);
	--ph-actions-gap: var(--space-10);
	--ph-btn-w: 212px;
	--ph-btn-h: 49px;
	--ph-btn-size: var(--fs-text);
	--ph-deco-w: 336px;
	--ph-deco-right: -87px;
	--ph-deco-bottom: -35px;

	position: relative;
	overflow: hidden;
	padding-block: var(--ph-pad-top) var(--ph-pad-bottom);
	background-color: var(--c-bg-alt);
}

.c-page-hero--band .c-page-hero__inner {
	position: relative; /* above the graphic */
	padding-inline: var(--ph-side);
}

.c-page-hero__eyebrow {
	font-size: var(--ph-eyebrow-size);
	font-weight: 700;
	line-height: 1.6;
	color: var(--c-primary);
}

.c-page-hero--band .c-page-hero__title {
	margin-top: var(--ph-gap);
	font-size: var(--ph-title-size);
	line-height: 1.4;
}

.c-page-hero--band .c-page-hero__lead {
	max-width: none;
	margin-top: var(--ph-gap);
	font-size: var(--ph-lead-size);
	line-height: 1.6;
	color: var(--c-text);
}

.c-page-hero--band .c-page-hero__actions {
	margin-top: var(--ph-actions-gap);
}

.c-page-hero--band .c-page-hero__actions .c-btn {
	min-width: var(--ph-btn-w);
	min-height: var(--ph-btn-h);
	font-size: var(--ph-btn-size);
}

.c-page-hero__deco {
	position: absolute;
	right: var(--ph-deco-right);
	bottom: var(--ph-deco-bottom);
	width: var(--ph-deco-w);
	height: auto;
	pointer-events: none;
}

@media (min-width: 1024px) {
	.c-page-hero--band {
		--ph-side: var(--container-padding);
		--ph-pad-top: 60px;
		--ph-pad-bottom: 80px;
		--ph-eyebrow-size: 20px;
		--ph-title-size: 40px;
		--ph-lead-size: 17px;
		--ph-gap: var(--space-4);
		--ph-actions-gap: var(--space-8);
		--ph-btn-w: 300px;
		--ph-btn-h: 62px;
		--ph-btn-size: 18px;
		--ph-deco-w: 539px;
		--ph-deco-right: -86px;
		--ph-deco-bottom: -28px;
	}
}

/* --- FAQ accordion (template-parts/components/faq.php) -------------------
   Figma /improvement PC: list 980 wide, 16px apart; item = 1px #F6F8FA border, radius 10;
   question row #F6F8FA, padding 24 / 40, 「Q」 24/500, text 14/700, toggle at the end;
   answer row padding 24 / 40, 「A」 24/500 blue, text 14/400 (lh 22.4).
   SP (Figma SP): 16 apart, padding 22 / 24, 「Q」「A」 24, 24 to the text, toggle 20. */
.c-faq {
	/* SP = Figma SP */
	--faq-gap: var(--space-4);
	--faq-pad: 22px 24px;
	--faq-col-gap: var(--space-6);
	--faq-mark-size: 24px;
	--faq-toggle-w: 20px;
	/* Motion (main.js reads these; the +/− icon uses the same values so both end together).
	   Standard easing (no initial snap); open a bit slower to lead the eye, close faster. */
	--faq-open-duration: 0.35s;
	--faq-open-easing: cubic-bezier(0.4, 0, 0.2, 1);
	--faq-close-duration: 0.25s;
	--faq-close-easing: cubic-bezier(0.4, 0, 0.2, 1);

	display: grid;
	gap: var(--faq-gap);
	max-width: 980px;
	margin-inline: auto;
}

.c-faq__item {
	overflow: hidden;
	border: 1px solid var(--c-bg-alt);
	border-radius: var(--radius-md);
}

.c-faq__q,
.c-faq__a {
	display: flex;
	align-items: flex-start;
	gap: var(--faq-col-gap);
	padding: var(--faq-pad);
}

.c-faq__q {
	align-items: center;
	background-color: var(--c-bg-alt);
	cursor: pointer;
	list-style: none; /* hide the native marker */
	-webkit-tap-highlight-color: transparent;
	transition: background-color var(--transition-fast);
}

.c-faq__q::-webkit-details-marker {
	display: none;
}

.c-faq__q-text {
	transition: color var(--transition-fast);
}

@media (hover: hover) {
	.c-faq__q:hover {
		background-color: var(--c-bg-alt-hover);
	}

	.c-faq__q:hover .c-faq__q-text {
		color: var(--c-primary);
	}
}

/* Keyboard: clear blue ring inside the rounded item */
.c-faq__q:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: -2px;
	border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.c-faq__item:not([open]) .c-faq__q:focus-visible {
	border-radius: var(--radius-md);
}

.c-faq__mark {
	flex-shrink: 0;
	width: 20px;
	font-size: var(--faq-mark-size);
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
}

.c-faq__mark--a {
	color: var(--c-primary);
}

.c-faq__q-text {
	flex: 1;
	font-size: var(--fs-text);
	font-weight: 700;
	line-height: 1.2; /* Figma: 14/700, lh 16.8 (2-line questions on SP) */
	/* Wraps naturally (design feedback 4/11); 「…です／か？」 is prevented by zenworth_no_orphan(). */
}

.c-faq__a-text {
	flex: 1;
	padding-top: 3px; /* text box 22.4 inside the 28.8 「A」 line (Figma) */
	font-size: var(--fs-text);
	line-height: 1.6;
}

/* + when closed, − when open: the second bar turns 90° to lie on the first one.
   Crisp at rest: even box (16 / 20), 2px bars on whole pixels (no translate(-50%)), so the
   bars sit on the pixel grid at 0° and 90°.
   .is-closing (main.js) turns the icon back to + as soon as the close animation starts. */
.c-faq__toggle {
	position: relative;
	flex-shrink: 0;
	width: var(--faq-toggle-w);
	height: var(--faq-toggle-w);
}

.c-faq__toggle::before,
.c-faq__toggle::after {
	content: "";
	position: absolute;
	top: calc(50% - 1px);
	left: 0;
	width: 100%;
	height: 2px;
	background-color: currentColor;
}

.c-faq__toggle::after {
	transform: rotate(90deg);
	transition: transform var(--faq-open-duration) var(--faq-open-easing);
}

/* Closing: same timing as the panel's close animation */
.c-faq__item.is-closing .c-faq__toggle::after {
	transition-duration: var(--faq-close-duration);
	transition-timing-function: var(--faq-close-easing);
}

.c-faq__item[open]:not(.is-closing) .c-faq__toggle::after {
	transform: rotate(0deg);
}

/* Answer panel: the JS animates its height (0 ↔ content) and opacity */
.c-faq__panel {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.c-faq__toggle::after {
		transition: none;
	}
}

@media (min-width: 1024px) {
	.c-faq {
		--faq-gap: var(--space-4);
		--faq-pad: 24px 40px;
		--faq-col-gap: var(--space-6);
		--faq-mark-size: 24px;
		--faq-toggle-w: 20px;
	}
}

/* --- CONTACT block at the end of every page (F-04) ---------------------- */
.c-contact {
	padding-block: var(--space-16) var(--space-16);
}

.c-contact__card {
	position: relative;
	overflow: hidden;
	padding: var(--space-12) var(--space-8);
	background: linear-gradient(124.6deg, var(--c-surface) 33.24%, var(--c-bg) 99.59%);
	border-radius: var(--radius-md);
}

.c-contact__body {
	position: relative; /* above the decoration */
}

.c-contact__title {
	margin-top: 6px;
	font-size: 32px;
}

.c-contact__lead {
	margin-top: 10px;
	font-size: var(--fs-text);
}

.c-contact__actions {
	margin-top: var(--space-8);
}

.c-contact__actions .c-btn {
	width: 100%;
	min-width: 0; /* full card width on mobile, never wider (320px) */
}

/* Infinity vector, clipped by the card (Figma: 217 wide top-right on mobile) */
.c-contact__deco {
	position: absolute;
	top: 15px;
	right: -58px;
	width: 217px;
	height: auto;
	pointer-events: none;
}

@media (min-width: 768px) {
	.c-contact__actions .c-btn {
		width: auto;
		min-width: 300px;
	}
}

@media (min-width: 1024px) {
	.c-contact {
		padding-block: var(--space-30);
	}

	/* 1140 × 360, content centered vertically (Figma) */
	.c-contact__card {
		display: flex;
		flex-direction: column;
		justify-content: center;
		min-height: 360px;
		padding: var(--space-10) 120px;
	}

	.c-contact__lead {
		font-size: 16px;
	}

	/* Full Figma vector (609 × 270), clipped by the card */
	.c-contact__deco {
		top: auto;
		right: -101px;
		bottom: -31px;
		width: 609px;
	}
}

/* --- Message pages (thanks, 404) ---------------------------------------- */
.c-message {
	text-align: center;
}

.c-message__code {
	font-family: var(--font-en);
	font-size: var(--fs-display);
	font-weight: 600;
	color: var(--c-primary);
	letter-spacing: var(--ls-eyebrow);
}

.c-message__body {
	margin-top: var(--space-6);
}

.c-message__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-4);
	margin-top: var(--space-12);
}

/* --- Rich content of fallback pages (index.php / page.php; news posts: article.css) --- */
.c-prose > * + * {
	margin-top: 1.5em;
}

.c-prose h2 {
	margin-top: 2.5em;
	font-size: var(--fs-h3);
	padding-bottom: var(--space-2);
	border-bottom: 1px solid var(--c-border);
}

.c-prose h3 {
	margin-top: 2em;
	font-size: 1.05em;
}

.c-prose ul,
.c-prose ol {
	padding-left: 1.5em;
}

.c-prose a {
	color: var(--c-primary);
}

.c-prose img {
	border-radius: var(--radius-sm);
}

/* --- Scroll reveal (P6). Hidden only when JS runs and motion is allowed. ---
   Add `data-reveal` to a block to animate it; remove the attribute to stop.
   Timing: --reveal-* in tokens.css. --reveal-delay is set by main.js (stagger). */
@media (prefers-reduced-motion: no-preference) {
	.js [data-reveal] {
		opacity: 0;
		transform: translateY(var(--reveal-distance));
		transition:
			opacity var(--reveal-duration) var(--reveal-easing),
			transform var(--reveal-duration) var(--reveal-easing);
		transition-delay: var(--reveal-delay, 0s);
	}

	.js [data-reveal].is-visible {
		opacity: 1;
		transform: none;
	}
}
