/* ==========================================================================
   SGH Starter — base commune (ne pas modifier pour un client : utiliser client.css)
   1. Variables  2. Base  3. Mise en page des blocs  4. En-tête  5. Pied de page
   6. Boutons  7. Composants (classes sgh-*)  8. Formulaires  9. Animations  10. Divers
   ========================================================================== */

/* 1. Variables ------------------------------------------------------------- */
:root {
	--c-bg: var(--wp--preset--color--fond, #f6f5f2);
	--c-paper: var(--wp--preset--color--papier, #fff);
	--c-ink: var(--wp--preset--color--encre, #16181c);
	--c-muted: var(--wp--preset--color--gris, #5f656d);
	--c-accent: var(--wp--preset--color--accent, #2b59c3);
	--c-night: var(--wp--preset--color--nuit, #1a1c20);
	--c-line: color-mix(in srgb, var(--c-ink) 13%, transparent);
	--f-title: var(--wp--preset--font-family--titres, system-ui, sans-serif);
	--f-text: var(--wp--preset--font-family--texte, system-ui, sans-serif);
	--w-content: var(--wp--style--global--content-size, 760px);
	--w-wide: var(--wp--style--global--wide-size, 1200px);
	--gutter: clamp(18px, 4vw, 40px);
	--section: clamp(72px, 10vw, 128px);
	--radius: 14px;
	--radius-lg: 22px;
	--shadow: 0 1px 2px rgb(20 24 28 / .05), 0 8px 24px -12px rgb(20 24 28 / .2);
	--shadow-lg: 0 2px 6px rgb(20 24 28 / .06), 0 24px 60px -24px rgb(20 24 28 / .35);
	--header-h: 76px;
	--ease: cubic-bezier(.2, .7, .2, 1);
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; background: var(--c-bg); color: var(--c-ink); font-family: var(--f-text); font-size: 1.0625rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .18em; }
h1, h2, h3, h4 { font-family: var(--f-title); line-height: 1.08; margin: 0 0 .5em; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
.screen-reader-text, .sgh-form__hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--c-ink); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.wrap { width: min(var(--w-wide), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* 3. Mise en page des blocs -------------------------------------------------- */
.entry-content > * { width: min(var(--w-content), 100% - 2 * var(--gutter)); margin-inline: auto; }
.entry-content > .alignwide { width: min(var(--w-wide), 100% - 2 * var(--gutter)); }
.entry-content > .alignfull { width: 100%; }
.entry-content > .alignfull > .wp-block-group__inner-container,
.entry-content .alignfull.is-layout-constrained > * { width: min(var(--w-content), 100% - 2 * var(--gutter)); margin-inline: auto; }
.entry-content .alignfull.is-layout-constrained > .alignwide { width: min(var(--w-wide), 100% - 2 * var(--gutter)); max-width: none; }
.entry-content .alignfull.is-layout-constrained > .alignfull { width: 100%; max-width: none; }
.site-main:not(.site-main--full) .entry-content { padding-bottom: var(--section); }
.wp-block-columns { gap: clamp(28px, 5vw, 72px); }
.wp-block-image img { border-radius: var(--radius); }
.wp-block-image.is-style-plain img { border-radius: 0; }
figure { margin: 0 0 1.5em; }
.wp-block-table table { width: 100%; border-collapse: collapse; }
.wp-block-table td, .wp-block-table th { padding: 12px 10px; border: 0; border-top: 1px solid var(--c-line); }
.wp-block-details { border-top: 1px solid var(--c-line); padding: 0; }
.wp-block-details:last-of-type { border-bottom: 1px solid var(--c-line); }
.wp-block-details summary { cursor: pointer; list-style: none; position: relative; padding: 22px 44px 22px 0; font-weight: 600; font-size: 1.1rem; }
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 14px; margin-top: -7px; background: linear-gradient(currentColor, currentColor) center / 14px 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 14px no-repeat; transition: transform .3s; }
.wp-block-details[open] summary::after { transform: rotate(45deg); }
.wp-block-details > :not(summary) { padding-right: 40px; color: var(--c-muted); }
.wp-block-cover { min-height: 420px; }
.wp-block-separator { border: 0; border-top: 1px solid var(--c-line); }

/* Pages intérieures */
.page-hero { padding: calc(var(--header-h) + clamp(48px, 8vw, 96px)) 0 clamp(32px, 5vw, 56px); }
.page-hero__title { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0; }
.page-hero__lead { margin: 18px 0 0; max-width: 620px; color: var(--c-muted); font-size: 1.15rem; }
.post-list { display: grid; gap: 40px; }
.post-item__date { color: var(--c-muted); font-size: .9rem; margin: 14px 0 4px; }
.post-item__title { font-size: 1.5rem; }
.post-item__title a { text-decoration: none; }

/* 4. En-tête --------------------------------------------------------------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 50; transition: background .3s, box-shadow .3s, color .3s; }
.site-header.is-solid, body:not(.has-dark-hero) .site-header { background: color-mix(in srgb, var(--c-bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--c-line); }
.has-dark-hero .site-header:not(.is-solid) { color: #fff; }
.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }
.site-header__in { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.site-logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.site-logo img { max-height: 44px; width: auto; }
.site-logo__text { font-family: var(--f-title); font-weight: 800; font-size: 1.15rem; }
.site-nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.site-nav__list, .lang-switch { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.site-nav__list a { text-decoration: none; font-weight: 500; font-size: .95rem; opacity: .85; }
.site-nav__list a:hover, .site-nav__list .current-menu-item:not(.menu-item-type-custom) > a { opacity: 1; }
.site-nav__list .sub-menu { display: none; }
.lang-switch { gap: 2px; border: 1.5px solid currentColor; border-radius: 999px; padding: 3px; }
.lang-switch a { display: block; padding: 4px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-decoration: none; }
.lang-switch .is-current { background: currentColor; }
.lang-switch .is-current { color: inherit; }
.lang-switch .is-current::selection { background: none; }
.burger { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: none; color: inherit; cursor: pointer; }
.burger__bars, .burger__bars::before, .burger__bars::after { display: block; width: 24px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s, opacity .3s; position: relative; margin: auto; }
.burger__bars::before, .burger__bars::after { content: ""; position: absolute; left: 0; }
.burger__bars::before { top: -7px; }
.burger__bars::after { top: 7px; }
.nav-open .burger__bars { background: transparent; }
.nav-open .burger__bars::before { transform: translateY(7px) rotate(45deg); }
.nav-open .burger__bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1020px) {
	.burger, .site-logo { position: relative; z-index: 2; }
	.burger { display: block; }
	.site-nav { position: fixed; inset: 0; z-index: 1; flex-direction: column; align-items: stretch; gap: 28px; padding: calc(var(--header-h) + 24px) var(--gutter) 32px; background: var(--c-bg); color: var(--c-ink); transform: translateY(-100%); visibility: hidden; transition: transform .45s cubic-bezier(.7, 0, .2, 1), visibility 0s .45s; overflow-y: auto; }
	.nav-open .site-nav { transform: none; visibility: visible; transition-delay: 0s; }
	body.nav-open .site-header { color: var(--c-ink) !important; background: var(--c-bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
	/* backdrop-filter sur l'en-tête enfermerait le menu plein écran dans la hauteur de l'en-tête */
	.site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
	.site-nav__list a { display: block; padding: 12px 0; border-bottom: 1px solid var(--c-line); font-family: var(--f-title); font-weight: 800; font-size: 1.9rem; opacity: 1; }
	.site-nav__list .sub-menu { display: block; padding-left: 16px; list-style: none; }
	.lang-switch { align-self: flex-start; }
	.lang-switch .is-current { color: var(--c-bg); background: var(--c-ink); }
	.nav-open { overflow: hidden; }
}

/* 5. Pied de page ---------------------------------------------------------- */
.site-footer { background: var(--c-night); color: rgb(255 255 255 / .72); padding: 72px 0 32px; font-size: .95rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer__in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer .site-logo { color: #fff; margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid rgb(255 255 255 / .12); font-size: .85rem; color: rgb(255 255 255 / .5); }
.site-footer__legal ul { display: flex; flex-wrap: wrap; gap: 18px; }
@media (max-width: 800px) { .site-footer__in { grid-template-columns: 1fr; } }

/* 6. Boutons --------------------------------------------------------------- */
.wp-element-button, .wp-block-button__link, .sgh-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 24px; border-radius: 999px; border: 1.5px solid transparent;
	background: var(--c-accent); color: #fff; font: 600 .97rem/1.2 var(--f-text); text-decoration: none; cursor: pointer;
	transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.wp-element-button:hover, .wp-block-button__link:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--c-accent) 82%, #000); color: #fff; }
.is-style-outline > .wp-block-button__link { background: transparent; border-color: currentColor; color: inherit; }
.is-style-outline > .wp-block-button__link:hover { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }
.is-style-dark > .wp-block-button__link { background: var(--c-ink); }
.is-style-light > .wp-block-button__link { background: #fff; color: var(--c-ink); }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }

/* 7. Composants (classe à poser dans « Classe(s) CSS additionnelle(s) ») ------------- */
/* Section : groupe pleine largeur avec marges verticales. Variantes : is-paper, is-dark */
.sgh-section { padding-block: var(--section); }
.sgh-section.is-paper { background: var(--c-paper); }
.sgh-section.is-dark { background: var(--c-night); color: #fff; }
.sgh-section:not(.is-paper):not(.is-dark) + .sgh-section:not(.is-paper):not(.is-dark) { padding-top: 0; }
.sgh-title { font-size: var(--wp--preset--font-size--titre, clamp(2rem, 4.2vw, 3.4rem)); font-weight: 800; letter-spacing: -.02em; line-height: 1.02; }
.sgh-lead { color: var(--c-muted); font-size: 1.15rem; max-width: 600px; }
.is-dark .sgh-lead { color: rgb(255 255 255 / .75); }
/* Bandeau d'ouverture : bloc Couverture pleine hauteur */
.sgh-hero.wp-block-cover { min-height: 100svh; align-items: flex-end; padding: calc(var(--header-h) + 64px) 0 clamp(48px, 7vw, 84px); }
.sgh-hero .wp-block-cover__inner-container { width: min(var(--w-wide), 100% - 2 * var(--gutter)); }
.sgh-hero h1 { font-size: clamp(2.5rem, 6.4vw, 5.25rem); font-weight: 800; line-height: .98; letter-spacing: -.02em; max-width: 12ch; }
/* Liste à puces sobre (trait coloré) */
.sgh-dash { list-style: none; padding: 0; display: grid; gap: 16px; }
.sgh-dash li { position: relative; padding-left: 26px; }
.sgh-dash li::before { content: ""; position: absolute; left: 0; top: .72em; width: 12px; height: 2px; background: var(--c-accent); }
/* Liste numérotée en étapes */
.sgh-steps { list-style: none; counter-reset: step; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 36px; }
.sgh-steps > li { counter-increment: step; }
.sgh-steps > li::before { content: counter(step, decimal-leading-zero); display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 22px; border-radius: 50%; background: var(--c-accent); color: #fff; font: 800 .95rem var(--f-title); }
/* Image avec ombre et coins arrondis */
.sgh-photo img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

/* 8. Formulaires ----------------------------------------------------------- */
.sgh-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.sgh-form__field { margin: 0; display: grid; gap: 6px; }
.sgh-form__field.is-wide, .sgh-form__submit { grid-column: 1 / -1; }
.sgh-form label { font-weight: 600; font-size: .92rem; }
.sgh-form input:not([type="checkbox"]), .sgh-form select, .sgh-form textarea { width: 100%; padding: 13px 14px; border: 1.5px solid var(--c-line); border-radius: 10px; background: var(--c-paper); font: inherit; color: inherit; }
.sgh-form input:focus, .sgh-form select:focus, .sgh-form textarea:focus { border-color: var(--c-accent); outline: none; }
.sgh-form__check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.sgh-form__check input { margin-top: 4px; }
.sgh-form .req { color: var(--c-accent); }
.sgh-form__notice { padding: 14px 18px; border-radius: 10px; font-weight: 600; }
.sgh-form__notice.is-success { background: #e3f1e8; color: #1f5c38; }
.sgh-form__notice.is-error { background: #fbe6e4; color: #8a1f17; }
/* Choix en boutons et formulaires en étapes */
.sgh-form__label { font-weight: 600; font-size: .92rem; }
.sgh-form__choices { display: flex; flex-wrap: wrap; gap: 8px; }
.sgh-form__choice { position: relative; cursor: pointer; }
.sgh-form__choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.sgh-form__choice span { display: block; padding: 10px 16px; border: 1.5px solid var(--c-line); border-radius: 999px; background: var(--c-paper); font-weight: 500 !important; font-size: .95rem; transition: background .15s, border-color .15s, color .15s; }
.sgh-form__choice input:checked + span { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }
.sgh-form__choice input:focus-visible + span { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.sgh-form__step { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin: 0; padding: 0; border: 0; min-width: 0; }
.sgh-form__step legend { padding: 0; margin-bottom: 4px; font: 800 1.3rem var(--f-title); }
.sgh-form__step legend, .sgh-form__intro { grid-column: 1 / -1; }
.sgh-form__intro { margin: -8px 0 4px; color: var(--c-muted); }
.sgh-form.is-steps .sgh-form__step:not(.is-current) { display: none; }
.sgh-form.is-steps:not(.is-last) .sgh-form__submit { display: none; }
.sgh-form__nav { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; }
.sgh-form .is-back { background: transparent; color: inherit; border-color: currentColor; }
.sgh-form__progress { grid-column: 1 / -1; display: flex; gap: 6px; }
.sgh-form__progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--c-line); transition: background .3s; }
.sgh-form__progress i.is-done { background: var(--c-ink); }
.sgh-form__count { margin-left: auto; color: var(--c-muted); font-size: .85rem; }
@media (max-width: 640px) { .sgh-form, .sgh-form__step { grid-template-columns: 1fr; } }

/* 9. Animations : apparition au défilement (ajoutée par main.js) ------------- */
.js .sgh-reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js .sgh-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.js .sgh-reveal { opacity: 1; transform: none; transition: none; }
}

/* 10. Divers --------------------------------------------------------------- */
.has-text-align-center { text-align: center; }
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.wp-block-group.is-layout-flex { display: flex; gap: 20px; flex-wrap: wrap; }
.wp-block-group.is-vertical { flex-direction: column; }
.sgh-form.is-steps .sgh-form__submit { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 12px; }

/* 11. Articles et boutique --------------------------------------------------- */
.post-hero__meta { margin: 0 0 14px; font-size: .9rem; color: var(--c-muted); }
.post-hero__meta a { color: var(--c-accent); font-weight: 600; text-decoration: none; }
.post-hero__img { width: min(var(--w-wide), 100% - 2 * var(--gutter)); margin: 0 auto clamp(32px, 5vw, 56px); }
.post-hero__img img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius-lg); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: var(--section); }
.post-nav a { display: block; padding: 18px 20px; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-paper); text-decoration: none; font-weight: 600; line-height: 1.35; }
.post-nav a span { display: block; margin-bottom: 4px; font-size: .8rem; font-weight: 500; color: var(--c-muted); }
.post-nav__next { grid-column: 2; text-align: right; }
.site-main--post .entry-content { padding-bottom: clamp(40px, 6vw, 72px); }
.sgh-shop { padding-bottom: var(--section); }
.sgh-shop .woocommerce-breadcrumb { font-size: .875rem; color: var(--c-muted); margin-bottom: 20px; }
.woocommerce ul.products li.product a img { border-radius: var(--radius); }
.woocommerce .button, .woocommerce button.button, .woocommerce a.button, .woocommerce input.button { border-radius: 999px; }
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } .post-nav__next { grid-column: auto; } }
