/* =====================================================================
   Properties (offerings listing) page styles. Load after css/site.css.
   ===================================================================== */

.page-lede {
  max-width: 820px;
  margin: 20px 0 0;
  font-size: var(--fs-md);
  line-height: var(--lh-body);
}

.listing {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 40px;
  align-items: start;
  margin-top: 32px;
}

/* ---------- Filters ---------- */
.filters summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;           /* same height as .results-bar so the two lines align */
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mist);
  list-style: none;
  cursor: default;
}

.filters summary::-webkit-details-marker { display: none; }

.filters-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: var(--fs-md);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filters-heading svg { width: 14px; height: 14px; color: var(--pewter); }

.filters-active {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: 0;
  text-transform: none;
  color: var(--burgundy);
}

.toc-chev {
  display: none;
  width: 16px;
  height: 16px;
  color: var(--pewter);
  transition: transform 0.15s ease;
}

.filters-form { font-size: var(--fs-base); }

.filters select,
.sort select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: var(--white);
  font-size: var(--fs-base);
  color: var(--text);
}

.filters select:focus,
.sort select:focus {
  outline: 2px solid var(--steel-blue);
  outline-offset: -1px;
}

.filters fieldset {
  margin: 0;
  padding: 12px 0 0;
  border: 0;
}

.filters legend {
  float: left;
  width: 100%;
  margin-bottom: 8px;
  padding: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  clear: both;
  padding: 3px 0;
  color: var(--pewter);
  cursor: pointer;
}

.filters label:hover { color: var(--text); }

.filters input[type="checkbox"],
.filters input[type="radio"] {
  margin: 0;
  accent-color: var(--steel-blue);
}

.f-count {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}

.f-clear,
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--fs-base);
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.f-clear { margin-top: 14px; }

.f-clear:hover,
.link-btn:hover { color: var(--burgundy); }

/* ---------- Dropdowns (multi-select and single-select) ---------- */
.ms { position: relative; }

.ms-toggle,
.select-wrap select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  background: var(--white);
  font: inherit;
  font-size: var(--fs-base);
  color: var(--pewter);
  text-align: left;
  cursor: pointer;
}

.select-wrap { position: relative; clear: both; }

.ms-toggle { clear: both; }

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
}

.select-wrap .ms-chev {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.ms-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms.has-value .ms-toggle {
  color: var(--text);
  border-color: var(--mist);
}

.ms-chev {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--pewter);
  transition: transform 0.15s ease;
}

.ms.open .ms-toggle .ms-chev { transform: rotate(180deg); }

.ms-toggle:hover,
.select-wrap select:hover { border-color: var(--mist); }

.ms-toggle:focus-visible,
.select-wrap select:focus-visible {
  outline: 2px solid var(--steel-blue);
  outline-offset: -1px;
}

.ms-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px 0;
  border: 1px solid var(--hairline);
  background: var(--white);
  box-shadow: 0 8px 20px rgba(43, 48, 58, 0.12);
}

.ms-panel label {
  padding: 6px 12px;
}

.ms-panel label:hover {
  background: var(--alabaster);
}

/* Location quick-select groups */
.ms-heading {
  margin: 0;
  padding: 10px 12px 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mist);
}

.ms-heading:not(:first-child) {
  margin-top: 6px;
  border-top: 1px solid var(--hairline);
}

.ms-panel label.ms-group:not(.is-empty) > span:first-of-type {
  color: var(--text);
}

.ms-location .ms-panel { max-height: 340px; }

/* options with no matching offerings stay selectable but read as empty */
.ms-panel label.is-empty { color: var(--mist); }

/* ---------- Results ---------- */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 44px;           /* same height as the Filters heading so the two lines align */
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mist);
}

.results-count {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: var(--fs-md);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.results-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}

.results-tools .view-switch button { padding: 5px 10px; }

/* Sort-by menu is for cards; the table sorts by its headings */
.results.is-table .sort { display: none; }

.sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-base);
  color: var(--pewter);
  white-space: nowrap;
}

.sort .select-wrap { display: inline-block; }

.sort select {
  width: auto;
  padding: 6px 32px 6px 10px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.sort select:hover { border-color: var(--mist); }

.offers {
  display: grid;
  grid-template-columns: 1fr;   /* one horizontal card per row */
  gap: 16px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.offer[hidden],
.offers[hidden] { display: none; }

.offer article { height: 100%; }

.offer-link {
  display: flex;
  flex-direction: row;
  height: 100%;
  border: 1px solid var(--hairline);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.offer-link:hover,
.offer-link:focus-visible {
  border-color: var(--mist);
  box-shadow: 0 6px 18px rgba(43, 48, 58, 0.08);
}

.offer-photo {
  display: flex;
  flex: 0 0 220px;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  background: #E6E9EE;
  color: var(--mist);
}

.offer-photo svg { width: 28px; height: 28px; }

.offer-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
}

.offer-eyebrow {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 6px;
  font-size: var(--fs-sm);
  color: var(--pewter);
}

.offer-eyebrow .eyebrow-dot { width: 14px; height: 14px; }

.offer-name {
  font-size: var(--fs-lg);
  margin: 0 0 10px;
  /* one line; very long names end with an ellipsis */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
}

.offer-link:hover .offer-name { color: var(--burgundy); }

.offer-facts {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}

.offer-facts tbody {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));   /* equal columns so rows line up card to card */
  gap: 10px 20px;
}

.offer-facts tr {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.offer-facts th {
  padding: 0;
  font-size: var(--fs-xs);
  font-weight: 400;
  text-align: left;
  color: var(--mist);
}

.offer-facts td {
  padding: 0;
  text-align: left;
  overflow-wrap: anywhere;   /* long values wrap rather than being cut off */
}

.no-results {
  margin: 32px 0 0;
  padding: 24px;
  background: var(--alabaster);
  font-size: var(--fs-md);
  text-align: center;
}

.results > .detail-note { margin-top: 24px; }

/* ---------- Table view ---------- */
.offers-table-wrap { margin-top: 16px; }
.offers-table-wrap[hidden] { display: none; }

.offers-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;          /* fixed columns so long text truncates instead of wrapping */
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.offers-table th,
.offers-table td {
  padding: 10px 12px 10px 0;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--hairline);
}

/* column widths: Offering | Property Type | Yield | LTV | Hold | 721 Exit */
.offers-table th:nth-child(1) { width: 29%; }
.offers-table th:nth-child(2) { width: 23%; }
.offers-table th:nth-child(3) { width: 13%; }
.offers-table th:nth-child(4) { width: 9%; }
.offers-table th:nth-child(5) { width: 11%; }
.offers-table th:nth-child(6) { width: 10%; }
.offers-table th:nth-child(7) { width: 5%; }

.offers-table td.t-name { overflow: hidden; text-overflow: ellipsis; }
.t-name .status-icon { margin-right: 8px; }

.t-types {
  display: table-cell;
}

.t-types .primary {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.t-types .more {
  margin-left: 6px;
  color: var(--mist);
}

.offers-table .num { text-align: right; white-space: nowrap; }

.offers-table thead th {
  padding-top: 0;
  font-weight: 600;
  color: var(--pewter);
  white-space: nowrap;
  border-bottom: 1px solid var(--mist);
}

.offers-table thead th button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.offers-table thead th.num button { flex-direction: row-reverse; }

.offers-table thead th button:hover,
.offers-table thead th[aria-sort] button { color: var(--text); }

.sort-icon {
  width: 12px;
  height: 12px;
  color: var(--hairline);
  transition: transform 0.15s ease;
}

.offers-table thead th button:hover .sort-icon { color: var(--mist); }
.offers-table thead th[aria-sort] .sort-icon { color: var(--burgundy); }
.offers-table thead th[aria-sort="descending"] .sort-icon { transform: rotate(180deg); }

.offers-table tbody tr { cursor: pointer; }
.offers-table tbody tr:hover { background: var(--alabaster); }
.offers-table tbody tr[hidden] { display: none; }

.offers-table .t-name a {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.offers-table tbody tr:hover .t-name a { color: var(--burgundy); }

.offers-table .t-sub {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--pewter);
}

.offers-table td:first-child { padding-left: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .offer-facts tbody { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .offer-photo { flex-basis: 160px; }

  .listing {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Filters become an accordion */
  .filters summary {
    height: auto;
    padding: 12px 0;
    border-top: 2px solid var(--mist);
    border-bottom: 1px solid var(--hairline);
    cursor: pointer;
  }

  .toc-chev { display: block; }
  .filters-details[open] .toc-chev { transform: rotate(180deg); }

  .filters-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }

  .f-clear { grid-column: 1 / -1; }
  .f-clear { justify-self: start; margin-bottom: 8px; }
}

@media (max-width: 640px) {
  .filters-form { grid-template-columns: 1fr; }
  .results-tools { width: 100%; flex-wrap: wrap; gap: 10px 16px; }
  .sort { flex: 1; min-width: 0; }
  .sort .select-wrap { flex: 1; min-width: 0; }
  .sort select { width: 100%; }

  .offer-link { flex-direction: column; }
  .offer-photo { flex-basis: auto; aspect-ratio: 16 / 9; min-height: 0; }
  .offer-facts tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-bar { flex-wrap: wrap; height: auto; }
}

/* Footnote markers */
.ms-heading sup,
.detail-note sup {
  font-size: 0.75em;
  line-height: 0;
  margin-left: 2px;
}

.ms-heading sup a,
.detail-note a[href^="#note"] {
  color: var(--navy);
  text-decoration: none;
}

.ms-heading sup a:hover,
.detail-note a[href^="#note"]:hover { color: var(--burgundy); }

.results > .detail-note + .detail-note { margin-top: 8px; }

/* keep the results column inside the page so the table scrolls in its own box */
.results { min-width: 0; }
.offers-table th { text-overflow: clip; }
.offers-table td.num { text-overflow: clip; }

/* ---------- Save / bookmark ---------- */
.offer article { position: relative; }

.save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--hairline);
  background: var(--white);
  color: var(--pewter);
  cursor: pointer;
}

.save-btn svg { width: 16px; height: 16px; }
.save-btn:hover,
.save-btn:focus-visible { color: var(--burgundy); border-color: var(--mist); }
.save-btn[aria-pressed="true"] { color: var(--burgundy); }
.save-btn[aria-pressed="true"] svg { fill: currentColor; }

.offer .save-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* keep the eyebrow and name clear of the button */
.offer-eyebrow,
.offer-name { margin-right: 40px; }

.offers-table .t-save { text-align: right; padding-right: 0; text-overflow: clip; }
.offers-table td.t-save { padding-top: 4px; padding-bottom: 4px; }
.offers-table .save-btn { width: 28px; height: 28px; border-color: transparent; background: none; }
.offers-table .save-btn:hover,
.offers-table .save-btn:focus-visible { border-color: var(--hairline); }

/* ---------- Status icons (table view) ---------- */
.status-icon { display: inline-flex; vertical-align: -3px; }
.status-icon svg { width: 16px; height: 16px; }
.status-open { color: #2E7D4F; }
.status-soon { color: var(--steel-blue); }
.status-review { color: #A8681A; }
.status-closed { color: var(--mist); }

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 12px 0 0;
  font-size: var(--fs-sm);
  color: var(--pewter);
}

.status-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.status-legend .status-icon { vertical-align: 0; }
.status-legend .visually-hidden { display: none; }
.status-legend[hidden] { display: none; }

@media (max-width: 640px) {
  .offer .save-btn { top: 10px; right: 10px; }
  /* on phones the photo sits on top, so the name no longer needs room for the button */
  .offer-eyebrow, .offer-name { margin-right: 0; }
}

/* contain the hidden status labels so they cannot widen the page */
.offers-table-wrap { position: relative; }

/* Offering photo from the database. The image fills the photo area without
   setting its height, so a tall photo cannot stretch its card. */
.offer-photo.has-img { position: relative; padding: 0; overflow: hidden; }
.offer-photo.has-img img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }

/* Every card in the list is the same height (the tallest card sets it),
   so all photos are the same size even when a value wraps to two lines. */
.offers { grid-auto-rows: 1fr; }

/* ---------- Saved Only toggle ---------- */
.saved-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--hairline);
  background: var(--white);
  font: inherit;
  font-size: var(--fs-base);
  color: var(--pewter);
  white-space: nowrap;
  cursor: pointer;
}
.saved-toggle svg { width: 14px; height: 14px; }
.saved-toggle:hover { color: var(--burgundy); border-color: var(--mist); }
.saved-toggle[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.saved-toggle[aria-pressed="true"] svg { fill: currentColor; }
.saved-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--alabaster);
  color: var(--navy);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}
.saved-toggle[aria-pressed="true"] .saved-count { background: var(--white); color: var(--navy); }
.no-results [hidden] { display: none; }
@media (max-width: 640px) {
  .saved-toggle > span:not(.saved-count) { display: none; }
}
