:root {
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    line-height: 1.7;
    margin: 0;
    background: #fff;
    color: #222;
}

header:first-child {
    padding-top: 1rem;
    padding-bottom: 1rem;
}
footer:last-of-type {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}
main {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.copyright {
  --bs-text-opacity: 1;
  color: var(--bs-secondary-color) !important;
  font-size: .875em;
}

.site-title {
    font-style: italic;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-shadow: 6px 6px 2px rgba(0,0,0,0.2);
  }
  .site-title a {
    color: #222;
    text-decoration: none;
}

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

.content pre, .content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .95em;
}


/* text-decoration-none 指定時もホバーしたいときに使用 */
a.hover-underline:hover {
    text-decoration: underline !important;
}

a {
    color: #0077cc;
}

a:hover {
    color: #005fa3;
}

/* 見出しの余白を控えめに（素朴な間隔） */
h1, h2, h3 {
    margin-top: 0;
}

/* 記事の表示を調整 */
/* 版面：本文の最大幅と行長を調整（約65字） bootstrap のクラスを上書きしている */
.container, main.container { max-width: 72ch; }

/* auto-toc（目次）用スタイル */
aside.toc {
  position: fixed;
  top: 2.5rem;
  right: 1rem;
  border: 1px solid #e5e5e5;
  padding: 1rem 1rem 1rem 1rem;
  width: fit-content;
  margin-bottom: 1rem;
  background: #fafafa;
}
.toc-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 2em;
}
.toc-list li {
  margin-bottom: .3em;
}
.toc-list .toc-h3 {
  margin-left: 1em;
  font-size: .95em;
}
.toc-list a {
  text-decoration: none;
  color: #0077cc;
}
.toc-list a:hover {
  text-decoration: underline;
}
.toc-toggle-label {
  display: block;
  cursor: pointer;
  font-weight: bold;
}
.toc-content {
  display: none;
  margin-top: .5em;
  background: #fafafa;
  border-radius: .5em;
  max-height: 70vh;
  overflow-y: auto;
}
/* チェック時に目次を表示 */
.toc-toggle:checked + .toc-toggle-label + .toc-content {
  display: block;
}

/* 画像ポップアップ用モーダル */
#imgModal .modal-dialog {
  margin: 1rem; /* 上下左右の余白を小さめに（デフォルト1.75rem） */
  max-width: 95vw; /* 画面幅のほぼ全域 */
}

#imgModal .modal-content {
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* ソーシャルボタン */
.social-links {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: .75rem;
}

.social-links a {
  display: inline-block;
  padding: .35rem .75rem;
  border-radius: .4rem;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: background .2s, color .2s;
  line-height: 1.3;
}

/* 色味をプラットフォームっぽく */
.social-links a[href*="hatena"] {
  background: #00A4DE;
  color: white;
}
.social-links a[href*="facebook"] {
  background: #1877F2;
  color: white;
}
.social-links a[href*="twitter"] {
  background: #333;
  color: white;
}

/* ホバー効果 */
.social-links a:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* 暗転モードのささやかな配慮 */
@media (prefers-color-scheme: dark) {
  body, header, footer { background:#111; color:#ddd; }
  a { color:#7fb8ff; }
  /* Bootstrapのクラス上書き */
  .text-muted,
  .text-secondary,
  .text-body-secondary { color: #aaa !important; }
  .fw-light, .fw-normal, .fw-semibold { font-weight: 600 !important; }
  .bg-light, .bg-body-secondary, .bg-white { background: #181818 !important; }
  .border, .border-light, .border-secondary { border-color: #333 !important; }
  .shadow-sm, .shadow { box-shadow: 0 1px 3px rgba(255,255,255,0.05) !important; }
  /* 独自スタイルの上書き */
  .site-title { text-shadow: 1px 1px 2px rgba(0,0,0,0.6); }
  .site-title a { color: #eee !important; }
  .copyright { color: #aaa !important; }
  .post-list li { border-color:#222; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
  .post-list li .text-muted.small { background:#1a1a1a; border-color:#2a2a2a; color:#aaa; }
}
