/*
Theme Name: トータルカーディーラーケイズ Lightning Child
Template: lightning
Version: 1.0.10
Text Domain: lightning-child-keys
*/

/* ===== 変数(配色: 漆黒×クロームシルバー+ブロンズアクセント / 高級感、地域密着セクションは暖色系にトーン切替) ===== */
:root {
	--ink: #0b0c0f;
	--ink-2: #16181d;
	--ink-3: #202329;
	--silver: #c9cdd6;
	--silver-dim: #8b8f99;
	--gold: #b6905a;
	--gold-dark: #8f7043;
	--white: #f7f6f3;
	--cream: #f4f0e8;
	--cream-border: #e4ddcd;
	--text: #1c1d20;
	--text-light: #5c5f66;
	--radius: 4px;
	--container-width: 1160px;
}

* { box-sizing: border-box; }

.ks-front .siteHeader,
.ks-front .site-header,
.ks-front .siteHeaderBefore,
.ks-plain .siteHeader,
.ks-plain .site-header,
.ks-plain .siteHeaderBefore {
	display: none;
}

html { scroll-behavior: smooth; }

body.ks-body {
	font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
	color: var(--text);
	line-height: 1.8;
	background: var(--white);
	/* 注意: ここにoverflow-x:hiddenを置くと祖先要素にoverflowが乗り、
	   ヒーローのposition:stickyが機能しなくなる(横方向のはみ出しは
	   .ks-hero__stage側のoverflow:hiddenで局所的に抑えている) */
}

.ks-container {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 24px;
}

h1, h2, h3 {
	font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif;
	letter-spacing: 0.02em;
}

a { text-decoration: none; color: inherit; }

/* ===== ヘッダー(初期は透明=映像/ビジュアルを邪魔しない、スクロールで実体化) ===== */
.ks-header {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 100;
	background: transparent;
	border-bottom: 1px solid transparent;
	transition: background .4s ease, border-color .4s ease, backdrop-filter .4s ease;
}
.ks-header--solid {
	background: rgba(11,12,15,0.85);
	backdrop-filter: blur(6px);
	border-bottom: 1px solid rgba(201,205,214,0.15);
}
.ks-nav a { position: relative; }
.ks-nav a::after {
	content: "";
	position: absolute; left: 0; bottom: -4px;
	width: 100%; height: 1px;
	background: var(--gold);
	transform: scaleX(0);
	transform-origin: right;
	transition: transform .3s ease;
}
.ks-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.ks-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 72px;
}
.ks-brand {
	display: flex;
	align-items: center;
	gap: 10px;
}
.ks-brand__mark { height: 30px; width: auto; }
.ks-brand__text {
	color: var(--silver);
	font-family: "Noto Serif JP", serif;
	font-size: 14px;
	letter-spacing: 0.04em;
}
.ks-nav {
	display: flex;
	gap: 28px;
}
.ks-nav a {
	color: var(--silver);
	font-size: 14px;
	letter-spacing: 0.04em;
	transition: color .2s;
}
.ks-nav a:hover { color: var(--gold); }
.ks-header__tel {
	color: var(--white);
	font-size: 15px;
	border: 1px solid var(--gold);
	padding: 8px 18px;
	border-radius: var(--radius);
	transition: background .2s, color .2s;
}
.ks-header__tel:hover { background: var(--gold); color: var(--ink); }
@media (max-width: 860px) {
	.ks-nav { display: none; }
}

/* ===== ヒーロー(通常どおりスクロールで流れる。ピン留めはせず、
   スクロールで画面外に出ていく量(--hp: 0=全部見えている→1=ほぼ通過)に応じて
   連続的に縮小・フェードするだけの安全な方式) ===== */
.ks-hero {
	position: relative;
	min-height: 100vh;
	display: flex;
	align-items: center;
	background:
		radial-gradient(circle at 80% 20%, rgba(182,144,90,0.18), transparent 55%),
		linear-gradient(160deg, #0b0c0f 0%, #16181d 55%, #0b0c0f 100%);
	overflow: hidden;
}
.ks-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		repeating-linear-gradient(100deg, rgba(201,205,214,0.05) 0px, rgba(201,205,214,0.05) 1px, transparent 1px, transparent 120px);
	opacity: .6;
}

/* スクロール量(--hp: 0=先頭 → 1=画面からほぼ出た)に応じて連続的に縮小・フェードする要素 */
[data-ks-scrub] {
	transform: scale(calc(1 - var(--hp, 0) * 0.1)) translateY(calc(var(--hp, 0) * -24px));
	opacity: calc(1 - var(--hp, 0) * 1.1);
}
[data-ks-scrub-fast] {
	opacity: calc(1 - var(--hp, 0) * 2.2);
	transform: translateY(calc(var(--hp, 0) * -16px));
}

/* 光が一定周期で画面を斜めに横切る演出 */
.ks-hero__sweep {
	position: absolute;
	inset: -10% -40%;
	background: linear-gradient(100deg, transparent 40%, rgba(182,144,90,0.10) 48%, rgba(201,205,214,0.14) 50%, rgba(182,144,90,0.10) 52%, transparent 60%);
	animation: ksSweep 9s ease-in-out infinite;
	pointer-events: none;
}
@keyframes ksSweep {
	0%, 20% { transform: translateX(-15%); }
	60%, 100% { transform: translateX(15%); }
}

/* カーソル追従のスポットライト(pointer:fineのみ) */
.ks-hero__spotlight {
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	transition: opacity .4s ease;
	background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), rgba(182,144,90,0.16), transparent 65%);
}
@media (pointer: fine) {
	.ks-hero__spotlight { opacity: 1; }
}

/* 見出し1文字ずつの登場アニメーション */
.ks-char {
	display: inline-block;
	opacity: 0;
	transform: translateY(0.5em);
	animation: ksCharIn .6s cubic-bezier(.2,.7,.2,1) forwards;
	animation-delay: var(--d, 0s);
}
@keyframes ksCharIn {
	to { opacity: 1; transform: translateY(0); }
}
.ks-hero__reveal {
	opacity: 0;
	transform: translateY(16px);
	animation: ksFadeUp .7s ease forwards;
	animation-delay: var(--d, 0s);
}
@keyframes ksFadeUp {
	to { opacity: 1; transform: translateY(0); }
}

/* ヒーロー下部の統計バー */
.ks-hero__stats {
	margin-top: clamp(32px, 6vh, 56px);
}
.ks-hero__stats-inner {
	display: flex;
	gap: clamp(16px, 5vw, 64px);
	flex-wrap: wrap;
	border-top: 1px solid rgba(201,205,214,0.18);
	padding-top: 20px;
}
.ks-stat { display: flex; flex-direction: column; gap: 4px; }
.ks-stat__num {
	font-family: "Noto Serif JP", serif;
	color: var(--gold);
	font-size: clamp(18px, 2.4vw, 28px);
}
.ks-stat__label { color: var(--silver-dim); font-size: 11px; letter-spacing: 0.05em; }
@media (max-width: 640px) {
	.ks-hero__stats-inner { gap: 16px 28px; }
}
.ks-hero__content {
	position: relative;
	padding-top: 100px;
	max-width: 720px;
}
.ks-hero__eyebrow {
	display: inline-block;
	color: var(--gold);
	font-size: 13px;
	letter-spacing: 0.2em;
	margin-bottom: 20px;
	border-left: 2px solid var(--gold);
	padding-left: 12px;
}
.ks-hero h1 {
	color: var(--white);
	font-size: clamp(32px, 5vw, 56px);
	line-height: 1.4;
	margin: 0 0 24px;
}
.ks-hero h1 em {
	font-style: normal;
	color: var(--gold);
}
.ks-hero__sub {
	color: var(--silver);
	font-size: 16px;
	max-width: 560px;
	margin-bottom: 40px;
}
.ks-hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }
.ks-btn {
	display: inline-block;
	padding: 15px 32px;
	border-radius: var(--radius);
	font-size: 15px;
	letter-spacing: 0.05em;
	transition: all .2s;
}
.ks-btn--primary { background: var(--gold); color: var(--ink); }
.ks-btn--primary:hover { background: var(--gold-dark); }
.ks-btn--outline { border: 1px solid var(--silver-dim); color: var(--white); }
.ks-btn--outline:hover { border-color: var(--gold); color: var(--gold); }
.ks-hero__scroll {
	position: absolute;
	bottom: 32px; left: 24px;
	color: var(--silver-dim);
	font-size: 11px;
	letter-spacing: 0.3em;
	writing-mode: vertical-rl;
}

/* ===== セクション共通 ===== */
.ks-section { padding: 96px 0; }
.ks-section--dark { background: var(--ink); color: var(--white); }
.ks-section--cream { background: var(--cream); }

/* ダークな展示セクションから、地域密着セクションへの斜めカット演出 */
#ks-area.ks-section--cream {
	position: relative;
	margin-top: -1px;
}
#ks-area.ks-section--cream::before {
	content: "";
	position: absolute;
	top: -72px; left: 0; right: 0; height: 72px;
	background: var(--ink);
	clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
@media (max-width: 640px) {
	#ks-area.ks-section--cream::before { top: -40px; height: 40px; }
}
.ks-section__head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.ks-section__eyebrow {
	display: block;
	color: var(--gold);
	font-size: 12px;
	letter-spacing: 0.25em;
	margin-bottom: 14px;
}
.ks-section__title { font-size: clamp(24px, 3.2vw, 34px); margin: 0 0 16px; }
.ks-section--dark .ks-section__title { color: var(--white); }
.ks-section__lead { color: var(--text-light); font-size: 15px; }
.ks-section--dark .ks-section__lead { color: var(--silver); }

/* ===== 在庫ラインナップ ===== */
.ks-lineup__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}
@media (max-width: 900px) { .ks-lineup__grid { grid-template-columns: minmax(0, 1fr); } }
.ks-lineup__card {
	display: block;
	background: var(--ink-2);
	border: 1px solid rgba(201,205,214,0.12);
	border-radius: var(--radius);
	overflow: hidden;
}
.ks-lineup__media {
	aspect-ratio: 4 / 3;
	background: linear-gradient(135deg, var(--ink-3), var(--ink));
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--gold);
	font-family: "Noto Serif JP", serif;
	font-size: 14px;
	letter-spacing: 0.1em;
	overflow: hidden;
}
.ks-lineup__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ks-lineup__body { padding: 20px 22px 24px; }
.ks-lineup__brand { color: var(--gold); font-size: 12px; letter-spacing: 0.1em; }
.ks-lineup__name { color: var(--white); font-size: 18px; margin: 8px 0 12px; }
.ks-lineup__meta { display: flex; gap: 14px; color: var(--silver-dim); font-size: 13px; margin-bottom: 14px; }
.ks-lineup__price { color: var(--white); font-size: 22px; font-family: "Noto Serif JP", serif; }
.ks-lineup__price span { color: var(--silver-dim); font-size: 12px; margin-left: 6px; }
.ks-lineup__more { text-align: center; margin-top: 48px; }

/* ===== 選ばれる理由(エディトリアルなリスト、絵文字/カードを使わない) ===== */
.ks-reasons__head {
	max-width: 640px;
	margin: 0 0 8px;
}
.ks-reasons__head .ks-section__title { margin-bottom: 0; }
.ks-reasons__list {
	list-style: none;
	margin: 56px 0 0;
	padding: 0;
	border-top: 1px solid var(--cream-border);
}
.ks-reasons__row {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	align-items: baseline;
	gap: 32px;
	padding: 32px 0;
	border-bottom: 1px solid var(--cream-border);
	transition: padding-left .3s ease;
}
.ks-reasons__row:hover { padding-left: 12px; }
/* 初回表示アニメーションが終わったら、以後はスクロール量(--sp: 画面中央に近いほど1)で
   連続的に強調度が変わるようにする(トランジションを切って直結させる) */
.ks-reasons__row.is-visible {
	transition: opacity .1s linear;
	transform: scale(calc(0.97 + var(--sp, 1) * 0.03));
	opacity: calc(0.55 + var(--sp, 1) * 0.45);
	filter: none;
}
.ks-reasons__row.is-visible .ks-reasons__index {
	transition: color .2s ease;
	color: color-mix(in srgb, var(--gold) calc(var(--sp, 1) * 100%), var(--silver-dim));
}
.ks-reasons__index {
	font-family: "Noto Serif JP", serif;
	font-size: 34px;
	color: var(--gold);
	line-height: 1;
}
.ks-reasons__title { font-size: 19px; margin: 0 0 10px; }
.ks-reasons__text { font-size: 14px; color: var(--text-light); max-width: 640px; }
@media (max-width: 640px) {
	.ks-reasons__row { grid-template-columns: 56px minmax(0, 1fr); gap: 20px; padding: 24px 0; }
	.ks-reasons__index { font-size: 24px; }
}

/* ===== サービス ===== */
.ks-services__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	background: rgba(201,205,214,0.15);
	border: 1px solid rgba(201,205,214,0.15);
}
@media (max-width: 760px) { .ks-services__grid { grid-template-columns: minmax(0, 1fr); } }
.ks-services__item {
	background: var(--ink);
	padding: 32px 28px;
}
.ks-services__num { color: var(--gold); font-family: "Noto Serif JP", serif; font-size: 13px; }
.ks-services__title { color: var(--white); font-size: 17px; margin: 10px 0 10px; }
.ks-services__text { color: var(--silver); font-size: 13px; }

.ks-services__pricing {
	margin-top: 40px;
	border: 1px solid rgba(182,144,90,0.3);
	border-radius: var(--radius);
	padding: 28px 32px;
}
.ks-services__pricing h3 {
	color: var(--gold);
	font-size: 16px;
	margin: 0 0 18px;
}
.ks-services__pricing table { width: 100%; border-collapse: collapse; }
.ks-services__pricing th, .ks-services__pricing td {
	text-align: left;
	padding: 10px 0;
	border-bottom: 1px solid rgba(201,205,214,0.15);
	font-size: 13px;
	font-weight: 400;
}
.ks-services__pricing th { color: var(--silver); width: 55%; }
.ks-services__pricing td { color: var(--white); }
.ks-services__pricing-note {
	margin: 16px 0 0;
	font-size: 12px;
	color: var(--silver-dim);
	line-height: 1.7;
}

/* ===== 地域密着エリア ===== */
.ks-area {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 56px;
	align-items: start;
}
@media (max-width: 900px) { .ks-area { grid-template-columns: minmax(0, 1fr); } }
.ks-area__map {
	border: 1px solid var(--cream-border);
	border-radius: var(--radius);
	overflow: hidden;
	aspect-ratio: 4 / 3;
}
.ks-area__map iframe { width: 100%; height: 100%; border: 0; display: block; }
.ks-area__address { margin-bottom: 0; }
.ks-area__address dt { color: var(--gold-dark); font-size: 12px; letter-spacing: 0.1em; margin-bottom: 6px; }
.ks-area__address dd { margin: 0 0 18px; font-size: 15px; }

/* ===== お客様の声 ===== */
.ks-voices__badge {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--ink-2); color: var(--gold);
	padding: 8px 18px; border-radius: 999px; font-size: 13px;
	margin-bottom: 40px;
}
.ks-voices__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}
@media (max-width: 900px) { .ks-voices__grid { grid-template-columns: minmax(0, 1fr); } }
.ks-voices__card {
	background: var(--ink-2);
	border: 1px solid rgba(201,205,214,0.12);
	border-radius: var(--radius);
	padding: 28px;
}
.ks-voices__stars { color: var(--gold); font-size: 14px; margin-bottom: 14px; }
.ks-voices__text { color: var(--silver); font-size: 14px; margin-bottom: 16px; }
.ks-voices__name { color: var(--white); font-size: 13px; }

/* ===== 会社概要 ===== */
.ks-company table { width: 100%; border-collapse: collapse; }
.ks-company th, .ks-company td {
	text-align: left;
	padding: 16px 0;
	border-bottom: 1px solid var(--cream-border);
	font-size: 14px;
	vertical-align: top;
}
.ks-company th { width: 180px; color: var(--gold-dark); font-weight: 500; }

/* ===== お問い合わせ ===== */
.ks-contact {
	background: var(--ink);
	color: var(--white);
	text-align: center;
}
.ks-contact__tel {
	display: block;
	font-family: "Noto Serif JP", serif;
	font-size: clamp(30px, 5vw, 44px);
	color: var(--gold);
	margin: 24px 0 8px;
}
.ks-contact__hours { color: var(--silver); font-size: 14px; margin-bottom: 32px; }

/* ===== フッター ===== */
.ks-footer {
	background: var(--ink);
	color: var(--silver-dim);
	font-size: 12px;
	text-align: center;
	padding: 28px 0;
	border-top: 1px solid rgba(201,205,214,0.1);
}

/* ===== プレーンヘッダー(車両詳細・一覧ページ用、固定/透明にしない) ===== */
.ks-plain-header {
	background: var(--ink);
	padding: 20px 0;
}
.ks-plain-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.ks-plain-header .ks-brand__mark { height: 26px; }
.ks-plain-header__back { color: var(--silver); font-size: 13px; transition: color .2s; }
.ks-plain-header__back:hover { color: var(--gold); }

/* ===== 車両詳細ページ ===== */
.ks-vehicle { padding: 56px 0 96px; }
.ks-vehicle__layout {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	gap: 56px;
}
@media (max-width: 900px) { .ks-vehicle__layout { grid-template-columns: minmax(0, 1fr); } }
.ks-vehicle__main-photo {
	aspect-ratio: 4 / 3;
	border-radius: var(--radius);
	overflow: hidden;
	background: linear-gradient(135deg, var(--ink-3), var(--ink));
}
.ks-vehicle__main-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ks-vehicle__main-photo--placeholder {
	display: flex; align-items: center; justify-content: center;
	color: var(--gold); font-family: "Noto Serif JP", serif; letter-spacing: 0.1em;
}
.ks-vehicle__gallery {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	margin-top: 8px;
}
.ks-vehicle__gallery img {
	aspect-ratio: 1 / 1;
	width: 100%;
	object-fit: cover;
	border-radius: var(--radius);
}
.ks-vehicle__status {
	display: inline-block;
	font-size: 12px;
	letter-spacing: 0.05em;
	padding: 5px 14px;
	border-radius: 999px;
	margin-bottom: 16px;
}
.ks-vehicle__status--available { background: var(--gold); color: var(--ink); }
.ks-vehicle__status--negotiating { border: 1px solid var(--gold); color: var(--gold); }
.ks-vehicle__status--sold { border: 1px solid var(--silver-dim); color: var(--silver-dim); }
.ks-vehicle__brand { display: block; color: var(--gold-dark); font-size: 13px; letter-spacing: 0.05em; margin-bottom: 8px; }
.ks-vehicle__title { font-size: clamp(24px, 3vw, 32px); margin: 0 0 20px; }
.ks-vehicle__price {
	font-family: "Noto Serif JP", serif;
	font-size: 28px;
	margin-bottom: 24px;
}
.ks-vehicle__price span { color: var(--text-light); font-size: 13px; margin-left: 8px; }
.ks-vehicle__spec { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.ks-vehicle__spec th, .ks-vehicle__spec td {
	text-align: left; padding: 12px 0; border-bottom: 1px solid var(--cream-border); font-size: 14px;
}
.ks-vehicle__spec th { width: 120px; color: var(--gold-dark); font-weight: 500; }
.ks-vehicle__highlights { list-style: none; margin: 0 0 24px; padding: 0; }
.ks-vehicle__highlights li {
	position: relative; padding-left: 22px; margin-bottom: 10px; font-size: 14px; color: var(--text);
}
.ks-vehicle__highlights li::before { content: "✓"; position: absolute; left: 0; color: var(--gold-dark); }
.ks-vehicle__desc { font-size: 14px; color: var(--text-light); margin-bottom: 28px; }
.ks-vehicle__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.ks-vehicle .ks-btn--primary { background: var(--gold-dark); color: var(--white); }
.ks-vehicle .ks-btn--outline { border-color: var(--gold-dark); color: var(--gold-dark); }

/* ===== 在庫車両一覧ページ ===== */
.ks-vehicle-archive { padding: 56px 0 96px; }
.ks-vehicle-archive__pagination {
	display: flex; gap: 8px; justify-content: center; margin-top: 48px;
}
.ks-vehicle-archive__pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 36px; height: 36px; padding: 0 10px;
	border: 1px solid var(--cream-border); border-radius: var(--radius);
	font-size: 13px; color: var(--text);
}
.ks-vehicle-archive__pagination .page-numbers.current { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* ===== スクロール表示アニメーション(スケール+ブラーで奥行きを演出、JSでstagger付与) ===== */
[data-ks-reveal] {
	opacity: 0;
	transform: translateY(28px) scale(.96);
	filter: blur(6px);
	transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1), filter .8s ease;
	transition-delay: var(--rd, 0s);
}
[data-ks-reveal].is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	filter: blur(0);
}

/* ===== カード3Dチルト(マウス追従、pointer:fineのみJSが有効化) ===== */
.ks-lineup__card {
	transition: transform .25s ease, border-color .25s ease;
	transform-style: preserve-3d;
	will-change: transform;
}
.ks-lineup__card:hover { border-color: rgba(182,144,90,0.4); }

/* ===== マグネティックボタン(カーソルにわずかに引き寄せられる) ===== */
[data-ks-magnetic] {
	display: inline-block;
	transition: transform .2s ease;
}
