/* RDO Provider Card — Availability variants
 * Author: RedOcean <https://redocean.pt>
 * Since:  1.4.31 (Phase 4 of the search-temporal-filter epic)
 *
 * Tokens (aligned with the design system used by booknetic-animals CP and
 * booknetic-rdo-booking-theme):
 *   Brown primary  #7E5B34
 *   Brown muted    #a07c52
 *   Beige border   #EFBE86
 *   Cream          #FFFCEB
 *   Orange         #EF4C24   (used for 'soon')
 *   Theme green    #3DA66B   (used for 'available')
 *
 * The badge sits inline at the right of the provider name (since 1.4.32).
 * The .rdo-card__avail-msg sits between the address line and the
 * "Voir la fiche" CTA.
 */

/* ─── Badge — inline next to the provider name ─── */
/* The badge lives inside the <h1> alongside the provider link. We use
   inline-flex on the heading so the title and the badge align on the
   baseline, and `flex-wrap: wrap` so the badge drops below the title on
   narrow cards instead of overflowing.
   Specificity bump: main.css has `body #providers-list article h1 {…}`
   (0,1,3) — we ancestor-chain via #providers-list to win cleanly. */
body #providers-list article.rdo-card h1,
body #animals-list article.rdo-card h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
body #providers-list article.rdo-card h1 > a,
body #animals-list article.rdo-card h1 > a {
  /* Allow the link to shrink so the badge sits next to it without forcing
     overflow on long provider names. */
  flex: 0 1 auto;
  min-width: 0;
}
.rdo-card__badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.4;
  text-transform: uppercase;
  background: #ffffff;
  color: #7E5B34;
  box-shadow: 0 2px 6px rgba(94, 66, 32, 0.18);
  white-space: nowrap;
  flex: 0 0 auto;
  vertical-align: middle;
}

/* ─── Variants ─── */
.rdo-card__badge--available {
  background: #3DA66B;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(61, 166, 107, 0.30);
}
.rdo-card__badge--soon {
  background: #EF4C24;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(239, 76, 36, 0.28);
}
.rdo-card__badge--external {
  background: #7E5B34;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(126, 91, 52, 0.28);
}
.rdo-card__badge--unavailable {
  background: #DEE3E9;
  color: #5a6470;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ─── Availability message above CTA ─── */
/* The message is a <p> living between the address line and the CTA <p>.
   We give it explicit top/bottom margins (slightly larger than the theme's
   default <p> margin) so it reads as a distinct row rather than glued to
   neighbours — and so cards with a message stay visually balanced against
   cards without one. */
.rdo-card__avail-msg {
  margin: 0.7em 0 0.9em;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  color: #7E5B34;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rdo-card__avail-msg::before {
  content: "";
  display: inline-block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.rdo-card__avail-msg--available {
  color: #3DA66B;
}
.rdo-card__avail-msg--soon {
  color: #EF4C24;
}
.rdo-card__avail-msg--external {
  color: #7E5B34;
}
.rdo-card__avail-msg--unavailable {
  color: #6b7682;
  font-weight: 500;
}

/* ─── Card-level dimming for unavailable / external ─── */
/* Subtle visual distinction so the eye lands on the available providers
   first while keeping these cards readable and clickable. */
.rdo-card--unavailable .relative img {
  filter: grayscale(0.35);
  opacity: 0.85;
}
.rdo-card--external .relative img {
  filter: saturate(0.85);
}

/* ─── Mobile spacing — increase row gap between stacked cards ───
 * The theme's #providers-list uses `gap: 2.8rem var(--gap)` (row, col),
 * which is fine on desktop where cards sit side-by-side. On mobile every
 * card stacks vertically and the perception of separation drops — more
 * so when some cards have an extra .rdo-card__avail-msg row that makes
 * adjacent cards feel uneven in height. Bumping the row-gap on narrow
 * viewports keeps a clear break between cards. */
@media screen and (max-width: 767px) {
  body #providers-list,
  body #animals-list {
    /* Override only the row-axis of the shorthand. var(--gap) is preserved
       by main.css (1.6rem) for the column axis even though stacking makes
       it irrelevant in single-column layouts. */
    gap: 3.6rem var(--gap);
  }
}
