body[data-page="projects"] .filters {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 3fr);
}

body[data-page="projects"] .catalogue-filter-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 14px;
}

body[data-page="projects"] .filters label,
body[data-page="projects"] .catalogue-more-filters {
  min-width: 0;
}

body[data-page="projects"] .catalogue-more-filters > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 2px;
  color: var(--ink);
}

body[data-page="projects"] .catalogue-more-filters > summary::-webkit-details-marker {
  display: none;
}

body[data-page="projects"] .catalogue-more-filters > summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px auto;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

body[data-page="projects"] .catalogue-more-filters[open] > summary::after {
  transform: rotate(225deg);
  margin-block: 4px 0;
}

body[data-page="projects"] #filter-selection {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: #455044;
  overflow-wrap: anywhere;
}

@media (min-width: 701px) {
  body[data-page="projects"] .catalogue-more-filters[open] > summary {
    display: none;
  }
}

@media (min-width: 701px) and (max-width: 1150px) {
  body[data-page="projects"] .filters {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  body[data-page="projects"] .page-intro {
    padding-top: 24px;
  }

  body[data-page="projects"] .page-intro .eyebrow {
    margin-bottom: 9px;
    font-size: 10px;
  }

  body[data-page="projects"] .page-intro h1 {
    font-size: clamp(38px, 10vw, 48px);
    line-height: 1.08;
  }

  body[data-page="projects"] .page-intro .section-heading {
    margin-bottom: 8px;
  }

  body[data-page="projects"] .page-intro .section-heading > p {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
  }

  body[data-page="projects"] .page-tabs {
    gap: 22px;
    font-size: 11px;
  }

  body[data-page="projects"] .page-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: 8px;
  }

  body[data-page="projects"] .catalogue {
    padding-top: 14px;
  }

  body[data-page="projects"] .filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 12px 14px 3px;
  }

  body[data-page="projects"] .filters label {
    gap: 4px;
    font-size: 12px;
  }

  body[data-page="projects"] .filters input,
  body[data-page="projects"] .filters select {
    font-size: 16px;
  }

  body[data-page="projects"] .catalogue-more-filters > summary {
    border-top: 1px solid var(--line);
    font-size: 14px;
  }

  body[data-page="projects"] .catalogue-filter-inputs {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-block: 4px 10px;
  }

  body[data-page="projects"] .reset-button {
    justify-self: start;
    font-size: 13px;
  }

  body[data-page="projects"] .catalogue-toolbar {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-block: 10px;
  }

  /* The fixed chat button occupies the right edge at every scroll position. */
  body[data-page="projects"] .catalogue-toolbar label {
    order: -1;
    max-width: calc(100% - 64px);
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
  }

  body[data-page="projects"] .catalogue-toolbar select {
    min-width: 0;
    max-width: min(48vw, 180px);
    min-height: 44px;
    padding: 6px 6px 6px 8px;
    font-size: 16px;
  }

  body[data-page="projects"] .catalogue-toolbar p {
    font-size: 12px;
  }
}

/* Keep each piece of information in the same place across a catalogue row. */
#project-grid .card-photo {
  aspect-ratio: 16 / 9;
  align-self: start;
}
#project-grid .card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#project-grid .card-body {
  min-width: 0;
  padding: 18px clamp(16px, 1.45vw, 23px) 0;
}
#project-grid .card-body .eyebrow {
  margin: 0 0 5px;
  font-size: 10px;
  line-height: 1.5;
}
#project-grid h3 {
  margin: 0;
  font-size: clamp(21px, 1.55vw, 25px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
#project-grid .card-types {
  min-height: 0;
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #414b43;
}
#project-grid .card-facts {
  flex-wrap: wrap;
  gap: 2px 14px;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #4a564b;
}
#project-grid .card-facts span:empty { display: none }
#project-grid .card-price {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  justify-content: flex-start;
  gap: 9px 10px;
  margin-top: 0;
  padding: 16px 0 13px;
  border: 0;
}
#project-grid .card-price > * { flex: 1 1 8.2rem }
#project-grid .card-price > p { margin: 0 }
#project-grid .card-price .card-total { display: block }
#project-grid .card-finance-label {
  min-width: 0;
  margin-bottom: 3px;
  color: #4a564b;
  font-size: 12px;
  line-height: 1.45;
}
#project-grid .card-price strong { line-height: 1.18; font-variant-numeric: tabular-nums }
#project-grid .card-monthly strong { font-size: 23px }
#project-grid .card-total strong { font-size: 19px }
#project-grid .card-price .card-assumptions {
  flex-basis: 100%;
  font-size: 12px;
  line-height: 1.45;
}
#project-grid .card-price .card-action {
  min-height: 44px;
  padding: 3px 0;
  gap: 5px;
  align-items: center;
  font-size: 13px;
  line-height: 1.35;
}
#project-grid .card-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 8px 0;
  gap: 8px;
}
#project-grid .card-bottom .card-action,
#project-grid .card-bottom .card-enquire {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  font-size: 13px;
  line-height: 1.35;
}
#project-grid .card-bottom .card-action {
  justify-content: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid #b9c5b6;
  border-radius: 3px;
  background: #f3f5ef;
  color: #25382b;
}
#project-grid .card-bottom .card-enquire { justify-content: flex-end; color: #37463a }
#project-grid .card-bottom .card-action:hover { border-color: #5e715a; background: #e9eee5 }
#project-grid .card-body :is(a,button):focus-visible { outline: 2px solid #355a38; outline-offset: 2px }

@media (min-width: 701px) {
  @supports (grid-template-rows: subgrid) {
    #project-grid { row-gap: 0 }
    #project-grid .project-card {
      display: grid;
      grid-row: span 7;
      grid-template-rows: subgrid;
      row-gap: 0;
      margin-bottom: 24px;
    }
    #project-grid .card-photo { grid-row: 1 }
    #project-grid .card-body {
      display: grid;
      grid-row: 2 / span 6;
      grid-template-rows: subgrid;
      row-gap: 0;
    }
    #project-grid .card-body > .eyebrow { grid-row: 1 }
    #project-grid h3 { grid-row: 2 }
    #project-grid .card-types { grid-row: 3 }
    #project-grid .card-facts { grid-row: 4 }
    #project-grid .card-price { grid-row: 5 }
    #project-grid .card-bottom { grid-row: 6; margin-top: 0 }
  }
}
@media (max-width: 700px) {
  #project-grid { row-gap: 18px }
  #project-grid .card-facts + .card-bottom { margin-top: 14px }
}

.catalogue-toolbar label {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.catalogue-toolbar label::after {
  content: '';
  pointer-events: none;
  position: absolute;
  right: 13px;
  top: calc(50% - 5px);
  width: 7px;
  height: 7px;
  border: solid #465145;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
#project-sort {
  -webkit-appearance: none;
  appearance: none;
  height: 44px;
  min-height: 44px;
  width: 152px;
  max-width: 100%;
  padding: 6px 30px 6px 11px;
  border: 1px solid #a9b4a5;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.3;
}
#project-sort:focus-visible { outline: 2px solid #355a38; outline-offset: 2px }
.catalogue-sort-note {
  margin: -3px 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #455044;
}
@media(max-width:700px) {
  #project-sort { font-size: 16px; width: 152px }
}
@media(forced-colors:active) {
  #project-sort { appearance: auto }
  .catalogue-toolbar label::after { display:none }
}

/* Expand the native title link over the summary while keeping footer actions independent. */
#project-grid [data-linked-overview] { position: relative; isolation: isolate }
#project-grid [data-linked-overview] .card-title-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
#project-grid [data-linked-overview] .card-bottom a,
#project-grid [data-linked-overview] .card-bottom button {
  position: relative;
  z-index: 2;
}
@media (max-width: 700px) {
  /* Leave the enquiry action clear of the fixed WhatsApp button at the screen edge. */
  #project-grid [data-linked-overview] .card-bottom { padding-inline-end: 44px }
}
