/* dashboard.css -- styles for the FRED Economic Dashboard */

/* -- Fonts --------------------------------------------- */
@font-face {
  font-family: 'WindowsCommandPrompt';
  src: url('fonts/windows_command_prompt.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #EEF0F4;
  color: #222;
  line-height: 1.5;
}
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* -- Header ------------------------------------------- */
.header {
  background: #1B2A3B;
  color: white;
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 16px;
}
.header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.header .meta {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}
.header .headline {
  font-size: 14px;
  color: rgba(255,255,255,0.88);
  font-style: italic;
  border-left: 3px solid #EE7733;
  padding-left: 12px;
  line-height: 1.55;
}

/* -- Site nav (below header, main dashboard only) ----- */
.header.has-nav {
  border-radius: 10px 10px 0 0;
  margin-bottom: 0;
}
.site-nav {
  background: white;
  border-radius: 0 0 10px 10px;
  border-top: 1px solid #E0E3E8;
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 16px;
  overflow: hidden;
}
.site-nav a {
  font-size: 13px;
  font-weight: 600;
  color: #1B2A3B;
  text-decoration: none;
  padding: 5px 18px;
  border-right: 1px solid #E0E3E8;
  transition: background 0.15s;
}
.site-nav a:last-child {
  border-right: none;
}
.site-nav a:hover {
  background: #EEF0F4;
  text-decoration: none;
}

/* -- Scorecard ----------------------------------------- */
.scorecard {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.score-card {
  border-radius: 8px;
  padding: 14px 12px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card-sym   { font-size: 20px; line-height: 1; }
.card-lbl   { font-size: 10px; font-weight: 600; opacity: 0.82;
               text-transform: uppercase; letter-spacing: 1px; }
.card-badge { font-size: 13px; font-weight: 700; }
.card-sum   { font-size: 11px; opacity: 0.84; margin-top: 5px;
               line-height: 1.38; }

/* -- Hero chart ---------------------------------------- */
.hero-block {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.hero-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 4px;
}

/* -- Section blocks ------------------------------------ */
.section-block {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.sec-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  margin-bottom: 16px;
}
.sec-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.sec-title {
  font-size: 15px;
  font-weight: 700;
  color: #1B2A3B;
  flex: 1;
  margin: 0;
}
.sec-badge {
  font-size: 10px;
  font-weight: 700;
  color: white;
  border-radius: 4px;
  padding: 3px 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* -- Chart grid ---------------------------------------- */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.chart-full { grid-column: 1 / -1; }
.chart-half { min-width: 0; }

/* -- Narrative text ------------------------------------ */
.narr {
  font-size: 13px;
  color: #444;
  line-height: 1.68;
  border-top: 1px solid #EEEEEE;
  padding-top: 12px;
}
.ai-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #0077BB;
  background: #EBF4FB;
  border-radius: 4px;
  padding: 2px 7px;
  margin-bottom: 8px;
  width: fit-content;
}
.chart-note {
  font-size: 12px;
  color: #777;
  line-height: 1.55;
  margin-top: 6px;
  padding: 0 4px;
}

/* -- AI narrative Show More / Show Less (applied via JS on touch devices) */
.narr-collapsible {
  position: relative;
}
.narr-collapsible.narr-collapsed {
  max-height: 130px;
  overflow: hidden;
}
.narr-collapsible.narr-collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, white);
  pointer-events: none;
}
.narr-toggle {
  display: block;
  margin-top: 6px;
  background: none;
  border: none;
  color: #0077BB;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 0;
  text-align: left;
}

/* -- Footer -------------------------------------------- */
.footer {
  text-align: center;
  font-size: 11px;
  color: #777;
  padding: 8px 0 8px;
}
.footer-nav {
  text-align: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #BBB;
  padding-bottom: 10px;
}
.footer-nav a {
  color: #0077BB;
  text-decoration: none;
  margin: 0 5px;
  font-size: 16px;
}
.footer-nav a:visited {
  color: #0077BB;
}
.footer-nav a:hover {
  text-decoration: underline;
}
.footer-nav a + a::before {
  content: "|";
  color: #CCC;
  margin-right: 10px;
}

/* -- Copyright ----------------------------------------- */
.copyright {
  font-family: 'WindowsCommandPrompt', monospace;
  font-size: 14px;
}

/* -- Content pages (methodology.html, privacy-policy.html) -- */
.page-card {
  background: white;
  border-radius: 10px;
  padding: 32px 36px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.back-link {
  display: inline-block;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  padding: 4px 10px;
  margin-top: 10px;
  transition: background 0.15s;
}
.back-link:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  text-decoration: none;
}
.page-card h2 {
  font-size: 15px;
  font-weight: 700;
  color: #1B2A3B;
  margin-top: 28px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #EEF0F4;
}
.page-card h2:first-child { margin-top: 0; }
.page-card p {
  font-size: 14px;
  color: #333;
  line-height: 1.65;
  margin-bottom: 12px;
}
.page-card p:last-child { margin-bottom: 0; }
.page-card ul {
  font-size: 14px;
  color: #333;
  line-height: 1.65;
  margin: 8px 0 12px 20px;
}
.page-card ul li { margin-bottom: 6px; }
.page-card a { color: #0077BB; text-decoration: none; }
.page-card a:hover { text-decoration: underline; }
.page-date {
  font-size: 12px;
  color: #888;
  margin-bottom: 24px;
}

/* -- Status pill badges (methodology.html) -- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  color: white;
  vertical-align: middle;
  letter-spacing: 1px;
}
.status-pill-healthy { background: #0077BB; }
.status-pill-caution { background: #EE7733; }
.status-pill-alert   { background: #CC3311; }

/* -- Responsive overrides --------------------------------------------- */

/* -- Tablet portrait / small laptop (1024px and below) ---------------- */
@media (max-width: 1024px) {
  .scorecard {
    grid-template-columns: repeat(3, 1fr);
  }
  [id^="chart-"] {
    touch-action: pan-y;
  }
}

/* -- Tablet / phone landscape (768px and below) ----------------------- */
@media (max-width: 768px) {
  .scorecard {
    grid-template-columns: repeat(3, 1fr);
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .chart-full {
    grid-column: 1;
  }
  .sec-hdr {
    flex-wrap: wrap;
  }
  .meta-detail {
    display: none;
  }
  [id^="chart-"] {
    touch-action: pan-y;
  }
}

/* -- Phone portrait (480px and below) --------------------------------- */
@media (max-width: 480px) {
  .footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
  }
  .footer-nav a {
    font-size: 14px;
    padding: 6px 0;
    display: inline-block;
  }
  .footer-nav a + a::before {
    content: none;
  }
  .container {
    padding: 12px;
  }
  .scorecard {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .header {
    padding: 16px;
  }
  .site-nav a {
    font-size: 12px;
    padding: 5px 14px;
  }
  .card-sum {
    font-size: 12px;
  }
  .card-lbl {
    font-size: 11px;
  }
  .header h1 {
    font-size: 22px;
  }
  [id^="chart-"] {
    height: 310px !important;
  }
  .chart-full [id^="chart-"] {
    height: 280px !important;
  }
  .narr {
    font-size: 15px !important;
  }
  .ai-label {
    font-size: 12px;
  }
  .chart-note {
    font-size: 13px;
  }
  .hero-label {
    font-size: 11px;
  }
  .header .headline {
    font-size: 15px;
  }
  .page-card {
    padding: 20px 16px;
  }
  .page-card h2 {
    font-size: 18px;
  }
  .page-card p,
  .page-card ul {
    font-size: 16px;
  }
  .back-link {
    font-size: 14px;
  }
  .page-date {
    font-size: 12px;
  }
}

/* -- Print ------------------------------------------------------------ */
@media print {
  body {
    background: white;
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .chart-full {
    grid-column: 1;
  }
}
