/* ============================================
   Broward County Housing Initiative — Investor Deck
   Supplemental styles — loads after style.css
   ============================================ */

/* -------------------------------------------
   Housing-specific color extensions
   ------------------------------------------- */
:root {
  --navy: #1B2838;
  --gold: #C4A265;
  --gold-light: #D4B97A;
  /* WHY: Navy and gold signal institutional finance; sage green inherited from main site provides continuity */
}

/* -------------------------------------------
   Page-level layout
   ------------------------------------------- */
.housing-page {
  background: var(--cream);
}

.housing-section {
  padding: 120px 0;
  position: relative;
}

.housing-section:first-of-type {
  padding-top: 0;
}

.housing-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 40px;
}

.housing-inner--wide {
  max-width: 1200px;
}

/* -------------------------------------------
   Hero — Investor Deck
   ------------------------------------------- */
.housing-hero {
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 0 40px 80px;
  position: relative;
  overflow: hidden;
  background: var(--navy);
}

.housing-hero::before {
  content: 'B';
  position: absolute;
  top: -10%;
  right: -5%;
  font-family: var(--serif);
  font-size: 70vw;
  font-weight: 900;
  color: rgba(255,255,255,0.03);
  line-height: 1;
  pointer-events: none;
}

.housing-hero-inner {
  width: 100%;
  position: relative;
  z-index: 1;
}

.housing-hero-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 40px;
}

.housing-hero-headline {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 6rem);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 40px;
  color: var(--cream);
  max-width: 85%;
}

.housing-hero-headline em {
  color: var(--gold);
  font-style: italic;
}

.housing-hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.housing-hero-intro {
  max-width: 520px;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
}

.housing-hero-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  flex-shrink: 0;
  text-align: right;
  line-height: 2;
}

/* -------------------------------------------
   Section headers
   ------------------------------------------- */
.housing-section-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  display: block;
  margin-bottom: 16px;
}

.housing-section-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--ink);
}

.housing-section-title em {
  color: var(--accent);
}

.housing-section-subtitle {
  font-size: 1.1rem;
  color: var(--ink-light);
  line-height: 1.7;
  max-width: 700px;
  margin-bottom: 48px;
}

/* Dark section variants */
.housing-section--dark {
  background: var(--ink);
  color: var(--cream);
}

.housing-section--dark .housing-section-num {
  color: var(--gold);
}

.housing-section--dark .housing-section-title {
  color: var(--cream);
}

.housing-section--dark .housing-section-title em {
  color: var(--gold);
}

.housing-section--dark .housing-section-subtitle {
  color: var(--cream-dark);
}

.housing-section--navy {
  background: var(--navy);
  color: var(--cream);
}

.housing-section--navy .housing-section-num {
  color: var(--gold);
}

.housing-section--navy .housing-section-title {
  color: var(--cream);
}

.housing-section--navy .housing-section-title em {
  color: var(--gold);
}

.housing-section--navy .housing-section-subtitle {
  color: rgba(255,255,255,0.7);
}

/* -------------------------------------------
   Crisis stat cards
   ------------------------------------------- */
.crisis-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.crisis-stat {
  background: var(--white);
  padding: 32px 24px;
  border-left: 3px solid var(--accent);
}

.crisis-stat-num {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.crisis-stat-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  line-height: 1.5;
}

/* -------------------------------------------
   Data tables — institutional style
   ------------------------------------------- */
.housing-table-wrap {
  overflow-x: auto;
  margin-bottom: 48px;
  -webkit-overflow-scrolling: touch;
}

.housing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.housing-table thead th {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  background: var(--ink);
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
}

.housing-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--cream-dark);
  color: var(--ink-light);
  vertical-align: top;
  line-height: 1.5;
}

.housing-table tbody tr:nth-child(even) td {
  background: var(--white);
}

.housing-table tbody tr:nth-child(odd) td {
  background: var(--cream);
}

.housing-table tbody td:first-child {
  font-weight: 600;
  color: var(--ink);
}

/* WHY: Right-align financial columns for scanability */
.housing-table .num {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: nowrap;
}

.housing-table .total td {
  font-weight: 700;
  color: var(--ink);
  border-top: 2px solid var(--ink);
  background: var(--cream-dark);
}

/* Dark table variant */
.housing-section--dark .housing-table thead th {
  background: rgba(255,255,255,0.08);
  color: var(--gold);
}

.housing-section--dark .housing-table tbody td {
  border-bottom-color: rgba(255,255,255,0.08);
  color: var(--cream-dark);
}

.housing-section--dark .housing-table tbody td:first-child {
  color: var(--cream);
}

.housing-section--dark .housing-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.03);
}

.housing-section--dark .housing-table tbody tr:nth-child(odd) td {
  background: transparent;
}

.housing-section--dark .housing-table .total td {
  border-top-color: var(--gold);
  background: rgba(255,255,255,0.06);
  color: var(--cream);
}

/* Navy table variant */
.housing-section--navy .housing-table thead th {
  background: rgba(255,255,255,0.06);
  color: var(--gold);
}

.housing-section--navy .housing-table tbody td {
  border-bottom-color: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}

.housing-section--navy .housing-table tbody td:first-child {
  color: var(--cream);
}

.housing-section--navy .housing-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}

.housing-section--navy .housing-table tbody tr:nth-child(odd) td {
  background: transparent;
}

.housing-section--navy .housing-table .total td {
  border-top-color: var(--gold);
  background: rgba(255,255,255,0.05);
  color: var(--cream);
}

/* -------------------------------------------
   Capital stack visualization — CSS only
   ------------------------------------------- */
.stack-bar {
  display: flex;
  height: 56px;
  margin-bottom: 24px;
  overflow: hidden;
}

.stack-bar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 4px 12px;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--white);
  line-height: 1.3;
}

.stack-bar-seg span {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
}

/* WHY: Each segment color matches the capital stack layer's institutional context */
.stack-bar-seg--private { background: var(--accent); }
.stack-bar-seg--lihtc { background: #4A7A6B; }
.stack-bar-seg--debt { background: var(--ink-light); }
.stack-bar-seg--state { background: var(--gold); color: var(--ink); }
.stack-bar-seg--county { background: var(--cream-dark); color: var(--ink); }

.stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 48px;
}

.stack-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.stack-legend-swatch {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* -------------------------------------------
   Capital stack layers — vertical flow
   ------------------------------------------- */
.stack-layers {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 48px;
}

.stack-layer {
  display: grid;
  grid-template-columns: 48px 1fr 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(26,26,26,0.1);
  align-items: start;
}

.stack-layer-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 2px;
}

.stack-layer-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.stack-layer-source {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.stack-layer-desc {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.6;
}

/* -------------------------------------------
   Circle of Life — Flow steps
   ------------------------------------------- */
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 48px;
  counter-reset: flow-step;
}

.flow-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
  counter-increment: flow-step;
}

.flow-step-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  padding-top: 4px;
}

.flow-step-num::before {
  content: counter(flow-step, decimal-leading-zero);
}

.flow-step-content h4 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 4px;
}

.flow-step-content p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
}

/* WHY: Arrow connector between steps signals continuous cycle */
.flow-step::after {
  content: '';
  position: absolute;
  left: 31px;
  bottom: -1px;
  width: 1px;
  height: 24px;
  background: var(--gold);
  opacity: 0.3;
}

.flow-step:last-child::after {
  display: none;
}

/* -------------------------------------------
   Callout / Key insight boxes
   ------------------------------------------- */
.callout {
  padding: 32px;
  margin: 32px 0;
  border-left: 3px solid var(--accent);
  background: var(--white);
}

.callout-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

.callout p {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--ink);
}

/* Dark variant */
.housing-section--dark .callout,
.housing-section--navy .callout {
  background: rgba(255,255,255,0.04);
  border-left-color: var(--gold);
}

.housing-section--dark .callout-label,
.housing-section--navy .callout-label {
  color: var(--gold);
}

.housing-section--dark .callout p,
.housing-section--navy .callout p {
  color: var(--cream);
}

/* -------------------------------------------
   Return summary — big numbers
   ------------------------------------------- */
.return-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 48px 0;
}

.return-card {
  padding: 40px 32px;
  background: rgba(255,255,255,0.04);
  border-top: 3px solid var(--gold);
  text-align: center;
}

.return-card-num {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 8px;
}

.return-card-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
}

/* -------------------------------------------
   Geography grid
   ------------------------------------------- */
.geo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.geo-card {
  padding: 28px 24px;
  background: var(--white);
  border-top: 2px solid var(--accent);
}

.geo-card h4 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.geo-card-tracts {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

.geo-card p {
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.5;
}

/* -------------------------------------------
   Government tiers
   ------------------------------------------- */
.gov-tiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
}

.gov-tier {
  padding: 32px 28px;
  background: var(--white);
  border-top: 2px solid var(--accent);
}

.gov-tier h4 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.gov-tier ul {
  list-style: none;
}

.gov-tier li {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.6;
  padding: 6px 0;
  border-bottom: 1px solid var(--cream-dark);
}

.gov-tier li:last-child {
  border-bottom: none;
}

.gov-tier li strong {
  color: var(--ink);
}

/* -------------------------------------------
   Sensitivity table — conditional colors
   ------------------------------------------- */
.housing-table .scenario-base td {
  background: rgba(107,144,128,0.08);
}

.housing-table .scenario-down td {
  background: rgba(196,162,101,0.08);
}

.housing-table .scenario-up td {
  background: rgba(107,144,128,0.12);
}

/* -------------------------------------------
   Disclaimer / footer
   ------------------------------------------- */
.housing-disclaimer {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
  padding-top: 48px;
  border-top: 1px solid rgba(26,26,26,0.1);
  max-width: 700px;
}

.housing-section--dark .housing-disclaimer,
.housing-section--navy .housing-disclaimer {
  border-top-color: rgba(255,255,255,0.1);
}

.housing-footer {
  background: var(--navy);
  padding: 40px;
  text-align: center;
}

.housing-footer p {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 4px;
}

/* -------------------------------------------
   Proof of concept highlight
   ------------------------------------------- */
.poc-highlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 48px;
}

.poc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.poc-stat {
  text-align: center;
  padding: 24px;
  background: rgba(255,255,255,0.04);
}

.poc-stat-num {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
}

.poc-stat-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
}

.poc-text h3 {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--cream);
  margin-bottom: 16px;
}

.poc-text p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
}

/* -------------------------------------------
   Two-column content
   ------------------------------------------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.two-col h4 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.two-col p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-light);
}

/* -------------------------------------------
   Print styles
   ------------------------------------------- */
@media print {
  .housing-hero { min-height: auto; padding: 40px; }
  .housing-section { padding: 40px 0; }
  .housing-hero::before { display: none; }
  .cursor { display: none; }
  #navbar { display: none; }
  .reveal-up { opacity: 1; transform: none; }
}

/* -------------------------------------------
   Responsive
   ------------------------------------------- */
@media (max-width: 1024px) {
  .crisis-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .return-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .geo-grid {
    grid-template-columns: 1fr;
  }

  .gov-tiers {
    grid-template-columns: 1fr;
  }

  .poc-highlight {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .stack-layer {
    grid-template-columns: 48px 1fr;
  }

  .stack-layer-desc {
    grid-column: 2;
  }
}

@media (max-width: 768px) {
  .housing-hero {
    padding: 0 24px 40px;
  }

  .housing-hero-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .housing-inner {
    padding: 0 24px;
  }

  .crisis-stats {
    grid-template-columns: 1fr;
  }

  .stack-bar {
    flex-direction: column;
    height: auto;
  }

  .stack-bar-seg {
    padding: 12px 16px;
    flex-direction: row;
    justify-content: space-between;
  }

  .return-grid {
    grid-template-columns: 1fr;
  }

  .housing-footer {
    padding: 24px;
  }

  .flow-step {
    grid-template-columns: 48px 1fr;
  }

  .flow-step::after {
    left: 23px;
  }
}
