/* Condo pages (/condos/). The main site's look, as on the HDB pages: numbered tiles for "on
   this page", white hairline tables with a navy head row, www's section headings and the
   closing call-to-action band. Mobile first; no sideways scrolling at 375px (wide tables
   scroll inside their box).
   Colours come from the --c-* custom properties the layout sets from the brand config
   (src/brand.js); nothing brand-specific is written here. */

/* "On this page" */

.condo-toc {
  margin: 0 0 52px;
}

/* Two tiles a row on phones, four from 761px; a short last row stretches to fill it. */
.condo-toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  margin: 0;
  padding: 1px;
  background: color-mix(in srgb, var(--c-primary) 27%, transparent);
  list-style: none;
}

.condo-toc li {
  flex: 1 1 calc(50% - 1px);
  min-width: 0;
  max-width: none;
}

.condo-toc a {
  display: grid;
  height: 100%;
  min-height: 68px;
  align-content: center;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 0;
  background: var(--c-surface);
  color: var(--c-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1.35;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 180ms ease;
}

.condo-toc a:hover {
  background: var(--c-raised);
}

.condo-toc b {
  color: var(--c-accent);
  font-size: 12px;
}

/* The hero panel: the last 12 months at a glance */

.condo-hero-facts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.condo-hero-facts li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  max-width: none;
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--c-line-on-primary);
  color: var(--c-on-primary);
  font-size: 15px;
  font-weight: 700;
}

.condo-hero-facts li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.condo-hero-facts span {
  color: var(--c-eyebrow-on-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Project facts: label and value in two columns, hairlines between rows */

.condo-facts {
  display: grid;
  max-width: 760px;
  margin: 0;
  border-top: 1px solid var(--c-line);
}

.condo-facts div {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--c-line);
}

.condo-facts dt {
  color: var(--c-muted);
  font-size: 14px;
  font-weight: 700;
}

.condo-facts dd {
  margin: 0;
  color: var(--c-ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Atlas score */

.condo-score {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 20px;
  margin: 0 0 22px;
}

.page-body .condo-score p {
  margin: 0;
}

.condo-score-figure strong {
  color: var(--c-primary);
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 470;
  line-height: 1;
}

.condo-score-figure span {
  color: var(--c-muted);
  font-weight: 700;
}

.condo-score-basis {
  color: var(--c-muted);
  font-size: 15px;
}

.condo-parts {
  display: grid;
  gap: 0;
  max-width: 760px;
  margin: 0 0 18px;
  padding: 0;
  border-top: 1px solid var(--c-line);
  list-style: none;
}

.condo-parts li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label value" "bar bar";
  align-items: center;
  gap: 6px 12px;
  max-width: none;
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--c-line);
}

.condo-part-label {
  grid-area: label;
  font-weight: 700;
}

.condo-part-value {
  grid-area: value;
  color: var(--c-muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.condo-part-bar {
  grid-area: bar;
  display: block;
  height: 6px;
  background: color-mix(in srgb, var(--c-primary) 12%, transparent);
}

.condo-part-bar span {
  display: block;
  height: 100%;
  background: var(--c-primary);
}

/* Notes, counts and the yield line */

.condo-note,
.condo-count {
  color: var(--c-muted);
  font-size: 15px;
}

.condo-yield {
  margin: 22px 0 8px;
  color: var(--c-ink);
}

.condo-notes {
  max-width: 760px;
  margin: 0;
  padding-left: 20px;
  color: var(--c-muted);
}

.condo-notes li {
  margin: 0 0 10px;
}

.condo-n {
  color: var(--c-muted);
  font-size: 0.85em;
  font-weight: 600;
}

/* Tables: phone widths get tighter cells; wide tables scroll inside .table-wrap */

.condo-table-short {
  max-width: 520px;
  margin-top: 28px;
}

.condo-table th,
.condo-table td {
  padding: 11px 7px;
  font-size: 13px;
}

.condo-sales td,
.condo-rents td,
.condo-rents th,
.condo-listings td {
  white-space: nowrap;
}

.condo-directory th[scope="row"] a {
  font-weight: 800;
}

/* Filters */

.condo-filters {
  max-width: 980px;
  margin: 0;
}

.condo-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.condo-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.condo-field label {
  font-size: 14px;
  font-weight: 800;
}

.condo-field input,
.condo-field select {
  width: 100%;
  min-width: 0;
}

.condo-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin: 22px 0 0;
}

.condo-filter-actions .button {
  width: auto;
}

/* Pages of results */

.condo-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin: 22px 0 0;
  font-weight: 700;
}

.condo-pager span {
  color: var(--c-muted);
}

/* The chart */

.condo-chart {
  max-width: 640px;
  margin: 0;
  padding: 20px 16px 16px;
  border: 1px solid var(--c-line);
  background: var(--c-raised);
}

.condo-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--c-primary);
}

.condo-chart-line {
  fill: none;
  stroke: var(--c-primary);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.condo-chart-dot {
  fill: var(--c-primary);
  stroke: var(--c-raised);
  stroke-width: 1.5;
}

.condo-chart-grid {
  stroke: var(--c-line);
  stroke-width: 1;
}

.condo-chart-text {
  fill: var(--c-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.condo-chart-value {
  fill: var(--c-primary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
}

.condo-chart figcaption {
  margin-top: 10px;
  color: var(--c-muted);
  font-size: 13px;
}

.condo-chart-data {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--c-line);
}

.condo-chart-data summary {
  display: inline-flex;
  width: fit-content;
  padding: 4px 0;
  border-bottom: 1px solid var(--c-primary);
  color: var(--c-primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.condo-chart-data[open] summary {
  margin-bottom: 14px;
}

.condo-chart-data .table-wrap {
  margin-bottom: 0;
}

/* The closing call to action: www's full-width band, as on the HDB pages */

.condo-cta {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 60px 0;
  background: var(--c-band);
  box-shadow: 0 0 0 100vmax var(--c-band);
  clip-path: inset(0 -100vmax);
  color: var(--c-on-primary);
  isolation: isolate;
}

.page-body > .shell > .condo-cta:last-child {
  margin-bottom: -52px;
}

.condo-cta::after {
  content: "";
  position: absolute;
  top: -120px;
  right: 8%;
  z-index: -1;
  width: 300px;
  height: 300px;
  border: 1px solid color-mix(in srgb, var(--c-on-primary) 15%, transparent);
  border-radius: 50%;
}

.condo-cta .eyebrow {
  margin: 0;
}

.page-body .condo-cta h2 {
  max-width: none;
  margin: 0;
  color: var(--c-on-primary);
  font-size: var(--t-section-size);
}

.condo-cta-copy p {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--c-intro-on-primary);
  font-size: 16px;
}

.condo-cta-action {
  margin: 35px 0 0;
}

@media (min-width: 761px) {
  .condo-toc {
    margin-bottom: 72px;
  }

  .condo-toc li {
    flex-basis: calc(25% - 1px);
  }

  .condo-toc a {
    min-height: 82px;
    padding: 14px;
  }

  .condo-table th,
  .condo-table td {
    font-size: 14px;
  }

  .condo-table thead th {
    padding: 18px 14px;
  }

  .condo-table tbody td {
    padding: 15px 14px;
  }

  .condo-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .condo-field-wide {
    grid-column: 1 / -1;
  }

  .condo-parts li {
    grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr) auto;
    grid-template-areas: "label bar value";
  }

  .condo-chart {
    padding: 28px 28px 20px;
  }

  .condo-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    align-items: center;
    gap: 35px 55px;
    padding: 72px 0;
  }

  .page-body > .shell > .condo-cta:last-child {
    margin-bottom: -80px;
  }

  .condo-cta::after {
    width: 360px;
    height: 360px;
  }

  .condo-cta-action {
    grid-column: 2;
    margin: 0;
  }
}

@media (min-width: 981px) {
  .condo-cta {
    grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.2fr) auto;
  }

  .condo-cta-action {
    grid-column: auto;
    justify-self: end;
  }
}
