/**
 * NIYAPRESS: Global Spacing Fix - ULTRA CLEAN
 * Élimine TOUS les espaces blancs indésirables
 * Fonctionne sur TOUTES les pages (home, catégorie, article, etc.)
 * Version: 2.0 - PRODUCTION READY
 */

/* ═══════════════════════════════════════════════════════════
   RESET GLOBAL - Éliminer tous les espaces parasites
   ═══════════════════════════════════════════════════════════ */

html {
	margin: 0 !important;
	padding: 0 !important;
}

body {
	margin: 0 !important;
	/* Padding calculé automatiquement par JavaScript */
}

#page,
.site {
	margin: 0 !important;
	padding: 0 !important;
}

/* ═══════════════════════════════════════════════════════════
   HEADER FIXED - Position absolue en haut
   ═══════════════════════════════════════════════════════════ */

.site-header,
.site-header.site-header--magazine,
header.site-header {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	width: 100% !important;
	z-index: 9000 !important;
	margin: 0 !important;
}

/* Admin bar offset */
body.admin-bar .site-header,
body.admin-bar .site-header.site-header--magazine {
	top: 32px !important;
}

@media screen and (max-width: 782px) {
	body.admin-bar .site-header,
	body.admin-bar .site-header.site-header--magazine {
		top: 46px !important;
	}
}

/* ═══════════════════════════════════════════════════════════
   CONTENT - Pas de marge/padding supplémentaire
   ═══════════════════════════════════════════════════════════ */

#content,
.site-content,
#primary,
.site-main,
main {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Premier élément du contenu */
.site-content > *:first-child,
.site-main > *:first-child,
#primary > *:first-child {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* ═══════════════════════════════════════════════════════════
   BANNIÈRES - Placement correct sous le header
   ═══════════════════════════════════════════════════════════ */

.niyapress-lachtv-leaderboard,
.ad-banner,
.header-banner,
.header-ad-banner,
.site-banner,
[class*="banner"],
[class*="ad-slot"],
.widget_media_image {
	margin-top: 0 !important;
	margin-bottom: 20px !important;
}

/* ═══════════════════════════════════════════════════════════
   CATÉGORIES - Espacement propre
   ═══════════════════════════════════════════════════════════ */

body.category #content,
body.category .site-content,
body.archive #content,
body.archive .site-content {
	margin-top: 0 !important;
	padding-top: 20px !important;
}

.archive-niyapress-header,
.category-header,
.page-header {
	margin-top: 0 !important;
	margin-bottom: 30px !important;
}

/* ═══════════════════════════════════════════════════════════
   ARTICLES - Espacement propre
   ═══════════════════════════════════════════════════════════ */

body.single #content,
body.single .site-content,
body.single-post #content,
body.single-post .site-content {
	margin-top: 0 !important;
	padding-top: 20px !important;
}

/* ═══════════════════════════════════════════════════════════
   HOMEPAGE - Espacement propre
   ═══════════════════════════════════════════════════════════ */

body.home #content,
body.home .site-content,
body.front-page #content,
body.front-page .site-content {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Première section de la home */
body.home .site-content > section:first-child,
body.front-page .site-content > section:first-child {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* ═══════════════════════════════════════════════════════════
   SECTIONS - Espacement harmonisé
   ═══════════════════════════════════════════════════════════ */

.np-section,
section[class*="np-"],
section[class*="niya-"] {
	margin-bottom: 40px !important;
}

.np-section:first-child,
section[class*="np-"]:first-child {
	margin-top: 0 !important;
}

/* ═══════════════════════════════════════════════════════════
   Z-INDEX - Ordre correct des couches
   ═══════════════════════════════════════════════════════════ */

/* Admin bar */
#wpadminbar {
	z-index: 99999 !important;
}

/* Header et navigation */
.site-header,
.site-header.site-header--magazine,
header.site-header {
	z-index: 9000 !important;
}

.site-header .main-nav,
.site-header nav,
.menu-primary-container,
.main-navigation {
	z-index: 9100 !important;
}

/* Bannières */
.niyapress-lachtv-leaderboard,
.ad-banner,
[class*="banner"] {
	z-index: 100 !important;
}

/* Contenu */
.site-content,
.site-main {
	z-index: 10 !important;
}

/* Footer */
.site-footer,
footer {
	z-index: 5 !important;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE - Ajustements responsive
   ═══════════════════════════════════════════════════════════ */

@media screen and (max-width: 768px) {
	body.category #content,
	body.archive #content,
	body.single #content {
		padding-top: 15px !important;
	}
	
	.np-section,
	section[class*="np-"] {
		margin-bottom: 30px !important;
	}
}

/* ═══════════════════════════════════════════════════════════
   CORRECTION POUR CATEGORY.PHP INLINE STYLES
   ═══════════════════════════════════════════════════════════ */

/* Override des styles inline dans category.php */
body.category .site-header[style*="position: relative"] {
	position: fixed !important;
}

body.category .site-header[style*="position:relative"] {
	position: fixed !important;
}
