/* ══════════════════════════════════════
   base.css — chartmemo 共通スタイル
   全ページから読み込まれます
══════════════════════════════════════ */

/* ── リセット ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── カラー変数 ── */
:root {
  --bg:      #f7f6f2;
  --surface: #ffffff;
  --ink:     #1c1c1e;
  --muted:   #6e6e73;
  --border:  #e5e2db;
  --accent:  #1a3e56;
  --accent-light: #235f7a;
  --gold:    #c0832a;
  --green:   #1a7a4a;
  --up:      #2563eb;
  --down:    #dc2626;
  /* 記事タグ */
  --tag-up-bg:       #eff6ff; --tag-up-text:       #1d4ed8;
  --tag-down-bg:     #fef2f2; --tag-down-text:     #b91c1c;
  --tag-flat-bg:     #f0fdf4; --tag-flat-text:     #166634;
  /* ホームタグ */
  --tag-new-bg:      #fff8e6; --tag-new-text:      #b05e00;
  --tag-week-bg:     #e8f2f8; --tag-week-text:     #1a3e56;
  --tag-analysis-bg: #f0faf4; --tag-analysis-text: #1a7a4a;
}

/* ── ベース ── */
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400; line-height: 1.85; font-size: 15px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── グローバルヘッダー ── */
.site-header {
  background: var(--accent); position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}
.header-inner {
  max-width: 980px; margin: 0 auto;
  display: flex; align-items: center; padding: 0 20px; height: 54px; gap: 16px;
}
.logo {
  font-family: 'Noto Serif JP', serif; font-size: 16px; font-weight: 700;
  color: #fff; letter-spacing: .06em; text-decoration: none; white-space: nowrap;
}
.logo-sub { font-size: 10px; font-weight: 400; opacity: .65; margin-left: 8px; letter-spacing: .1em; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  color: rgba(255,255,255,.78); font-size: 12px; text-decoration: none;
  padding: 6px 10px; border-radius: 6px;
  transition: background .15s, color .15s; white-space: nowrap;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.18); color: #fff; text-decoration: none; }
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 6px; margin-left: auto; background: none; border: none;
}
.hamburger span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }
@media(max-width: 680px) {
  .nav {
    display: none; flex-direction: column;
    position: absolute; top: 54px; right: 0;
    background: var(--accent); width: 200px; padding: 12px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.3); border-radius: 0 0 10px 10px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 20px; border-radius: 0; width: 100%; }
  .hamburger { display: flex; }
  .site-header { position: relative; }
}

/* ── ヒーロー共通 ── */
.hero {
  background:
    linear-gradient(to bottom,rgba(255,255,255,.10) 0%,rgba(255,255,255,.30) 100%),
    url('hero-bg.svg') center top / cover no-repeat;
  color: #0c2030; padding: 48px 24px 40px; text-align: center;
}
.hero h1 {
  font-family: 'Noto Serif JP', serif; font-size: clamp(22px,5vw,34px);
  font-weight: 700; line-height: 1.5; margin-bottom: 16px;
  color: #0c2030; text-shadow: 0 1px 8px rgba(255,255,255,.6);
}
.hero-eyebrow, .hero-sub {
  font-size: 11px; letter-spacing: .2em; color: #1a4560;
  margin-bottom: 12px; text-transform: uppercase;
}
.hero-date { font-size: 12px; letter-spacing: .15em; color: #1a4560; margin-bottom: 12px; }
.hero p, .hero-lead {
  font-size: 14px; color: #1a3852; max-width: 560px; margin: 0 auto;
  line-height: 1.9; text-shadow: 0 1px 4px rgba(255,255,255,.55);
}

/* ── グローバルフッター ── */
footer {
  background: var(--accent); color: rgba(255,255,255,.82);
  text-align: center; padding: 32px 20px; font-size: 13px; line-height: 1.9;
}
footer a { color: rgba(255,255,255,.75); text-decoration: none; }
footer a:hover { color: #fff; text-decoration: none; }
.footer-message { margin-bottom: 12px; }
.footer-nav { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }

/* ── 広告サイドバー ── */
.ad-sidebar-right { display: none; }
@media(min-width: 1200px) {
  .ad-sidebar-right { display: block; position: absolute; top: 0; left: calc(100% + 20px); width: 310px; }
}

/* ── 関連記事 ── */
.related-articles {
  max-width: 800px;
  margin: 48px auto 0;
  padding: 32px 20px 40px;
  border-top: 1px solid var(--border);
}
.related-articles h2 {
  font-family: 'Noto Serif JP', serif;
  font-size: 15px; font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: .06em;
}
.related-articles ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.related-articles li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background .15s, border-color .15s;
}
.related-articles li:hover {
  background: #f0f6fb;
  border-color: var(--accent);
}
.related-articles li a {
  display: block;
  padding: 11px 16px;
  font-size: 13px; color: var(--ink);
  text-decoration: none;
  line-height: 1.65;
}
.related-articles li a::before {
  content: '📄 ';
  font-style: normal;
}
.related-articles li a:hover { color: var(--accent); }
