/* Potrebbe interessarti + foal CTA row (scheda puledro)
   Extends site foal-carousel: 4 cards desktop, 3 phone. */

.interessarti-section {
  border-top: 1px solid var(--border);
}

.interessarti-section .section-title {
  margin-bottom: 1.25rem;
}

.interessarti-note {
  color: var(--accent);
  font-size: 0.9rem;
  margin: -0.5rem 0 1rem;
}

/* Override home carousel flex widths: phone 3, desktop 4 */
.interessarti-carousel .foal-carousel-track > .card {
  flex: 0 0 calc((100% - 2.5rem) / 3);
}

@media (min-width: 720px) {
  .interessarti-carousel .foal-carousel-track > .card {
    flex: 0 0 calc((100% - 3.75rem) / 4);
  }
}

/* Phone: arrows ABOVE the track so 3 cards stay wider */
@media (max-width: 719px) {
  .interessarti-carousel .foal-carousel-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "prev next"
      "view view";
    gap: 0.35rem 0.5rem;
    padding-inline: 0;
    align-items: center;
  }
  .interessarti-carousel .foal-carousel-viewport {
    grid-area: view;
  }
  .interessarti-carousel .foal-carousel-nav {
    position: static;
    width: auto;
    height: auto;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    padding: 0.15rem 0.4rem;
    color: var(--text);
    justify-content: center;
  }
  .interessarti-carousel .foal-carousel-prev { grid-area: prev; justify-self: start; }
  .interessarti-carousel .foal-carousel-next { grid-area: next; justify-self: end; }
  .interessarti-carousel .foal-carousel-nav .gallery-chevron {
    width: 22px;
    height: 22px;
    filter: none;
    opacity: 0.9;
  }
}

.interessarti-card .card-body {
  padding: 0.55rem 0.55rem 0.7rem;
  min-width: 0;
}

/* 4 lines under cover: Name · Description · Sire · Dam */
.interessarti-card h3 {
  font-size: 0.78rem;
  line-height: 1.25;
  margin: 0 0 0.22rem;
  font-family: var(--font-display);
  color: var(--text);
  /* desktop: single line — ellipsis if needed */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  -webkit-hyphens: none;
}

.interessarti-meta,
.interessarti-sire,
.interessarti-dam {
  margin: 0 0 0.18rem;
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--text);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  -webkit-hyphens: none;
}

.interessarti-meta {
  color: var(--muted);
}

.interessarti-sire,
.interessarti-dam {
  color: var(--text);
}

.interessarti-dam {
  margin-bottom: 0;
}

.interessarti-card,
.interessarti-card .card-body,
.interessarti-card .card-link {
  overflow: hidden;
}

/* Phone: name wraps between words, up to ~2 lines, no ellipsis */
@media (max-width: 719px) {
  .interessarti-card h3 {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    -webkit-hyphens: none;
    /* v2 (26/10/2026, Pasquale): spazio minimo di 3 righe per il nome in tutte le card (card alte uguali),
       nessun max-height: con 3+ righe la riga anno/colore/sesso scende sotto, mai sovrapposta. */
    max-height: none;
    min-height: calc(1.25em * 3);
  }
  .interessarti-card .card-body {
    overflow: visible;
  }
}

@media (min-width: 720px) {
  .interessarti-card .card-body {
    padding: 0.75rem 0.85rem 0.95rem;
  }
  .interessarti-card h3 {
    font-size: 0.95rem;
  }
  .interessarti-meta,
  .interessarti-sire,
  .interessarti-dam {
    font-size: 0.78rem;
    margin-bottom: 0.22rem;
  }
  .interessarti-dam {
    margin-bottom: 0;
  }
}

.interessarti-card .card-media.foal-media {
  aspect-ratio: 3 / 2;
}

/* ——— Foal detail CTAs (below genealogy) ——— */
.foal-cta .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.foal-cta .btn svg {
  flex: none;
}
/* Hide lista.js Salva under title — Salva lives in .btn-row */
.detail-info > h1 + .btn-salva,
.detail-info > .btn-salva:not(.foal-salva-cta) {
  display: none !important;
}
.foal-cta .btn-row .foal-salva-cta {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  box-sizing: border-box;
}
.foal-salva-cta::before {
  display: none !important; /* drop bookmark glyph; heart SVG in markup */
}
.foal-salva-cta svg {
  flex: none;
}
/* Desktop (≥769): keep all CTAs on one row inside narrow detail column */
@media (min-width: 769px) {
  .foal-cta .btn-row {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .foal-cta .btn-row > .btn,
  .foal-cta .btn-row .foal-salva-cta {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 48px;
    padding: 0.55rem 0.65rem;
    white-space: nowrap;
    font-size: 0.88rem;
  }
}
/* Phone: Salva full width, stacked like the other CTAs */
@media (max-width: 768px) {
  .foal-cta .btn-row .foal-salva-cta {
    width: 100%;
    flex: 1 1 auto;
    min-height: 44px;
    padding: 0.55rem 1.1rem;
  }
}
