/* reports-hosting/public/css/report.css */

/* ---------- Reset & base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

:root {
  --ink: #1f2733;
  --ink-soft: #46505c;
  --ink-faint: #6b7683;
  --paper: #eef0f2;
  --card: #ffffff;
  --navy: #16324f;
  --navy-deep: #102438;
  --accent: #b06423;
  --accent-soft: #f6ead9;
  --rule: #dfe3e8;
  --rule-soft: #ebeef1;
  --link: #1c5687;
  --cite: #64707d;

  /* Brand hooks — overridden per client by a theme-* class on <body>. */
  --brand: var(--navy);
  --brand-deep: var(--navy-deep);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter,
    "Bitstream Charter", Cambria, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Helvetica,
    Arial, sans-serif;
}

/* Client brand themes — colors sampled from each firm's public site. */
.theme-spaceplace {
  --brand: #d84205;
  --brand-deep: #7e2f10;
}

.theme-maven {
  --brand: #018788;
  --brand-deep: #0b4a4b;
}

.theme-embarcadero {
  --brand: #34586e;
  --brand-deep: #24404f;
}

.theme-urban {
  --brand: #de764a;
  --brand-deep: #32373c;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: var(--link);
  text-decoration-color: rgba(28, 86, 135, 0.35);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-color: currentColor;
}

a:visited {
  color: var(--link);
}

/* ---------- Site chrome (index page) ---------- */

.site-header {
  background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #f5f7f9;
  padding: 1.1rem 1.5rem;
  border-bottom: 3px solid var(--accent);
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

.site-header__title {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-header__subtitle {
  margin: 0.3rem 0 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(245, 247, 249, 0.75);
}

/* ---------- Client masthead (report pages) ---------- */

.client-header {
  background: var(--card);
  border-top: 6px solid var(--brand);
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 1.5rem 1.25rem;
  text-align: center;
}

.client-header__name {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.client-header__byline {
  margin: 0.35rem 0 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.client-header__byline a {
  color: var(--ink-soft);
}

.site-footer {
  margin-top: 3.5rem;
  padding: 1.75rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-faint);
  text-align: center;
  border-top: 1px solid var(--rule);
}

.site-footer a {
  color: var(--ink-soft);
}

/* ---------- Report card ---------- */

.report {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1.4rem 2.5rem;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(16, 36, 56, 0.06), 0 12px 40px rgba(16, 36, 56, 0.08);
}

@media (min-width: 48rem) {
  .report {
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
    padding: 3rem 3.5rem 3.5rem;
    border-radius: 4px;
  }
}

/* ---------- Title block ---------- */

.report-title {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-deep);
}

.report-subtitle {
  margin: 0 0 1.6rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

/* ---------- Disclaimer ---------- */

.disclaimer {
  background: #fdf9f0;
  border: 1px solid #ecdfc4;
  border-left: 4px solid var(--accent);
  border-radius: 0 3px 3px 0;
  padding: 1rem 1.3rem;
  margin: 0 0 1.75rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #59513f;
}

.disclaimer strong {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.disclaimer a {
  color: #7a5c22;
}

/* ---------- Metadata ---------- */

.report-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.5rem;
  margin: 0 0 2.25rem;
  padding: 1.1rem 1.3rem;
  background: #f7f8fa;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  font-size: 0.9rem;
}

.report-meta dt {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 0;
  align-self: baseline;
  padding-top: 0.15em;
}

.report-meta dd {
  margin: 0;
  color: var(--ink);
}

/* ---------- Sections ---------- */

.report section {
  margin-bottom: 2.5rem;
}

.report h2 {
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--brand-deep);
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--brand);
}

.report h3 {
  margin: 1.5rem 0 0.5rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand);
}

.report p {
  margin: 0 0 1rem;
}

.report section > p:last-child,
.report section > ol:last-child,
.report section > ul:last-child {
  margin-bottom: 0;
}

.report strong {
  color: var(--brand-deep);
}

.report ul,
.report ol {
  margin: 0 0 1.1rem;
  padding-left: 1.4rem;
}

.report li {
  margin-bottom: 0.7rem;
}

.report li::marker {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--brand);
}

/* Citation links — present but quiet */
.report section a {
  color: var(--cite);
  font-size: 0.92em;
  text-decoration-color: rgba(100, 112, 125, 0.4);
}

.report section a:hover {
  color: var(--link);
}

/* ---------- Stat cards ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 0 0 1.6rem;
}

@media (min-width: 48rem) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  padding: 0.9rem 1rem 0.95rem;
  background: #f7f8fa;
  border: 1px solid var(--rule-soft);
  border-top: 3px solid var(--brand);
  border-radius: 3px;
}

.stat__value {
  display: block;
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
}

.stat__delta {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
}

.stat__label {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--ink-faint);
}

/* ---------- Fact rows (figures pulled out of prose) ---------- */

.facts {
  display: grid;
  gap: 0.3rem;
  margin: 0.55rem 0 0.35rem;
}

.fact {
  display: grid;
  grid-template-columns: 5.4rem 1fr auto;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.4rem 0.7rem;
  background: #f7f8fa;
  border-left: 2px solid var(--brand);
  border-radius: 0 3px 3px 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.fact__num {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.fact__what {
  color: var(--ink-soft);
}

.fact__what em {
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.82em;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}

.report section a.fact__src,
a.fact__src {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-decoration-color: rgba(107, 118, 131, 0.4);
  white-space: nowrap;
}

@media (max-width: 30rem) {
  .fact {
    grid-template-columns: 4.4rem 1fr;
  }

  .fact__src {
    grid-column: 2;
  }
}

/* ---------- Bar charts (pure CSS, no JS) ---------- */

.bar-chart {
  margin: 1.25rem 0 1.6rem;
  padding: 1.1rem 1.2rem 1rem;
  background: #f7f8fa;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  font-family: var(--sans);
}

.bar-chart__title {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: left;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(6.5rem, 10rem) 1fr 3.4rem;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.bar-row__label {
  color: var(--ink-soft);
  text-align: right;
  line-height: 1.25;
}

.bar-row__track {
  background: var(--rule-soft);
  border-radius: 2px;
  height: 0.9rem;
  overflow: hidden;
}

.bar-row__fill {
  display: block;
  height: 100%;
  background: var(--brand);
  opacity: 0.45;
  border-radius: 2px 0 0 2px;
}

.bar-row--highlight .bar-row__fill {
  opacity: 1;
}

.bar-row--highlight .bar-row__label,
.bar-row--highlight .bar-row__value {
  font-weight: 700;
  color: var(--brand-deep);
}

.bar-row__value {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.bar-chart__note {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* ---------- Placeholder seams ---------- */

.placeholder {
  display: inline;
  background: var(--accent-soft);
  border: 1px dashed #d8b98c;
  border-radius: 3px;
  padding: 0.05em 0.4em;
  font-family: var(--sans);
  font-size: 0.82em;
  color: #7a5c22;
  white-space: normal;
}

/* ---------- Tables ---------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.data-table th,
.data-table td {
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  border-bottom: 2px solid var(--brand);
  background: none;
}

.data-table tbody th {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand);
  background: #f7f8fa;
  width: 32%;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- CTA ---------- */

.report-cta {
  margin: 2.5rem 0;
  padding: 1.5rem 1.75rem;
  background: var(--brand-deep);
  border-radius: 4px;
  color: #eef2f6;
  font-size: 0.98rem;
  line-height: 1.65;
}

.report-cta p {
  margin: 0;
}

.report-cta strong {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--sans);
  font-size: 1.02rem;
  color: #ffffff;
}

.report-cta a {
  color: #ffffff;
  font-weight: 600;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

.report-cta p + p {
  margin-top: 0.9rem;
}

.report-cta__button {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.55rem 1.1rem;
  background: #ffffff;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-deep) !important;
  text-decoration: none;
}

.report-cta__button:hover {
  text-decoration: underline;
}

.report-cta__alt {
  font-size: 0.85rem;
  color: rgba(238, 242, 246, 0.75);
}

/* ---------- Sources ---------- */

.sources {
  padding-top: 0.5rem;
}

.sources h2 {
  border-bottom-color: var(--rule);
  border-bottom-width: 1px;
  color: var(--ink-faint);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sources ol {
  padding-left: 1.3rem;
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.sources li {
  margin-bottom: 0.55rem;
  word-break: break-word;
}

.sources li::marker {
  color: var(--ink-faint);
  font-weight: 400;
}

.sources a {
  color: var(--cite);
  font-size: 1em;
}

/* ---------- Index page ---------- */

.index-list {
  list-style: none;
  padding: 0;
  margin: 1.75rem 0 0;
}

.index-list li {
  margin-bottom: 1rem;
  padding: 1.1rem 1.3rem;
  background: #f7f8fa;
  border: 1px solid var(--rule-soft);
  border-left: 3px solid var(--navy);
  border-radius: 0 3px 3px 0;
  transition: border-color 120ms ease, background 120ms ease;
}

.index-list li:hover {
  background: #f1f4f7;
  border-left-color: var(--accent);
}

.index-list a {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy-deep);
  text-decoration: none;
}

.index-list a:hover {
  color: var(--link);
  text-decoration: underline;
}

.index-list p {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Print ---------- */

@media print {
  body {
    background: #fff;
    font-size: 10.5pt;
  }

  .site-header,
  .site-footer,
  .report-cta {
    display: none;
  }

  /* Client masthead is letterhead — keep it in print. */
  .client-header {
    border-bottom: 1px solid #999;
  }

  .report {
    box-shadow: none;
    margin: 0;
    padding: 0;
    max-width: none;
    border-radius: 0;
  }

  .disclaimer {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  .report h2 {
    page-break-after: avoid;
  }

  .data-table,
  .bar-chart,
  .stat-grid {
    page-break-inside: avoid;
  }

  .bar-row__fill {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    font-weight: normal;
    color: #555;
  }

  a[href^="mailto"]::after {
    content: "";
  }
}
