/* ==========================================================================
   Homino (site13) — property card.

   Its own file because the card is not owned by any one screen: search
   results, saved properties and the project page all render
   resources/views/site13/frontend/estate/estate_card.blade.php. Keeping the
   rules in listings.css left the card unstyled everywhere else.

   Self-contained on purpose — the tokens are declared on .es-card rather than
   inherited from a page wrapper, so the card looks the same wherever it is
   dropped. Pages that want a narrower variant override from outside (see
   .ls-body[data-view="2"] in listings.css).
   ========================================================================== */

.es-card {
  --t: #142D54;
  --t-dark: #0E2142;
  --navy: #142D54;
  --ink: #142D54;
  --muted: #5A6B86;
  --line: #E9E4DA;
  --bg-soft: #F8F6F1;
  --r-sm: 10px;
  --r: 16px;
  --pill: 999px;
  --sh-sm: 0 2px 10px rgba(20,45,84, .05);
  --sh: 0 10px 30px rgba(20,45,84, .08);

  position: relative;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}

/* The global stylesheet pins Arial with !important, which flattens the type
   hierarchy — restore a stack that actually ships semibold/bold weights. */
.es-card,
.es-card b,
.es-card strong,
.es-card button {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.es-card *,
.es-card *::before,
.es-card *::after { box-sizing: border-box; }

/* Deliberately not overflow:hidden — the share menu is a Bootstrap dropdown
   rendered inside the card, and a clipped card cuts it in half. Only the photo
   needs clipping, so it rounds its own outer corners instead. */

.es-card:hover {
  border-color: rgba(20,45,84, .35);
  box-shadow: var(--sh);
  transform: translateY(-2px);
}

.es-card__media {
  position: relative;
  display: block;
  min-height: 220px;
  overflow: hidden;
  background: var(--bg-soft);
  border-radius: calc(var(--r) - 1px) 0 0 calc(var(--r) - 1px);
}

.es-card__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.es-card__tags {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.es-tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  border-radius: var(--pill);
  backdrop-filter: blur(6px);
}

.es-tag--deal { background: rgba(20,45,84, .82); }
.es-tag--offplan { background: rgba(245, 158, 11, .95); }

.es-card__acts {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  display: flex;
  gap: 6px;
}

.es-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--navy);
  font-size: 14px;
  line-height: 1;
  background: rgba(255, 255, 255, .92);
  border: 0;
  border-radius: 50%;
  box-shadow: var(--sh-sm);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.es-iconbtn:hover {
  color: var(--t-dark);
  background: #fff;
  transform: scale(1.06);
}

.es-iconbtn.is-on { color: #E5484D; }

.es-card__agent {
  position: absolute;
  inset-inline-end: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: var(--sh-sm);
}

.es-card__agent img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.es-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
}

.es-card__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--navy);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.es-card__price small {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 700;
}

.es-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;
}

a.es-card__title:hover { color: var(--t-dark); }

.es-card__place {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
}

.es-card__place i { color: var(--t); }

.es-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.es-specs span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
}

.es-specs i { color: var(--muted); font-size: 12px; }

.es-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.es-card__ref {
  margin-inline-end: auto;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.es-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.es-mini--call {
  color: #fff;
  background: var(--t);
  border-color: var(--t);
}

.es-mini--call:hover { color: #fff; background: var(--t-dark); }

.es-mini--wa {
  color: #128C7E;
  background: #E9F8F3;
  border-color: rgba(18, 140, 126, .25);
}

.es-mini--wa:hover { background: #DBF3EB; }

.es-mini--tour {
  color: var(--ink);
  background: #fff;
}

.es-mini--tour:hover { background: var(--bg-soft); }

/* --------------------------------------------------------------------------
   Stacked layout — phones, and any column too narrow for a side-by-side photo
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
  .es-card { grid-template-columns: 1fr; }

  .es-card__media {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0;
  }

  .es-card__body { padding: 15px 16px; }
  .es-card__price { font-size: 21px; }
  .es-card__ref { flex: 1 1 100%; order: 3; }
  .es-mini { flex: 1 1 0; }
}

@media (max-width: 575px) {
  /* Three labelled buttons do not fit; the two contact ones keep their icon
     only, and "Viewing" keeps its label because its icon alone is ambiguous. */
  .es-card__foot .es-mini span { display: none; }
  .es-card__foot .es-mini { padding: 0 10px; }
  .es-card__foot .es-mini--tour span { display: inline; }
}
