/* coachme.fun : site éditorial sur la méthode des mini-habitudes.
   Palette : ambre (la régularité, la série de jours) et vert (la progression), sur fond crème.
   Titres en Lora, texte en Nunito Sans, hébergées sur le site (aucune requête vers un tiers). */
@font-face { font-family: "Lora"; font-weight: 600; font-display: swap; src: url("/fonts/lora-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 700; font-display: swap; src: url("/fonts/lora-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 400; font-display: swap; src: url("/fonts/nunito-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/nunito-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 700; font-display: swap; src: url("/fonts/nunito-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #fffbf4;
  --surface: #ffffff;
  --sunk: #fbf3e6;
  --text: #1c1917;
  --muted: #57534e;          /* 7:1 sur le fond */
  --line: #eadfce;
  --amber: #b45309;          /* 5:1 sur le fond : liens, accents */
  --amber-soft: #fef3c7;
  --green: #047857;          /* 5,4:1 */
  --green-soft: #e3f6ec;
  --on-accent: #ffffff;
  --focus: #b45309;
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 6px 20px rgba(28, 25, 23, .06);
  --ease: 180ms ease-out;
  --wrap: 1120px;
  --read: 68ch;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171310;
  --surface: #221c17;
  --sunk: #1d1814;
  --text: #f5efe6;
  --muted: #c4b8a8;
  --line: #3a3029;
  --amber: #f5b14a;
  --amber-soft: rgba(245, 177, 74, .14);
  --green: #4fd1a5;
  --green-soft: rgba(79, 209, 165, .14);
  --on-accent: #171310;
  --focus: #f5b14a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 18px/1.7 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--amber); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- En-tête ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; min-height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.logo img { width: 36px; height: 36px; }
:root[data-theme="dark"] .logo img { filter: invert(1); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 16px; transition: background-color var(--ease), color var(--ease);
}
.nav a:hover { background: var(--sunk); }
.nav a[aria-current="page"] { background: var(--amber-soft); color: var(--amber); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: 4px; padding: 0;
  border: 1.5px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); cursor: pointer;
  transition: border-color var(--ease), background-color var(--ease);
}
.theme-toggle:hover { border-color: var(--amber); }
.theme-toggle .icon-sun, :root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ---------- Accueil ---------- */
.hero { padding: 56px 0 40px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); } }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { font-size: clamp(38px, 6vw, 60px); }
.hero .lead { margin: 18px 0 0; font-size: clamp(19px, 2.2vw, 22px); color: var(--muted); max-width: 46ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--amber); color: var(--on-accent); font-weight: 700; text-decoration: none;
  transition: transform var(--ease), box-shadow var(--ease);
}
.button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.button.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.button.ghost:hover { border-color: var(--amber); }
.tracker { padding: 24px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.tracker svg { display: block; width: 100%; height: auto; }
.tracker figcaption { margin-top: 12px; color: var(--muted); font-size: 15px; text-align: center; }
.day { fill: var(--sunk); stroke: var(--line); stroke-width: 1; }
.day.done { fill: var(--amber); stroke: none; }
.day.done.plus { fill: var(--green); }
.day-label { fill: var(--muted); font: 700 11px var(--font-body); text-anchor: middle; }

section.band { padding: 56px 0; }
section.band.sunk { background: var(--sunk); }
.band h2 { font-size: clamp(28px, 4vw, 38px); }
.band .intro { margin: 12px 0 0; max-width: 60ch; color: var(--muted); }
.grid { display: grid; gap: 18px; margin-top: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.card { padding: 22px 22px 24px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card h3 { font-size: 22px; }
.card p { margin: 8px 0 0; color: var(--muted); }
.num { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.steps li { position: relative; padding: 18px 20px 18px 72px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.steps li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 16px;
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: var(--on-accent);
  font-family: var(--font-display); font-weight: 700;
}
.steps strong { display: block; font-size: 19px; }
.steps span { color: var(--muted); }
.examples { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.examples li { padding: 14px 16px; border-left: 4px solid var(--green); border-radius: 0 12px 12px 0; background: var(--surface); }
.more { display: inline-flex; align-items: center; min-height: 44px; margin-top: 20px; font-weight: 700; }

/* ---------- Pages de lecture ---------- */
.page-head { padding-top: 48px; padding-bottom: 8px; }
.page-head h1 { font-size: clamp(34px, 5vw, 50px); max-width: 22ch; }
.page-head .lead { margin: 14px 0 0; color: var(--muted); font-size: 20px; max-width: 60ch; }
.prose { padding-bottom: 48px; }
.prose > * { max-width: var(--read); }
.prose h2 { margin: 44px 0 10px; font-size: 30px; }
.prose h3 { margin: 30px 0 8px; font-size: 23px; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose li { margin-bottom: 8px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose figure { margin: 26px 0; }
.prose figure img { display: block; width: 100%; border-radius: 12px; }
.prose blockquote { margin: 24px 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--amber); font-family: var(--font-display); font-size: 21px; }
.callout { margin: 26px 0; padding: 18px 20px; border-radius: var(--radius); background: var(--green-soft); }
.callout p:last-child { margin-bottom: 0; }
.formula { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.formula em { color: var(--amber); font-style: normal; }
.meta { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; margin: 0 0 6px; padding: 0; list-style: none; font-size: 15px; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; }
.toc { margin: 24px 0 8px; padding: 18px 22px; border-radius: var(--radius); background: var(--sunk); }
.toc p { margin: 0 0 6px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc a { display: inline-block; padding: 4px 0; }

/* Exemples de mini-habitudes */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; }
.chips a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; font-size: 16px;
}
.chips a:hover { border-color: var(--amber); color: var(--amber); }
.theme-block { scroll-margin-top: 16px; }
.theme-block .examples { margin-top: 14px; }

/* Blog */
.posts { display: grid; gap: 18px; margin: 28px 0 56px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.post-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: transform var(--ease), box-shadow var(--ease); }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(28, 25, 23, .06), 0 12px 30px rgba(28, 25, 23, .1); }
.post-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--sunk); }
.post-card .body { padding: 18px 20px 22px; }
.post-card :is(h2, h3) { font-size: 21px; }
.post-card :is(h2, h3) a { color: inherit; text-decoration: none; }
.post-card :is(h2, h3) a::after { content: ""; position: absolute; inset: 0; }
.post-card:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.post-card :is(h2, h3) a:focus-visible { outline: none; }
.post-card p { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.post-card .date { font-size: 14px; }
.post-nav { display: grid; gap: 14px; margin: 8px 0 56px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); max-width: var(--read); }
.post-nav a { display: block; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; }
.post-nav small { display: block; color: var(--muted); font-size: 14px; }
.post-nav strong { color: var(--text); }

/* À propos */
.about { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .about { grid-template-columns: minmax(0, 1fr) 300px; } }
.aside-card { padding: 22px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.aside-card h2 { font-size: 22px; margin-bottom: 8px; }
.aside-card p { margin: 0 0 10px; color: var(--muted); font-size: 16px; }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
