/* ===== Bandeaux publicitaires latéraux ===== */

.ad-rail {
    position: fixed;
    top: 140px;
    bottom: 16px;
    width: clamp(150px, 14vw, 220px);
    z-index: 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    font-family: 'Lato', 'Arial', sans-serif;
}

.ad-rail-left { left: max(12px, 2vw); }
.ad-rail-right { right: max(12px, 2vw); }

.ad-rail-label {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #9a9a9a;
    text-align: center;
    margin-bottom: 6px;
}

.ad-rail-window {
    position: relative;
    -webkit-box-flex: 1;
        -ms-flex: 1;
            flex: 1;
    overflow: hidden;
    /* Fondu léger en haut (la carte affichée s'y arrête), plus marqué en bas (carte suivante). */
    -webkit-mask-image: -webkit-linear-gradient(top, transparent 0, #000 6px, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 6px, #000 calc(100% - 28px), transparent 100%);
}

/* Deux copies de la liste ; ads.js déplace la piste d'une carte à la fois (transform). */
.ad-rail-track {
    position: relative;
    will-change: transform;
}

/* Pas de place sur les côtés : on masque les bandeaux. */
@media only screen and (max-width: 1100px) {
    .ad-rail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ad-rail-window { overflow-y: auto; }
}

/* ===== Bannières dans les pages (une annonce à la fois) ===== */

.ad-banner {
    width: 92%;
    max-width: 920px;
    margin: 28px auto;
    font-family: 'Lato', 'Arial', sans-serif;
    text-align: left;
}

.ad-banner .ad-rail-label { display: block; }

.ad-banner-slides .ad-card { margin-bottom: 0; }

/* .ad-card est en flex/grid : sans cette règle, l'attribut hidden serait ignoré. */
.ad-card[hidden] { display: none; }

.ad-banner-slides .ad-card:not([hidden]) {
    -webkit-animation: ad-banner-in .6s ease;
            animation: ad-banner-in .6s ease;
}

@-webkit-keyframes ad-banner-in {
    from { opacity: 0; -webkit-transform: translateY(12px); transform: translateY(12px); }
    to { opacity: 1; -webkit-transform: none; transform: none; }
}

@keyframes ad-banner-in {
    from { opacity: 0; -webkit-transform: translateY(12px); transform: translateY(12px); }
    to { opacity: 1; -webkit-transform: none; transform: none; }
}

.ad-banner-dots {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    margin-top: 6px;
}

.ad-banner-dots button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.ad-banner-dots button::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    margin: 0 auto;
    border-radius: 4px;
    background: #c5ccd3;
    -webkit-transition: width .3s ease, background-color .3s ease;
    -o-transition: width .3s ease, background-color .3s ease;
    transition: width .3s ease, background-color .3s ease;
}

.ad-banner-dots button[aria-current]::before {
    width: 18px;
    background: #555c63;
}

@media (prefers-reduced-motion: reduce) {
    .ad-banner-slides .ad-card:not([hidden]) { -webkit-animation: none; animation: none; }
}

/* ===== Carte publicitaire ===== */

.ad-card {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-align: start;
        -ms-flex-align: start;
            align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    padding: 16px 14px;
    border-radius: 12px;
    text-decoration: none;
    line-height: 1.35;
    -webkit-box-shadow: 0 6px 18px rgba(12, 33, 57, .18);
            box-shadow: 0 6px 18px rgba(12, 33, 57, .18);
    -webkit-transition: -webkit-transform .2s ease, -webkit-box-shadow .2s ease;
    transition: -webkit-transform .2s ease, -webkit-box-shadow .2s ease;
    -o-transition: transform .2s ease, box-shadow .2s ease;
    transition: transform .2s ease, box-shadow .2s ease;
    transition: transform .2s ease, box-shadow .2s ease, -webkit-transform .2s ease, -webkit-box-shadow .2s ease;
}

.ad-card:hover,
.ad-card:focus-visible {
    -webkit-transform: translateY(-2px);
        -ms-transform: translateY(-2px);
            transform: translateY(-2px);
    -webkit-box-shadow: 0 10px 24px rgba(12, 33, 57, .28);
            box-shadow: 0 10px 24px rgba(12, 33, 57, .28);
}

.ad-card-brand {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.ad-card-icon {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 20px;
}

.ad-card-image {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.ad-card-title {
    font-size: 16px;
    font-weight: 700;
}

.ad-card-text {
    font-size: 13px;
    font-weight: 400;
}

.ad-card-cta {
    margin-top: 4px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

/* Thème Paie Afrique : bleus #004aa1 / #008fd5, marine #0c2139, accent rouge #ed4b4b */
.ad-theme-paie-afrique {
    font-family: 'Inter', 'Lato', 'Arial', sans-serif;
    background: -webkit-linear-gradient(290deg, #004aa1 0%, #0c2139 100%);
    background: -o-linear-gradient(290deg, #004aa1 0%, #0c2139 100%);
    background: linear-gradient(160deg, #004aa1 0%, #0c2139 100%);
}
.ad-theme-paie-afrique .ad-card-brand { color: #7fd0f5; }
.ad-theme-paie-afrique .ad-card-icon { background: #008fd5; color: #fff; }
.ad-theme-paie-afrique .ad-card-title { color: #fff; }
.ad-theme-paie-afrique .ad-card-text { color: #dce4ed; }
/* Bouton calqué sur .thm-btn de paie-afrique.com */
.ad-theme-paie-afrique .ad-card-cta { background: #008fd5; color: #fff; border-radius: 4px; font-weight: 500; }
.ad-theme-paie-afrique:hover .ad-card-cta { background: #fff; color: #008fd5; }

/* Thème TaskerPlace : orange #ea580c → #c2410c, marine #111827 */
.ad-theme-taskerplace {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: #111827;
}
/* Nom écrit comme le logo du site : « Tasker » en blanc, « Place » en orange clair */
.ad-theme-taskerplace .ad-card-brand {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
}
.ad-theme-taskerplace .ad-card-brand-accent { color: #fb923c; }
.ad-theme-taskerplace .ad-card-icon { background: -webkit-linear-gradient(315deg, #ea580c, #c2410c); background: -o-linear-gradient(315deg, #ea580c, #c2410c); background: linear-gradient(135deg, #ea580c, #c2410c); color: #fff; }
.ad-theme-taskerplace .ad-card-title { color: #fff; }
.ad-theme-taskerplace .ad-card-text { color: #d1d5db; }
.ad-theme-taskerplace .ad-card-cta { background: -webkit-linear-gradient(315deg, #ea580c, #c2410c); background: -o-linear-gradient(315deg, #ea580c, #c2410c); background: linear-gradient(135deg, #ea580c, #c2410c); color: #fff; }
.ad-theme-taskerplace:hover .ad-card-cta { background: #fff1e7; color: #9a3412; }

/* Thème Impôts et Taxes : teintes foncées du site, #3f7678 (survol du menu) → #153638 (pied de page),
   accents #5cbbbe et #b7f0f1 */
.ad-theme-impots-et-taxes {
    background: -webkit-linear-gradient(290deg, #3f7678 0%, #153638 100%);
    background: -o-linear-gradient(290deg, #3f7678 0%, #153638 100%);
    background: linear-gradient(160deg, #3f7678 0%, #153638 100%);
}
.ad-theme-impots-et-taxes .ad-card-brand { color: #b7f0f1; }
.ad-theme-impots-et-taxes .ad-card-icon { background: #5cbbbe; color: #fff; }
.ad-theme-impots-et-taxes .ad-card-title { color: #fff; }
.ad-theme-impots-et-taxes .ad-card-text { color: #e3f6f6; }
.ad-theme-impots-et-taxes .ad-card-cta { background: #fff; color: #153638; }
.ad-theme-impots-et-taxes:hover .ad-card-cta { background: #5cbbbe; color: #fff; }

/* Thème neutre */
.ad-theme-neutre {
    background: #fff;
    border: 1px solid #e6eaef;
    border-top: 4px solid #555c63;
}
.ad-theme-neutre .ad-card-brand { color: #6b7280; }
.ad-theme-neutre .ad-card-icon { background: #eff2f6; color: #374151; }
.ad-theme-neutre .ad-card-title { color: #1f2937; }
.ad-theme-neutre .ad-card-text { color: #555c63; }
.ad-theme-neutre .ad-card-cta { background: #374151; color: #fff; }

/* ===== Carte au format bannière : visuel à gauche, texte au centre, bouton à droite ===== */

.ad-card-wide {
    display: -ms-grid;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "media brand cta"
        "media title cta"
        "media text  cta";
    -webkit-column-gap: 20px;
       -moz-column-gap: 20px;
            column-gap: 20px;
    row-gap: 4px;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    padding: 20px 24px;
}

.ad-card-wide .ad-card-icon,
.ad-card-wide .ad-card-image { grid-area: media; }
.ad-card-wide .ad-card-icon { width: 56px; height: 56px; font-size: 26px; }
.ad-card-wide .ad-card-image { width: 140px; }
.ad-card-wide .ad-card-brand { grid-area: brand; }
.ad-card-wide .ad-card-title { grid-area: title; font-size: 20px; }
.ad-card-wide .ad-card-text { grid-area: text; font-size: 14px; }
.ad-card-wide .ad-card-cta {
    grid-area: cta;
    margin-top: 0;
    padding: 10px 18px;
    font-size: 14px;
    white-space: nowrap;
}

/* Petits écrans : le bouton passe sous le texte. */
@media only screen and (max-width: 600px) {
    .ad-card-wide {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "media brand"
            "media title"
            "text  text"
            "cta   cta";
        row-gap: 6px;
        padding: 16px;
    }
    .ad-card-wide .ad-card-icon { width: 44px; height: 44px; font-size: 20px; }
    .ad-card-wide .ad-card-image { width: 72px; }
    .ad-card-wide .ad-card-title { font-size: 17px; }
    .ad-card-wide .ad-card-cta { justify-self: start; margin-top: 6px; }
}
