/* =========================================================
   労働力調査 長期時系列分析レポート — style.css
   Light theme, professional design
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #1A6EBD;
  --primary-dk:#135599;
  --accent:    #E84A3C;
  --success:   #2E8B57;
  --warn:      #F5A623;
  --bg:        #ffffff;
  --bg-alt:    #f5f7fa;
  --bg-card:   #ffffff;
  --border:    #e2e8f0;
  --text:      #1a202c;
  --text-sub:  #4a5568;
  --text-muted:#718096;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --radius:    8px;
  --radius-lg: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

/* ── Navigation ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--primary);
  padding: 0 24px;
}
.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 52px;
  gap: 4px;
  overflow-x: auto;
}
.nav-inner a {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  text-decoration: none;
  transition: background .18s, color .18s;
}
.nav-inner a:hover {
  background: var(--primary);
  color: #fff;
}

/* ── Header ── */
.site-header {
  background: linear-gradient(135deg, #1A3C6E 0%, #1A6EBD 60%, #3B9CD9 100%);
  color: #fff;
  padding: 56px 24px 48px;
  text-align: center;
}
.header-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  margin-bottom: 16px;
}
.site-header h1 {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 10px;
  line-height: 1.3;
}
.header-subtitle {
  font-size: 14px;
  opacity: .85;
  margin-bottom: 40px;
}

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 860px;
  margin: 0 auto;
}
.kpi-card {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  backdrop-filter: blur(4px);
  transition: transform .2s, background .2s;
}
.kpi-card:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,.18);
}
.kpi-label {
  font-size: 12px;
  opacity: .8;
  margin-bottom: 8px;
  font-weight: 500;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}
.kpi-unit {
  font-size: 13px;
  opacity: .75;
}

/* ── Sections ── */
.report-section {
  padding: 64px 24px;
}
.report-section:nth-child(even) {
  background: var(--bg-alt);
}
.section-inner {
  max-width: 1140px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.section-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.section-header h2 {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}

/* ── Chart image wrap ── */
.chart-img-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.chart-img-wrap:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.chart-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  transition: transform .2s;
}
.chart-img-wrap img:hover {
  transform: scale(1.02);
}
.chart-caption {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: #fafafa;
}

/* Chart.js canvas wrap */
.chartjs-canvas-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: box-shadow .2s;
}
.chartjs-canvas-wrap:hover {
  box-shadow: var(--shadow-md);
}
.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.grid-1-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}
.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) {
  .grid-1-2, .grid-2-1 {
    grid-template-columns: 1fr;
  }
}

/* ── Insight text ── */
.insight-box {
  background: linear-gradient(135deg, #EBF5FF 0%, #F0F7FF 100%);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-sub);
}
.insight-box strong {
  color: var(--primary);
}

/* ── Finding cards (Section 8) ── */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.finding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--primary);
  transition: box-shadow .2s, transform .2s;
}
.finding-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.finding-card:nth-child(2) { border-top-color: var(--accent); }
.finding-card:nth-child(3) { border-top-color: var(--success); }
.finding-card:nth-child(4) { border-top-color: var(--warn); }
.finding-card:nth-child(5) { border-top-color: #8B5CF6; }
.finding-card:nth-child(6) { border-top-color: #0891B2; }
.finding-icon {
  font-size: 28px;
  margin-bottom: 12px;
}
.finding-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.finding-card p {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
}

/* ── Footer ── */
.site-footer {
  background: #1a202c;
  color: rgba(255,255,255,.7);
  padding: 40px 24px 32px;
}
.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.footer-section p, .footer-section a {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,.6);
}
.footer-section a {
  text-decoration: none;
}
.footer-section a:hover { color: #fff; }
.footer-divider {
  max-width: 1140px;
  margin: 20px auto 16px;
  border: none;
  border-top: 1px solid rgba(255,255,255,.1);
}
.footer-credit {
  max-width: 1140px;
  margin: 0 auto;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.5);
  width: 100%;
}

/* ── Scroll animation ── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Chart Modal ── */
.chart-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.chart-modal.open {
  display: flex;
}
.chart-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 40, .82);
  cursor: pointer;
}
.chart-modal-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  animation: modalIn .22s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.93); }
  to   { opacity: 1; transform: scale(1); }
}
.chart-modal-content img {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  background: #fff;
}
.chart-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  line-height: 1;
}
.chart-modal-close:hover { background: rgba(0,0,0,.8); }

/* ── Responsive tweaks ── */
@media (max-width: 600px) {
  .report-section { padding: 44px 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .site-header { padding: 40px 16px 36px; }
}
