/* CARP RUSH TV / GoWatch PHP8 TEST32
   Fiches video et articles classiques : lisibilite, sidebar mobile.
   PWA : meme regles CSS responsive selon la largeur de la fenetre.
*/

/* Le bouton est mis en evidence au repos, pas uniquement au survol.
   Applique au bouton depliable des fiches video et des articles. */
body.single-video .single-content .content-toggler span,
body.single-post .single-content .content-toggler span {
    background-color: #be0028;
    color: #ffffff;
    border: 1px solid #be0028;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    font-weight: 700;
}
/* Sur ecrans tactiles, le navigateur peut conserver artificiellement :hover.
   La bascule des couleurs est reservee a la souris, et au focus clavier. */
body.single-video .single-content .content-toggler span:focus-visible,
body.single-post .single-content .content-toggler span:focus-visible {
    background-color: #ffffff;
    color: #be0028;
    border-color: #be0028;
}
@media (hover: hover) and (pointer: fine) {
    body.single-video .single-content .content-toggler span:hover,
    body.single-post .single-content .content-toggler span:hover {
        background-color: #ffffff;
        color: #be0028;
        border-color: #be0028;
    }
}

/* Le widget lateral est volontairement conserve sur ordinateur et tablette.
   Uniquement les fiches single video/article sur smartphone (<768px).
   Ne pas masquer les autres zones publicitaires dans les contenus. */
@media screen and (max-width: 767px) {
    body.single-video .single-content.airkit_single-post aside#secondary.secondary,
    body.single-post .single-content.airkit_single-post aside#secondary.secondary {
        display: none !important;
    }

    /* Les colonnes gerees par GoWatch doivent utiliser toute la largeur
       lorsque la sidebar est retiree de la mise en page mobile. */
    body.single-video .single-content.airkit_single-post .row > .sidebar-right,
    body.single-video .single-content.airkit_single-post .row > .sidebar-left,
    body.single-post .single-content.airkit_single-post .row > .sidebar-right,
    body.single-post .single-content.airkit_single-post .row > .sidebar-left {
        width: 100%;
        max-width: 100%;
        float: none;
        flex: 0 0 100%;
    }
}


/* CARP RUSH TV TEST33 – articles classiques uniquement.
   Réduction des espaces cumulés autour des articles associés.
   Ne modifie ni la fiche vidéo, ni le contenu éditorial, ni les archives. */
body.single-post .post-footer > .airkit_advertising-container {
    margin-bottom: 24px;
}
body.single-post .post-footer > .post-related:not(.single-featured-posts) {
    padding-top: 16px;
    padding-bottom: 16px;
}
body.single-post .post-footer > .post-related .block-title {
    margin-top: 10px;
    margin-bottom: 22px;
}
body.single-post .post-footer > .post-related:last-child {
    padding-bottom: 4px;
}
/* La pagination précédent/suivant avait deux marges de 50 px. */
body.single-post .post-footer .single-post-navigation {
    margin-top: 18px;
}
body.single-post .post-footer .single-post-navigation .navigation {
    margin-top: 20px;
    margin-bottom: 24px;
}
@media screen and (max-width: 767px) {
    body.single-post .post-footer > .airkit_advertising-container {
        margin-bottom: 18px;
    }
    body.single-post .post-footer > .post-related:not(.single-featured-posts) {
        padding-top: 8px;
        padding-bottom: 10px;
    }
    body.single-post .post-footer > .post-related .block-title {
        margin-top: 8px;
        margin-bottom: 18px;
    }
    body.single-post .post-footer > .post-related:last-child {
        padding-bottom: 2px;
    }
    body.single-post .post-footer .single-post-navigation .navigation {
        margin-top: 15px;
        margin-bottom: 18px;
    }
}


/* CARP RUSH TV TEST34 – fiche article + vidéo, partage mobile.
   Contredit explicitement les media queries historiques de GoWatch qui
   forcent flex-direction:column sous 768px; ne modifie pas le PC.
   Les actions existantes (favoris/playlists/partage) restent intactes. */
@media screen and (max-width: 767px) {
    body.single.single-post aside.post-meta,
    body.single.single-video aside.post-meta {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-width: 0;
        width: 100%;
        padding-top: 16px;
        padding-bottom: 16px;
        margin-bottom: 0;
    }

    body.single.single-post aside.post-meta > .post-meta-author,
    body.single.single-video aside.post-meta > .post-meta-author {
        display: flex;
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        margin: 0;
        text-align: left;
        align-items: center;
    }

    body.single.single-post aside.post-meta > .post-meta-actions,
    body.single.single-video aside.post-meta > .post-meta-actions {
        display: flex;
        flex: 0 0 auto;
        width: auto;
        min-width: 40px;
        min-height: 40px;
        margin: 0 0 0 auto;
        padding: 0;
        float: none;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: nowrap;
        text-align: right;
        gap: 4px;
    }

    body.single.single-post aside.post-meta > .post-meta-actions > *,
    body.single.single-video aside.post-meta > .post-meta-actions > * {
        flex: 0 0 auto;
        float: none !important;
        margin: 0;
        padding: 0;
    }

    /* Post.php comprend l'avatar, l'auteur et la date dans le meme DIV.
       On met nom/date en colonne à droite de l'avatar sans perdre la place
       réservée au bouton de partage. */
    body.single.single-post .post-meta-author > .entry-meta-author {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 3px;
        position: relative;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        min-height: 48px;
        padding-left: 56px;
        margin: 0;
        line-height: 1.3;
        text-align: left;
    }
    body.single.single-post .post-meta-author .post-author-avatar {
        position: absolute;
        width: 46px;
        height: 46px;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
    }
    body.single.single-post .post-meta-author .post-author-avatar img {
        width: 46px;
        height: 46px;
        object-fit: cover;
    }
    body.single.single-post .post-meta-author .entry-meta-author > a[rel="author"],
    body.single.single-post .post-meta-author .entry-meta-author > .entry-meta-date {
        max-width: 100%;
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    body.single.single-post .post-meta-author .entry-meta-author > .entry-meta-date {
        font-size: 11px;
    }

    /* L'ancien CSS vidéo contient déjà un alignement, mais ici on assure
       que les trois icônes restent sur la même ligne sur petits écrans. */
    body.single.single-video .post-meta-author .post-author-avatar {
        flex-shrink: 0;
    }
    body.single.single-video .post-meta-author .post-author-meta {
        min-width: 0;
    }

    /* Le panneau de partage doit rester accessible dans le viewport. */
    body.single.single-post .post-meta-actions .tooltip-sharing .airkit_sharing .popover,
    body.single.single-video .post-meta-actions .tooltip-sharing .airkit_sharing .popover {
        left: auto !important;
        right: 0;
        width: min(290px, calc(100vw - 24px)) !important;
        min-width: 0;
        max-width: calc(100vw - 24px);
    }

    /* Quelques finitions de lecture des articles, sans toucher aux vidéos.
       Evite les grandes rivières blanches dues aux textes justifiés sur mobile.
       Ne modifie pas les paragraphes volontairement centrés ou alignés à droite. */
    body.single.single-post .post-container .post-content p:not(.has-text-align-center):not(.has-text-align-right):not([style*="center"]):not([style*="right"]) {
        text-align: left !important;
        line-height: 1.65;
        margin-bottom: 1.4em;
        overflow-wrap: break-word;
    }
    body.single.single-post.dropcap-content .post-content > p:first-child:first-letter,
    body.single.single-post.dropcap-content .post-content > div:first-child > p:first-child:first-letter {
        font-size: 56px;
        line-height: 49px;
        padding-top: 4px;
        padding-right: 7px;
    }
}
@media screen and (max-width: 360px) {
    body.single.single-post aside.post-meta,
    body.single.single-video aside.post-meta { gap: 5px; }
    body.single.single-post aside.post-meta > .post-meta-actions,
    body.single.single-video aside.post-meta > .post-meta-actions { gap: 2px; }
    body.single.single-post .post-meta-author .post-author-avatar,
    body.single.single-post .post-meta-author .post-author-avatar img { width: 40px; height: 40px; }
    body.single.single-post .post-meta-author > .entry-meta-author { padding-left: 46px; }
}

/* CARP RUSH TV TEST51 — leger arrondi des images editoriales des articles.
   Seulement les articles classiques (template post-layout-single1).
   Ne modifie ni les lecteurs video, ni les vignettes des listes, ni le mode sombre.
   L'arrondi est identique en modes clair et sombre. */
body.single-post .single-content article.post-layout-single1 > figure.featured-image {
    border-radius: 9px;
    overflow: hidden;
}
body.single-post .single-content article.post-layout-single1 > figure.featured-image img {
    border-radius: 9px;
}

/* Images inserees par l'editeur classique et blocs image Gutenberg.
   Ciblage des illustrations d'article, pas des icones, videos ou publicites. */
body.single-post .single-content article.post-layout-single1 .post-content > img,
body.single-post .single-content article.post-layout-single1 .post-content > p > img,
body.single-post .single-content article.post-layout-single1 .post-content > p > a > img,
body.single-post .single-content article.post-layout-single1 .post-content .wp-caption img,
body.single-post .single-content article.post-layout-single1 .post-content figure.wp-block-image img {
    border-radius: 5px;
}
