/* Encarts de la régie maison — feuille AUTONOME, chargée par le composant.
 *
 * Trois familles : l'encart (.tv-enc, avec ses habits vedette et article), le
 * bandeau fixe (.tv-encbar) et l'écran (.tv-encmodal). Les couleurs empruntent
 * les jetons du design system quand ils existent, avec repli : charte suivie
 * sur les pages marketplace, rendu correct partout ailleurs.
 *
 * Le parti pris : PREMIUM ET CALME. Un encart criard est fermé sans être lu,
 * et c'est la page qui l'accueille qui en paie le prix. La qualité se joue
 * dans le cadre du visuel, l'ombre douce, le bouton net — pas dans la couleur. */

/* ── L'encart ──────────────────────────────────────────────────────────── */
.tv-enc { position: relative; display: block; margin: 24px 0;
    border: 1px solid var(--mk-line, #E9ECEF); border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 31, 23, .04), 0 10px 28px -18px rgba(15, 31, 23, .18);
    overflow: hidden;
    font-family: "Inter", "Poppins", system-ui, -apple-system, sans-serif;
    transition: box-shadow .22s ease, transform .22s ease; }
.tv-enc:hover { transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(15, 31, 23, .05), 0 16px 36px -16px rgba(15, 31, 23, .26); }

/* La mention n'est jamais masquable ni décorative : une publicité qui ne se
   signale pas trompe le visiteur et fragilise tout le site. */
.tv-enc__tag { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2;
    padding: 3px 9px; border-radius: 999px;
    background: rgba(17, 24, 39, .66); backdrop-filter: blur(3px); color: #fff;
    font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

.tv-enc__lien { display: flex; align-items: stretch; gap: 0;
    color: inherit; text-decoration: none; }
.tv-enc__lien:hover { text-decoration: none; color: inherit; }

.tv-enc__cadre { flex: none; width: clamp(170px, 32%, 320px); align-self: stretch;
    overflow: hidden; background: #F3F5F4; }
.tv-enc__img { display: block; width: 100%; height: 100%; min-height: 158px;
    object-fit: cover; transition: transform .35s ease; }
.tv-enc:hover .tv-enc__img { transform: scale(1.04); }

.tv-enc__corps { display: flex; flex-direction: column; justify-content: center;
    gap: 7px; min-width: 0; padding: 20px 26px; }
.tv-enc__titre { font-size: 17px; font-weight: 700; letter-spacing: -.01em;
    color: var(--mk-ink, #101828); line-height: 1.3; }
.tv-enc__texte { font-size: 13.5px; color: var(--mk-ink-2, #55606E); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Texte déplié : le clamp saute (bouton « Voir plus », encarts.js) */
.tv-enc__texte.est-ouvert, .tv-encmodal__texte.est-ouvert { display: block; -webkit-line-clamp: none; overflow: visible; }
.tv-enc__plus { align-self: flex-start; margin: 2px 0 0; padding: 0;
    border: 0; background: none; cursor: pointer; font: inherit; font-size: 12.5px;
    font-weight: 600; color: var(--mk-primary, #203EA0); text-decoration: underline; }
.tv-encmodal .tv-enc__plus { display: block; margin: -8px auto 12px; }

.tv-enc__cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px;
    margin-top: 8px; padding: 8px 16px; border-radius: 999px;
    background: var(--mk-green, #157F56); color: #fff;
    font-size: 13px; font-weight: 700;
    box-shadow: 0 4px 12px -6px rgba(21, 127, 86, .55);
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease; }
.tv-enc__lien:hover .tv-enc__cta { background: var(--mk-green-dark, #0F6A47);
    transform: translateY(-1px); box-shadow: 0 7px 16px -6px rgba(21, 127, 86, .6); }
.tv-enc__cta svg { width: 14px; height: 14px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Les pictos pleins (WhatsApp) se remplissent, les tracés restent en trait. */
.tv-enc__cta svg path[d^="M17.5"] { fill: currentColor; stroke: none; }

/* ── Mise en avant : tête de liste ─────────────────────────────────────────
   Le cadre s'accentue — filet vert et fond légèrement teinté — parce qu'elle
   vit AU MILIEU de cartes ordinaires : elle doit se distinguer sans crier. */
.tv-enc--vedette { border-color: var(--mk-green, #157F56);
    background: linear-gradient(135deg, #F4FBF7 0%, #fff 45%); }
.tv-enc--vedette .tv-enc__cadre { width: clamp(190px, 34%, 340px); }
.tv-enc--vedette .tv-enc__titre { font-size: 17px; }

/* ── Article sponsorisé : le visuel raconte ───────────────────────────────── */
.tv-enc--article .tv-enc__cadre { width: clamp(220px, 36%, 360px); }
.tv-enc--article .tv-enc__img { min-height: 150px; }
.tv-enc--article .tv-enc__titre { font-size: 17.5px; }
.tv-enc--article .tv-enc__texte { -webkit-line-clamp: 3; }

@media (max-width: 620px) {
    .tv-enc__lien { flex-direction: column; }
    .tv-enc__cadre, .tv-enc--vedette .tv-enc__cadre, .tv-enc--article .tv-enc__cadre {
        width: 100%; }
    /* MOBILE : la photo reste INTACTE quel que soit son format (demande
       propriétaire 27/08) — hauteur au ratio naturel, bornée pour les
       portraits, contain letterboxe au lieu de rogner. */
    .tv-enc__img { height: auto; min-height: 0; max-height: 340px;
        object-fit: contain; background: #F3F5F4; }
    .tv-enc__corps { padding: 14px 16px 16px; }
}

/* ── Le bandeau fixe ──────────────────────────────────────────────────────── */
/* z-index SOUS le voile des tiroirs (1040) : menu ou drawer ouvert, le bandeau
   passe derrière le voile au lieu de flotter par-dessus (rien ne doit cacher
   ni distraire un tiroir ouvert — règle du 27/08). */
.tv-encbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 1039;
    display: flex; align-items: center; gap: 8px;
    margin: 0 auto; max-width: 720px;
    background: #fff; border: 1px solid var(--mk-line, #E9ECEF); border-bottom: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px -12px rgba(15, 31, 23, .28);
    font-family: "Inter", "Poppins", system-ui, sans-serif;
    animation: tv-encbar-monte .45s cubic-bezier(.22, .61, .36, 1); }
@keyframes tv-encbar-monte { from { transform: translateY(105%); } to { transform: none; } }
.tv-encbar[hidden] { display: none; }

.tv-encbar .tv-enc__tag { top: -22px; inset-inline-end: 12px; }

.tv-encbar__lien { flex: 1; display: flex; align-items: center; gap: 12px;
    min-width: 0; padding: 10px 0 10px 12px; color: inherit; text-decoration: none; }
.tv-encbar__lien:hover { text-decoration: none; color: inherit; }
.tv-encbar__img { flex: none; width: 52px; height: 52px; object-fit: cover; border-radius: 10px; }
/* Variante repli AdSense : la barre accueille l'unite Google au centre.
   Le format 'horizontal' borne la hauteur (bannieres 320x50 a 728x90) —
   on ne rogne JAMAIS une annonce au CSS. */
.tv-encbar--fill { padding: 6px 8px; }
.tv-encbar__pub { flex: 1; min-width: 0; display: block; }
.tv-encbar__pub .adsbygoogle { display: block; max-height: 100px; overflow: hidden; }
/* Google n'a rien servi : pas de coquille vide a l'ecran */
.tv-encbar--fill:has(ins[data-ad-status="unfilled"]) { display: none; }

.tv-encbar__corps { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tv-encbar__corps b { font-size: 13.5px; color: var(--mk-ink, #101828);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-encbar__corps span { font-size: 12px; color: var(--mk-ink-2, #55606E);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-encbar .tv-enc__cta { margin-top: 0; flex: none; padding: 7px 14px; font-size: 12.5px; }

.tv-encbar__fermer { flex: none; width: 34px; height: 34px; margin-inline-end: 8px;
    border: 0; border-radius: 50%; background: #F1F3F4; color: #5F6B7A;
    font-size: 19px; line-height: 1; cursor: pointer; }
.tv-encbar__fermer:hover { background: #E4E7EA; color: #101828; }

@media (max-width: 560px) {
    .tv-encbar { border-radius: 0; max-width: none; }
    .tv-encbar__img { display: none; }
}

/* ── L'écran publicitaire ─────────────────────────────────────────────────── */
.tv-encmodal { position: fixed; inset: 0; z-index: 1060;
    display: flex; align-items: center; justify-content: center; padding: 18px;
    font-family: "Inter", "Poppins", system-ui, sans-serif; }
.tv-encmodal[hidden] { display: none; }
.tv-encmodal__voile { position: absolute; inset: 0;
    background: rgba(13, 22, 18, .58); backdrop-filter: blur(2px);
    animation: tv-encmodal-voile .5s ease; }
@keyframes tv-encmodal-voile { from { opacity: 0; } }
/* Google Auto Ads n'a rien a faire DANS l'ecran publicitaire */
.tv-encmodal .google-auto-placed, .tv-encmodal ins.adsbygoogle { display: none !important; }

.tv-encmodal__panneau { position: relative; width: min(480px, 100%);
    max-height: calc(100vh - 32px); overflow: auto;
    background: #fff; border-radius: 20px;
    box-shadow: 0 24px 70px -20px rgba(0, 0, 0, .45);
    animation: tv-encmodal-entre .55s cubic-bezier(.22, .61, .36, 1); }
@keyframes tv-encmodal-entre { from { opacity: 0; transform: translateY(22px) scale(.97); } }

.tv-encmodal .tv-enc__tag { top: 12px; inset-inline-start: 12px; inset-inline-end: auto; }

/* La croix est CE QUI REND LE FORMAT ACCEPTABLE : grande, contrastée, visible
   dès l'ouverture — jamais un piège à clics. */
.tv-encmodal__fermer { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 3;
    width: 38px; height: 38px; border: 0; border-radius: 50%;
    background: rgba(17, 24, 39, .55); backdrop-filter: blur(3px); color: #fff;
    font-size: 22px; line-height: 1; cursor: pointer; }
.tv-encmodal__fermer:hover { background: rgba(17, 24, 39, .8); }

/* L'image ENTIÈRE, quel que soit son format (demande propriétaire 27/08) :
   l'ancien height fixe + cover rognait tout visuel qui n'était pas au ratio.
   height:auto suit le ratio naturel ; le max-height borne les portraits pour
   que le panneau (image + texte + CTA) tienne dans la fenêtre, et contain
   letterboxe alors sur fond neutre au lieu de rogner. */
.tv-encmodal__img { display: block; width: 100%; height: auto;
    max-height: min(48vh, 430px); object-fit: contain; background: #F3F5F4; }
.tv-encmodal__corps { padding: 20px 24px 24px; text-align: center; }
.tv-encmodal__titre { display: block; font-size: 19px; font-weight: 700;
    letter-spacing: -.01em; color: #101828; margin-bottom: 6px; }
.tv-encmodal__texte { font-size: 14px; color: #55606E; line-height: 1.6; margin: 0 0 14px;
    /* Clamp : un texte-fleuve ferait déborder l'écran publicitaire de la
       fenêtre — au-delà de 5 lignes, « Voir plus » (encarts.js) */
    display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.tv-encmodal .tv-enc__cta--plein { align-self: center; display: inline-flex;
    padding: 11px 26px; font-size: 14.5px; }

@media (prefers-reduced-motion: reduce) {
    .tv-encbar, .tv-encmodal__voile, .tv-encmodal__panneau { animation: none; }
    .tv-enc, .tv-enc__img, .tv-enc__cta { transition: none; }
}
