/*
 * 全デザイン共通の骨組み（リセット・レイアウト・余白・アクセシビリティ）。
 * 色・書体・装飾はデザインごとの design.css で決める。ここでは変数を参照するだけ。
 */
@layer base, design;

@layer base {
	:root {
		--color-bg: #fff;
		--color-surface: #f6f7f9;
		--color-text: #1d2330;
		--color-muted: #5b6475;
		--color-border: #dfe3ea;
		--color-heading: var(--color-text);
		--color-accent: #1f3a68;
		--color-accent-contrast: #fff;
		--font-body: system-ui, sans-serif;
		--font-heading: var(--font-body);
		--radius: 4px;
		--container: 1160px;
		--container-narrow: 820px;
		--gutter: clamp(16px, 4vw, 40px);
		--section-space: clamp(56px, 9vw, 112px);
		--header-h: 72px;
	}

	*, *::before, *::after { box-sizing: border-box; }
	* { margin: 0; }
	html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
	body {
		background: var(--color-bg);
		color: var(--color-text);
		font-family: var(--font-body);
		font-size: 16px;
		line-height: 1.85;
		letter-spacing: 0.02em;
		font-feature-settings: "palt" 0;
		-webkit-font-smoothing: antialiased;
		overflow-wrap: anywhere;
		line-break: strict;
	}
	img, picture, svg, video, iframe { display: block; max-width: 100%; height: auto; }
	/*
	 * 枠いっぱいに写真を敷く箇所。Astro の画像用スタイル（レイヤー外）が height:auto と
	 * 元画像の縦横比を付けるため、!important で上書きする（レイヤー内の !important はレイヤー外より強い）
	 */
	.card__media img, .feature__media img, .hero__media img, .greeting__photo img {
		width: 100% !important; height: 100% !important; max-width: none !important; aspect-ratio: auto !important; object-fit: cover;
	}
	a { color: inherit; }
	button { font: inherit; color: inherit; cursor: pointer; }
	ul, ol { padding: 0; list-style: none; }
	h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-heading); line-height: 1.4; }
	:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
	main:focus { outline: none; }

	.visually-hidden {
		position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
		overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
	}
	.skip-link {
		position: absolute; left: 8px; top: -100px; z-index: 1000; padding: 8px 16px;
		background: var(--color-accent); color: var(--color-accent-contrast);
	}
	.skip-link:focus { top: 8px; }

	.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
	.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }
	.section { padding-block: var(--section-space); }
	.section--alt { background: var(--color-surface); }
	.empty { color: var(--color-muted); padding: 24px 0; }

	/* ボタン */
	.btn {
		display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
		min-height: 44px; padding: 0.6em 1.4em; border: 1px solid transparent;
		font-weight: 700; text-decoration: none; line-height: 1.4; transition: background-color .2s, color .2s, border-color .2s, transform .2s;
	}
	.btn--lg { min-height: 56px; padding: 0.8em 2em; font-size: 1.05rem; }
	.btn--primary { background: var(--color-accent); color: var(--color-accent-contrast); }
	.btn--primary:hover { filter: brightness(1.12); }
	.btn--ghost { border-color: currentColor; background: transparent; }
	.link-more { display: inline-flex; gap: .5em; align-items: center; font-weight: 700; text-decoration: none; color: var(--color-accent); }
	.link-more:hover span { transform: translateX(4px); }
	.link-more span { transition: transform .2s; }

	/* ヘッダー（共通の動き。見た目はデザイン側） */
	.site-header { position: sticky; top: 0; z-index: 100; background: var(--color-bg); }
	.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
	.site-logo { display: inline-flex; align-items: center; text-decoration: none; font-weight: 700; font-size: 1.15rem; line-height: 1.3; }
	.site-logo img { max-height: 44px; width: auto; }
	.site-nav { display: none; margin-left: auto; align-items: center; gap: 4px; }
	.site-nav__link { padding: 8px 12px; text-decoration: none; font-weight: 500; font-size: .95rem; }
	.menu-toggle {
		margin-left: auto; width: 44px; height: 44px; display: grid; place-items: center;
		background: none; border: 0;
	}
	.menu-toggle__bar, .menu-toggle__bar::before, .menu-toggle__bar::after {
		content: ""; display: block; width: 22px; height: 2px; background: currentColor; position: relative; transition: transform .2s, background-color .2s;
	}
	.menu-toggle__bar::before { position: absolute; top: -7px; }
	.menu-toggle__bar::after { position: absolute; top: 7px; }
	[aria-expanded="true"] > .menu-toggle__bar { background: transparent; }
	[aria-expanded="true"] > .menu-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
	[aria-expanded="true"] > .menu-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }
	.mobile-nav { display: flex; flex-direction: column; padding: 8px var(--gutter) 24px; border-top: 1px solid var(--color-border); background: var(--color-bg); }
	.mobile-nav[hidden] { display: none; }
	.mobile-nav__link { padding: 14px 0; border-bottom: 1px solid var(--color-border); text-decoration: none; font-weight: 500; }
	.mobile-nav__link.is-button { margin-top: 16px; border: 0; text-align: center; background: var(--color-accent); color: var(--color-accent-contrast); font-weight: 700; }
	@media (min-width: 960px) {
		.site-nav { display: flex; }
		.menu-toggle, .mobile-nav { display: none !important; }
	}

	/* ページ見出し・パンくず */
	.page-header { padding-block: clamp(40px, 6vw, 80px) clamp(32px, 5vw, 64px); }
	.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .8rem; color: var(--color-muted); margin-bottom: 20px; }
	.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 8px; opacity: .6; }
	.breadcrumb a { text-decoration: none; }
	.breadcrumb a:hover { text-decoration: underline; }
	.page-header__title { font-size: clamp(1.75rem, 4vw, 2.6rem); }
	.page-header__lead { margin-top: 16px; max-width: 46em; color: var(--color-muted); }

	/* セクション見出し */
	.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: clamp(28px, 4vw, 48px); }
	.section-head__eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .2em; color: var(--color-accent); }
	.section-head__title { font-size: clamp(1.5rem, 3vw, 2.1rem); }
	.section-head__lead { margin-top: 8px; color: var(--color-muted); }
	.section-title-sm { font-size: 1.3rem; margin: 48px 0 20px; }
	.section-title-sm:first-child { margin-top: 0; }

	/* カード */
	.card-grid { display: grid; gap: clamp(20px, 3vw, 32px); grid-template-columns: 1fr; }
	@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
	@media (min-width: 960px) { .card-grid--3 { grid-template-columns: repeat(3, 1fr); } }
	.card__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
	.card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--color-surface); }
	.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
	.card__link:hover .card__media img { transform: scale(1.04); }
	.card__placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--color-surface), var(--color-border)); }
	.card__body { display: flex; flex-direction: column; flex: 1; gap: 8px; padding-top: 16px; }
	.card__meta { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: .85rem; color: var(--color-muted); }
	.card__title { font-size: 1.15rem; }
	.card__text { color: var(--color-muted); font-size: .95rem; }
	.card__more { margin-top: auto; padding-top: 8px; font-size: .9rem; font-weight: 700; color: var(--color-accent); }

	/* お知らせ */
	.news-item__link { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; padding: 20px 4px; border-bottom: 1px solid var(--color-border); text-decoration: none; }
	.news-item:first-child .news-item__link { border-top: 1px solid var(--color-border); }
	.news-item__date { font-size: .9rem; color: var(--color-muted); font-variant-numeric: tabular-nums; }
	.news-item__cat { justify-self: start; padding: 2px 10px; font-size: .75rem; font-weight: 700; border: 1px solid currentColor; color: var(--color-accent); text-decoration: none; }
	.news-item__title { grid-column: 1 / -1; font-weight: 500; }
	.news-item__link:hover .news-item__title { text-decoration: underline; text-underline-offset: 4px; }
	@media (min-width: 768px) {
		.news-item__link { grid-template-columns: 7em 9em 1fr; }
		.news-item__title { grid-column: auto; }
	}

	/* チップ（絞り込み） */
	.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
	.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 16px; border: 1px solid var(--color-border); text-decoration: none; font-size: .9rem; }
	.chip[aria-current="page"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-contrast); }
	.chip--sm { min-height: 0; padding: 1px 10px; font-size: .8rem; }

	/* 本文 */
	.prose > * + * { margin-top: 1.2em; }
	.prose h2 { font-size: 1.45rem; margin-top: 2.4em; padding-bottom: .4em; border-bottom: 2px solid var(--color-border); }
	.prose h3 { font-size: 1.2rem; margin-top: 2em; }
	.prose ul { list-style: disc; padding-left: 1.5em; }
	.prose ol { list-style: decimal; padding-left: 1.5em; }
	.prose li + li { margin-top: .4em; }
	.prose a { color: var(--color-accent); text-underline-offset: 3px; }
	.prose blockquote { padding: 16px 20px; border-left: 4px solid var(--color-accent); background: var(--color-surface); }
	.prose img { margin-block: 1.6em; }
	.lead { font-size: 1.1rem; margin-bottom: 32px; }
	.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 32px; color: var(--color-muted); }
	.article-image { margin-bottom: 40px; }
	.article-image img { width: 100%; }
	.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
	.back-link { margin-top: 56px; }
	.back-link a { color: var(--color-accent); text-decoration: none; font-weight: 700; }
	.notice { padding: 16px 20px; margin-bottom: 32px; background: var(--color-surface); border-left: 4px solid var(--color-muted); }

	/* 項目と内容の表（会社概要・募集要項） */
	.spec-list__row { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--color-border); }
	.spec-list__row:first-child { border-top: 1px solid var(--color-border); }
	.spec-list dt { font-weight: 700; }
	@media (min-width: 640px) { .spec-list__row { grid-template-columns: 10em 1fr; gap: 24px; } }

	/* 沿革 */
	.timeline__item { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 16px 0 16px 24px; border-left: 2px solid var(--color-border); position: relative; }
	.timeline__item::before { content: ""; position: absolute; left: -7px; top: 24px; width: 12px; height: 12px; border-radius: 50%; background: var(--color-accent); }
	.timeline__year { font-weight: 700; color: var(--color-accent); font-variant-numeric: tabular-nums; }
	@media (min-width: 640px) { .timeline__item { grid-template-columns: 9em 1fr; gap: 24px; } }

	/* 事業紹介の一覧 */
	.feature-list { display: grid; gap: clamp(48px, 7vw, 96px); }
	.feature { display: grid; gap: 24px; align-items: center; }
	.feature__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--color-surface); }
	.feature__media img { width: 100%; height: 100%; object-fit: cover; }
	.feature__num { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 700; line-height: 1; color: var(--color-accent); opacity: .9; }
	.feature__title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 12px 0 16px; }
	.feature__text { color: var(--color-muted); margin-bottom: 20px; }
	@media (min-width: 900px) {
		.feature { grid-template-columns: 1.1fr 1fr; gap: 56px; }
		.feature:nth-child(even) .feature__media { order: 2; }
	}

	/* 代表挨拶 */
	.greeting { display: grid; gap: 40px; align-items: start; }
	.greeting__photo { aspect-ratio: 4 / 5; overflow: hidden; }
	.greeting__title { font-size: clamp(1.4rem, 3vw, 2rem); margin: 8px 0 24px; }
	.greeting__sign { margin-top: 32px; text-align: right; font-weight: 700; }
	@media (min-width: 900px) { .greeting { grid-template-columns: 320px 1fr; gap: 64px; } }

	/* 採用 */
	.job-list { display: grid; gap: 16px; }
	.job-item__link { display: block; padding: 24px; border: 1px solid var(--color-border); text-decoration: none; transition: border-color .2s; }
	.job-item__link:hover { border-color: var(--color-accent); }
	.job-item__head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
	.job-item__title { font-size: 1.2rem; }
	.job-item__text { margin-top: 8px; color: var(--color-muted); }
	.job-item__meta { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 12px; font-size: .9rem; }
	.closed-jobs { margin-top: 40px; color: var(--color-muted); }
	.closed-jobs summary { cursor: pointer; }
	.closed-jobs ul { margin-top: 12px; padding-left: 1em; list-style: disc; }
	.apply-box { margin-top: 48px; text-align: center; }

	/* アクセス */
	.access__address { font-size: 1.05rem; }
	.access__note { margin-top: 8px; color: var(--color-muted); }
	.access__map { width: 100%; aspect-ratio: 16 / 9; margin-top: 24px; border: 0; }

	/* トップの帯 */
	.recruit-band, .cta-band__inner, .about-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; }
	.recruit-band__title, .about-band__title { font-size: clamp(1.4rem, 3vw, 2rem); margin-top: 8px; }
	.about-band__text { display: grid; gap: 16px; justify-items: start; }
	.cta-band { padding-block: clamp(48px, 7vw, 88px); }
	.cta-band__title { font-size: clamp(1.4rem, 3vw, 2rem); }
	.cta-band__text { margin-top: 8px; }

	/* ページ送り */
	.pagination { display: flex; justify-content: space-between; margin-top: 48px; }
	.pagination__link { font-weight: 700; color: var(--color-accent); text-decoration: none; }

	/* フッター */
	.site-footer__inner { display: grid; gap: 32px; padding-block: 56px; }
	.site-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
	.site-footer__nav a, .site-footer__legal a { text-decoration: none; font-size: .9rem; }
	.site-footer__nav a:hover, .site-footer__legal a:hover { text-decoration: underline; }
	.site-footer__tagline { margin-top: 8px; font-size: .9rem; opacity: .8; }
	.site-footer__bottom-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 20px; font-size: .8rem; }
	.site-footer__legal { display: flex; flex-wrap: wrap; gap: 8px 24px; }
	@media (min-width: 900px) { .site-footer__inner { grid-template-columns: 1fr 1.4fr; } }

	/* 404 */
	.not-found { text-align: center; }
	.not-found__code { font-size: 5rem; font-weight: 700; line-height: 1; color: var(--color-accent); }
	.not-found__title { margin: 16px 0; }
	.not-found .btn { margin-top: 24px; }

	/* デザイン見本表示の目印 */
	.design-preview-badge {
		position: fixed; right: 16px; bottom: 16px; z-index: 1000; padding: 8px 14px; border-radius: 999px;
		background: #111; color: #fff; font-size: .8rem; box-shadow: 0 4px 16px rgb(0 0 0 / .25);
	}

	/* スライダーの共通の重なり（見た目はデザイン側） */
	[data-slide] { transition: opacity .8s ease; }
	[data-slider] [data-slide]:not(.is-active) { opacity: 0; pointer-events: none; }
	@media (prefers-reduced-motion: reduce) {
		*, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
	}
}
