/* hard-enduro-jp 共通スタイル
   index.html / series.html の両方から読み込まれます */

:root { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 24px;
  background: #f4f6f9;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: #1a1f28;
  line-height: 1.6;
}
.wrap { max-width: 980px; margin: 0 auto; }

/* ---------- ヘッダー ---------- */
header.page-header {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
header.page-header h1 { margin: 0 0 6px 0; font-size: 24px; }
header.page-header .date-line { color: #5a6472; font-size: 14px; }

/* ---------- サマリー ---------- */
.next-bar { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.next-box {
  flex: 1 1 210px;
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-top: 4px solid #6c757d;
}
.next-box.upcoming-hewc { border-top-color: #0d6efd; }
.next-box.upcoming-hewr { border-top-color: #d9480f; }
.next-box.upcoming-open { border-top-color: #12805c; }
.next-box.done { border-top-color: #6c757d; }
.next-box .label {
  font-size: 12px; color: #6c757d; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.next-box .value { font-size: 20px; font-weight: 700; margin: 4px 0 2px; }
.next-box .value.big { font-size: 26px; }
.next-box .sub { font-size: 12px; color: #6c757d; }

/* ---------- カード ---------- */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card h3 { font-size: 14px; margin: 20px 0 8px; }
.card p { margin: 0 0 10px; font-size: 14px; color: #2b3240; }
.card p:last-child { margin-bottom: 0; }
.card ul { margin: 0 0 10px; padding-left: 20px; font-size: 14px; color: #2b3240; }
.card li { margin-bottom: 4px; }

/* 解説ページの導入部（ボタンは置かない。導線はヘッダーのpagenavに1本だけ） */
.card.lead { border-left: 4px solid #6f42c1; }
.card.lead strong { color: #1a1f28; }

/* ヘッダー内の控えめな導線 */
.pagenav { margin-top: 10px; font-size: 13px; color: #5a6472; }
.pagenav a { color: #5a6472; text-decoration: none; border-bottom: 1px solid #d5dae1; }
.pagenav a:hover { color: #1a1f28; border-bottom-color: #8a929c; }

/* 凡例の下などに添える一行注記 */
.footnote { font-size: 12.5px; color: #5a6472; margin: 12px 0 0; }
.footnote a { color: #5a6472; }

/* ---------- タブ ---------- */
.tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  border-bottom: 2px solid #e3e7ed;
  margin: 0 0 16px;
}
.tab {
  appearance: none;
  background: none; border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 8px 14px;
  font: inherit; font-size: 14px; font-weight: 700;
  color: #6c757d; cursor: pointer;
  border-radius: 6px 6px 0 0;
}
.tab:hover { background: #f4f6f9; color: #3a4252; }
.tab .count {
  font-size: 11.5px; font-weight: 600;
  color: #8a929c; margin-left: 5px;
}
.tab[aria-selected="true"] { color: #1a1f28; border-bottom-color: #1a1f28; }
.tab[aria-selected="true"][data-tab="hewc"] { color: #0b5ed7; border-bottom-color: #0d6efd; }
.tab[aria-selected="true"][data-tab="hewc"] .count { color: #0d6efd; }
.tab[aria-selected="true"][data-tab="hewr"] { color: #d9480f; border-bottom-color: #d9480f; }
.tab[aria-selected="true"][data-tab="hewr"] .count { color: #d9480f; }
.tab[aria-selected="true"][data-tab="open"] { color: #12805c; border-bottom-color: #12805c; }
.tab[aria-selected="true"][data-tab="open"] .count { color: #12805c; }

.tab-note {
  font-size: 13px; color: #5a6472;
  margin: -4px 0 14px;
}

/* ---------- 凡例 ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13.5px; color: #3a4252; }
.legend .item { display: flex; align-items: center; gap: 8px; }
.swatch { width: 26px; height: 18px; border-radius: 4px; flex: none; }
.swatch.hewc { background: #e7f1ff; border: 1px solid #0d6efd; }
.swatch.hewr { background: #fff1e6; border: 1px solid #d9480f; }
.swatch.open { background: #e6f5ef; border: 1px solid #12805c; }

/* ---------- カレンダー ---------- */
.month-head {
  font-size: 13px; font-weight: 700; color: #3a4252;
  margin: 20px 0 8px; padding-left: 2px;
}
.month-head:first-of-type { margin-top: 4px; }

/* レース行そのものが詳細ページへのリンク（a要素） */
.race {
  display: flex; align-items: flex-start; gap: 14px;
  border: 1px solid #e3e7ed; border-left-width: 4px;
  border-radius: 8px; padding: 12px 14px; margin-bottom: 8px;
  background: #fff;
  text-decoration: none; color: inherit;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.race.hewc { border-left-color: #0d6efd; }
.race.hewr { border-left-color: #d9480f; }
.race.open { border-left-color: #12805c; }
.race.is-done { opacity: 0.62; }
.race.is-next { box-shadow: 0 0 0 2px #0d6efd33; background: #fbfdff; }
.race.is-next.hewr { box-shadow: 0 0 0 2px #d9480f33; background: #fffcfa; }
.race.is-next.open { box-shadow: 0 0 0 2px #12805c33; background: #fafdfb; }

.race:hover { border-color: #b9c4d1; background: #fafbfd; }
.race.hewc:hover { border-left-color: #0d6efd; }
.race.hewr:hover { border-left-color: #d9480f; }
.race.open:hover { border-left-color: #12805c; }
.race:hover .chev { color: #3a4252; transform: translateX(2px); }
.race:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; }
.race.is-done:hover { opacity: 0.85; }

.race .when { display: block; flex: none; width: 108px; font-size: 13px; }
.race .when .d { display: block; font-weight: 700; }
.race .when .y { display: block; color: #6c757d; font-size: 11.5px; }
.race .what { display: block; flex: 1 1 auto; min-width: 0; }
.race .name { display: block; font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.race .meta { display: block; font-size: 12.5px; color: #5a6472; }
.race .note {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 12.5px; color: #2b3240; margin-top: 6px;
}
.race .chev {
  flex: none; align-self: center;
  color: #b9c4d1; font-size: 20px; line-height: 1;
  transition: color .12s, transform .12s;
}

.hint { font-size: 12.5px; color: #6c757d; margin: 12px 0 0; }

.tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px; margin-right: 6px;
  vertical-align: 1px;
}
.tag.hewc { background: #e7f1ff; color: #0b5ed7; }
.tag.hewr { background: #fff1e6; color: #d9480f; }
.tag.open { background: #e6f5ef; color: #0f6b4e; }
.tag.status-done { background: #eceff3; color: #6c757d; }
.tag.status-next { background: #0d6efd; color: #fff; }
.tag.status-next.hewr-next { background: #d9480f; }
.tag.status-next.open-next { background: #12805c; }
.tag.tentative { background: #fff8e1; color: #8a6d00; }

/* ---------- 比較表（series.html） ---------- */
.cmp { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 10px; }
.cmp th, .cmp td {
  border: 1px solid #e3e7ed; padding: 9px 12px;
  text-align: left; vertical-align: top;
}
.cmp thead th { background: #f7f9fb; font-size: 13px; }
.cmp thead th.hewc-h { color: #0b5ed7; }
.cmp thead th.hewr-h { color: #d9480f; }
.cmp tbody th { background: #fbfcfd; font-weight: 700; width: 130px; color: #3a4252; }
.table-scroll { overflow-x: auto; }

/* ---------- 出典・フッター ---------- */
.sources { font-size: 13px; }
.sources ul { margin: 8px 0 0; padding-left: 18px; }
.sources li { margin-bottom: 4px; }
.sources a { color: #0b5ed7; }

footer.page-footer {
  font-size: 12.5px; color: #6c757d; text-align: center;
  padding: 18px 0 8px;
  border-top: 1px solid #e3e7ed;
  margin-top: 4px;
}
footer.page-footer .site-name {
  font-weight: 700; color: #3a4252; font-size: 14px;
  margin-bottom: 2px;
}
footer.page-footer .foot-links { margin: 10px 0 6px; }
footer.page-footer .foot-links a { color: #5a6472; text-decoration: none; }
footer.page-footer .foot-links a:hover { color: #1a1f28; text-decoration: underline; }
footer.page-footer .foot-links .sep { margin: 0 8px; color: #b9c4d1; }
footer.page-footer .updated { font-size: 11.5px; color: #8a929c; }

/* ---------- 詳細ページ（race.html） ---------- */
.crumb { font-size: 13px; margin-bottom: 14px; color: #b9c4d1; }
.crumb a { color: #5a6472; text-decoration: none; }
.crumb a:hover { color: #1a1f28; text-decoration: underline; }
.crumb .sep { margin: 0 8px; }

header.race-header { border-top: 4px solid #6c757d; }
header.race-header.hewc { border-top-color: #0d6efd; }
header.race-header.hewr { border-top-color: #d9480f; }
header.race-header.open { border-top-color: #12805c; }
header.race-header .badges { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
header.race-header .badges .tag { margin-right: 0; }
header.race-header h1 { font-size: 22px; }

.cmp.info tbody th { width: 110px; }

.unknown { color: #8a929c; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { margin-bottom: 6px; font-size: 14px; }
.plain-list a { color: #0b5ed7; }


/* サマリーカードがリンクになっている場合 */
.next-box.linked { text-decoration: none; color: inherit; display: block; }
.next-box.linked:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

/* ===========================================================
   ここから下は「関東オフロードコース 現況」で足したもの
   （上半分は sekai-hard-enduro から流用した共通スタイル）
   =========================================================== */

/* ---------- 鮮度バッジ ---------- */
/* このサイトの主役。1週間前と1年前が同じ見え方をしてはいけない */
.freshness {
  display: inline-block;
  font-size: 11.5px; font-weight: 700;
  padding: 1px 8px; border-radius: 10px;
  background: #eceff3; color: #6c757d;
  white-space: nowrap;
}
.freshness.fr-fresh  { background: #e6f5ef; color: #0f6b4e; }
.freshness.fr-recent { background: #eef4ff; color: #3a5ccc; }
.freshness.fr-aging  { background: #fff8e1; color: #8a6d00; }
.freshness.fr-stale  { background: #fdecea; color: #b42318; }

.fresh-note { display: none; }
.fresh-note.show {
  display: block;
  font-size: 12.5px; color: #8a6d00;
  margin-top: 6px;
}

/* ---------- 営業状況 ---------- */
.tag.st-open    { background: #e6f5ef; color: #0f6b4e; }
.tag.st-caution { background: #fff8e1; color: #8a6d00; }
.tag.st-closed  { background: #fdecea; color: #b42318; }
.tag.st-unknown { background: #eceff3; color: #6c757d; }

.status-panel {
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 5px solid #6c757d;
}
.status-panel.st-open    { border-left-color: #12805c; }
.status-panel.st-caution { border-left-color: #d9a400; }
.status-panel.st-closed  { border-left-color: #d92d20; }
.status-panel.st-unknown { border-left-color: #8a929c; }
.status-panel .status-head { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.status-panel.st-open    .status-head { color: #0f6b4e; }
.status-panel.st-caution .status-head { color: #8a6d00; }
.status-panel.st-closed  .status-head { color: #b42318; }
.status-panel p { margin: 0 0 10px; font-size: 14px; color: #2b3240; }
.status-panel .checked-line { font-size: 12.5px; }

/* ---------- コース種別 ---------- */
.tag.kind { background: #eef1f5; color: #3a4252; }
.tag.kind-hard { background: #ffe9e3; color: #b42318; }
.tag.kind-ed   { background: #fff1e6; color: #d9480f; }
.tag.kind-kids { background: #eef4ff; color: #3a5ccc; }
.tag.kind-none { background: transparent; color: #8a929c; border: 1px dashed #cfd6de; font-weight: 600; }

/* ---------- 一覧 ---------- */
.region-head {
  font-size: 13px; font-weight: 700; color: #3a4252;
  margin: 20px 0 8px; padding-left: 2px;
}
.region-head:first-of-type { margin-top: 4px; }

.course {
  display: flex; align-items: flex-start; gap: 14px;
  border: 1px solid #e3e7ed; border-left-width: 4px;
  border-radius: 8px; padding: 12px 14px; margin-bottom: 8px;
  background: #fff;
  text-decoration: none; color: inherit;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.course.st-open    { border-left-color: #12805c; }
.course.st-caution { border-left-color: #d9a400; }
.course.st-closed  { border-left-color: #d92d20; }
.course.st-unknown { border-left-color: #8a929c; }

/* 閉業は薄くする。ただし消さない・読めなくしない */
.course.st-closed { background: #fcfcfd; }
.course.st-closed .name { color: #6c757d; }

.course:hover { border-color: #b9c4d1; background: #fafbfd; }
.course:hover .chev { color: #3a4252; transform: translateX(2px); }
.course:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; }

.course .where { display: block; flex: none; width: 116px; }
.course .where .pref { display: block; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.course .what { display: block; flex: 1 1 auto; min-width: 0; }
.course .name { display: block; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.course .meta { display: block; margin-bottom: 4px; }
.course .note {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 12.5px; color: #2b3240; margin-top: 4px;
}
.course .note.warn { color: #8a6d00; }
.course.st-closed .note.warn { color: #b42318; }
.course .chev {
  flex: none; align-self: center;
  color: #b9c4d1; font-size: 20px; line-height: 1;
  transition: color .12s, transform .12s;
}

/* ---------- 土地の許可についての警告 ---------- */
/* 林道・河川敷にだけ出る。目立たなければ意味がないので、
   カードの中に埋めずに独立したブロックにしている */
.land-warning {
  background: #fff8f6;
  border: 2px solid #d92d20;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
}
.land-warning .lw-title {
  font-weight: 700; font-size: 15px; color: #b42318;
  margin-bottom: 8px;
}
.land-warning ul { margin: 0; padding-left: 20px; font-size: 13.5px; color: #2b3240; }
.land-warning li { margin-bottom: 6px; }
.land-warning li:last-child { margin-bottom: 0; }

.tag.land { background: #fdecea; color: #b42318; border: 1px solid #f0b4ae; }

/* ---------- 林道マップ ---------- */
#map {
  height: 520px;
  border-radius: 8px;
  border: 1px solid #e3e7ed;
  /* Leaflet のポップアップがカードからはみ出さないように */
  z-index: 0;
}

.map-tools {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.map-tools input[type="search"] {
  flex: 1 1 auto; min-width: 0;
  font: inherit; font-size: 14px;
  padding: 9px 12px;
  border: 1px solid #cfd6de; border-radius: 8px;
  background: #fff; color: #1a1f28;
}
.map-tools input[type="search"]:focus {
  outline: 2px solid #0d6efd; outline-offset: 1px; border-color: #0d6efd;
}
.map-count { flex: none; font-size: 13px; font-weight: 700; color: #5a6472; }

.map-legend {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin-top: 14px; font-size: 12.5px; color: #3a4252;
}
.map-legend .item { display: flex; align-items: center; gap: 8px; }

/* 凡例の線は、地図上の見え方（色・太さ・線種）をそのまま再現する。
   凡例と実物が違うと、かえって迷わせるため。 */
.map-legend .ln {
  display: inline-block; width: 30px; flex: none;
  /* 高さは太さに合わせて個別指定。中央に揃えるため box は固定 */
  height: 6px; background-clip: content-box;
}
.ln-closed {
  background: #d92d20;                       /* 太い実線 */
  border-radius: 3px;
}
.ln-caution {                                /* 破線 */
  background: repeating-linear-gradient(90deg, #e07000 0 9px, transparent 9px 15px);
  height: 5px;
}
.ln-known {                                  /* 実線 */
  background: #0f7b52;
  height: 5px; border-radius: 2.5px;
}
.ln-plain {                                  /* 実線。細くしすぎない */
  background: #4a5568;
  height: 3px; border-radius: 1.5px;
}

/* ---------- 詳細ページ ---------- */
header.course-header { border-top: 4px solid #6c757d; }
header.course-header.st-open    { border-top-color: #12805c; }
header.course-header.st-caution { border-top-color: #d9a400; }
header.course-header.st-closed  { border-top-color: #d92d20; }
header.course-header.st-unknown { border-top-color: #8a929c; }
header.course-header .badges { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
header.course-header .badges .tag { margin-right: 0; }
header.course-header h1 { font-size: 22px; }

/* 情報の確かさ */
.card.conf-confirmed   { border-left: 4px solid #12805c; }
.card.conf-reported    { border-left: 4px solid #d9a400; }
.card.conf-unconfirmed { border-left: 4px solid #8a929c; }


/* ---------- スマホ ---------- */
@media (max-width: 560px) {
  body { padding: 14px; }
  .race, .course { flex-wrap: wrap; gap: 4px 10px; }
  .race .when, .course .where { width: 100%; }
  .race .what, .course .what { flex-basis: 100%; }
  .race .chev, .course .chev { display: none; }
  .course .where .pref { display: inline; margin-right: 8px; }
  .tab { padding: 8px 10px; font-size: 13px; }
  .cmp tbody th, .cmp.info tbody th { width: auto; }
}

/* ===========================================================
   房総の林道マップ で足したもの
   =========================================================== */

/* 詳細ページの地図。一覧より小さめ */
.map-small { height: 380px; }

/* 詳細ページの凡例。当該の林道は赤、周辺の林道は黒 */
.ln-this  { background: #d9480f; height: 5px; border-radius: 2.5px; }
.ln-other { background: #1a1f28; height: 3px; border-radius: 1.5px; opacity: 0.7; }
.map-legend .ln-dot {
  display: inline-block; flex: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid #1a1f28;
}

/* 並び替えのボタン */
.sort-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.sort-bar .sb-label {
  font-size: 12.5px; font-weight: 700; color: #5a6472;
  margin-right: 2px;
}
.sortbtn {
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 6px 12px;
  border: 1px solid #cfd6de; border-radius: 999px;
  background: #fff; color: #3a4252;
  cursor: pointer;
}
.sortbtn:hover { border-color: #8a929c; background: #f7f9fb; }
.sortbtn:focus-visible { outline: 2px solid #0d6efd; outline-offset: 1px; }
/* 選ばれている項目。矢印だけでなく色でも分かるようにする */
.sortbtn.is-on {
  background: #1a1f28; border-color: #1a1f28; color: #fff;
}
.sortbtn .ar { margin-left: 5px; font-size: 12px; }
.sort-note {
  font-size: 12px; color: #6c757d;
  margin: 0 0 12px; line-height: 1.6;
}

/* 林道の一覧 */
.rindo-row {
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid #eef1f5;
  padding: 11px 4px;
  text-decoration: none; color: inherit;
}
.rindo-row:last-child { border-bottom: none; }
.rindo-row:hover { background: #f7f9fb; }
.rindo-row:focus-visible { outline: 2px solid #0d6efd; outline-offset: -2px; }
.rindo-row .rn { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 14px; }
.rindo-row .rm {
  flex: none; width: 80px;
  font-size: 12.5px; color: #5a6472;
}
.rindo-row .rl {
  flex: none; width: 78px; text-align: right;
  font-size: 13px; font-weight: 700; color: #3a4252;
}
.rindo-row .rp {
  flex: none; width: 74px;
  font-size: 11.5px; color: #8a929c;
}
.rindo-row .chev { flex: none; color: #b9c4d1; font-size: 18px; line-height: 1; }

/* トップの「地域を選ぶ」 */
.region-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.region-card {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px;
  border: 1px solid #e3e7ed; border-radius: 10px;
  background: #fff; text-decoration: none; color: inherit;
}
.region-card:hover { border-color: #8a929c; background: #f7f9fb; }
.region-card:focus-visible { outline: 2px solid #0d6efd; outline-offset: 1px; }
.region-card .rc-name { font-size: 17px; font-weight: 700; }
.region-card .rc-cov { font-size: 12px; color: #8a929c; }
.region-card .rc-num { font-size: 13px; font-weight: 700; color: #3a4252; margin-top: 4px; }

@media (max-width: 560px) {
  .rindo-row { flex-wrap: wrap; gap: 2px 10px; }
  .rindo-row .rn { flex-basis: 100%; }
  .rindo-row .rm { width: auto; }
  .rindo-row .rl { width: auto; text-align: left; }
  .rindo-row .rp { width: auto; }
  .rindo-row .chev { display: none; }
  .map-small { height: 300px; }
}
