/* WTC Marlière — feuille de style commune */

:root {
  --ink: #0E2433;
  --primary: #0B5C7A;
  --primary-dark: #073F55;
  --accent: #2FA3C7;
  --sky: #7FC4DB;
  --bg: #F4F8FA;
  --white: #FFFFFF;
  --line: #DCE6EC;
  --line-soft: #EDF2F4;
  --border: #B9CCD6;
  --soft: #E3EEF3;
  --muted: #4A6373;
  --text-2: #33505F;
  --on-dark: #C9DCE5;
  --on-primary: #D3E8F0;
  --footer: #9FB8C5;
  --red: #A3271D;
  --red-bg: #FBEDEB;
  --red-text: #4B2C29;
  --warn-bg: #FFF1CC;
  --warn-line: #E8C86A;
  --warn-text: #4A3200;
  --ok-bg: #E3F3EA;
  --ok-text: #1E6B43;

  --font-display: Manrope, sans-serif;
  --font-body: 'Source Sans 3', sans-serif;
}

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

/* Défilement fluide vers les ancres (#analyses, #devis…), sauf si l'utilisateur réduit les animations */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* Laisse la place à l'en-tête collant quand on arrive sur une section */
[id] { scroll-margin-top: 90px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
[hidden] { display: none !important; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  border: 0;
  border-radius: 12px;
  padding: 14px 22px;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { color: var(--white); background: var(--primary-dark); }
.btn-light { background: var(--white); color: var(--ink); }
.btn-light:hover { color: var(--ink); }
.btn-ghost-dark { border: 1.5px solid rgba(255,255,255,.45); color: var(--white); }
.btn-ghost-dark:hover { color: var(--white); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-sm { padding: 12px 20px; border-radius: 10px; }
.btn-lg { padding: 16px 26px; }

.link-strong { font-family: var(--font-display); font-weight: 700; }
.back-link {
  background: none; border: 0; padding: 8px 0; cursor: pointer;
  color: var(--primary); font-family: var(--font-display); font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}

/* ---------- Pastilles / filtres ---------- */
.chip {
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}
.chip[aria-pressed="true"], .chip[aria-selected="true"] { border-color: var(--primary); background: var(--primary); color: var(--white); }
.chip-lg { padding: 14px 22px; font-size: 15px; }
.tag {
  display: inline-block;
  background: var(--soft); color: var(--primary);
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  padding: 6px 12px; border-radius: 999px;
}
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--soft); color: var(--primary); }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.badge-warn { background: var(--warn-bg); color: #6B4A00; }
.badge-bad { background: var(--red-bg); color: var(--red); }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.field input, .field select, .field textarea {
  padding: 13px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--white); color: var(--ink); font-weight: 400;
}
.field textarea { resize: vertical; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }
/* Le logo garde toujours ses proportions : il ne rétrécit pas quand la navigation manque de place */
.site-header .logo { flex: none; display: block; }
.site-header .logo img { height: 48px; width: auto; max-width: none; display: block; object-fit: contain; }
@media (max-width: 380px) { .site-header .logo img { height: 40px; } }
.navlinks { display: flex; gap: 26px; align-items: center; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.navlinks a { color: var(--ink); text-decoration: none; white-space: nowrap; }
.navlinks a[aria-current="page"] { color: var(--primary); font-weight: 700; }
.navlinks .nav-account { display: flex; align-items: center; gap: 8px; }
.navlinks .btn { color: var(--white); padding: 12px 20px; border-radius: 10px; }
.burger {
  display: none; width: 48px; height: 48px; border: 1px solid var(--line); background: var(--white);
  border-radius: 10px; align-items: center; justify-content: center; cursor: pointer;
}
.mobile-menu { display: flex; flex-direction: column; gap: 4px; padding: 8px 32px 20px; font-family: var(--font-display); font-weight: 600; }
.mobile-menu a { padding: 12px 0; color: var(--ink); text-decoration: none; }
.mobile-menu .btn { padding: 14px 18px; color: var(--white); text-align: center; border-radius: 10px; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--ink); color: var(--footer); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 32px; padding-bottom: 32px; }
.site-footer a { color: var(--footer); }

/* ---------- Bandeau de page (pages internes) ---------- */
.page-hero { background: var(--ink); color: var(--white); }
.page-hero .wrap { padding-top: 80px; padding-bottom: 72px; }
.page-hero h1 { font-size: 52px; line-height: 1.08; letter-spacing: -1px; max-width: 16em; }
.page-hero p { margin: 18px 0 0; font-size: 19px; color: var(--on-dark); max-width: 36em; }

.sec-title { font-size: 40px; line-height: 1.15; letter-spacing: -.8px; }
.sec-intro { margin: 14px 0 0; color: var(--text-2); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 20px; }
.card-h { transition: transform .25s ease, box-shadow .25s ease; }
.card-h:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(14,36,51,.12); }
.placeholder-img {
  background: var(--soft); display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px;
}
.avatar { border-radius: 50%; object-fit: cover; object-position: 50% 25%; flex: none; }
.avatar-empty { border-radius: 50%; background: var(--line); flex: none; display: inline-block; }

/* Liste d'articles (Articles + profil) */
.article-list { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1.5px solid var(--ink); }
.article-list li { border-bottom: 1px solid var(--line); }
.article-row {
  width: 100%; text-align: left; cursor: pointer; background: transparent; border: 0;
  display: grid; grid-template-columns: minmax(130px, 170px) 1fr auto; gap: 10px 28px; align-items: center;
  padding: 22px 12px; color: var(--ink); text-decoration: none; transition: background .2s ease;
}
.article-row:hover { background: var(--white); color: var(--ink); }
.article-row .cat { font-size: 14px; color: var(--primary); font-weight: 600; }
.article-row .title { display: block; font-family: var(--font-display); font-weight: 800; font-size: 21px; line-height: 1.3; }
.article-row .meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.article-row .meta strong { color: var(--ink); }
.article-row .when { font-size: 14px; color: var(--muted); white-space: nowrap; }

/* Lecture d'un article */
.article { max-width: 780px; padding-top: 28px; padding-bottom: 104px; }
.article .kicker { margin: 28px 0 0; font-family: var(--font-display); font-weight: 700; color: var(--primary); }
.article h1 { margin-top: 8px; font-size: 44px; line-height: 1.12; letter-spacing: -.8px; }
.article .byline { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); font-size: 15px; }
.article .byline a { color: var(--ink); font-weight: 700; }
.article .cover { margin-top: 28px; height: 300px; border-radius: 20px; }
.article h2 { margin: 30px 0 0; font-size: 24px; }
.article h2:first-of-type { margin-top: 36px; }
.article h2 + p { margin: 10px 0 0; color: var(--text-2); }
.article .cta { margin-top: 40px; padding: 24px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; border-radius: 16px; }
.article .cta .btn { color: var(--white); }

/* Animations */
@keyframes inview { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.view { animation: inview .4s cubic-bezier(.2,.7,.2,1) both; }

@media (max-width: 820px) {
  .navlinks { display: none; }
  .burger { display: flex; }
  .page-hero h1, .article h1 { font-size: 36px; }
  .sec-title { font-size: 30px; }
  .article-row { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
}
@media (min-width: 821px) { .mobile-menu { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
