/* ==========================================================================
   ともろう工房 - 共通スタイルシート
   方針：白地に黒い文字、青いリンク。飾りは最小限で、文字とリストで読ませる。
   ========================================================================== */

:root {
  --bg: #ffffff;
  --ink: #222222;        /* 本文 */
  --ink-muted: #666666;  /* 補足・日付など */
  --line: #dddddd;       /* 区切り線 */
  --bg-soft: #f5f5f5;    /* 囲み枠の地色 */
  --link: #1a5fb4;
  --link-visited: #5b3c8c;
  --link-hover: #d1440c;

  --font-body: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;

  --content-width: 1000px;
  --sidebar-width: 240px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
}

a { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover { color: var(--link-hover); }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }

.container { /* ページ内側の器。幅は .layout 側で決める */ }

/* ==========================================================================
   ヘッダー
   ========================================================================== */
.site-head {
  border-bottom: 1px solid var(--line);
}
.site-head__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 20px 20px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}
.site-title a,
.site-title a:visited { color: var(--ink); text-decoration: none; }
.site-tagline {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}
.site-head__sns { display: flex; gap: 12px; }

.sns-link,
.sns-link:visited {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
}
.sns-link:hover { color: var(--ink); }
.sns-link__favicon { width: 18px; height: 18px; border-radius: 3px; flex-shrink: 0; }

/* ==========================================================================
   本文＋サイドバーの2段組み（nav.js が .layout で囲む）
   ========================================================================== */
.layout {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  gap: 48px;
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; gap: 32px; }
}

/* ページ見出し（旧 hero） */
.hero { margin-bottom: 24px; }
.hero__eyebrow { display: none; }
.hero__title {
  font-size: 26px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
}
.hero__lead { color: var(--ink); }

.breadcrumb {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}
.breadcrumb span { margin: 0 6px; }

.section { margin-bottom: 32px; }
.section__head { margin: 0; }
.section__title,
.prose h2 {
  font-size: 19px;
  margin-top: 1.6em;
  padding-left: 10px;
  border-left: 4px solid var(--ink);
}
.prose h3 { font-size: 16px; }
.prose ul, .prose ol { padding-left: 1.4em; }

/* ==========================================================================
   カテゴリー一覧（旧カード）→ ただの箇条書き
   ========================================================================== */
.card-grid {
  margin: 0;
  padding-left: 1.4em;
}
.card {
  display: list-item;
  list-style: disc;
  margin-bottom: 10px;
  text-decoration: none;
}
.card__title {
  display: inline;
  font-size: 16px;
  font-weight: 700;
  text-decoration: underline;
}
.card__owned {
  display: inline-block;
  margin-left: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-muted);
}
.card__desc {
  margin: 0;
  font-size: 14px;
  color: var(--ink-muted);
}
.spec-plate,
.card__link { display: none; }

/* 更新履歴 */
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: 4px 0; border-bottom: 1px dotted var(--line); }
.history time {
  display: inline-block;
  min-width: 7em;
  color: var(--ink-muted);
  font-size: 14px;
}

/* ==========================================================================
   サイドバー
   ========================================================================== */
.sidebar { font-size: 14px; }
.sidebar__title {
  font-size: 15px;
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.sidebar__block { margin-bottom: 28px; }
.side-nav,
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav ul { padding-left: 1em; }
.side-nav li { margin: 2px 0; }
.side-nav li::before { content: "- "; color: var(--ink-muted); }
.side-nav a.is-current { color: var(--ink); font-weight: 700; text-decoration: none; }
.sidebar .site-head__sns { flex-direction: column; gap: 4px; }
.link-group__title {
  margin: 10px 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}
.link-group__title:first-child { margin-top: 0; }

/* ==========================================================================
   フッター
   ========================================================================== */
#site-footer {
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-muted);
}
.footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 16px 20px 24px;
}

/* ==========================================================================
   汎用パーツ
   ========================================================================== */
.btn { font-size: 15px; }

.lang-toggle-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 6px 14px;
  background: #fff;
  color: var(--ink);
  border: 1px solid #999;
  border-radius: 3px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.lang-toggle-btn:hover { background: var(--bg-soft); }

.notice-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 12px 16px;
  font-size: 14px;
  margin: 24px 0;
}

.placeholder-box {
  color: var(--ink-muted);
  font-size: 14px;
}

/* 自己紹介 */
.profile__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.profile__icon { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); flex-shrink: 0; }
.profile__name { margin: 0; font-weight: 700; font-size: 15px; }
.profile__role { margin: 0; font-size: 12px; color: var(--ink-muted); line-height: 1.5; }
.profile__title { margin: 12px 0 2px; font-size: 14px; }
.profile__text { margin: 0; }
.profile__closing { margin: 12px 0 0; }
.profile__group {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}
.profile__hobbies {
  padding-left: 10px;
  border-left: 2px solid var(--line);
}
.profile__hobbies .profile__title:first-child { margin-top: 4px; }

/* 写真 */
.hero__photo { margin: 16px 0 0; }
.hero__photo img { display: block; width: 100%; height: auto; }

/* サムネイル付きの一覧（車種一覧など） */
.card--thumb {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  list-style: none;
  margin-left: -1.4em;
  margin-bottom: 16px;
}
.card__thumb { width: 160px; height: auto; flex-shrink: 0; }

/* 車両データの表 */
.spec-table { border-collapse: collapse; margin: 12px 0 0; font-size: 14px; }
.spec-table th,
.spec-table td { border: 1px solid var(--line); padding: 4px 12px; text-align: left; }
.spec-table th { background: var(--bg-soft); font-weight: 700; white-space: nowrap; }

/* 記事 */
.post-meta { margin: -4px 0 0; font-size: 14px; color: var(--ink-muted); }
.post-photo { margin: 20px 0; }
.post-photo img { display: block; width: 100%; height: auto; }
.post-photo figcaption { margin-top: 4px; font-size: 13px; color: var(--ink-muted); }
.post-back { margin-top: 32px; font-size: 14px; }

/* 記事一覧（日付＋タイトル） */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 6px 0; border-bottom: 1px dotted var(--line); }
.post-list time { display: inline-block; min-width: 8em; color: var(--ink-muted); font-size: 14px; }

/* 整備記事の手順（写真＋説明） */
.post-step { margin: 28px 0; }
.post-step img { display: block; max-width: 100%; height: auto; margin-bottom: 8px; }
.post-step p { margin: 0; }
.post-source { margin-top: 32px; font-size: 13px; color: var(--ink-muted); }

/* 記事一覧（サムネイル付き）
   サムネイルは /images/thumbs/<記事のフォルダ名>.jpg（320x240）に置く */
.post-list .post-item {
  display: flex;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.post-list li:has(.post-item) { padding: 10px 0; }
.post-item__thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.post-item__body { display: flex; flex-direction: column; gap: 2px; }
.post-item__body time { min-width: 0; }
.post-item__title { color: var(--link); text-decoration: underline; font-weight: 700; }
.post-item:visited .post-item__title { color: var(--link-visited); }
.post-item:hover .post-item__title { color: var(--link-hover); }

/* アクセスカウンター（緑の7セグメント表示・水色の枠） */
.visitor-counter { margin: 0; }
.visitor-counter > div { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.visitor-counter dt { width: 2.5em; font-weight: 700; }
.visitor-counter dd { margin: 0; }
.led-counter {
  display: inline-flex;
  gap: 2px;
  padding: 4px 5px;
  background: #000;
  border: 3px solid;
  border-color: #c4d6f4 #7d97c8 #7d97c8 #c4d6f4;
  outline: 2px solid #34401a;
  line-height: 0;
}
.led-counter .seg-on { fill: #39ff2e; }
.led-counter .seg-off { fill: #0c2a0a; }
