/* ==========================================================================
   Direct Homes – Wide property card
   Markup: components/property-card-wide.php → dh_property_card_wide()
   White card (same colours as the classic card, css/directhomes-cards.css):
   photo left with the labels, details right.
   Below 640px the photo moves on top.
   ========================================================================== */
.dh-wcard {
  position: relative;
  display: flex;
  height: 100%;
  min-height: 300px;
  overflow: hidden;
  /* border: 1px solid var(--dh-sand); */
  border-radius: 14px;
  background: #fff;
  color: #666;
  box-shadow: 0 6px 18px rgba(var(--dh-primary-rgb), 0.07);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.45s ease;
}

.dh-wcard:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(var(--dh-primary-rgb), 0.14);
}

/* ---- photo ---- */
.dh-wcard__media {
  position: relative;
  flex: 0 0 46%;
  max-width: 46%;
  background: var(--dh-bg);
}

.dh-wcard__img {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
}

.dh-wcard__img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* light shade at the top and bottom so the labels and icons stay readable */
.dh-wcard__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.22) 0%,
    rgba(0, 0, 0, 0) 30%,
    rgba(0, 0, 0, 0) 68%,
    rgba(0, 0, 0, 0.32) 100%);
  pointer-events: none;
}

/* labels: Featured + status, top left */
.dh-wcard__tags {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.dh-wcard__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(22, 35, 30, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
}

.dh-wcard__tag--featured {
  border-color: #fff;
  background: #fff;
  color: var(--dh-primary);
}

.dh-wcard__tag--featured svg {
  color: var(--dh-accent);
}

/* share + favourite, bottom left on the photo */
.dh-wcard__actions {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.dh-wcard__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.35);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.dh-wcard__icon:hover,
.dh-wcard__icon:focus-visible {
  border-color: #fff;
  background: #fff;
  color: var(--dh-primary);
}

.dh-wcard__icon.dh-action--fav.is-active {
  border-color: var(--dh-accent);
  background: var(--dh-accent);
  color: #fff;
}

.dh-wcard__icon.dh-action--fav.is-active svg {
  fill: currentColor;
}

/* ---- details ---- */
.dh-wcard__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  padding: 26px 28px 24px;
}

.dh-wcard__address {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 13.5px;
  color: #555;
}

.dh-wcard__address svg {
  flex: 0 0 auto;
  color: var(--dh-accent);
}

.dh-wcard__address span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dh-wcard__title {
  margin: 0 0 8px;
  font-family: var(--dh-font-heading);
  font-size: 23px;
  font-weight: 400;
  line-height: 1.25;
  text-transform: none;
}

.dh-wcard__title a {
  color: var(--dh-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.dh-wcard__title a:hover {
  color: var(--dh-accent);
  text-decoration: none;
}

/* description: 2 lines under the title */
.dh-wcard__desc {
  display: -webkit-box;
  margin: 0 0 16px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 14.5px;
  line-height: 1.6;
  color: #666;
}

/* rooms | baths | living area */
.dh-wcard__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--dh-sand);
  border-bottom: 1px solid var(--dh-sand);
  list-style: none;
}

.dh-wcard__facts li {
  display: flex;
  flex-direction: column;
  padding: 0 10px;
}

.dh-wcard__facts li:first-child {
  padding-left: 0;
}

.dh-wcard__facts li + li {
  border-left: 1px solid var(--dh-sand);
}

.dh-wcard__facts b {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--dh-primary);
  white-space: nowrap;
}

.dh-wcard__facts b i {
  margin-right: 7px;
  font-size: 14px;
  color: var(--dh-accent);
}

.dh-wcard__facts span {
  font-size: 12.5px;
  color: #777;
}

/* price + link */
.dh-wcard__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}

.dh-wcard__price {
  font-family: var(--dh-font-heading);
  font-size: 24px;
  line-height: 1.1;
  color: var(--dh-primary);
  white-space: nowrap;
}

.dh-wcard__more {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dh-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.dh-wcard__more:hover,
.dh-wcard__more:focus-visible {
  color: var(--dh-accent);
  text-decoration: none;
}

.dh-wcard__more svg {
  transition: transform 0.3s ease;
}

.dh-wcard__more:hover svg {
  transform: translateX(3px);
}

/* the whole card opens the detail page: the title link stretches over the
   card; share + favourite stay clickable above it */
.dh-wcard {
  cursor: pointer;
}

.dh-wcard__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.dh-wcard__actions {
  z-index: 3;
}

/* hover: title and "View details" turn gold, the link gets an underline */
.dh-wcard__more {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.dh-wcard:hover .dh-wcard__title a,
.dh-wcard:focus-within .dh-wcard__title a {
  color: var(--dh-accent);
  text-decoration: none;
}

.dh-wcard:hover .dh-wcard__more,
.dh-wcard:focus-within .dh-wcard__more,
.dh-wcard__more:hover,
.dh-wcard__more:focus-visible {
  color: var(--dh-accent);
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.dh-wcard:hover .dh-wcard__more svg {
  transform: translateX(3px);
}

.dh-wcard__title a:focus-visible {
  outline: none;
}

.dh-wcard:focus-within {
  box-shadow: 0 0 0 3px rgba(var(--dh-accent-rgb), 0.45), 0 22px 44px rgba(var(--dh-primary-rgb), 0.13);
}

/* slider: 2 cards from 992px, 1 card below */
.dh-wcard-slider .dh-featured__slide {
  padding: 14px 12px 26px;
}

/* 992–1199: two cards are narrower, so a slightly smaller text */
@media (min-width: 992px) and (max-width: 1199px) {
  .dh-wcard__media {
    flex-basis: 40%;
    max-width: 40%;
  }

  .dh-wcard__body {
    padding: 22px 20px 20px;
  }

  .dh-wcard__title {
    font-size: 21px;
  }

  .dh-wcard__desc {
    -webkit-line-clamp: 2;
  }

  .dh-wcard__facts li {
    padding: 0 6px;
  }

  .dh-wcard__facts b {
    font-size: 14px;
  }

  .dh-wcard__facts b i {
    margin-right: 5px;
    font-size: 12px;
  }

  .dh-wcard__price {
    font-size: 19px;
  }

  .dh-wcard__more {
    font-size: 12.5px;
  }

  .dh-wcard__footer {
    gap: 8px;
  }
}

/* phones: photo on top */
@media (max-width: 639px) {
  .dh-wcard {
    flex-direction: column;
    min-height: 0;
  }

  .dh-wcard__media {
    flex: 0 0 auto;
    max-width: none;
    height: 290px;
  }

  .dh-wcard__actions {
    left: auto;
    right: 16px;
  }

  .dh-wcard__body {
    padding: 20px 20px 22px;
  }

  .dh-wcard__title,
  .dh-wcard__price {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dh-wcard,
  .dh-wcard__more svg {
    transition: none;
  }
}
