/*
Theme Name:   dedefensa
Description:  Thème enfant de Neve pour dedefensa.org — reprend l'identité de l'ancien site (marine, olive, sable, Grandesign) en version simplifiée.
Template:     neve
Version:      1.0.5
Text Domain:  neve-dedefensa
*/

@font-face {
	font-family: "Grandesign";
	src: url("fonts/GrandesignNeueSerif.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* --- Palette et typo : reprises de l'ancien site, aplaties ---------------- */
:root {
	--dde-navy: #0f3955;
	--dde-navy-deep: #0a2a40;
	--dde-olive: #6f6b45;
	--dde-sand: #e4e0cc;
	--dde-sand-soft: #f3f1e7;
	--dde-rule: #d6d1ba;
	--dde-ink: #26292b;
	--dde-muted: #5f5d50;
	--dde-red: #b3352d;
	--dde-serif: "Grandesign", Georgia, "Times New Roman", Times, serif;

	/* Variables Neve : tout le thème suit la palette */
	--nv-primary-accent: var(--dde-navy);
	--nv-secondary-accent: var(--dde-olive);
	--nv-text-color: var(--dde-ink);
	--nv-light-bg: var(--dde-sand-soft);
	--bodyfontfamily: var(--dde-serif);
	--headingsfontfamily: var(--dde-serif);
	--bodyfontsize: 17px;
	--bodylineheight: 1.6;
	--headingcolor: var(--dde-navy);
	--h1fontweight: 400;
	--h2fontweight: 400;
	--h3fontweight: 400;
	--h4fontweight: 400;
}

body {
	font-family: var(--dde-serif);
	color: var(--dde-ink);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

::selection { background: var(--dde-sand); color: var(--dde-navy-deep); }

a { color: var(--dde-navy); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--dde-olive); }
:focus-visible { outline: 2px solid var(--dde-olive); outline-offset: 2px; }

h1, h2, h3, h4, h5, h6 { text-wrap: balance; }

/* --- En-tête : blanc, filet marine (rappel du bandeau de l'ancien site) ---- */
.hfg_header .header-main,
.hfg_header .header-main-inner {
	background: #fff;
	border-bottom: 0;
	box-shadow: none;
}
.hfg_header {
	border-bottom: 3px solid var(--dde-navy);
}
.hfg_header .header-main-inner { min-height: 64px; }
.hfg_header .nv-icon, .hfg_header .navbar-toggle { color: var(--dde-navy); }

/* --- Colonne gauche : menu des rubriques ------------------------------------ */
.blog-sidebar .widget_nav_menu ul.menu {
	margin: 0;
	padding: 0;
	list-style: none;
	background: var(--dde-sand);
	border-radius: 3px;
	overflow: hidden;
}
.blog-sidebar .widget_nav_menu .menu-item {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid rgba(255, 255, 255, .55);
}
.blog-sidebar .widget_nav_menu .menu-item:last-child { border-bottom: 0; }
.blog-sidebar .widget_nav_menu .menu-item a {
	display: block;
	padding: 7px 14px;
	color: var(--dde-navy);
	font-variant-caps: small-caps;
	font-size: 1rem;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color .15s ease-out, color .15s ease-out;
}
.blog-sidebar .widget_nav_menu .menu-item a:hover,
.blog-sidebar .widget_nav_menu .menu-item a:focus-visible {
	background: var(--dde-olive);
	color: #fff;
}
.blog-sidebar .widget_nav_menu .current-menu-item > a {
	background: var(--dde-navy);
	color: #fff;
}

/* Soutenez + bouton don */
.blog-sidebar h4.colonne {
	margin: 28px 0 12px;
	font-size: 1.2rem;
	font-weight: 400;
}
.blog-sidebar h4.colonne a { color: var(--dde-olive); text-decoration: none; }
.blog-sidebar .wp-block-buttons.colonne .wp-block-button__link {
	background: var(--dde-red) !important; /* écrase la couleur inline du bloc */
	font-family: var(--dde-serif);
	font-size: 1rem;
	padding: 9px 22px;
	border-radius: 3px;
}
.blog-sidebar .wp-block-buttons.colonne .wp-block-button__link:hover { background: #942a23 !important; }

/* --- Bloc de présentation (accueil) ---------------------------------------- */
.entry-content .wp-block-group.has-nv-light-bg-background-color {
	background: var(--dde-sand-soft) !important;
	border: 0 !important;
	border-radius: 4px !important;
}
.entry-content .wp-block-group.has-nv-light-bg-background-color h4 {
	margin: 4px 0 20px;
	color: var(--dde-olive) !important;
	font-size: 1.3rem;
	font-weight: 400;
}
.entry-content .wp-block-group.has-nv-light-bg-background-color p {
	font-size: .95rem;
	color: var(--dde-ink);
	max-width: 72ch;
}

/* Bouton « Journal dde.crisis » : compact, comme l'ancien */
.entry-content .wp-block-button__link {
	display: inline-block;
	width: auto;
	padding: 9px 16px;
	border-radius: 3px;
	background: var(--dde-navy);
	color: #fff;
	font-family: var(--dde-serif);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.3;
	transition: background-color .15s ease-out;
}
.entry-content .wp-block-button__link:hover { background: var(--dde-olive); color: #fff; }
.entry-content .wp-block-button { width: auto !important; }

/* Intertitre « Journal dde.crisis » (bloc Titre H5 avec fond) */
.entry-content .has-nv-light-bg-background-color h5.has-background {
	display: inline-block;
	margin: 12px 0 4px;
	padding: 8px 16px;
	border-radius: 3px !important;
	background: var(--dde-navy) !important;
	color: #fff !important;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.3;
}

/* --- Listes « derniers articles » ------------------------------------------ */
.wp-block-latest-posts.wp-block-latest-posts__list {
	margin: 0;
	padding: 0 !important;
	width: 100%;
}
.wp-block-latest-posts.wp-block-latest-posts__list li {
	position: relative;
	margin: 0;
	padding: 18px 0;
	border-bottom: 1px solid var(--dde-rule);
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 16px;
}
.wp-block-latest-posts__post-title {
	flex: 1 1 20rem;
	order: 1;
	color: var(--dde-navy);
	font-family: var(--dde-serif);
	font-size: 1.35rem;
	line-height: 1.3;
	text-decoration: none;
}
.wp-block-latest-posts__post-title:hover { color: var(--dde-olive); }

.wp-block-latest-posts.wp-block-latest-posts__list li time {
	position: static;
	order: 2;
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--dde-muted);
	font-size: .85rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.wp-block-latest-posts__post-excerpt {
	order: 3;
	flex: 1 1 100%;
	margin: 8px 0 0;
	color: var(--dde-muted);
	font-size: .95rem;
	line-height: 1.55;
	/* garde-fou si le bloc affiche le contenu complet */
	max-height: calc(1.55em * 4);
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
	        mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.wp-block-latest-posts__post-excerpt p { margin: 0 0 .5em; }

/* Liste courte du bloc de présentation */
.wp-block-latest-posts.haut li { padding: 10px 0; }
.wp-block-latest-posts.haut li:last-child { border-bottom: 0; }
.wp-block-latest-posts.haut .wp-block-latest-posts__post-title { font-size: 1.15rem; }

/* Titre de section « Nos dernières parutions » */
.entry-content h2.wp-block-heading {
	margin: 8px 0 4px;
	padding: 0 0 10px !important;
	background: none !important;
	border: 0 !important;
	border-bottom: 2px solid var(--dde-navy) !important;
	border-radius: 0 !important;
	color: var(--dde-olive);
	font-size: 1.75rem;
	font-weight: 400;
	font-variant-caps: small-caps;
	letter-spacing: .01em;
	width: 100%;
}

/* --- Article seul ------------------------------------------------------------ */
.single .entry-header {
	margin-bottom: 28px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--dde-rule);
}
.single h1.entry-title {
	margin-bottom: 10px;
	color: var(--dde-navy);
	font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem);
	font-weight: 400;
	line-height: 1.15;
}
.nv-meta-list,
.nv-meta-list a {
	color: var(--dde-muted);
	font-size: .9rem;
	font-variant-numeric: tabular-nums;
}
.nv-meta-list .category a {
	color: var(--dde-olive);
	font-style: italic;
	text-decoration: none;
}
.nv-meta-list .category a:hover { text-decoration: underline; }

/* Corps de texte : valeurs reprises à l'identique de l'ancien site
   (.article.body + Bootstrap 3 + styles CKEditor) */
.single .nv-content-wrap,
.page:not(.home) .nv-content-wrap {
	margin: 20px 0 50px;
	color: #333;
	font-size: 16px;
	line-height: 1.428571429;
	text-align: left;
}
.single .nv-content-wrap p,
.page:not(.home) .nv-content-wrap p {
	margin: 0 0 11px;
	line-height: 1.7em;
}
.single .nv-content-wrap ul,
.single .nv-content-wrap ol { margin: 0 0 11px; }
.single .nv-content-wrap hr {
	margin: 22px 0;
	border: 0;
	border-top: 1px solid #eee;
}
/* l'import a produit des <p><p>…</p></p> : on masque les paragraphes vides */
.nv-content-wrap p:empty { display: none; }

/* Titres et intertitres : tailles, couleurs et petites capitales viennent
   des styles en ligne de CKEditor (titleset_*, subtitleset_*) */
.single .nv-content-wrap h1,
.single .nv-content-wrap h2,
.single .nv-content-wrap h3,
.single .nv-content-wrap h4 {
	font-family: var(--dde-serif);
	font-weight: 500;
	line-height: 1.1;
}
.single .nv-content-wrap h2 { margin: 40px 0 50px; }
.single .nv-content-wrap h3 { margin: 30px 0 40px; }
.single .nv-content-wrap h4 { margin: 20px 0 30px; }
.single .nv-content-wrap > h2:first-child { margin-top: 0; }
/* titres sans style en ligne : couleurs CKEditor par défaut */
.single .nv-content-wrap h2[class*="deepgreen"],
.single .nv-content-wrap h3[class*="deepgreen"] { color: #75714d; }
.single .nv-content-wrap h2[class*="deepblue"],
.single .nv-content-wrap h3[class*="deepblue"] { color: #0f3955; }
.single .nv-content-wrap strong,
.single .nv-content-wrap b { font-weight: 700; }

/* Liens dans le texte : soulignés, insécables, inversés au survol */
.single .nv-content-wrap a {
	color: #0f3955;
	text-decoration: underline;
}
.single .nv-content-wrap a:hover,
.single .nv-content-wrap a:active {
	padding: 3px;
	background: #0f3955;
	color: #fff;
	text-decoration: none;
}

/* Citations : « Blockquote Original » et « Blockquote Normal » de CKEditor */
.entry-content blockquote,
blockquote.wp-block-quote {
	margin: 2em 0;
	padding: 11px 22px;
	border-left: 5px solid #eee;
	color: #333;
	font-size: 1.25em;
	font-style: normal;
	font-weight: 300;
	line-height: 1.428571429;
}
/* « normal » : 1.05em en style en ligne, qui l'emporte comme sur l'ancien site */
.entry-content blockquote p {
	margin: 0 0 11px;
	color: inherit;
	font-size: inherit;
	font-style: normal; /* Neve met les citations en italique, pas l'ancien site */
	line-height: 1.7em;
}
.entry-content blockquote p:last-child,
.entry-content blockquote ul:last-child,
.entry-content blockquote ol:last-child { margin-bottom: 0; }
.entry-content blockquote footer,
.entry-content blockquote small {
	display: block;
	color: #999;
	font-size: 80%;
	line-height: 1.428571429;
}
.entry-content blockquote footer::before,
.entry-content blockquote small::before { content: "\2014 \00A0"; }

/* Compteur de lectures (Post Views Counter) */
.single .post-views {
	display: block;
	margin-top: 28px;
	color: var(--dde-muted);
	font-size: .9rem;
	font-variant-numeric: tabular-nums;
}
.single .post-views .pvc-icon { display: none; }

/* Précédent / suivant */
.nv-post-navigation {
	margin-top: 40px;
	padding-top: 18px;
	border-top: 1px solid var(--dde-rule);
	gap: 24px;
}
.nv-post-navigation a { text-decoration: none; color: var(--dde-navy); }
.nv-post-navigation a:hover { color: var(--dde-olive); }
.nv-post-navigation .nav-direction {
	display: block;
	color: var(--dde-muted);
	font-size: .85rem;
	font-variant-caps: small-caps;
}

/* Étiquettes — Neve impose blanc + majuscules en !important : on les remplace */
.nv-tags-list {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px;
	margin-top: 28px;
	padding-top: 16px;
	border-top: 1px solid var(--dde-rule);
}
.nv-tags-list > span {
	margin-right: 4px;
	color: var(--dde-muted);
	font-size: .9rem;
	font-variant-caps: small-caps;
}
.nv-tags-list a {
	display: inline-block;
	margin: 0;
	padding: 4px 10px;
	border: 1px solid var(--dde-rule);
	border-radius: 3px;
	background: var(--dde-sand-soft);
	color: var(--dde-navy) !important;
	font-family: var(--dde-serif);
	font-size: .85rem !important;
	font-weight: 400;
	line-height: 1.3;
	text-decoration: none;
	text-transform: none;
	transition: background-color .15s ease-out, color .15s ease-out;
}
.nv-tags-list a:hover,
.nv-tags-list a:focus-visible {
	border-color: var(--dde-olive);
	background: var(--dde-olive);
	color: #fff !important;
}

/* --- Rubriques (archives) ------------------------------------------------- */
.archive .nv-page-title-wrap { margin-bottom: 8px; }
.archive .nv-page-title h1 {
	margin-bottom: 14px;
	color: var(--dde-navy);
	font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem);
	font-weight: 400;
}
/* présentation de la rubrique */
.archive .nv-page-title p {
	margin: 0 0 12px;
	padding: 18px 22px;
	border-radius: 4px;
	background: var(--dde-sand-soft);
	color: var(--dde-ink);
	font-size: .95rem;
	line-height: 1.6;
}

/* liste d'articles : même traitement que l'accueil, sans cartes */
.nv-index-posts { --cardboxshadow: none; --borderradius: 0; --padding: 0; }
.nv-index-posts .posts-wrapper { border-top: 2px solid var(--dde-navy); }
.nv-index-posts article.nv-non-grid-article,
.nv-index-posts .article-content-col,
.nv-index-posts .article-content-col .content {
	margin: 0 !important;
	padding: 0 !important;
}
.nv-index-posts .nv-ft-wrap,
.nv-index-posts .non-grid-content {
	margin: 0;
	padding: 18px 0 !important;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: none !important;
}
.nv-index-posts article + article .non-grid-content { border-top: 1px solid var(--dde-rule); }
.blog-entry-title {
	margin: 0 0 4px;
	font-size: 1.35rem;
	font-weight: 400;
	line-height: 1.3;
}
.blog-entry-title a { color: var(--dde-navy); text-decoration: none; }
.blog-entry-title a:hover { color: var(--dde-olive); }
.nv-index-posts .nv-meta-list { margin: 0 0 8px; }
.nv-index-posts .excerpt-wrap p {
	margin: 0;
	color: var(--dde-muted);
	font-size: .95rem;
	line-height: 1.55;
}
.nv-index-posts .excerpt-wrap strong { font-weight: inherit; }

/* pagination */
.nv-posts-pagination { margin-top: 28px; }
.nv-posts-pagination .page-numbers {
	border-radius: 3px;
	color: var(--dde-navy);
	font-variant-numeric: tabular-nums;
}
.nv-posts-pagination .page-numbers.current {
	background: var(--dde-navy);
	color: #fff;
}

/* --- Pied de page ------------------------------------------------------------ */
.site-footer {
	margin-top: 48px;
	border-top: 3px solid var(--dde-navy);
	background: var(--dde-sand-soft);
	color: var(--dde-muted);
	font-size: .9rem;
	line-height: 1.6;
}
.site-footer .footer-bottom,
.site-footer .footer-bottom-inner { background: transparent; }
.site-footer .footer-bottom-inner { padding: 24px 0 28px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--dde-navy); }
/* mention « Neve | Propulsé par WordPress » */
.site-footer .builder-item.cr { display: none; }

/* --- Mobile & tablette (< 960px, seuil de Neve) ----------------------------- */
@media (max-width: 959px) {
	/* le menu des rubriques est dans le menu burger : on retire le doublon */
	.blog-sidebar .widget_nav_menu { display: none; }
	/* « Soutenez » passe après le contenu */
	.nv-sidebar-wrap.nv-left { order: 2; }
	.nv-single-page-wrap { order: 1; }

	/* menu burger */
	.header-menu-sidebar .menu-item { display: block; }
	.header-menu-sidebar .menu-item a {
		color: var(--dde-navy);
		font-variant-caps: small-caps;
		font-size: 1.05rem;
	}

	.entry-content .wp-block-group.has-nv-light-bg-background-color {
		padding: 20px !important;
	}
	.wp-block-latest-posts__post-title { font-size: 1.2rem; }
	.entry-content h2.wp-block-heading { font-size: 1.5rem; }
	.blog-entry-title { font-size: 1.2rem; }
	.nv-index-posts .nv-meta-list .no-mobile { display: inline-block; }
	.nv-post-navigation { flex-direction: column; }
}
