/* ==========================================================================
   Direct Homes – Popular Places (Swiss cities)
   Colors/fonts come from css/directhomes-theme.css (--dh-* variables).
   ========================================================================== */

/* Same vertical spacing as the other homepage sections (4.6rem top/bottom) */
section.dh-places {
  padding: 4.6rem 0;
  background: #fff;
}

.dh-places__grid {
  row-gap: 25px;
}

.dh-place-card {
  position: relative;
  display: block;
  /* height: 340px; */
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: 14px;
  background: var(--dh-primary);
  text-decoration: none;
  isolation: isolate;
}

.dh-place-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* Light black overlay so the white text is always readable */
.dh-place-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0.55) 100%);
  transition: background-color 0.3s ease;
}

.dh-place-card:hover img,
.dh-place-card:focus-visible img {
  transform: scale(1.08);
}

.dh-place-card:hover::before,
.dh-place-card:focus-visible::before {
  background-color: rgba(var(--dh-primary-rgb), 0.25);
}

.dh-place-card:focus-visible {
  outline: 3px solid var(--dh-accent);
  outline-offset: 3px;
}

/* City name + count */
.dh-place-card__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.dh-place-card__title {
  margin: 0 0 6px;
  font-family: var(--dh-font-heading);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  color: #fff;
  text-transform: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.dh-place-card__count {
  font-family: var(--dh-font-body);
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

/* Diagonal "Featured" ribbon (top-left corner) */
.dh-place-card__ribbon {
  position: absolute;
  top: 22px;
  left: -38px;
  z-index: 3;
  width: 150px;
  padding: 5px 0;
  background: rgba(var(--dh-primary-rgb), 0.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--dh-font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 767px) {
  .dh-place-card {
    height: 260px;
  }

  .dh-place-card__title {
    font-size: 26px;
  }
}
