/* Public detail page for one demand or one supplier. Sits on top of app.css,
   which already provides the header, buttons and colour variables. */

.listing {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 1.6rem;
  align-items: start;
  padding: 2.4rem 0 1.4rem;
}

/* offer.js takes the side card away from a signed-in reader; without this the
   column it used to fill would stay behind as empty space. */
.listing--solo { grid-template-columns: minmax(0, 1fr); }

.listing-card,
.listing-cta {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.8rem;
}

/* A stripe in the kind's colour, the same signal the feed and the map use. */
.listing-card { border-top: 4px solid var(--line); }
.listing--private { border-top-color: var(--blue); }
.listing--company { border-top-color: var(--red); }
.listing--supplier { border-top-color: var(--orange); }

.listing-kind {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.listing--private .listing-kind { color: var(--blue-ink); }
.listing--company .listing-kind { color: var(--red-ink); }
.listing--supplier .listing-kind { color: var(--orange-ink); }

.listing-card h1 {
  margin: 0 0 1.2rem;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.listing-card h2 {
  margin: 1.8rem 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.listing-logo {
  max-width: 9rem;
  max-height: 4.5rem;
  object-fit: contain;
  margin: 0 0 1.2rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.9rem 1.4rem;
  margin: 0;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.facts dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.2rem;
}
.facts dd { margin: 0; font-size: 0.95rem; font-weight: 600; }

.listing-text { font-size: 1rem; line-height: 1.65; }
.listing-text p { margin: 0 0 0.9rem; }

.listing-note {
  margin: 0.8rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}

.listing-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.6rem;
}
.listing-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: #f1f3f7;
}

.listing-contact {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.listing-contact p { margin: 0 0 0.5rem; color: var(--ink-soft); line-height: 1.6; }

/* Filled in by offer.js after the page loads, so it reserves no space until it
   has something to show. */
.offer { margin-top: 1.2rem; display: grid; gap: 0.6rem; justify-items: start; }
.offer-note { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }

.listing-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: -0.4rem 0 1.1rem;
}
.listing-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #f1f3f7;
  color: var(--ink-soft);
}
.listing-badge--ok {
  background: #e8f6ee;
  color: #14532d;
}
.listing-reviews {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.listing-review {
  margin: 0;
  line-height: 1.55;
}
.listing-review .listing-note { display: block; margin-top: 0.25rem; }

.listing-cta { position: sticky; top: 1.4rem; grid-column: 2; }
.listing-share { grid-column: 2; }
.listing-cta h2 { margin: 0 0 0.5rem; font-size: 1.05rem; letter-spacing: -0.01em; }
.listing-cta p { margin: 0 0 1.1rem; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
.listing-cta .btn { width: 100%; justify-content: center; margin-bottom: 0.5rem; }

.listing-index {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.listing-index li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  font-weight: 700;
}
.listing-index span {
  font-weight: 600;
  color: var(--ink-soft);
}
.listing-index--guides li { flex-direction: column; gap: 0.15rem; }
.listing-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.listing-faq { display: grid; gap: 0.85rem; margin: 1.2rem 0; }
.listing-faq dt { font-weight: 800; }
.listing-faq dd { margin: 0.25rem 0 0; color: var(--ink-soft); line-height: 1.55; }
.listing-share pre,
.acc-embed,
.listing-embed {
  margin: 0.6rem 0;
  padding: 0.8rem 1rem;
  background: #f4f6f8;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.82rem;
  max-width: 100%;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 860px) {
  .listing { grid-template-columns: 1fr; padding-top: 1.6rem; }
  .listing-cta,
  .listing-share { grid-column: auto; }
  .listing-cta { position: static; }
  .facts { grid-template-columns: 1fr; }
  .listing-actions,
  .offer,
  .listing-cta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .listing-actions .btn,
  .offer .btn,
  .listing-cta .btn,
  .listing-share .btn {
    display: flex;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    white-space: normal;
  }
}
