/* ============================================================
   BELHOCKAZ — Styles ExternalListingCard (annonces sites tiers)
   ============================================================
   Volontairement distincts de .bh-card (annonces natives) pour que
   l'utilisateur perçoive immédiatement la différence de nature entre
   une annonce BELHOCKAZ et une annonce externe redirigée.

   ⚠️ Nommage : fichier et classes CSS volontairement appelés
   "ext-listing" (et non "ext-ad") pour éviter le blocage par les
   bloqueurs de publicités (uBlock Origin, AdBlock, Brave Shields...)
   dont les filtres EasyList masquent par défaut (display:none via CSS
   injecté) tout sélecteur contenant "ad"/"ads".
   Cf. incident du 2026-07-04 : annonces invisibles pour les visiteurs
   équipés d'un bloqueur de pub alors que l'API répondait correctement.
   ============================================================ */

.ext-listing-card {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1.5px dashed #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.ext-listing-card:hover,
.ext-listing-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #94a3b8;
    outline: none;
}

.ext-listing-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    background: rgba(71, 85, 105, 0.92);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 3px 9px;
    border-radius: 20px;
}

.ext-listing-photo {
    position: relative;
    width: 100%;
    height: 210px;
    /* Fond sombre proche du logo générique pour un rendu "letterbox" propre
       lorsque l'image (carrée) est affichée en entier via object-fit:contain */
    background: #0a1526;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Le badge sport n'étant plus superposé à l'image (il a été déplacé dans
       .ext-listing-body, au-dessus du titre), l'image peut occuper tout
       l'espace disponible : marge réduite au minimum pour un rendu plus
       grand/pro. */
    padding: 8px;
    box-sizing: border-box;
}

.ext-listing-photo img {
    /* ✅ contain (et non cover), et bornée par max-width/max-height (et non
       width/height:100%) : l'image générique (logo + bandeau "SITE EXTERNE")
       reste toujours visible EN ENTIER, avec une marge de sécurité, jamais
       rognée ni recouverte par le badge sport. */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    opacity: 0.98;
}

/* Badge sport (ex: "Hockey sur glace") — repositionné dans le flux normal
   de .ext-listing-body, juste au-dessus du titre (et non plus en
   superposition sur l'image, ce qui permet à cette dernière d'être
   affichée plus grande). */
.ext-listing-badge-sport {
    align-self: flex-start;
    background: #eef2f7;
    border: 1px solid #dbe3ec;
    color: #475569;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ext-listing-body {
    padding: 12px 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.ext-listing-title {
    font-size: .9rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ext-listing-desc {
    font-size: .76rem;
    color: #64748b;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ext-listing-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: #475569;
    margin-top: 2px;
}

.ext-listing-mention {
    font-size: .68rem;
    font-style: italic;
    color: #94a3b8;
    line-height: 1.3;
    margin-top: 2px;
}

.ext-listing-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px 14px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.ext-listing-source-link,
.ext-listing-source-name {
    font-size: .72rem;
    color: #64748b;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ext-listing-source-link:hover {
    color: #334155;
    text-decoration: underline;
}

.ext-listing-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #475569;
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    transition: background .15s ease;
}

.ext-listing-cta:hover {
    background: #334155;
}

.ext-listing-cta--disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}

/* Bandeau d'information entre le bloc annonces natives et le bloc externe.
   Explique clairement la nature "relais" de ces annonces (pas de transaction
   BELHOCKAZ, tout se passe sur le site d'origine). */
.ext-listings-section-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0 4px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #64748b;
    font-size: .8rem;
    font-weight: 500;
    line-height: 1.5;
}

.ext-listings-section-divider::before {
    content: '\f05a'; /* fa-circle-info */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #94a3b8;
    flex-shrink: 0;
    margin-top: 1px;
}

@media (max-width: 640px) {
    .ext-listing-photo { height: 170px; padding: 6px; }
}
