/* =====================================================================
   CITIES.CSS — Compact, dense redesign for /cities/ pages
   Scoped under body.city-page so it doesn't affect other page types.
   ===================================================================== */

/* ---- Hero / page header (tighten the top) ---- */
body.city-page .page-header {
  padding: 40px 0 32px;
}
body.city-page .page-header h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  margin: 0.5rem 0 0.5rem;
}
body.city-page .page-header .lead,
body.city-page .page-header > .container > p {
  font-size: 1rem;
  line-height: 1.55;
  margin: 0;
  color: var(--ink-muted);
  max-width: 720px;
}
body.city-page .page-header .breadcrumb {
  font-size: 0.82rem;
  margin-bottom: 12px;
  opacity: 0.85;
}
body.city-page .page-header .eyebrow,
body.city-page .page-header [class*="eyebrow"] {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

/* ---- Quick Answer — compact callout, not a giant box ---- */
body.city-page .quick-answer-section {
  padding: 20px 0;
  background: transparent;
}
body.city-page .quick-answer-section .container {
  background: #fff8f1;
  border-left: 3px solid var(--brand-orange, #f08030);
  padding: 16px 20px;
  border-radius: 0 6px 6px 0;
  max-width: 980px;
}
body.city-page .quick-answer-section .eyebrow,
body.city-page .quick-answer-section p.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.35rem;
  color: var(--brand-orange, #f08030);
  font-weight: 700;
}
body.city-page .quick-answer-section p:not(.eyebrow) {
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
  margin: 0;
  color: var(--ink, #1a2238);
}

/* ---- Section padding — cut from 70px to 32px ---- */
body.city-page .program-section,
body.city-page section.program-section,
body.city-page main > section {
  padding: 24px 0 !important;
}
body.city-page section.scenario-section,
body.city-page section.definitions-section,
body.city-page section.qa-section {
  padding: 32px 0;
}

/* ---- Content layout — tighter gap, more space for content ---- */
body.city-page .content-layout {
  grid-template-columns: 1.8fr 1fr;
  gap: 32px;
  align-items: flex-start;
}
@media (max-width: 900px) {
  body.city-page .content-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ---- Main content typography — tighter ---- */
body.city-page .content-main h2 {
  font-size: 1.4rem;
  margin: 1.5rem 0 0.6rem;
  line-height: 1.25;
}
body.city-page .content-main h2:first-child {
  margin-top: 0;
}
body.city-page .content-main h3 {
  font-size: 1.1rem;
  margin: 1.1rem 0 0.4rem;
}
body.city-page .content-main p {
  font-size: 0.97rem;
  line-height: 1.6;
  margin-bottom: 0.85rem;
  color: var(--ink, #1a2238);
}
body.city-page .content-main ul,
body.city-page .content-main ol {
  margin: 0 0 1rem 1.25rem;
}
body.city-page .content-main ul li,
body.city-page .content-main ol li {
  margin-bottom: 0.3rem;
  line-height: 1.55;
  font-size: 0.95rem;
}

/* ---- Stat row — compact inline strip ---- */
body.city-page .stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 1.5rem;
  padding: 0;
  background: #f7f5ef;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
}
body.city-page .stat-tile {
  background: transparent !important;
  border: none !important;
  border-right: 1px solid rgba(0,0,0,0.06) !important;
  padding: 14px 16px !important;
  text-align: left !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  min-width: 0;
}
body.city-page .stat-row .stat-tile:last-child {
  border-right: none !important;
}
body.city-page .stat-tile strong {
  font-size: 1.35rem !important;
  font-family: var(--font-display, 'Fraunces', Georgia, serif) !important;
  color: var(--navy, #1a2238) !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.city-page .stat-tile span {
  font-size: 0.7rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: var(--ink-soft, #5e6a85) !important;
  margin-top: 0 !important;
  line-height: 1.3 !important;
}
@media (max-width: 600px) {
  body.city-page .stat-row {
    grid-template-columns: 1fr;
  }
  body.city-page .stat-tile {
    border-right: none !important;
    border-bottom: 1px solid rgba(0,0,0,0.06) !important;
  }
  body.city-page .stat-row .stat-tile:last-child {
    border-bottom: none !important;
  }
}

/* ---- Fact box — compact ---- */
body.city-page .fact-box {
  padding: 14px 18px;
  margin: 1rem 0;
  font-size: 0.92rem;
}
body.city-page .fact-box h3,
body.city-page .fact-box h4 {
  font-size: 0.88rem !important;
  margin: 0 0 0.3rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-orange, #f08030);
  font-weight: 700;
}
body.city-page .fact-box p {
  font-size: 0.92rem !important;
  line-height: 1.5 !important;
  margin: 0;
}

/* ---- Cities-grid (loan program tiles) — 4 across, denser cards ---- */
body.city-page .cities-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 0 1rem;
}
body.city-page .city-tile {
  padding: 14px 16px !important;
  border-radius: 6px !important;
  gap: 3px !important;
  background: var(--white, #fff) !important;
  border: 1px solid var(--line, rgba(0,0,0,0.08)) !important;
  transition: all 0.15s ease;
}
body.city-page .city-tile:hover {
  border-color: var(--brand-orange, #f08030) !important;
  transform: none !important;
  background: #fff8f1 !important;
}
body.city-page .city-tile h3,
body.city-page .city-tile h4 {
  font-size: 0.95rem !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  color: var(--navy, #1a2238) !important;
}
body.city-page .city-tile span {
  font-size: 0.78rem !important;
  color: var(--ink-soft, #5e6a85) !important;
  line-height: 1.3 !important;
}
body.city-page .city-tile:hover h3,
body.city-page .city-tile:hover h4 {
  color: var(--brand-orange, #f08030) !important;
}
body.city-page .city-tile:hover span {
  color: var(--ink-muted, #4a5570) !important;
}
@media (max-width: 900px) {
  body.city-page .cities-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  body.city-page .cities-grid { grid-template-columns: 1fr; }
}

/* ---- City-grid (LA subpage links etc.) — same compact treatment ---- */
body.city-page .city-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 900px) {
  body.city-page .city-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  body.city-page .city-grid { grid-template-columns: 1fr; }
}

/* ---- FAQ list — compact accordion ---- */
body.city-page .faq-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 0.5rem;
}
body.city-page details.faq-item {
  background: var(--white, #fff);
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: 6px;
  padding: 0;
}
body.city-page details.faq-item summary {
  font-size: 0.95rem;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--navy, #1a2238);
  cursor: pointer;
  line-height: 1.35;
}
body.city-page details.faq-item .answer {
  padding: 0 16px 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink, #1a2238);
}
body.city-page details.faq-item .answer p {
  margin: 0;
  font-size: 0.92rem;
}
body.city-page details.faq-item[open] summary {
  color: var(--brand-orange, #f08030);
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.08));
  margin-bottom: 8px;
}

/* ---- Scenario box — 2-col layout (story left, numbers right) ---- */
body.city-page .scenario-box {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  padding: 1.25rem 1.5rem;
  align-items: start;
}
body.city-page .scenario-box > p {
  margin: 0 0 0.55rem;
  font-size: 0.93rem;
  line-height: 1.5;
}
body.city-page .scenario-box > ul {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: start;
  margin: 0;
  padding: 1rem;
  background: var(--bg-soft, #f7f5ef);
  border-radius: 6px;
  font-size: 0.88rem;
}
body.city-page .scenario-box > ul li {
  padding: 0.3rem 0;
  font-size: 0.88rem;
  line-height: 1.4;
}
@media (max-width: 800px) {
  body.city-page .scenario-box {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  body.city-page .scenario-box > ul {
    grid-column: 1;
    grid-row: auto;
  }
}

/* ---- Glossary / definitions — 2-col compact ---- */
body.city-page .definitions-section {
  padding: 28px 0 !important;
}
body.city-page .definitions-section dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  row-gap: 12px;
}
body.city-page .definitions-section dt {
  font-weight: 600;
  color: var(--navy, #1a2238);
  font-size: 0.93rem;
  margin: 0;
}
body.city-page .definitions-section dd {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-soft, #5e6a85);
  margin: 0 0 0.4rem;
}
@media (max-width: 700px) {
  body.city-page .definitions-section dl {
    grid-template-columns: 1fr;
  }
}

/* ---- Sticky sidebar (form follows scroll) ---- */
body.city-page .sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}
body.city-page .sidebar form,
body.city-page .sidebar > div {
  padding: 18px 20px;
  font-size: 0.92rem;
}
body.city-page .sidebar h3,
body.city-page .sidebar h2 {
  font-size: 1.1rem !important;
  margin: 0 0 0.4rem !important;
}
body.city-page .sidebar p {
  font-size: 0.85rem;
  margin: 0 0 0.85rem;
}
body.city-page .sidebar label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
body.city-page .sidebar input,
body.city-page .sidebar select {
  padding: 9px 12px;
  font-size: 0.92rem;
  margin-bottom: 8px;
}
body.city-page .sidebar .btn,
body.city-page .sidebar button {
  padding: 11px 18px;
  font-size: 0.93rem;
}
@media (max-width: 900px) {
  body.city-page .sidebar {
    position: static;
  }
}

/* ---- CTA banner — tighten ---- */
body.city-page .cta-banner {
  padding: 36px 0 !important;
}
body.city-page .cta-banner h2 {
  font-size: 1.4rem !important;
  margin: 0 0 0.5rem !important;
}
body.city-page .cta-banner p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

/* ---- Neighborhoods list (the giant flex of neighborhood names) ---- */
body.city-page .content-main blockquote,
body.city-page .content-main .neighborhood-list,
body.city-page .content-main p:has(> a):has(.neighborhood-tag) {
  background: var(--bg-soft, #f7f5ef);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.92rem;
  line-height: 1.8;
  margin: 0.5rem 0 1rem;
}

/* ---- Compact comparison tables ---- */
body.city-page table.compare-table {
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem;
}
body.city-page table.compare-table th,
body.city-page table.compare-table td {
  padding: 8px 12px;
}

/* ---- "Quick reference: key facts" section ---- */
body.city-page section.program-section h2 {
  font-size: 1.4rem !important;
  margin-bottom: 0.6rem !important;
}

/* ---- Container padding ---- */
body.city-page .container {
  max-width: 1180px;
}
body.city-page .container.narrow-content {
  max-width: 980px;
}

/* ---- Helpful tools box / related programs callout (already small, keep tight) ---- */
body.city-page .helpful-tools-box,
body.city-page .related-loan-programs,
body.city-page .city-specific-scenarios {
  margin: 1rem auto !important;
}
body.city-page .city-specific-scenarios ul li {
  padding: 0.7rem 0.9rem !important;
  margin-bottom: 0.4rem !important;
  font-size: 0.92rem;
}

/* ---- Reduce huge gap between section heading and next paragraph ---- */
body.city-page section h2 + p,
body.city-page section h2 + ul {
  margin-top: 0.5rem;
}


/* Hide mid-page "Buying in [City]?" navy-background CTA callout
   (the final CTA banner at the bottom of the page is sufficient) */
body.city-page .fact-box[style*="background:var(--navy)"],
body.city-page .fact-box[style*="background: var(--navy)"] {
  display: none !important;
}
