/*
 Theme Name:   Blocksy Child
 Theme URI:    https://creativethemes.com/blocksy/
 Description:  Thème enfant personnalisé Philippe Mercier Bourges 2026
 Author:       LMLC / Benji
 Author URI:   https://philippe-mercier-bourges2026.fr/
 Template:     blocksy
 Version:      1.0.0
 Text Domain:  blocksy-child
*/

/* ----------------------------------------------------------
   STYLE ARTICLE – PHILIPPE MERCIER BOURGES 2026
   Objectif :
   - Image "bannière campagne" en haut des articles, bord à bord.
   - Le header du site visuellement posé dessus/sans gros blanc entre les deux.
   - Titre bleu sous l'image, pas overlay.
   - Corps de texte lisible et propre.
   - Ne pas casser les autres pages du site.
   ---------------------------------------------------------- */

/* 1. HERO BANNIÈRE FULL WIDTH */
body.single-post .pm-article-hero-banner {
    position: relative;
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
    margin-top: -90px !important;
    margin-bottom: 2rem;
    margin-right: calc(-50vw + 50%);
    background: #000;
    z-index: 1;
}

body.single-post .pm-article-hero-banner__wrap {
    position: relative;
    width: 100%;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    height: 90vh;
    min-height: 380px;
    max-height: 700px;
    overflow: hidden;
    background: #000;
}

body.single-post .pm-article-hero-banner__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* 2. CONTENU APRÈS LA BANNIÈRE */
body.single-post .pm-article-body {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
    padding-top: 0;
}

/* 3. HEADLINE SOUS LA BANNIÈRE */
body.single-post .pm-article-headline {
    margin-bottom: 2rem;
}

body.single-post .pm-article-headline__title {
    margin: 0;
    color: #1F18C0;
    font-size: clamp(1.8rem, 1vw + 1.4rem, 2.2rem);
    line-height: 1.2;
    font-weight: 600;
    max-width: 1000px;
}

/* 4. CONTENU TEXTE */
body.single-post .pm-article-body .entry-header .entry-title,
body.single-post .pm-article-body .entry-content > h1.entry-title {
    display: none;
}

body.single-post .pm-article-body .entry-content p {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #1a1a1a;
    margin-bottom: 1.2em;
}

body.single-post .pm-article-body .entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0;
    display: block;
    margin: 1.5rem auto;
}

body.single-post .pm-article-body .entry-content h2 {
    font-size: 1.4rem;
    line-height: 1.3;
    font-weight: 600;
    color: #1F18C0;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #1F18C0;
    padding-bottom: .4rem;
}

body.single-post .pm-article-body .entry-content h3 {
    font-size: 1.2rem;
    line-height: 1.4;
    font-weight: 600;
    color: #000;
    margin-top: 2rem;
    margin-bottom: .8rem;
}

/* ----------------------------------------------------------
   5. BLOCS BAS DE PAGE (navigation + partage)
   Réactivation propre et harmonisation campagne
---------------------------------------------------------- */

body.single-post .ct-related-posts,
body.single-post .ct-entry-related {
    display: none !important;
}

/* bloc partage réseaux */
body.single-post .ct-share-box {
    display: block !important;
    max-width: 800px;
    margin: 3rem auto 2rem auto;
    padding-top: 1rem;
    border-top: 2px solid #1F18C0;
}

/* navigation précédent / suivant */
body.single-post .post-navigation {
  
    max-width: 800px;
    margin: 2rem auto 3rem auto;
    padding-top: 1rem;
    border-top: 2px solid #1F18C0;
    font-size: 0.95rem;
    line-height: 1.4;
}

body.single-post .post-navigation a {
    color: #1F18C0 !important;
    text-decoration: none;
    font-weight: 600;
}
body.single-post .post-navigation a:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------------
   6. RESPONSIVE HERO + TITRE
---------------------------------------------------------- */
@media (max-width: 768px) {
    body.single-post .pm-article-hero-banner__wrap {
        height: 65vh;
        min-height: 320px;
        max-height: 520px;
    }

    body.single-post .pm-article-headline__title {
        font-size: clamp(1.5rem, 2vw + 1rem, 1.7rem);
    }
}

/* ----------------------------------------------------------
   PATCH PAGES STATIQUES
---------------------------------------------------------- */

/* Cas 1 : Image mise en avant classique */
body.page:not(.single-post) .ct-featured-image,
body.page:not(.single-post) .ct-featured-image-container,
body.page:not(.single-post) .post-thumbnail,
body.page:not(.single-post) .entry-header .post-thumbnail,
body.page:not(.single-post) .entry-header .wp-post-image,
body.page:not(.single-post) .entry-header img.wp-post-image {
    display: none !important;
}

/* Cas 2 : Bloc Gutenberg */
body.page:not(.single-post) .entry-content > figure.wp-block-post-featured-image,
body.page:not(.single-post) figure.wp-block-post-featured-image,
body.page:not(.single-post) .entry-content > figure.wp-block-image.is-featured,
body.page:not(.single-post) .entry-content > .wp-block-post-featured-image,
body.page:not(.single-post) .wp-block-post-featured-image img,
body.page:not(.single-post) img.wp-post-image.alignfull,
body.page:not(.single-post) img.wp-post-image.alignwide {
    display: none !important;
}

/* Cas 3 : Wrappers résiduels */
body.page:not(.single-post) .entry-header > figure,
body.page:not(.single-post) .entry-header > .ct-media-container,
body.page:not(.single-post) .page-featured-image,
body.page:not(.single-post) .featured-media,
body.page:not(.single-post) .ct-post-thumb,
body.page:not(.single-post) .pm-article-hero,
body.page:not(.single-post) .pm-article-hero__inner,
body.page:not(.single-post) .pm-article-hero__media,
body.page:not(.single-post) .pm-article-hero-banner,
body.page:not(.single-post) .pm-article-hero-banner__wrap {
    display: none !important;
}

/* Sécurité */
body.page:not(.single-post) main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ----------------------------------------------------------
   Ajustement header + titre dans image
---------------------------------------------------------- */

body.single-post .site-header {
    background: transparent !important;
    position: relative;
    z-index: 1000;
}

/* on colle l'image sous le header */
body.single-post .pm-article-hero-banner {
    margin-top: -155px !important;
}

/* masque l'ancien bloc titre sous image */
body.single-post .pm-article-headline {
    display: none !important;
}

/* texte du titre intégré à la bannière */
body.single-post .pm-article-hero-banner__titlewrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding-left: clamp(1rem, 3vw, 3rem);
    padding-right: clamp(1rem, 3vw, 3rem);
    padding-bottom: clamp(1rem, 2vw, 2rem);
    background-image: linear-gradient(
        to top,
        rgba(255,255,255,0.95) 0%,
        rgba(255,255,255,0.7) 40%,
        rgba(255,255,255,0) 80%
    );
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    box-sizing: border-box;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    height: auto;
}

/* titre bleu dans image */
body.single-post .pm-article-hero-banner__title {
    margin: 0;
    color: #1F18C0;
    line-height: 1.2;
    font-weight: 600;
    max-width: min(90%, 1100px);
	font-size: 55px;
    padding-left: 10%;
	text-shadow: 3px 3px 1px rgba(255,255,255,0.8);
}

/* responsive */
@media (max-width: 768px) {
    body.single-post .pm-article-hero-banner__title {
        font-size: clamp(1.4rem, 2vw + 1rem, 1.6rem);
    }

    body.single-post .pm-article-hero-banner__titlewrap {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 1rem;
        background-image: linear-gradient(
            to top,
            rgba(255,255,255,0.95) 0%,
            rgba(255,255,255,0.8) 30%,
            rgba(255,255,255,0) 70%
        );
    }
}
