/* ===== base.css ===== */
:root{
  /* brand + tokens */
  --brand: #111;
  --accent: #d84a3a;   /* 現在地（赤） */
  --hover:  #d84a3a;   /* ← ホバー色：ここを変えるだけで全体反映 */
  --fg: #222;
  --muted:#5b5b5b;
  --bg: #fff;
  --line:#cfcfcf;
  --max: 1080px;

  --radius: 10px;
  --shadow: 0 8px 24px rgba(0,0,0,.08);

  /* 背景（今は白紙） */
  --bg-image: none;        /* 例: url("../assets/img/bg-map.svg") */
  --bg-map-opacity: 1;
  --bg-map-size: 1800px;
  --bg-map-pos: center;

  /* ヘッダーの上下余白（対称） */
  --brandbar-pad-sp: 56px; /* スマホ */
  --brandbar-pad-pc: 64px; /* デスクトップ */

  /* page-title 下の間隔（一定化用） */
  --page-title-gap-sp: 16px; /* smartphone gap under .page-title */
  --page-title-gap-pc: 24px; /* desktop gap under .page-title */
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#ffffff00;      /* ← 白固定 */
    --fg:#000;      /* ← 黒固定 */
    --muted:#444;
    --line:#e0e0e0;
    --brand:#000;
  }
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
html{ height:100%; }
body{
  /* Sticky footer の土台 */
  min-height: 100vh;
  min-height: 100dvh;      /* 動的ビューポート */
  display:flex;
  flex-direction: column;

  /* タイポ */
  font-family: Inter, "Noto Sans JP",
               Helvetica, "Helvetica Neue",
               "Hiragino Kaku Gothic ProN", "Hiragino Sans",
               "Yu Gothic", Meiryo, Arial, sans-serif;
  line-height: 1.75;
  letter-spacing: .01em;         /* 英字も日本語も詰まりすぎない程度 */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 背景（無効化中。--bg-image を設定でON） */
body::before{
  content:"";
  position: fixed; inset: 0; z-index: 0; pointer-events:none;
  opacity: var(--bg-map-opacity);
  background-image: var(--bg-image);
  background-repeat: no-repeat;
  background-size: var(--bg-map-size) auto;
  background-position: var(--bg-map-pos);
}

.container{ width:100%; max-width:var(--max); margin:0 auto; padding:0 24px; position:relative; z-index:1; }

/* ===== ブランドバー（タイトルが上下中央） ===== */
.brandbar{
  padding-block: var(--brandbar-pad-sp);   /* 上下対称 */
  border-bottom: 1px solid var(--line);
  margin-bottom: 56px;
}
.brandbar__title{
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: .02em;
}

/* ページ見出し（基準） */
.page-title{
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  margin: 56px 0 24px; /* ← bottomは後段で0に上書きします（一定化のため） */
}

/* About: 定義リスト（PC基準） */
.dl{
  display:grid;
  grid-template-columns: 180px 1fr;
  gap: 20px 32px;
  margin: 24px 0 80px;
}
.dl dt{ font-weight:700; color:#333; }
.dl dd{ margin:0; color:#222; }

/* Archive: 記事 */
.article{ margin: 40px 0 120px; }
.article__visual{
  width: min(920px, 100%);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display:block;
}
.article__h{
  font-size: clamp(20px, 3.4vw, 28px);
  margin: 24px 0 12px;
  font-weight:700;
}
.article p{ margin: 0 0 16px; color:#333; }

/* ===== Sticky Footer（画面下に隠れない） ===== */
main{ flex: 1 0 auto; }
.bottomnav{
  /* 通常フロー。スクロール固定はしない */
  position: static;
  margin-top: auto;            /* 内容が短いとき下端へ吸着 */
  z-index: 1;
  background: color-mix(in oklab, var(--bg), white 0%);
  border-top: 1px solid var(--line);
}
.bottomnav__inner{
  display:flex; gap: 28px;
  align-items:center; justify-content:center;
  padding: 12px 8px;
}
@media (max-width: 640px){
  .bottomnav__inner{
    padding: 12px 8px calc(12px + env(safe-area-inset-bottom)); /* iOSセーフエリア */
  }
}

/* ナビリンク */
.bottomnav a{
  color:#333; text-decoration:none;
  padding: 10px 8px; border-radius: 6px;
  transition: color .15s ease, background .15s ease;
}
.bottomnav a:hover{ color: var(--hover); background: rgba(216,74,58,.06); }
.bottomnav a[aria-current="page"]{ color: var(--accent); }

/* 汎用 */
a{ color:inherit; }
a:hover{ color: var(--hover); }
.hr{ border:0; border-top: 1px solid var(--line); margin: 56px 0; }

/* ===== Mobile: <= 640px ===== */
@media (max-width: 640px){
  .brandbar{ padding-block: var(--brandbar-pad-sp); margin-bottom: 40px; }
  .brandbar__title{ text-align: center; }

  /* タイトルを画面中央寄せ＋余白を約半分に（50svh→25svh、32px→16px） */
  .page-title{
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    margin: 0 0 16px;
    min-height: calc(25svh - var(--brandbar-pad-sp));
  }

  .dl{ grid-template-columns: 120px 1fr; gap: 18px 18px; }
}

/* ===== Desktop: >= 960px ===== */
@media (min-width: 960px){
  .brandbar{ padding-block: var(--brandbar-pad-pc); }
  .brandbar__title{ text-align: left; }
  .page-title{ text-align: left; margin: 56px 0 24px; font-size: clamp(28px, 4vw, 40px); }
  .dl{ grid-template-columns: 200px 1fr; gap: 24px 64px; }
  .article__visual{ width: min(920px, 100%); }
}

/* ===== page-title 下マージンの一貫化 =====
   直後の要素の margin-top で統一。タイトル自身の bottom は常に 0 */
.page-title{ margin-bottom: 0; }
.page-title + *{ margin-top: var(--page-title-gap-pc); }
@media (max-width: 640px){
  .page-title{ margin-bottom: 0; }
  .page-title + *{ margin-top: var(--page-title-gap-sp); }
}

/* === Desktop partial borders (header 60% from left, footer 60% from right; min 300px) === */
@media (min-width: 960px){
  /* Header underline: from left toward right */
  .brandbar{
    border-bottom: 0;       /* デスクトップ時はデフォの全幅ボーダーを消す */
    position: relative;
  }
  .brandbar::after{
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: clamp(300px, 60vw, 100vw);  /* 最短300px／目安60%／最大は画面幅 */
    height: 1px;
    background: var(--line);
    pointer-events: none;
  }

  /* Footer top line: from right toward left */
  .bottomnav{
    border-top: 0;          /* デスクトップ時はデフォの全幅ボーダーを消す */
    position: relative;
  }
  .bottomnav::before{
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: clamp(300px, 60vw, 100vw);  /* 最短300px／目安60%／最大は画面幅 */
    height: 1px;
    background: var(--line);
    pointer-events: none;
  }
}
/* ===== Footer nav to right (desktop) ===== */
@media (min-width: 960px){
  .bottomnav__inner{
    justify-content: flex-end; /* center -> right */
  }
}

/* モバイルも右寄せにしたい場合は下をアンコメント
@media (max-width: 640px){
  .bottomnav__inner{
    justify-content: flex-end;
  }
}
*/

/* ===== Footer nav: triple vertical padding on desktop ===== */
@media (min-width: 960px){
  .bottomnav__inner{
    /* 元は 12px 8px → 縦だけ3倍（36px）、横はそのまま8px */
    padding-top: calc(12px * 3);
    padding-bottom: calc(12px * 3);
    /* まとめて書くなら：padding: 36px 8px; でもOK */
  }
}

body{ font-family: "IBM Plex Sans", "Zen Kaku Gothic New", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif; }
/* 背景コンテナ（常に最背面＆クリック透過） */
/* 背景レイヤ（最背面＆クリック透過） */
.bg-anim{
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background: #fff; /* 常に白 */
}

/* 共通：コーナー固定 */
.bg-svg{
  position: absolute;
  max-width: none; max-height: none;
  height: auto;        /* アスペクト比維持 */
  vector-effect: non-scaling-stroke;
}

/* 左下：重なり防止のため、画面の45%幅/45%高を上限に、幅は 0〜1400px に制限 */
.bg--leftbottom{
  left: 0; bottom: 0;
  width: clamp(0px, 45vw, 1400px);
  max-height: 45vh;
}

/* 右上：同様の上限を設定（上下左右でエリアを分ける＝互いに届かず重ならない） */
.bg--topright{
  right: 0; top: 0;
  width: clamp(0px, 45vw, 1400px);
  max-height: 45vh;
}

/* 本文は前面に */
.site-header, main, .site-footer{
  position: relative; z-index: 1;
}

/* モバイルは露出を少し控えめに（任意） */
@media (max-width: 600px){
  .bg--leftbottom, .bg--topright{
    width: clamp(0px, 50vw, 1400px);
    max-height: 40vh;
  }
}

label.post-caption {
  font-size: 14px;
  color: var(--muted);
  margin-right: 20px;
  font-weight: bold;
}
