/* ==========================================================================
   Nomad by Jérôme — Feuille de styles principale
   Les variables :root sont injectées dynamiquement (inc/palettes.php).
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
	--nomad-font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--nomad-shadow: 0 10px 30px -12px rgba(0,0,0,.25);
	--nomad-shadow-sm: 0 4px 14px -6px rgba(0,0,0,.2);
	--nomad-trans: .28s cubic-bezier(.16,1,.3,1);
}

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--nomad-font);
	font-size: var(--nomad-body-size, 17px);
	line-height: 1.65;
	color: var(--nomad-text);
	background: var(--nomad-bg);
	-webkit-font-smoothing: antialiased;
}

a { color: var(--nomad-primary); text-decoration: none; transition: color var(--nomad-trans); }
a:hover { color: var(--nomad-secondary); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: calc(2.6rem * var(--nomad-title-scale, 1)); }
h2 { font-size: calc(2rem * var(--nomad-title-scale, 1)); }
h3 { font-size: calc(1.4rem * var(--nomad-title-scale, 1)); }

.nomad-container {
	width: 100%;
	max-width: var(--nomad-content-max, 1200px);
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.nomad-skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 999;
	background: var(--nomad-primary); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 var(--nomad-radius) 0;
}
.nomad-skip-link:focus { left: 0; color: #fff; }

/* ----------------------------- En-tête ----------------------------------- */
.nomad-header {
	background: var(--nomad-bg);
	border-bottom: 1px solid color-mix(in srgb, var(--nomad-neutral) 25%, transparent);
	z-index: 100;
}
.nomad-sticky-header .nomad-header { position: sticky; top: 0; backdrop-filter: blur(10px); background: color-mix(in srgb, var(--nomad-bg) 88%, transparent); }

.nomad-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 72px; }
.nomad-site-title { font-size: 1.35rem; margin: 0; }
.nomad-site-title a { color: var(--nomad-text); }
.custom-logo { max-height: 56px; width: auto; }

.nomad-header__nav { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.nomad-menu { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; flex-wrap: wrap; }
.nomad-menu a { color: var(--nomad-text); font-weight: 500; position: relative; padding: .25rem 0; }
.nomad-menu a::after {
	content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
	background: var(--nomad-pill-grad); transition: width var(--nomad-trans);
}
.nomad-menu a:hover::after, .nomad-menu .current-menu-item > a::after { width: 100%; }

.nomad-nav--top .nomad-menu { gap: 1rem; font-size: .82rem; }
.nomad-nav--top .nomad-menu a { color: var(--nomad-text-soft); }

/* sous-menus */
.nomad-menu .sub-menu {
	list-style: none; margin: 0; padding: .5rem 0; position: absolute; min-width: 200px;
	background: var(--nomad-bg); box-shadow: var(--nomad-shadow); border-radius: var(--nomad-radius);
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: all var(--nomad-trans); z-index: 50;
}
.nomad-menu li { position: relative; }
.nomad-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nomad-menu .sub-menu a { display: block; padding: .5rem 1.25rem; }
.nomad-menu .sub-menu a::after { display: none; }

/* burger mobile */
.nomad-burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: .5rem; }
.nomad-burger span { width: 26px; height: 2px; background: var(--nomad-text); border-radius: 2px; transition: var(--nomad-trans); }
.nomad-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nomad-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nomad-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----------------------------- Héros ------------------------------------- */
.nomad-hero { position: relative; overflow: hidden; color: #fff; text-align: center; isolation: isolate; }
.nomad-hero__grad { position: absolute; inset: -20%; z-index: -1; background: var(--nomad-header-grad); background-size: 200% 200%; }
.nomad-hero--animated .nomad-hero__grad { animation: nomad-grad 14s ease infinite; }
@keyframes nomad-grad { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.nomad-hero__inner { padding: clamp(4rem, 12vw, 9rem) 1rem; }
.nomad-hero__title { font-size: clamp(2.4rem, 6vw, 4.4rem); margin-bottom: .3em; text-shadow: 0 2px 20px rgba(0,0,0,.2); }
.nomad-hero__subtitle { font-size: clamp(1.05rem, 2.4vw, 1.5rem); font-weight: 300; max-width: 640px; margin: 0 auto 2rem; opacity: .95; }
.nomad-hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.nomad-pill--hero-ghost { background: transparent; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.nomad-pill--hero-ghost:hover { background: rgba(255,255,255,.15); box-shadow: inset 0 0 0 2px #fff; }

/* ----------------------------- Pills ------------------------------------- */
.nomad-pill {
	display: inline-flex; align-items: center; gap: .5rem;
	padding: .7rem 1.6rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
	background: var(--nomad-pill-grad); color: #fff; border: 0; cursor: pointer;
	position: relative; overflow: hidden; transition: transform var(--nomad-trans), box-shadow var(--nomad-trans);
	box-shadow: var(--nomad-shadow-sm);
}
.nomad-pill::before {
	content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.25);
	transform: translateX(-100%) skewX(-20deg); transition: transform .6s ease;
}
.nomad-pill:hover { transform: translateY(-3px) scale(1.03); box-shadow: var(--nomad-shadow); color: #fff; }
.nomad-pill:hover::before { transform: translateX(100%) skewX(-20deg); }
.nomad-pill:active { transform: translateY(-1px) scale(.99); }
.nomad-pill--lg { padding: .95rem 2.2rem; font-size: 1.05rem; }
.nomad-pill--ghost {
	background: transparent; color: var(--nomad-primary);
	border: 2px solid color-mix(in srgb, var(--nomad-primary) 60%, transparent);
}
.nomad-pill--ghost:hover { color: #fff; background: var(--nomad-pill-grad); border-color: transparent; }

/* ----------------------------- Modules ----------------------------------- */
.nomad-module { padding: clamp(3rem, 8vw, 6rem) 0; }
.nomad-module--alt { background: var(--nomad-bg-alt); }
.nomad-module__head { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.nomad-module__title { position: relative; display: inline-block; }
.nomad-module__title::after {
	content: ""; display: block; width: 56px; height: 4px; margin: .6rem auto 0;
	border-radius: 4px; background: var(--nomad-pill-grad);
}
.nomad-module__subtitle { color: var(--nomad-text-soft); font-size: 1.1rem; font-weight: 300; }
.nomad-module__cta { text-align: center; }

.nomad-placeholder {
	text-align: center; padding: 2.5rem; border: 2px dashed color-mix(in srgb, var(--nomad-neutral) 40%, transparent);
	border-radius: var(--nomad-radius); color: var(--nomad-text-soft);
}
.nomad-placeholder code { display: inline-block; margin-top: .5rem; background: var(--nomad-bg-alt); padding: .3rem .7rem; border-radius: 8px; }

/* reveal au scroll */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.16,1,.3,1); }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ----------------------------- Grilles / cartes -------------------------- */
.nomad-grid { display: grid; gap: 1.75rem; }
.nomad-grid--cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.nomad-card {
	background: var(--nomad-bg); border-radius: var(--nomad-radius); overflow: hidden;
	box-shadow: var(--nomad-shadow-sm); transition: transform var(--nomad-trans), box-shadow var(--nomad-trans);
	display: flex; flex-direction: column; border: 1px solid color-mix(in srgb, var(--nomad-neutral) 15%, transparent);
}
.nomad-card:hover { transform: translateY(-6px); box-shadow: var(--nomad-shadow); }
.nomad-card__media img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.nomad-card__body { padding: 1.4rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.nomad-card__title { font-size: 1.2rem; margin: 0; }
.nomad-card__title a { color: var(--nomad-text); }
.nomad-card__title a:hover { color: var(--nomad-primary); }
.nomad-card__excerpt { color: var(--nomad-text-soft); font-size: .95rem; margin: 0; flex: 1; }
.nomad-card .nomad-pill { align-self: flex-start; margin-top: .4rem; }

/* ----------------------------- Layout pages/articles --------------------- */
.nomad-layout { display: grid; grid-template-columns: 1fr; gap: 2.5rem; padding-block: clamp(2rem, 6vw, 4rem); }
.nomad-layout:has(.nomad-sidebar) { grid-template-columns: minmax(0,1fr) 300px; }
.nomad-single__head { margin-bottom: 1.5rem; }
.nomad-single__title { font-size: clamp(1.8rem, 4vw, 3rem); }
.nomad-single__media { margin: 0 0 1.75rem; border-radius: var(--nomad-radius); overflow: hidden; }
.nomad-single__content { font-size: 1.05rem; }
.nomad-single__content > * { margin-block: 1rem; }
.nomad-page-intro { padding-block: clamp(2rem, 6vw, 4rem); }
.nomad-entry-meta { color: var(--nomad-text-soft); font-size: .9rem; }

.nomad-sidebar .widget { margin-bottom: 2rem; }
.widget-title { font-size: 1.1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--nomad-primary); }

.nomad-fullwidth { padding-block: clamp(2rem, 6vw, 4rem); }
.nomad-page { padding-block: clamp(2rem, 6vw, 4rem); }
.nomad-page--fullwidth .nomad-single__content { max-width: none; }

/* ----------------------------- Contenu éditorial (prose) ----------------- */
.nomad-prose { font-size: 1.05rem; }
.nomad-prose > * { margin-block: 1.1rem; }
.nomad-prose > *:first-child { margin-top: 0; }
.nomad-prose h2 { font-size: calc(1.7rem * var(--nomad-title-scale, 1)); margin-top: 2.2rem; }
.nomad-prose h3 { font-size: calc(1.35rem * var(--nomad-title-scale, 1)); margin-top: 1.8rem; }
.nomad-prose h4 { font-size: 1.1rem; margin-top: 1.5rem; }
.nomad-prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--nomad-primary) 45%, transparent); }
.nomad-prose a:hover { text-decoration-color: var(--nomad-primary); }
.nomad-prose ul, .nomad-prose ol { padding-left: 1.4rem; }
.nomad-prose li { margin-block: .35rem; }
.nomad-prose img { border-radius: var(--nomad-radius); }
.nomad-prose blockquote {
	margin: 1.6rem 0; padding: .25rem 1.25rem; border-left: 4px solid var(--nomad-primary);
	background: var(--nomad-bg-alt); border-radius: 0 var(--nomad-radius) var(--nomad-radius) 0;
	font-style: italic; color: var(--nomad-text-soft);
}
.nomad-prose pre {
	background: var(--nomad-text); color: #fff; padding: 1.1rem 1.25rem;
	border-radius: var(--nomad-radius); overflow-x: auto; font-size: .9rem;
}
.nomad-prose :not(pre) > code { background: var(--nomad-bg-alt); padding: .15em .45em; border-radius: 6px; font-size: .9em; }
.nomad-prose table { width: 100%; border-collapse: collapse; }
.nomad-prose th, .nomad-prose td { padding: .65rem .8rem; border-bottom: 1px solid color-mix(in srgb, var(--nomad-neutral) 25%, transparent); text-align: left; }
.nomad-prose th { background: var(--nomad-bg-alt); font-weight: 700; }
.nomad-prose figure { margin-inline: 0; }
.nomad-prose hr { border: 0; height: 1px; background: color-mix(in srgb, var(--nomad-neutral) 30%, transparent); }

/* Cadre neutre autour du contenu injecté par un shortcode de plugin :
   hérite de la typo/couleurs du thème sans imposer de mise en page rigide. */
.nomad-shortcode { color: var(--nomad-text); }
.nomad-shortcode a { color: var(--nomad-primary); }
.nomad-shortcode img { max-width: 100%; height: auto; }
.nomad-shortcode table { width: 100%; border-collapse: collapse; }

.nomad-404 { text-align: center; padding-block: clamp(4rem, 12vw, 8rem); }
.nomad-404 h1 { font-size: clamp(5rem, 18vw, 11rem); background: var(--nomad-pill-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nomad-empty { text-align: center; color: var(--nomad-text-soft); padding: 3rem 0; }

/* ----------------------------- Pied de page ------------------------------ */
.nomad-footer { background: var(--nomad-text); color: color-mix(in srgb, #fff 80%, transparent); margin-top: 4rem; }
.nomad-footer a { color: #fff; }
.nomad-footer__widgets { display: grid; gap: 2rem; padding-block: 3.5rem; }
.nomad-footer__widgets--2 { grid-template-columns: repeat(2, 1fr); }
.nomad-footer__widgets--3 { grid-template-columns: repeat(3, 1fr); }
.nomad-footer__widgets--4 { grid-template-columns: repeat(4, 1fr); }
.nomad-footer .widget-title { color: #fff; border-color: var(--nomad-primary); }
.nomad-footer__bottom {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
	padding-block: 1.75rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .9rem;
}
.nomad-footer__bottom .nomad-menu { gap: 1.25rem; }
.nomad-footer__bottom .nomad-menu a::after { background: #fff; }
.nomad-footer__copy { margin: 0; opacity: .7; }

/* bouton haut de page */
.nomad-totop {
	position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 90;
	width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--nomad-pill-grad); color: #fff; font-size: 1.3rem; box-shadow: var(--nomad-shadow);
	opacity: 0; transform: translateY(20px) scale(.8); transition: all var(--nomad-trans);
}
.nomad-totop.is-visible { opacity: 1; transform: none; }
.nomad-totop[hidden] { display: none; }

/* ----------------------------- Pagination -------------------------------- */
.pagination, .nav-links { display: flex; gap: .5rem; justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; }
.page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px;
	padding: 0 .75rem; border-radius: 999px; background: var(--nomad-bg-alt); color: var(--nomad-text); font-weight: 600;
}
.page-numbers.current { background: var(--nomad-pill-grad); color: #fff; }

/* ----------------------------- Responsive -------------------------------- */
@media (max-width: 860px) {
	.nomad-layout:has(.nomad-sidebar) { grid-template-columns: 1fr; }
	.nomad-footer__widgets--3, .nomad-footer__widgets--4 { grid-template-columns: repeat(2, 1fr); }

	.nomad-burger { display: flex; }
	.nomad-header__nav {
		position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch;
		background: var(--nomad-bg); padding: 1.5rem clamp(1rem,4vw,2.5rem); gap: 1rem;
		box-shadow: var(--nomad-shadow); transform: translateY(-120%); transition: transform var(--nomad-trans);
		max-height: calc(100dvh - 72px); overflow-y: auto;
	}
	.nomad-header__nav.is-open { transform: none; }
	.nomad-menu { flex-direction: column; gap: .75rem; }
	.nomad-menu .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding-left: 1rem; }
}
@media (max-width: 560px) {
	.nomad-footer__widgets--2, .nomad-footer__widgets--3, .nomad-footer__widgets--4 { grid-template-columns: 1fr; }
	.nomad-footer__bottom { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	[data-reveal] { opacity: 1; transform: none; }
	html { scroll-behavior: auto; }
}
