/* ============================================================
   blog.madior.fr — feuille de style éditoriale
   Reprend la charte MADIOR (assets/css/madior.css + madior-sig/charte) :
   palette identique, Newsreader serif éditorial, cuivre, dark/light.
   Site statique autonome (aucun bundler).
   ============================================================ */

/* ---- Tokens (thème sombre = défaut, comme madior.css) ---- */
:root {
  --bg: #1e1e22;
  --surface: #26262c;
  --surface-2: #2e2e34;
  --text-main: #e8e8ec;
  --text-muted: #8a8a94;
  --copper: #d4a574;
  --copper-glow: rgba(212, 165, 116, 0.14);
  --line: rgba(255, 255, 255, 0.08);

  --font-d: 'Poppins', sans-serif;          /* display / wordmark */
  --font-b: 'Inter', system-ui, sans-serif;  /* corps */
  --font-t: 'JetBrains Mono', ui-monospace, monospace; /* eyebrow mono */
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif; /* titres éditoriaux */
  --ease: cubic-bezier(0.19, 1, 0.22, 1);

  --maxw: 1120px;
  --read: 720px; /* colonne de lecture article */
}

[data-theme="light"] {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f5f0ea;
  --text-main: #1a1a1a;
  --text-muted: #555558; /* AA+ (>7:1) */
  --copper: #b8865a;
  --copper-glow: rgba(184, 134, 90, 0.16);
  --line: rgba(26, 26, 26, 0.10);
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-b);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

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

/* ---- Skip link (a11y) ---- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--copper); color: #000; padding: 12px 20px;
  font-family: var(--font-t); font-size: .75rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Conteneurs ---- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.eyebrow {
  font-family: var(--font-t); font-size: .72rem; letter-spacing: .26em;
  text-transform: uppercase; color: var(--copper); font-weight: 500;
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 18px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--copper); }

/* ---- En-tête (chrome MADIOR — aligné sur madior.fr) ---- */
nav#mainNav {
  position: sticky; top: 0; z-index: 100; width: 100%;
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
nav#mainNav .nav-container {
  width: 100%; max-width: none; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
  padding: 6px clamp(20px, 4vw, 40px);
}
.nav-brand { display: inline-flex; align-items: center; margin: 0; text-decoration: none; }
.nav-brand .nav-logo-img { max-height: 32px; width: auto; height: auto; object-fit: contain; display: block; }
.nav-main { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 45px); flex: 1; }
.nav-item {
  font-family: var(--font-t); font-size: .68rem; color: var(--text-muted);
  text-decoration: none; transition: color .3s; text-transform: uppercase;
  letter-spacing: .12em; padding: 8px 0; cursor: pointer;
}
.nav-item:hover, .nav-item.active, .nav-item[aria-current="page"] { color: var(--copper); }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.lang-switch { display: flex; gap: 2px; font: 600 .65rem var(--font-t); letter-spacing: .04em; }
.lang-btn { padding: 4px 8px; border: 1px solid var(--line); background: transparent; color: var(--text-muted); cursor: pointer; font: inherit; letter-spacing: inherit; border-radius: 0 4px 4px 0; }
.lang-btn:first-child { border-radius: 4px 0 0 4px; }
.lang-btn.active { background: color-mix(in srgb, var(--copper) 15%, transparent); border-color: color-mix(in srgb, var(--copper) 30%, transparent); color: var(--copper); }
.lang-btn[disabled] { opacity: .45; cursor: not-allowed; }
.theme-switch {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .3s;
}
.theme-switch:hover { border-color: var(--copper); transform: rotate(90deg); }
.theme-switch svg { width: 14px; height: 14px; stroke: var(--text-muted); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .3s; }
.theme-switch:hover svg { stroke: var(--copper); }
.theme-switch .icon-sun { display: block; }
.theme-switch .icon-moon { display: none; }
[data-theme="light"] .theme-switch .icon-sun { display: none; }
[data-theme="light"] .theme-switch .icon-moon { display: block; }
.nav-phone {
  font-family: var(--font-t); font-size: .7rem; color: var(--copper); text-decoration: none;
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  border: 1px solid color-mix(in srgb, var(--copper) 30%, transparent); border-radius: 6px; transition: .3s;
}
.nav-phone:hover { background: color-mix(in srgb, var(--copper) 10%, transparent); border-color: var(--copper); }
.nav-cta {
  padding: 10px 24px; background: linear-gradient(135deg, var(--copper), #b07550);
  color: #fff; text-decoration: none; font-family: var(--font-d); font-weight: 600; font-size: .65rem;
  letter-spacing: .1em; border-radius: 6px; transition: .3s; box-shadow: 0 2px 8px color-mix(in srgb, var(--copper) 30%, transparent);
  white-space: nowrap;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 4px 16px color-mix(in srgb, var(--copper) 50%, transparent); }
.menu-toggle {
  display: none; width: 30px; height: 22px; position: relative; cursor: pointer;
  background: none; border: 0; padding: 0; flex-direction: column; justify-content: space-between;
}
.menu-toggle span { display: block; width: 100%; height: 2px; background: var(--text-main); transition: .3s; border-radius: 2px; }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(7px, 7px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

/* ---- Hero du blog ---- */
.blog-hero { padding: clamp(56px, 9vw, 104px) 0 clamp(34px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.blog-hero h1 {
  font-family: var(--serif); font-weight: 400; text-transform: none;
  font-size: clamp(2.4rem, 5.6vw, 4.1rem); line-height: 1.04; letter-spacing: -.02em;
  margin: 0 0 .35em; color: var(--text-main); max-width: 16ch;
}
.blog-hero h1 em { font-style: italic; color: var(--copper); }
.blog-hero .lead { font-size: clamp(1.02rem, 1.6vw, 1.22rem); color: var(--text-muted); max-width: 60ch; margin: 0; line-height: 1.6; }
.hero-rule { height: 1px; width: 46%; max-width: 320px; margin: 28px 0 0; background: linear-gradient(90deg, var(--copper), transparent); }

/* ---- Liste d'articles ---- */
.posts { padding: clamp(40px, 6vw, 72px) 0 clamp(20px, 4vw, 40px); }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: clamp(20px, 2.4vw, 32px); }
.post-card {
  display: flex; flex-direction: column; padding: 28px 26px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: var(--text-main);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.post-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--copper) 50%, var(--line)); box-shadow: 0 18px 40px -24px var(--copper-glow); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; font-family: var(--font-t); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.post-tag { color: var(--copper); border: 1px solid color-mix(in srgb, var(--copper) 45%, transparent); border-radius: 100px; padding: 3px 10px; }
.post-card h2 { font-family: var(--serif); font-weight: 400; text-transform: none; font-size: 1.55rem; line-height: 1.16; letter-spacing: -.01em; margin: 0 0 .5em; }
.post-card:hover h2 { color: var(--copper); }
.post-card .excerpt { color: var(--text-muted); font-size: .95rem; line-height: 1.65; margin: 0 0 18px; flex: 1; }
.post-card .more { font-family: var(--font-t); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--copper); }

/* ---- Article (page de lecture) ---- */
.article { padding: clamp(40px, 6vw, 72px) 0 0; }
.breadcrumb { font-family: var(--font-t); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 26px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--copper); }
.article-head { max-width: var(--read); margin: 0 auto; }
.article-head h1 { font-family: var(--serif); font-weight: 400; text-transform: none; font-size: clamp(2.1rem, 4.4vw, 3.2rem); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .4em; }
.article-head .article-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-family: var(--font-t); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px; }
.article-head .standfirst { font-family: var(--serif); font-style: italic; font-size: clamp(1.12rem, 1.8vw, 1.4rem); line-height: 1.5; color: var(--text-muted); margin: 18px 0 0; }
.article-rule { height: 1px; width: 100%; max-width: var(--read); margin: 38px auto; background: var(--line); }

.prose { max-width: var(--read); margin: 0 auto; }
.prose > * + * { margin-top: 1.35em; }
.prose h2 { font-family: var(--serif); font-weight: 500; text-transform: none; font-size: 1.85rem; line-height: 1.2; letter-spacing: -.01em; margin-top: 2.2em; }
.prose h3 { font-family: var(--serif); font-weight: 500; text-transform: none; font-size: 1.35rem; line-height: 1.3; margin-top: 1.8em; }
.prose h2 + p, .prose h3 + p { margin-top: .7em; }
.prose p, .prose li { color: var(--text-main); font-size: 1.06rem; line-height: 1.8; }
.prose a { color: var(--copper); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .5em; }
.prose strong { color: var(--text-main); font-weight: 600; }
.prose blockquote { margin: 1.8em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--copper); font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--text-muted); }
.prose code { font-family: var(--font-t); font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; color: var(--copper); }
.prose .formula { font-family: var(--font-t); background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--copper); border-radius: 6px; padding: 16px 20px; font-size: .96rem; color: var(--text-main); overflow-x: auto; }
.prose figure { margin: 2em 0; }
.prose figcaption { font-family: var(--font-t); font-size: .72rem; letter-spacing: .08em; color: var(--text-muted); margin-top: 10px; text-transform: uppercase; }

.prose table { width: 100%; border-collapse: collapse; font-size: .96rem; margin: 1.6em 0; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--font-t); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--copper); }

/* ---- Encart CTA produit (« TP MADIOR ») ---- */
.cta-box { max-width: var(--read); margin: 2.4em auto; padding: 28px 28px 26px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--copper) 30%, var(--line)); border-radius: 10px; }
.cta-box .eyebrow { margin-bottom: 12px; }
.cta-box p { margin: 0 0 18px; color: var(--text-muted); font-size: 1rem; }
.btn { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-t); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; padding: 12px 22px; border-radius: 5px; transition: filter .25s, transform .25s, color .25s, background .25s; }
.btn-primary { background: var(--copper); color: var(--bg); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--copper); color: var(--copper); }
.btn-ghost:hover { background: var(--copper); color: var(--bg); }

/* ---- Veille réglementaire (liste de fiches sourcées) ---- */
.veille-list { max-width: var(--read); margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.veille-item { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--copper); border-radius: 8px; padding: 22px 24px; }
.veille-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; font-family: var(--font-t); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 10px; }
.veille-head .vdate { color: var(--copper); }
.veille-head .vtag { border: 1px solid color-mix(in srgb, var(--copper) 45%, transparent); border-radius: 100px; padding: 2px 9px; color: var(--copper); }
.veille-item h3 { font-family: var(--serif); font-weight: 500; font-size: 1.32rem; line-height: 1.25; margin: 0 0 .5em; color: var(--text-main); }
.veille-item p { color: var(--text-main); font-size: 1rem; line-height: 1.7; margin: 0 0 12px; }
.veille-item ul { margin: 8px 0 12px; padding-left: 1.2em; color: var(--text-main); font-size: .98rem; line-height: 1.65; }
.veille-item li + li { margin-top: 4px; }
.veille-source { display: flex; flex-wrap: wrap; gap: 14px; font-family: var(--font-t); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; padding-top: 12px; border-top: 1px solid var(--line); }
.veille-source a { color: var(--copper); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--copper) 40%, transparent); padding-bottom: 1px; }
.veille-source a:hover { color: var(--text-main); border-color: var(--copper); }
.veille-source .vlabel { color: var(--text-muted); }

/* ---- Newsletter ---- */
.newsletter { margin: clamp(48px, 7vw, 88px) 0; }
.newsletter .inner { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: clamp(32px, 5vw, 56px); text-align: center; }
.newsletter h2 { font-family: var(--serif); font-weight: 400; text-transform: none; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.1; margin: 0 0 .3em; }
.newsletter p { color: var(--text-muted); max-width: 52ch; margin: 0 auto 26px; }
.news-form { display: flex; gap: 10px; max-width: 440px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.news-form input { flex: 1; min-width: 220px; padding: 13px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; color: var(--text-main); font-family: var(--font-b); font-size: .95rem; }
.news-form input::placeholder { color: var(--text-muted); }
.news-form .form-note { width: 100%; font-family: var(--font-t); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-top: 4px; }

/* ---- Pied de page (chrome MADIOR — aligné sur madior.fr) ---- */
.contact-footer { border-top: 1px solid var(--line); padding: 22px 0 28px; margin-top: 48px; background: transparent; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-bottom > div { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.footer-copy { font-size: .72rem; color: var(--text-muted); font-family: var(--font-t); letter-spacing: .04em; }
.footer-link-small { color: var(--text-muted); text-decoration: none; font-size: 11px; font-family: var(--font-t); letter-spacing: .04em; transition: color .3s; }
.footer-link-small:hover { color: var(--copper); }
.footer-social { display: flex; align-items: center; gap: 14px; }
.footer-social a { color: var(--text-muted); transition: color .2s; display: inline-flex; }
.footer-social a:hover { color: var(--copper); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .nav-main {
    display: none; position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: color-mix(in srgb, var(--bg) 98%, transparent);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 24px clamp(20px, 5vw, 40px); z-index: 99; overflow-y: auto;
  }
  .nav-main.mobile-open { display: flex; }
  .nav-item { width: 100%; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: .82rem; }
  .menu-toggle { display: flex; }
  .nav-phone { font-size: .6rem; padding: 6px 10px; }
  .nav-phone .phone-text { display: none; }
  .nav-cta { padding: 8px 16px; font-size: .6rem; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .posts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .nav-phone { display: none; }
  .lang-switch { display: none; }
  .nav-cta { padding: 6px 12px; font-size: .55rem; }
}
