/* ================================================
   money.breefly.jp — 信頼感のあるマネーデザイン
   ================================================ */

:root {
  --primary:    #1B4FD8;
  --primary-dk: #1239A6;
  --accent:     #059669;
  --bg:         #F0F4FF;
  --surface:    #FFFFFF;
  --border:     #D1D9F0;
  --text:       #0F1729;
  --text-muted: #4B5880;
  --text-light: #8B95B3;
  --shadow-sm:  0 1px 3px rgba(27,79,216,.07);
  --shadow-md:  0 4px 12px rgba(27,79,216,.13);
  --radius:     12px;
  --radius-sm:  8px;
  --font:       'Noto Sans JP', sans-serif;
  --max-w:      1100px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.7; font-size: 15px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.logo-icon { font-size: 1.2rem; }
.logo-dot { color: var(--accent); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.header-nav::-webkit-scrollbar { display: none; }
.nav-tab {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.2s;
}
.nav-tab:hover { background: var(--bg); color: var(--primary); }
.nav-tab.is-active { background: var(--primary); color: #fff; }

.header-search { position: relative; flex-shrink: 0; }
.search-input {
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  width: 160px;
  outline: none;
  font-family: var(--font);
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); }
.search-dropdown {
  position: absolute;
  top: 60px;
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 360px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}
.search-dropdown.is-open { display: block; }
.search-result-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  transition: background 0.15s;
}
.search-result-item:hover { background: var(--bg); }
.search-result-item:last-child { border-bottom: none; }
.search-result-cat { font-size: 0.72rem; color: var(--primary); font-weight: 600; display: block; margin-bottom: 2px; }

/* ── Container ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 24px 16px 48px; }

/* ── Site Banner ── */
.page-hero-banner {
  text-align: center;
  padding: 32px 16px 24px;
}
.site-tagline {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.site-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Page Meta ── */
.page-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.update-info time { font-weight: 600; color: var(--text); }

/* ── Hero Section ── */
.hero-section { margin-bottom: 28px; }
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 10px;
  height: 380px;
}
.hero-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
}
.hero-card--main { grid-row: 1 / 3; }
.hero-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-card-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.hero-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.1) 60%, transparent 100%);
}
.hero-card-body {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 12px 14px;
}
.hero-card-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 4px;
}
.hero-card--main .hero-card-title { font-size: 1.1rem; }

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.article-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-link { display: block; }
.card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.article-card:hover .card-image img { transform: scale(1.03); }
.card-thumb {
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
  font-size: 2.5rem;
}
.card-body { padding: 14px; }
.card-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.card-date {
  font-size: 0.72rem;
  color: var(--text-light);
}
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-editor-note, .card-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.read-more {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

/* ── Category Chip ── */
.category-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  white-space: nowrap;
}

/* Category colors */
.category-chip[data-cat="お金の基礎知識"]                  { background: #1B4FD8; }
.category-chip[data-cat="貯金・節約術"]                    { background: #059669; }
.category-chip[data-cat="投資入門"]                        { background: #0891B2; }
.category-chip[data-cat="NISA・iDeCo"]                     { background: #7C3AED; }
.category-chip[data-cat="副業・スキルアップ"]              { background: #D97706; }
.category-chip[data-cat="クレジットカード・キャッシュレス"] { background: #0F766E; }
.category-chip[data-cat="奨学金・ローン"]                  { background: #B45309; }
.category-chip[data-cat="税金・確定申告"]                  { background: #DC2626; }
.category-chip[data-cat="フリーランス・起業"]              { background: #7C3AED; }
.category-chip[data-cat="詐欺・トラブル回避"]              { background: #B91C1C; }
.category-chip[data-cat="ライフプランニング"]              { background: #0369A1; }

/* ── Tag ── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  background: var(--bg);
  color: var(--primary);
  font-weight: 500;
  border: 1px solid var(--border);
}

/* ── Article Detail ── */
.article-container { max-width: 760px; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--text-light); }
.article-full { margin-bottom: 48px; }
.article-hero-image {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  aspect-ratio: 16/7;
}
.article-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.article-header { margin-bottom: 20px; }
.article-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.reading-time { font-size: 0.78rem; color: var(--text-muted); }
.article-title {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}
.article-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.article-date { font-size: 0.8rem; color: var(--text-muted); }
.article-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.article-editor-note {
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  margin-bottom: 24px;
}
.editor-note-label { font-size: 0.78rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.editor-note-body { font-size: 0.9rem; color: var(--text); line-height: 1.6; }

/* ── Prose (article body) ── */
.prose { font-size: 0.95rem; line-height: 1.85; color: var(--text); }
.prose h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
  color: var(--primary-dk);
}
.prose h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--text);
}
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px 1.5em; }
.prose li { margin-bottom: 6px; }
.prose strong { font-weight: 700; color: var(--primary-dk); }
.prose em { font-style: italic; }
.prose blockquote {
  border-left: 4px solid var(--primary);
  margin: 16px 0;
  padding: 8px 16px;
  background: var(--bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}
.prose code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.88em;
  font-family: monospace;
}
.prose pre { background: #1e1b4b; border-radius: var(--radius-sm); padding: 16px; overflow-x: auto; margin: 16px 0; }
.prose pre code { background: none; border: none; color: #e2e8f0; font-size: 0.85rem; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Related Articles ── */
.related-articles { margin-bottom: 40px; }
.related-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

/* ── Article Nav ── */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 40px;
}
.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  transition: border-color 0.2s;
}
.article-nav-link:hover { border-color: var(--primary); }
.article-nav-link.next { text-align: right; }
.nav-dir { font-size: 0.72rem; color: var(--primary); font-weight: 600; }
.nav-title { color: var(--text); line-height: 1.4; }

/* ── Category Heading ── */
.category-heading { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.pagination-info { font-size: 0.8rem; color: var(--text-muted); }
.pagination-links { display: flex; gap: 8px; }
.pagination-btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  transition: background 0.2s;
}
.pagination-btn:hover { background: var(--primary-dk); }
.pagination-btn.is-disabled { background: var(--border); color: var(--text-muted); pointer-events: none; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 64px 16px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 16px;
  text-align: center;
}
.footer-copy { font-size: 0.8rem; color: var(--text-muted); }
.footer-copy a:hover { color: var(--primary); }

/* ── Scroll to top ── */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 99;
  box-shadow: var(--shadow-md);
}
.scroll-top.is-visible { opacity: 1; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 180px 180px;
    height: auto;
  }
  .hero-card--main { grid-column: 1 / 3; grid-row: 1; }
  .header-nav { display: none; }
  .search-input { width: 120px; }
  .article-nav { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 200px 140px 140px 140px;
    height: auto;
  }
  .hero-card--main { grid-column: 1; grid-row: 1; }
  .card-grid { grid-template-columns: 1fr; }
  .header-search { display: none; }
}

/* ── Footer Disclaimer ── */
.footer-disclaimer {
  max-width: 720px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  background: #EBF0FF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.disclaimer-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: left;
}

/* ── Article Disclaimer ── */
.article-disclaimer {
  background: #FFF7ED;
  border: 1px solid #FCD34D;
  border-left: 4px solid #D97706;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin: 24px 0;
}
.article-disclaimer--global {
  background: #EBF0FF;
  border-color: var(--border);
  border-left-color: var(--primary);
  margin-top: 32px;
}
.disclaimer-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #D97706;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.disclaimer-body {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── インラインSVGチャート ── */
.chart-block {
  margin: 28px 0;
  background: #f8faff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 20px 20px 12px;
  overflow: hidden;
}
.chart-block svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.chart-caption {
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}
.chart-note {
  font-size: 0.7rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}
