/* Bannières maison et annonceurs (templates/partial/_house_banner.html.twig).
   Nommé « promo » et non « ads » : les listes des bloqueurs visent les noms en ad/ads.
   Taille fixe du format (--hb-w × --hb-h), bornée à la largeur disponible.
   Couleurs propres à chaque campagne : --hb-bg, --hb-accent, --hb-text. */

.jtp-promo-host {
    display: flex;
    justify-content: center;
}

.jtp-hb {
    position: relative;
    display: flex;
    box-sizing: border-box;
    width: var(--hb-w);
    max-width: 100%;
    height: var(--hb-h);
    overflow: hidden;
    border-radius: 12px;
    background: var(--hb-bg);
    color: var(--hb-text);
    font-family: var(--jtp-font-body, system-ui, sans-serif);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(13, 34, 38, .08), 0 10px 26px -14px rgba(13, 34, 38, .45);
    transition: transform .18s ease, box-shadow .18s ease;
    isolation: isolate;
}
.jtp-hb:hover,
.jtp-hb:focus-visible {
    color: var(--hb-text);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 1px 2px rgba(13, 34, 38, .08), 0 16px 32px -14px rgba(13, 34, 38, .55);
}
.jtp-hb:focus-visible {
    outline: 3px solid var(--hb-accent);
    outline-offset: 3px;
}

.jtp-hb__creative {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jtp-hb__visual {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}
.jtp-hb:hover .jtp-hb__visual { transform: scale(1.04); }

.jtp-hb__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.jtp-hb__id {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

/* Le logo est une icône carrée : le nom de marque s'affiche à côté. */
.jtp-hb__logo {
    display: block;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}

.jtp-hb__brand {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--jtp-font-display, system-ui, sans-serif);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hb-accent);
}

.jtp-hb__title {
    font-family: var(--jtp-font-display, system-ui, sans-serif);
    font-size: 21px;
    font-weight: 800;
    line-height: 1.12;
    text-wrap: balance;
}

.jtp-hb__sub {
    font-size: 13px;
    line-height: 1.35;
    opacity: .88;
}

.jtp-hb__cta {
    align-self: flex-start;
    margin-top: 4px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--hb-accent);
    color: var(--hb-bg);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .4);
    transition: transform .18s ease;
}
.jtp-hb:hover .jtp-hb__cta { transform: translateX(3px); }

.jtp-hb__tag {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    line-height: 1.4;
}

/* Skyscraper 160×600 : visuel en haut, texte en bas sur un dégradé de la couleur de fond. */
.jtp-hb--skyscraper .jtp-hb__body {
    justify-content: flex-end;
    width: 100%;
    padding: 16px 12px 16px;
    background: linear-gradient(to bottom, transparent 30%, var(--hb-bg) 58%);
}
.jtp-hb--skyscraper .jtp-hb__title { font-size: 20px; }
.jtp-hb--skyscraper .jtp-hb__cta {
    align-self: stretch;
    text-align: center;
    padding: 11px 8px;
}

/* Pavé 300×250 : visuel plein cadre, titre sur le tiers bas. */
.jtp-hb--rectangle .jtp-hb__body {
    justify-content: flex-end;
    width: 100%;
    padding: 14px 16px 16px;
    background: linear-gradient(to bottom, transparent 18%, color-mix(in srgb, var(--hb-bg) 70%, transparent) 50%, var(--hb-bg) 82%);
}
.jtp-hb--rectangle .jtp-hb__title { font-size: 20px; }
.jtp-hb--rectangle .jtp-hb__sub {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Megabanner 728×90 : visuel à gauche (270×90), texte, bouton à droite. */
.jtp-hb--leaderboard { container-type: inline-size; }
.jtp-hb--leaderboard .jtp-hb__visual {
    position: static;
    z-index: auto;
    flex: 0 0 auto;
    width: 37%;
    max-width: 270px;
    height: 100%;
    -webkit-mask-image: linear-gradient(to right, #000 70%, transparent);
    mask-image: linear-gradient(to right, #000 70%, transparent);
}
.jtp-hb--leaderboard .jtp-hb__body {
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 18px 10px 12px;
}
.jtp-hb--leaderboard .jtp-hb__id {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    max-width: 96px;
}
.jtp-hb--leaderboard .jtp-hb__logo { width: 34px; height: 34px; }
.jtp-hb--leaderboard .jtp-hb__brand { font-size: 11px; }
.jtp-hb--leaderboard .jtp-hb__title {
    flex: 1 1 auto;
    font-size: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.jtp-hb--leaderboard .jtp-hb__sub { display: none; }
.jtp-hb--leaderboard .jtp-hb__cta { align-self: center; margin: 0; flex: 0 0 auto; padding: 11px 16px; }
@container (max-width: 600px) {
    .jtp-hb--leaderboard .jtp-hb__id { display: none; }
    .jtp-hb--leaderboard .jtp-hb__title { font-size: 17px; }
}

/* Emplacement à deux formats (accueil) : la variante masquée n'est jamais vue, donc jamais comptée. */
.jtp-hb--narrow-only { display: none; }
@media (max-width: 767px) {
    .jtp-hb--wide-only { display: none; }
    .jtp-hb--narrow-only { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
    .jtp-hb,
    .jtp-hb__visual,
    .jtp-hb__cta { transition: none; }
    .jtp-hb:hover,
    .jtp-hb:hover .jtp-hb__visual,
    .jtp-hb:hover .jtp-hb__cta { transform: none; }
}

/* Marges alignées sur les emplacements régie qu'elles remplacent. */
.question-sidebar .jtp-promo-host,
.mobile-megabanner-section .jtp-promo-host { margin-bottom: 2rem; }
