/*
 * RunMotion v2 — styles communs (chargés partout).
 * Les tokens viennent de theme.json ; ces alias raccourcissent les feuilles des blocs.
 */
:root {
	--rm-bg: var(--wp--preset--color--bg);
	--rm-surface: var(--wp--preset--color--surface);
	--rm-surface-alt: var(--wp--preset--color--surface-alt);
	--rm-chip: var(--wp--preset--color--chip);
	--rm-footer: var(--wp--preset--color--footer);
	--rm-ink: var(--wp--preset--color--ink);
	--rm-ink-muted: var(--wp--preset--color--ink-muted);
	--rm-ink-subtle: var(--wp--preset--color--ink-subtle);
	--rm-line: var(--wp--preset--color--line);
	--rm-line-soft: var(--wp--preset--color--line-soft);
	--rm-line-strong: var(--wp--preset--color--line-strong);
	--rm-green: var(--wp--preset--color--green);
	--rm-on-green: var(--wp--preset--color--on-green);
	--rm-green-soft: var(--wp--preset--color--green-soft);
	--rm-green-tint: var(--wp--preset--color--green-tint);
	--rm-green-line: var(--wp--preset--color--green-line);
	--rm-link: var(--wp--preset--color--link);
	--rm-link-hover: var(--wp--preset--color--link-hover);
	--rm-focus: var(--wp--preset--color--focus);
	--rm-scrim: var(--wp--preset--color--scrim);
	--rm-shadow-card: var(--wp--preset--shadow--card);
	--rm-shadow-raised: var(--wp--preset--shadow--raised);
	--rm-r-sm: var(--wp--custom--radius--sm);
	--rm-r-md: var(--wp--custom--radius--md);
	--rm-r-lg: var(--wp--custom--radius--lg);
	--rm-r-xl: var(--wp--custom--radius--xl);
	--rm-r-pill: var(--wp--custom--radius--pill);
	--rm-gutter: var(--wp--preset--spacing--20);
	--rm-section: var(--wp--preset--spacing--30);
	--rm-header-h: var(--wp--custom--header--height-mobile);
}
@media (min-width: 1100px) {
	:root { --rm-header-h: var(--wp--custom--header--height); }
}

html { scroll-padding-top: calc(var(--rm-header-h) + 16px); }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; }
:where(h1, h2, h3, h4) { text-wrap: balance; overflow-wrap: break-word; }
@media (max-width: 480px) {
	:where(h1, h2) { hyphens: auto; -webkit-hyphens: auto; } /* Mots longs en capitales sur petit écran. */
}
.tabular, :where(table) { font-variant-numeric: tabular-nums; }

/* Focus clavier : 2 px plein, décalé de 2 px, sur tous les éléments interactifs. */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--rm-focus);
	outline-offset: 2px;
}

/* Textes masqués visuellement mais lus par les lecteurs d'écran. */
.screen-reader-text, .rm-sr {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Lien d'évitement. */
.rm-skip {
	position: absolute; left: 16px; top: -100px; z-index: 1000;
	background: var(--rm-surface); color: var(--rm-ink); font-weight: 700;
	padding: 12px 18px; border-radius: var(--rm-r-pill); box-shadow: var(--rm-shadow-raised);
	text-decoration: none;
}
.rm-skip:focus { top: 12px; }

/* Conteneur de contenu : 1280 px max, marges 80 px → 20 px. */
.rm-container {
	box-sizing: border-box; width: 100%; max-width: calc(1280px + 2 * var(--rm-gutter));
	margin-inline: auto; padding-inline: var(--rm-gutter);
}

/* ---- Boutons (design system : md / lg / block) ---- */
.rm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	box-sizing: border-box; min-height: 44px; border: 2px solid transparent;
	border-radius: var(--rm-r-pill); font-family: inherit; text-decoration: none; cursor: pointer;
	white-space: nowrap; transition: filter .15s ease;
}
.rm-btn--primary, .rm-btn--primary:hover, .rm-btn--primary:visited { background: var(--rm-green); color: var(--rm-on-green); }
.rm-btn--primary:hover { filter: brightness(1.06); }
.rm-btn--secondary { background: transparent; border-color: var(--rm-green-line); color: var(--rm-ink); }
.rm-btn--secondary:hover { border-color: var(--rm-green); color: var(--rm-ink); }
.rm-btn--md { font-size: 15px; font-weight: 800; line-height: 1.2; padding: 11px 20px; }
.rm-btn--lg { font-size: 17px; font-weight: 700; line-height: 1.2; letter-spacing: .01em; text-transform: uppercase; padding: 15px 30px; }
.rm-btn--sm { font-size: 13px; font-weight: 800; line-height: 1.2; padding: 10px 14px; min-height: 40px; }
.rm-btn--block { display: flex; width: 100%; white-space: normal; text-align: center; }
.rm-btn__arrow { font-size: 1.15em; line-height: 1; }

/* Liens texte du design system. */
.rm-link { color: var(--rm-link); font-weight: 700; text-decoration: none; }
.rm-link:hover { color: var(--rm-link-hover); }

/* Bouton core/button aligné sur le design system. */
.wp-block-button__link { min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
.wp-block-button.is-style-lg .wp-block-button__link { font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; padding: 15px 30px; }
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; border: 2px solid var(--rm-green-line); color: var(--rm-ink); }

/* ---- Motif « courbes de niveau » sous voile blanc 88 % (une section par page au plus) ---- */
.is-style-topo {
	background-color: var(--rm-bg);
	background-image: linear-gradient(var(--wp--custom--topo-veil), var(--wp--custom--topo-veil)), url("../img/courbes-de-niveau.svg");
	background-size: cover; background-position: center;
}

/* Barre CTA mobile : réserve sa hauteur en bas de page pour ne rien masquer. */
@media (max-width: 1099px) {
	body.has-rm-mobile-cta { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* Les parties de gabarit n'ajoutent pas de boîte (sinon l'en-tête collant ne colle plus). */
.wp-block-template-part.rm-part { display: contents; }

/*
 * Mode « app » (?app=true, inc/app-mode.php) : la personne a déjà l'application ;
 * on retire tout ce qui pousse vers l'essai 7 jours, Premium ou les stores.
 */
html.rm-app a[href^="https://go.run-motion.com"],
html.rm-app .rm-ctabar,
html.rm-app .rm-mmenu__note,
html.rm-app .rm-hero-home__cta,
html.rm-app .rm-cfg__note--center,
html.rm-app .rm-plan-promo,
html.rm-app .rm-inline-cta,
html.rm-app .rm-promo-card--app,
html.rm-app .rm-cta-final,
html.rm-app .rm-pricing,
html.rm-app .rm-home-section:has(.rm-pricing),
html.rm-app .rm-button-wrap:has(> a[href^="https://go.run-motion.com"]),
html.rm-app .rm-stores,
html.rm-app li:has(> a[href*="run-motion.com/premium"]) { display: none !important; }
html.rm-app body.has-rm-mobile-cta { padding-bottom: 0; }
@media (max-width: 1099px) {
	html.rm-app body.has-rm-mobile-cta .rm-lang-hint { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
