/**
 * BrillaHero listing card persona-centric (wireframe 01).
 *
 * Applied on every HivePress listing_view_block render (archive grid,
 * related listings, search results). Reshapes the default card into
 * a horizontal Hero-first row: avatar + identity / chips, price + CTA
 * on the right. The HivePress container classes stay, only the inside
 * is ours.
 */

:root {
  --bh-card-blu-primary:  var(--bh-blu-primary, #0047BB);
  --bh-card-blu-strong:   var(--bh-blu-strong, #1A2B5F);
  --bh-card-blu-soft:     var(--bh-blu-soft, #B3C5FF);
  --bh-card-corallo:      var(--bh-corallo, #EE4E44);
  --bh-card-surface:      var(--bh-surface, #F5F6FA);
  --bh-card-text-1:       var(--bh-text-1, #1A2B5F);
  --bh-card-text-2:       var(--bh-text-2, #877F7D);
  --bh-card-border:       var(--bh-border, #E2E6F2);
  --bh-card-font-body:    var(--bh-font-body, 'Inter', sans-serif);
  --bh-card-font-display: var(--bh-font-display, 'Bricolage Grotesque', sans-serif);
  --bh-card-font-caveat:  var(--bh-font-caveat, 'Caveat', cursive);
}

/* Outer HivePress shell — keep our card sitting clean inside it. */
.hp-listing.hp-listing--view-block {
  background: #fff;
  border: 1px solid var(--bh-card-border);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 150ms ease, transform 150ms ease;
}
.hp-listing.hp-listing--view-block:hover {
  box-shadow: 0 6px 18px rgba(26, 43, 95, 0.08);
  transform: translateY(-1px);
}

/* Hide every native HivePress card chrome inside listing_container —
   we keep the default block tree in the data layer (TaskHive's filter
   needs to fetch listing_rating without TypeErroring), but visually
   only our .bh-card renders. */
.hp-listing.hp-listing--view-block > *:not(.bh-card),
.hp-listing.hp-listing--view-block .hp-listing__header,
.hp-listing.hp-listing--view-block .hp-listing__content,
.hp-listing.hp-listing--view-block .hp-listing__actions,
.hp-listing.hp-listing--view-block .hp-listing__topbar {
  display: none !important;
}
.hp-listing.hp-listing--view-block > .bh-card {
  display: grid;
}

/* ===== Card layout =================================================== */

.bh-card {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
  font-family: var(--bh-card-font-body);
  color: var(--bh-card-text-1);
  text-decoration: none;
  cursor: pointer;
}
.bh-card:hover {
  color: var(--bh-card-text-1);
  text-decoration: none;
}

.bh-card__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bh-card-blu-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bh-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bh-card__monogram {
  font-family: var(--bh-card-font-display);
  font-weight: 700;
  font-size: 44px;
  color: #fff;
  line-height: 1;
}
.bh-card__monogram--coral {
  background: transparent;
}
.bh-card__avatar:has(.bh-card__monogram--coral) {
  background: var(--bh-card-corallo);
}

/* ===== Body (identity + meta + chips) =============================== */

.bh-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Stack vertically: name on top line, badge wraps to its own line
 * underneath. Andrea, 2026-06-06: "o badge colocaria por baixo do
 * nome, fica feio assim" (referring to the inline-with-name layout).
 * Smaller gap so the badge reads as a label of the name rather than
 * a separate field. */
.bh-card__name-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.bh-card__name {
  /* `margin: 0` alone loses to TaskHive's `.hp-listing h3` rule
   * (specificity 0,0,1,1 vs our 0,0,1,0). Andrea, 2026-06-06:
   * "tem um margin bottom que podemos remover". `!important` is
   * the smallest hammer that wins without restructuring selectors. */
  margin: 0 !important;
  font-family: var(--bh-card-font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  color: var(--bh-card-blu-strong);
}
.bh-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--bh-card-corallo);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
  border-radius: 999px;
  /* Sits on its own row below the name (see .bh-card__name-row's
   * column flex). No vertical fine-tune needed at this position. */
}

.bh-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--bh-card-text-2);
}
.bh-card__zones-more {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bh-card-surface);
  font-size: 12px;
  color: var(--bh-card-blu-strong);
}
.bh-card__star {
  color: var(--bh-card-corallo);
  margin-right: 4px;
}
.bh-card__rating-count {
  margin-left: 4px;
}

.bh-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.bh-card__chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bh-card-surface);
  color: var(--bh-card-text-2);
  border: 1px solid var(--bh-card-border);
}
.bh-card__chip.is-context {
  background: var(--bh-card-blu-soft);
  color: var(--bh-card-blu-strong);
  font-weight: 600;
  border-color: var(--bh-card-blu-soft);
}
.bh-card__chip-more {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--bh-card-text-2);
}

.bh-card__photo-note {
  font-family: var(--bh-card-font-caveat);
  font-size: 16px;
  color: var(--bh-card-corallo);
  font-style: italic;
  margin-top: 4px;
}

/* ===== Price + CTA (right column) =================================== */

.bh-card__price {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 140px;
}

.bh-card__price-value {
  font-family: var(--bh-card-font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--bh-card-blu-strong);
  line-height: 1;
}
.bh-card__price-quote {
  font-family: var(--bh-card-font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--bh-card-blu-strong);
  line-height: 1;
}
.bh-card__price-label {
  font-size: 13px;
  color: var(--bh-card-text-2);
}
.bh-card__cta {
  margin-top: 10px;
  color: var(--bh-card-blu-primary);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

/* ===== Mobile ====================================================== */

@media (max-width: 640px) {
  .bh-card {
    grid-template-columns: 64px 1fr;
    gap: 12px;
    padding: 16px;
  }
  .bh-card__avatar {
    width: 64px;
    height: 64px;
  }
  .bh-card__monogram {
    font-size: 28px;
  }
  .bh-card__name {
    font-size: 18px;
  }
  .bh-card__price {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    text-align: left;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--bh-card-border);
  }
}
