/*
 * template-fullwidth.css — neutralise les wrappers GeneratePress par défaut
 * quand la page utilise le template "Full Width" (templates/page-fullwidth.php).
 *
 * GP wrap par défaut <div class="site grid-container container hfeed"> (max-w ~1200px)
 * + sidebar auto. Sur les pages brand PS on owne tout le viewport.
 *
 * Loaded inconditionnellement — selectors scopés via body.page-template-page-fullwidth
 * OU via body:has(.ps-fullwidth-main) (fallback robuste basé sur la class unique du main).
 *
 * NB : le template page-canvas.php (sans get_header) n'a pas besoin de ces overrides ;
 * ce fichier ne cible QUE le template page-fullwidth (qui charge le header GP puis le masque).
 */

body.page-template-page-fullwidth #page,
body.page-template-page-fullwidth .site.grid-container,
body.page-template-page-fullwidth .site.container,
body.page-template-page-fullwidth .site-content,
body.page-template-page-fullwidth .content-area,
body.page-template-page-fullwidth .ps-fullwidth-main,
body:has(.ps-fullwidth-main) #page,
body:has(.ps-fullwidth-main) .site.grid-container,
body:has(.ps-fullwidth-main) .site.container,
body:has(.ps-fullwidth-main) .site-content,
body:has(.ps-fullwidth-main) .content-area,
body:has(.ps-fullwidth-main) .ps-fullwidth-main {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
}

body.page-template-page-fullwidth .widget-area,
body.page-template-page-fullwidth #right-sidebar,
body.page-template-page-fullwidth #left-sidebar,
body.page-template-page-fullwidth .sidebar,
body:has(.ps-fullwidth-main) .widget-area,
body:has(.ps-fullwidth-main) #right-sidebar,
body:has(.ps-fullwidth-main) #left-sidebar,
body:has(.ps-fullwidth-main) .sidebar {
	display: none !important;
}

body.page-template-page-fullwidth .site-header,
body.page-template-page-fullwidth #site-navigation,
body.page-template-page-fullwidth #masthead,
body.page-template-page-fullwidth .main-navigation,
body:has(.ps-fullwidth-main) .site-header,
body:has(.ps-fullwidth-main) #site-navigation,
body:has(.ps-fullwidth-main) #masthead,
body:has(.ps-fullwidth-main) .main-navigation {
	display: none !important;
}

body.page-template-page-fullwidth .site-footer,
body:has(.ps-fullwidth-main) .site-footer {
	display: none !important;
}

/* Wrappers WP/GP intérieurs : reset padding/margin SANS toucher aux <article>
 * imbriqués des patterns (ex: <article class="ps-card-*">). */
body.page-template-page-fullwidth .inside-article,
body.page-template-page-fullwidth .entry-content,
body.page-template-page-fullwidth article.hentry,
body:has(.ps-fullwidth-main) .inside-article,
body:has(.ps-fullwidth-main) .entry-content,
body:has(.ps-fullwidth-main) article.hentry {
	padding: 0;
	margin: 0;
}

/* Clip horizontal page-level (modern, ne casse pas sticky descendants). */
body.page-template-page-fullwidth,
body:has(.ps-fullwidth-main) {
	overflow-x: clip;
	/* PS hero = fond noir : continuité visuelle (cf. tokens.css --ps-color-black). */
	background: var(--ps-color-black, #000000);
}
