/* kirihasu.com 共通スタイル（静的サイト用・ビルド不要）
   方向：ナイトガレージ。黒い背景にガヤルドの写真を主役に、差し色は車体の青だけ。
   構成：1 トークン → 2 基本 → 3 共通部品（ヘッダー／フッター／記事リスト） → 4 トップページ → 5 /apps/（黒） → 6 WordPress 由来ページ（紙色のまま）
   既存記事の本文（.entry-content）は体裁だけを整え、内容は触らない。 */

/* ---------- 1. トークン ---------- */
:root {
  /* 夜（トップ・/apps/・ヘッダー・フッター） */
  --kh-night: #0B0D12;
  --kh-night-2: #12151C;
  --kh-night-3: #1A1F29;
  --kh-night-line: rgba(255,255,255,.14);
  --kh-snow: #F3F4F6;        /* 黒地の本文 */
  --kh-fog: #A9AFBA;         /* 黒地の補助 */
  --kh-blue: #3B86FF;        /* 黒地の差し色（ガヤルドの青） */
  --kh-blue-deep: #2F6FE0;   /* ボタン背景。白文字で 4.7:1 */
  /* 紙（記事） */
  --kh-ink: #16181B;
  --kh-asphalt: #4B5058;
  --kh-mute: #6B7079;
  --kh-paper: #F4F5F3;
  --kh-panel: #E7E9E6;
  --kh-line: #D3D6D2;
  --kh-accent: #1B5FC4;      /* 紙地のリンク */
  --kh-accent-ink: #15489A;
  --kh-font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --kh-measure: 42rem;       /* 記事本文の行長 */
  --kh-wide: 72rem;          /* トップ・/apps/・ヘッダーの幅 */
  --kh-gutter: 16px;
  --kh-section: 72px;
}
@media (min-width: 960px) {
  :root { --kh-gutter: 32px; --kh-section: 112px; }
}

/* ---------- 2. 基本 ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--kh-paper);
  color: var(--kh-ink);
  font-family: var(--kh-font);
  font-size: 16px;
  line-height: 1.9;
}
.kh-page img, .kh-page video { max-width: 100%; height: auto; }
.kh-page a { color: var(--kh-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.kh-page a:hover { color: var(--kh-accent-ink); }
.kh-page :focus-visible, .kh-header :focus-visible, .kh-footer :focus-visible, .kh-dark :focus-visible {
  outline: 2px solid var(--kh-blue); outline-offset: 3px; border-radius: 2px;
}
.kh-wrap { max-width: var(--kh-wide); margin: 0 auto; padding: 0 var(--kh-gutter); }
.kh-measure { max-width: var(--kh-measure); }
.kh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .kh-page *, .kh-dark * { transition: none !important; } }

/* ---------- 3. 共通部品（全ページ共通。黒） ---------- */
.kh-header { background: var(--kh-night); color: var(--kh-snow); }
.kh-header__in { display: flex; align-items: center; justify-content: space-between; height: 56px; }
body .kh-header__logo { color: var(--kh-snow); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: .04em; line-height: 1; white-space: nowrap; }
body .kh-header__logo:hover { color: var(--kh-snow); }
.kh-nav { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
body .kh-nav a { display: block; padding: 10px 10px; color: var(--kh-fog); text-decoration: none; font-size: 15px; font-weight: 700; line-height: 1; }
body .kh-nav a:hover { color: var(--kh-snow); }
@media (min-width: 960px) {
  .kh-header__in { height: 68px; }
  .kh-nav { gap: 14px; }
  body .kh-nav a { font-size: 16px; }
}

.kh-footer { margin-top: var(--kh-section); background: var(--kh-night); color: var(--kh-fog); padding: 48px 0 32px; font-size: 14px; border-top: 1px solid var(--kh-night-line); }
.kh-footer .kh-wrap { max-width: var(--kh-wide); }
.kh-footer__grid { display: grid; gap: 28px; }
.kh-footer h2 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--kh-snow); letter-spacing: .04em; }
.kh-footer ul { list-style: none; margin: 0; padding: 0; }
.kh-footer li { margin: 0 0 8px; }
body .kh-footer a { color: var(--kh-fog); text-decoration: none; }
body .kh-footer a:hover { color: var(--kh-snow); text-decoration: underline; text-underline-offset: .2em; }
.kh-footer__copy { margin: 40px 0 0; font-size: 13px; color: var(--kh-fog); opacity: .8; }
@media (min-width: 640px) { .kh-footer__grid { grid-template-columns: 1fr 1fr 1fr; } }

/* 記事リスト：日付＋題名の行。紙地（/blog/）と黒地（トップ）の両方で使う */
.kh-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--kh-line); }
.kh-list li { border-bottom: 1px solid var(--kh-line); }
body .kh-list a { display: grid; grid-template-columns: 5.6em 1fr; gap: 12px; padding: 14px 0; color: var(--kh-ink); text-decoration: none; }
body .kh-list a:hover .kh-list__title { text-decoration: underline; text-decoration-color: var(--kh-accent); text-underline-offset: .2em; }
.kh-list time { color: var(--kh-asphalt); font-size: 14px; font-variant-numeric: tabular-nums; padding-top: .15em; }
.kh-list__title { font-size: 16px; line-height: 1.7; }
.kh-list__car { display: block; margin-top: 2px; font-size: 13px; color: var(--kh-mute); }

/* ---------- 4. トップページ（黒） ---------- */
body.kh-top { background: var(--kh-night); color: var(--kh-snow); }
.kh-top a { color: var(--kh-blue); }
.kh-top a:hover { color: var(--kh-snow); }
.kh-top main { display: block; }
.kh-section { padding-top: var(--kh-section); }
.kh-h2 { margin: 0 0 6px; font-size: clamp(30px, 5vw, 44px); font-weight: 900; line-height: 1.2; letter-spacing: .01em; color: var(--kh-snow); }
.kh-lead { margin: 0 0 28px; color: var(--kh-fog); font-size: 15px; max-width: var(--kh-measure); }
.kh-more { margin: 24px 0 0; font-size: 15px; }
.kh-top .kh-more a { color: var(--kh-snow); text-decoration-color: var(--kh-blue); text-underline-offset: .25em; }

/* ヘッダーはヒーローの上に重ねる */
.kh-top .kh-header { position: absolute; top: 0; left: 0; right: 0; z-index: 3; background: linear-gradient(180deg, rgba(11,13,18,.72), rgba(11,13,18,0)); }

/* ヒーロー：全幅の写真。文字は左下 */
.kh-hero { position: relative; min-height: min(92vh, 920px); min-height: min(92svh, 920px); display: flex; align-items: flex-end; overflow: hidden; background: var(--kh-night); }
.kh-page .kh-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.kh-hero__shade { position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(11,13,18,0) 35%, rgba(11,13,18,.55) 70%, rgba(11,13,18,.97) 100%),
  linear-gradient(90deg, rgba(11,13,18,.45) 0%, rgba(11,13,18,0) 55%); }
.kh-hero__in { position: relative; z-index: 2; width: 100%; padding-top: 120px; padding-bottom: 36px; box-sizing: border-box; }
.kh-hero__tag { margin: 0 0 18px; font-size: clamp(46px, 12.5vw, 128px); font-weight: 900; line-height: 1.02; letter-spacing: .01em; color: var(--kh-snow); text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.kh-hero__tag .kh-dot { color: var(--kh-blue); }
.kh-hero__text { margin: 0 0 24px; max-width: 30em; font-size: 16px; line-height: 1.9; color: rgba(243,244,246,.9); }
.kh-hero__cta { display: flex; flex-wrap: wrap; gap: 10px 12px; margin: 0; padding: 0; list-style: none; }
body .kh-btn { display: inline-block; padding: 13px 22px; border-radius: 6px; font-weight: 700; font-size: 15px; line-height: 1; text-decoration: none; border: 1.5px solid transparent; }
body .kh-btn--primary { background: var(--kh-blue-deep); color: #fff; } /* 白文字で 4.7:1 */
body .kh-btn--primary:hover { background: #fff; color: var(--kh-night); }
body .kh-btn--ghost { color: var(--kh-snow); border-color: rgba(255,255,255,.55); }
body .kh-btn--ghost:hover { background: rgba(255,255,255,.12); color: var(--kh-snow); }
.kh-hero__credit { position: absolute; z-index: 2; right: var(--kh-gutter); bottom: 10px; margin: 0; font-size: 12px; color: rgba(243,244,246,.75); }
@media (min-width: 960px) {
  .kh-page .kh-hero__img { object-position: 50% 50%; }
  .kh-hero__in { padding-top: 160px; padding-bottom: 56px; }
  .kh-hero__tag { margin-bottom: 24px; }
  .kh-hero__text { font-size: 18px; margin-bottom: 32px; }
  body .kh-btn { padding: 15px 28px; font-size: 16px; }
  .kh-hero__credit { bottom: 16px; }
}

/* 実測の数字：3 つ。数字が主役、条件は小さく、各記事へ */
.kh-figures { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--kh-night-line); border-bottom: 1px solid var(--kh-night-line); }
.kh-figures li + li { border-top: 1px solid var(--kh-night-line); }
body .kh-figure { display: block; padding: 22px 0; color: var(--kh-snow); text-decoration: none; }
.kh-figure__num { display: block; white-space: nowrap; font-size: clamp(34px, 9vw, 52px); font-weight: 900; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kh-figure__num small { font-size: .5em; font-weight: 700; margin-left: .15em; letter-spacing: 0; }
.kh-figure__label { display: block; margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--kh-fog); }
body .kh-figure:hover .kh-figure__num { color: var(--kh-blue); }
@media (min-width: 760px) {
  .kh-figures { display: grid; grid-template-columns: repeat(3, 1fr); }
  .kh-figures li + li { border-top: 0; border-left: 1px solid var(--kh-night-line); }
  body .kh-figure { padding: 28px 28px 28px 0; }
  .kh-figure__num { font-size: clamp(34px, 3.4vw, 46px); }
  .kh-figures li + li .kh-figure { padding-left: 28px; }
}

/* 車：写真タイル 2 枚。文字は写真の下端に重ねる */
.kh-cars { display: grid; gap: 16px; }
body .kh-car { position: relative; display: block; overflow: hidden; border-radius: 8px; color: var(--kh-snow); text-decoration: none; background: var(--kh-night-2); }
.kh-car img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s ease; }
.kh-car__text { position: absolute; left: 0; right: 0; bottom: 0; padding: 72px 20px 18px; background: linear-gradient(180deg, rgba(11,13,18,0), rgba(11,13,18,.92)); }
.kh-car h3 { margin: 0 0 4px; font-size: 22px; line-height: 1.3; font-weight: 900; }
.kh-car p { margin: 0; color: rgba(243,244,246,.82); font-size: 14px; line-height: 1.6; }
body .kh-car:hover img { transform: scale(1.03); }
body .kh-car:hover h3 { color: var(--kh-blue); }
@media (min-width: 640px) { .kh-cars { grid-template-columns: 1fr 1fr; gap: 20px; } .kh-car img { aspect-ratio: 16 / 11; } .kh-car h3 { font-size: 24px; } .kh-car__text { padding: 96px 24px 22px; } }

/* アプリ：アイコンと一言。背景カードは作らず、罫線で区切る */
.kh-apps { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--kh-night-line); }
.kh-app { display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto auto; column-gap: 16px; row-gap: 0; align-content: start; padding: 18px 0; border-bottom: 1px solid var(--kh-night-line); min-width: 0; }
.kh-app > * { grid-column: 2; min-width: 0; }
.kh-app > .kh-app__icon { grid-column: 1; grid-row: 1 / 4; }
.kh-app > .kh-app__status { justify-self: start; }
.kh-app__icon { display: block; width: 56px; height: 56px; border-radius: 22.37%; background: var(--kh-night-3); overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.kh-app__icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kh-app h3 { margin: 2px 0 4px; font-size: 17px; line-height: 1.4; font-weight: 700; color: var(--kh-snow); }
body .kh-app h3 a { color: var(--kh-snow); text-decoration: none; }
body .kh-app h3 a:hover { color: var(--kh-blue); }
.kh-app p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--kh-fog); }
.kh-app__status { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--kh-fog); border: 1px solid var(--kh-night-line); padding: 2px 8px; border-radius: 4px; }
.kh-app__status--live { color: var(--kh-blue); border-color: rgba(59,134,255,.5); }
@media (min-width: 640px) {
  .kh-apps { grid-template-columns: 1fr 1fr; column-gap: 32px; }
}
@media (min-width: 960px) {
  .kh-apps { grid-template-columns: repeat(3, 1fr); column-gap: 40px; }
  .kh-app { grid-template-columns: 64px 1fr; padding: 22px 0; }
  .kh-app__icon { width: 64px; height: 64px; }
}

/* トップの記事リストは黒地用の色 */
.kh-top .kh-list { border-top-color: var(--kh-night-line); }
.kh-top .kh-list li { border-bottom-color: var(--kh-night-line); }
body.kh-top .kh-list a { color: var(--kh-snow); }
body.kh-top .kh-list a:hover .kh-list__title { text-decoration-color: var(--kh-blue); }
.kh-top .kh-list time { color: var(--kh-fog); }
.kh-top .kh-list__car { color: var(--kh-fog); }

/* 自己紹介と SNS */
.kh-about p { margin: 0 0 14px; max-width: var(--kh-measure); color: rgba(243,244,246,.92); }
.kh-sns { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 20px 0 0; padding: 0; list-style: none; }
body .kh-sns a { display: inline-block; padding: 9px 16px; border: 1px solid var(--kh-night-line); border-radius: 6px; color: var(--kh-snow); text-decoration: none; font-weight: 700; font-size: 14px; }
body .kh-sns a:hover { border-color: var(--kh-blue); color: var(--kh-blue); }

/* ---------- 5. /apps/（黒。WordPress の固定ページに黒地を敷く） ---------- */
body.kh-dark, .kh-dark #container, .kh-dark #content, .kh-dark #inner-content, .kh-dark #main, .kh-dark #entry, .kh-dark .entry { background: var(--kh-night) !important; color: var(--kh-snow); box-shadow: none !important; }
body.kh-dark #inner-content { max-width: calc(var(--kh-wide) + var(--kh-gutter) * 2) !important; }  /* 6 節の .page #inner-content より強くする */
.kh-dark .page-title, .kh-dark .entry-title { color: var(--kh-snow); font-size: clamp(30px, 5vw, 44px); font-weight: 900; }
.kh-dark #breadcrumb, .kh-dark #breadcrumb a { color: var(--kh-fog); }
.kh-dark #breadcrumb li + li::before { color: var(--kh-night-line); }
.kh-dark .entry-content { color: var(--kh-snow); }
.kh-dark .entry-content > p { color: var(--kh-fog); max-width: var(--kh-measure); }
.kh-dark .entry-content a { color: var(--kh-blue); }
.kh-dark .entry-content .kh-app h3 a { color: var(--kh-snow); }
.kh-dark .entry-content .kh-app h3 a:hover { color: var(--kh-blue); }
.kh-dark .article-header, .kh-dark #breadcrumb, .kh-dark .breadcrumb { background: transparent !important; box-shadow: none !important; }
.kh-dark .article-footer, .kh-dark .sns-btn, .kh-dark #sidebar1, .kh-dark .pre-footer { display: none !important; }
/* SANGO の本文用 ul・li・h3 の装飾を解く */
.entry-content .kh-apps { list-style: none; margin: 24px 0 0; padding: 0; }
.entry-content .kh-app { list-style: none; margin: 0; }
.entry-content .kh-app h3 { margin: 2px 0 4px; padding: 0; border: 0; background: none; font-size: 17px; line-height: 1.4; }
.entry-content .kh-app p { margin: 0; font-size: 14px; line-height: 1.7; }
.entry-content .kh-list { list-style: none; margin: 16px 0 0; padding: 0; }
.entry-content .kh-list li { list-style: none; padding: 0; margin: 0; }

/* ---------- 6. WordPress 由来ページ（記事・固定ページ・カテゴリ一覧）。紙色で読みやすく ---------- */
body.wp-singular, body.archive { background: var(--kh-paper); color: var(--kh-ink); font-family: var(--kh-font); font-size: 16px; }
#container { overflow-x: clip; }
#content { padding: 0; }
#inner-content, .single #inner-content, .page #inner-content {
  width: auto !important; max-width: calc(var(--kh-measure) + var(--kh-gutter) * 2) !important;
  margin: 0 auto !important; padding: 0 var(--kh-gutter) !important; box-sizing: border-box;
}
.kh-header .kh-wrap, .kh-footer .kh-wrap { max-width: var(--kh-wide) !important; padding: 0 var(--kh-gutter) !important; }
#main, .d-5of7, .d-2of7 { width: 100% !important; float: none !important; margin: 0 !important; padding: 0 !important; }
#main { padding-top: 24px !important; }
/* 静的化で動かない部品は表示しない：サイドバー・検索・コメント投稿欄 */
#sidebar1, .header-search, #respond, .comment-respond { display: none !important; }
#comments:empty { display: none; }
.dfont { font-family: inherit !important; }
/* 記事ヘッダー */
#breadcrumb { font-size: 13px; color: var(--kh-mute); }
#breadcrumb ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0 6px; }
#breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--kh-line); }
#breadcrumb a { color: var(--kh-mute); text-decoration: none; }
#breadcrumb a:hover { text-decoration: underline; }
.entry-title, .page-title, .archive-header h1, #archive_header h1 { font-size: 24px; line-height: 1.45; font-weight: 800; letter-spacing: -.01em; margin: 10px 0 8px; color: var(--kh-ink); }
.entry-meta { color: var(--kh-asphalt); font-size: 14px; display: flex; flex-wrap: wrap; gap: 0 16px; }
.entry-meta time.updated::before { content: "更新 "; }
.post-thumbnail { margin: 20px 0 0; }
.post-thumbnail img { display: block; width: 100%; height: auto; border-radius: 6px; }
@media (min-width: 960px) { .entry-title, .page-title, .archive-header h1, #archive_header h1 { font-size: 30px; } }
/* 本文：内容は触らず、はみ出しだけ止める */
.entry-content { font-size: 16px; line-height: 1.9; color: var(--kh-ink); overflow-wrap: anywhere; }
.entry-content img, .entry-content video { max-width: 100%; height: auto; }
.entry-content iframe, .entry-content embed, .entry-content object { max-width: 100%; }
.entry-content table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 表のセル：テーマの word-break:break-all（.entry-content .wp-block-table td）が「120,0／00円」のように数字の途中で折るので、#main で上書きして通常の改行に戻す。表は横スクロールできる */
#main .entry-content th, #main .entry-content td { word-break: normal; overflow-wrap: normal; }
@media (max-width: 480px) { .entry-content table { font-size: 15px; } }
.entry-content pre { max-width: 100%; overflow-x: auto; }
.entry-content [style*="width:"] { max-width: 100% !important; }
.entry-content .wp-block-image, .entry-content figure { max-width: 100%; }
.entry-content h2 { font-size: 22px; line-height: 1.45; margin: 48px 0 16px; font-weight: 800; }
.entry-content h3 { font-size: 19px; line-height: 1.5; margin: 36px 0 12px; }
.entry-content a { color: var(--kh-accent); }
@media (max-width: 768px) {
  .entry-content .alignleft, .entry-content .alignright { float: none; margin-left: 0; margin-right: 0; }
}
/* カテゴリ一覧：SANGO のカードを 1 列 → 2 列の素直なグリッドに */
.catpost-cards { display: grid; grid-template-columns: 1fr; gap: 28px 24px; margin: 24px 0 0; }
.catpost-cards .c_linkto_wrap { width: auto !important; margin: 0 !important; padding: 0 !important; float: none !important; }
.catpost-cards .c_linkto { display: block; color: var(--kh-ink); text-decoration: none; background: none; box-shadow: none; }
.catpost-cards .c_linkto_img_wrap { display: block; }
.catpost-cards .c_linkto img { display: block; width: 100%; height: auto; aspect-ratio: 520 / 300; object-fit: cover; background: var(--kh-panel); border-radius: 6px; }
.catpost-cards .c_linkto_text { padding: 10px 0 0; }
.catpost-cards .c_linkto_text time { font-size: 13px; color: var(--kh-asphalt); }
.catpost-cards .c_linkto_text h2 { font-size: 16px; line-height: 1.6; margin: 2px 0 0; font-weight: 700; }
.catpost-cards .c_linkto:hover h2 { text-decoration: underline; text-decoration-color: var(--kh-accent); text-underline-offset: .2em; }
@media (min-width: 640px) { .catpost-cards { grid-template-columns: 1fr 1fr; } }
.pagination { margin: 40px 0 0; }
.pagination ul { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; }
.pagination a, .pagination span { display: inline-block; min-width: 40px; padding: 8px 12px; text-align: center; border: 1px solid var(--kh-line); color: var(--kh-ink); text-decoration: none; }
.pagination .current { background: var(--kh-ink); color: #fff; border-color: var(--kh-ink); }
.article-footer { margin-top: 48px; }
