/* EstateHub: quiet, comparable listing cards. Keep legacy account cards intact. */
#results.results {
  gap: 24px;
  align-items: stretch;
}
#results .estate-card,
#results .estate-card.premium-listing {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 1px solid #e4e8ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 2px 5px rgb(24 38 56 / 3%);
  overflow: visible;
  isolation: isolate;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
#results .estate-card.premium-listing::before { display: none; }
#results .estate-card:hover {
  transform: none;
  border-color: #c4cfdf;
  box-shadow: 0 8px 24px rgb(24 38 56 / 7%);
  z-index: 2;
}
#results .estate-card:focus-visible,
#results .estate-card.active {
  border-color: #2563eb;
  outline: 2px solid rgb(37 99 235 / 16%);
  outline-offset: 2px;
  box-shadow: none;
  transform: none;
}
#results .estate-card .card-gallery {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 4 / 3;
  padding: 0;
  border-radius: 17px 17px 0 0;
  background: #e9edf3;
}
#results .estate-card .card-gallery > img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  object-fit: cover;
  transition: opacity 180ms ease;
}
#results .estate-card .listing-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 9px;
  padding: 17px 18px 18px;
  overflow: visible;
}
#results .estate-card .card-price {
  display: grid;
  gap: 4px;
  min-height: 53px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 730;
  letter-spacing: -.6px;
}
#results .estate-card .card-price-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 7px;
}
#results .estate-card .price-main {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: #182638;
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
#results .estate-card .price-period,
#results .estate-card .price-per-sqm {
  color: #56657a;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0;
  line-height: 1.45;
  opacity: 1;
  white-space: normal;
}
#results .estate-card .price-per-sqm { margin: 0; }
#results .estate-card h2 {
  display: -webkit-box;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  color: #182638;
  font-size: 16px;
  font-weight: 620;
  line-height: 1.4;
  letter-spacing: -.15px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
#results .estate-card h2 a { color: inherit; text-decoration: none; }
#results .estate-card h2 a:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
#results .estate-card .card-location {
  display: -webkit-box;
  margin: 0;
  min-height: 0;
  color: #56657a;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
#results .estate-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  flex: none;
  gap: 6px;
  min-height: 25px;
  max-height: none;
  margin-top: auto;
  padding: 3px 0 0;
  overflow: visible;
}
#results .estate-card .card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  max-width: 100%;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: #f3f5f8;
  color: #56657a;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  white-space: normal;
}
#results .estate-card .card-badge.verified { background: #edf7f0; color: #2d6b43; }
#results .estate-card .card-tools {
  top: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  gap: 7px;
}
#results .estate-card .card-tools .icon-action {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 9px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 96%);
  color: #253448;
  box-shadow: 0 2px 8px rgb(24 38 56 / 10%);
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}
#results .estate-card .icon-action svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#results .estate-card .icon-action.is-favorite { color: #2563eb; }
#results .estate-card .icon-action.is-favorite svg { fill: currentColor; }
#results .estate-card .icon-action:hover { background: #fff; transform: scale(1.06); }
#results .estate-card .icon-action:focus-visible,
#results .estate-card .gallery-step:focus-visible,
#results .estate-card .card-more-menu button:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
#results .estate-card .card-more { position: relative; }
#results .estate-card .card-more summary { list-style: none; }
#results .estate-card .card-more summary::-webkit-details-marker { display: none; }
#results .estate-card .card-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  min-width: 170px;
  max-width: 230px;
  padding: 5px;
  border: 1px solid #dce3ed;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(24 38 56 / 14%);
}
#results .estate-card .card-more-menu button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #182638;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
}
#results .estate-card .card-more-menu button:hover { background: #f3f6fb; }
#results .estate-card .gallery-step {
  width: 32px;
  height: 32px;
  padding: 0 0 2px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 94%);
  color: #182638;
  box-shadow: 0 2px 6px rgb(24 38 56 / 10%);
  font-family: Arial, sans-serif;
  font-size: 25px;
  opacity: 0;
  transition: opacity 180ms ease, background 180ms ease;
}
#results .estate-card:hover .gallery-step,
#results .estate-card:focus-within .gallery-step { opacity: 1; }
#results .estate-card .gallery-prev { left: 12px; }
#results .estate-card .gallery-next { right: 12px; }
#results .estate-card .card-photo-count,
#results .estate-card .card-viewed-label {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 3;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgb(24 38 56 / 66%);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
#results .estate-card .card-viewed-label { left: 12px; right: auto; background: rgb(255 255 255 / 94%); color: #34445a; }
@media (max-width: 760px) {
  body #results.results { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  body #results .estate-card { min-height: 0; }
  body #results .estate-card .listing-body { padding: 17px 17px 18px; }
  body #results .estate-card .card-gallery { aspect-ratio: 4 / 3; }
  body #results .estate-card .card-price { font-size: 23px; }
  body #results .estate-card h2 { font-size: 17px; }
  body #results .estate-card .card-tools .icon-action { width: 40px; height: 40px; min-width: 40px; }
  body #results .estate-card .gallery-step { opacity: 1; width: 36px; height: 36px; }
  body #results .estate-card .card-more-menu button { min-height: 44px; }
}
@media (hover: none) { #results .estate-card .gallery-step { opacity: 1; } }
/* A map is a comparison workspace: keep the adjacent results compact while
   the regular listing grid retains its large photographs. */
@media (min-width:761px) {
  body .content-grid.map-open #results.results {grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));gap:16px;align-content:start;}
  body .content-grid.map-open #results :is(.estate-card,.skeleton-card) {display:grid;grid-template-columns:clamp(104px,38%,144px) minmax(0,1fr);align-items:start;gap:12px;width:100%;max-width:480px;min-width:0;min-height:0;padding:12px;border-radius:14px;justify-self:start;}
  body .content-grid.map-open #results .estate-card .card-gallery {width:100%;height:auto;min-height:0;aspect-ratio:4/3;align-self:start;border-radius:10px;overflow:hidden;}
  /* Keep intrinsic portrait dimensions out of the frame's size calculation. */
  body .content-grid.map-open #results .estate-card .card-gallery > img {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;}
  body .content-grid.map-open #results .estate-card .listing-body {min-width:0;padding:0;gap:7px;}
  body .content-grid.map-open #results .estate-card .card-price {font-size:21px;min-height:0;letter-spacing:-.5px;gap:3px;}
  body .content-grid.map-open #results .estate-card .price-per-sqm {font-size:11px;}
  body .content-grid.map-open #results .estate-card h2 {font-size:14px;line-height:1.35;-webkit-line-clamp:2;}
  body .content-grid.map-open #results .estate-card .card-location {font-size:12px;line-height:1.4;-webkit-line-clamp:2;}
  body .content-grid.map-open #results .estate-card .card-tags {display:none;}
  body .content-grid.map-open #results .estate-card .card-tools {top:20px;left:20px;right:auto;gap:5px;}
  body .content-grid.map-open #results .estate-card .card-tools .icon-action {width:32px;height:32px;min-width:32px;padding:8px;}
  body .content-grid.map-open #results .estate-card .card-photo-count {bottom:8px;right:8px;font-size:10px;padding:3px 5px;}
  body .content-grid.map-open #results .estate-card .card-viewed-label {display:none;}
  body .content-grid.map-open #results .filter-nudge {display:none;}
  body .content-grid.map-open #results .skeleton-card {height:auto;min-height:134px;}
  body .content-grid.map-open #results .skeleton-card .skel-image {height:auto;aspect-ratio:4/3;align-self:start;}
  body .content-grid.map-open #results .skeleton-card .listing-body {min-width:0;padding:0;}
}
@media (prefers-reduced-motion: reduce) {
  #results .estate-card,
  #results .estate-card *,
  #results .estate-card *::before { transition: none !important; animation: none !important; }
}
