/* ==========================================================================
   Le Journal du Marketing — Maquette v1
   base.css : tokens, reset, typographie, structure globale (header / footer)
   ========================================================================== */

:root {
  /* Papier & encre */
  --paper: #F5F2EB;
  --paper-2: #ECE7DC;
  --paper-3: #E2DBCC;
  --ink: #15130F;
  --ink-2: #4F4A42;
  --ink-3: #6B665C;
  --rule: #D6CFC1;

  /* Signal (vermillon) & surligneur */
  --signal: #E0401F;
  --signal-ink: #B5321A;
  --signal-on-dark: #FF6B47;
  --mark: #FFE14A;

  /* Palette d'illustration (couvertures uniquement) */
  --ochre: #E2A437;
  --cobalt: #2E4ED6;
  --sage: #2F6B5A;
  --plum: #6A2C4B;

  /* Fond sombre */
  --night: #15130F;
  --night-2: #221F1A;
  --night-text: #F5F2EB;
  --night-muted: #B9B2A5;
  --night-rule: #3A362F;

  /* Typographie */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Mise en page */
  --wrap: 1320px;
  --gutter: clamp(16px, 2.4vw, 28px);
  --header-h: 60px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 116px; }
body, h1, h2, h3, h4, p, figure, blockquote, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
}

/* Grain papier, très discret */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--mark); color: var(--ink); }

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

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 14px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Structure ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 880px; }

.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule--ink { border-top: 1px solid var(--ink); }
.rule--thick { border-top: 3px solid var(--ink); }
.rule--double { border-top: 3px double var(--ink); }

/* ---------- Typographie ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.012em; line-height: 1.1; text-wrap: balance; }

.kicker {
  display: block;
  font-family: var(--sans); font-size: 11.5px; font-weight: 700; line-height: 1.5;
  letter-spacing: .12em; text-transform: uppercase; color: var(--signal-ink);
}
.kicker::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--signal); margin-right: .7em; vertical-align: .08em; }
.kicker--plain::before { display: none; }
.kicker--ink { color: var(--ink); }
.kicker .sep { color: var(--ink-3); font-weight: 500; }

.dek { font-family: var(--serif); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }

.meta { font-family: var(--mono); font-size: 12px; letter-spacing: .01em; color: var(--ink-3); line-height: 1.5; }
.meta a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.meta a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.meta .dot { margin-inline: .5em; }

.num { font-variant-numeric: tabular-nums; }

/* Surligneur : les passages « à retenir » */
.hl {
  background: linear-gradient(104deg, transparent .4em, var(--mark) .5em, var(--mark) calc(100% - .4em), transparent calc(100% - .3em));
  background-size: 100% 62%; background-position: 0 72%; background-repeat: no-repeat;
  padding-inline: .12em; margin-inline: -.12em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Liens de titres : soulignement éditorial */
.link-title { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .35s cubic-bezier(.2,.7,.2,1); padding-bottom: 1px; }
a:hover .link-title, .link-title:hover { background-size: 100% 1.5px; }

.text-link { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: .4em; border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }
.text-link svg { width: 14px; height: 14px; transition: transform .25s; }
.text-link:hover svg { transform: translateX(3px); }

/* ---------- Boutons, puces, champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  height: 44px; padding-inline: 20px; font-weight: 700; font-size: 14.5px;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: background .2s, color .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { background: var(--signal); border-color: var(--signal); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--sm { height: 36px; padding-inline: 14px; font-size: 13.5px; }
.btn--light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--light:hover { background: var(--signal-on-dark); border-color: var(--signal-on-dark); color: var(--ink); }
.btn--outline-light { background: transparent; color: var(--paper); border-color: var(--night-muted); }
.btn--outline-light:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn svg { width: 16px; height: 16px; }

.chip {
  display: inline-flex; align-items: center; gap: .4em; height: 32px; padding-inline: 13px;
  border: 1px solid var(--rule); background: transparent; font-size: 13.5px; font-weight: 600;
  border-radius: 999px; transition: border-color .2s, background .2s, color .2s; white-space: nowrap;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .count { font-family: var(--mono); font-size: 11px; opacity: .7; }

.field {
  height: 48px; padding-inline: 16px; border: 1.5px solid var(--ink); background: var(--paper);
  font-size: 15px; min-width: 0; width: 100%;
}
.field::placeholder { color: var(--ink-3); }

.avatar {
  --av: 40px;
  width: var(--av); height: var(--av); border-radius: 50%; flex: none;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-style: italic;
  font-size: calc(var(--av) * .4); color: var(--paper); background: var(--ink);
}
.avatar--signal { background: var(--signal); }
.avatar--cobalt { background: var(--cobalt); }
.avatar--sage { background: var(--sage); }
.avatar--plum { background: var(--plum); }
.avatar--ochre { background: var(--ochre); color: var(--ink); }


/* ---------- Barre utilitaire ---------- */
.topbar { border-bottom: 1px solid var(--rule); font-size: 12.5px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 16px; }
.topbar__date { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); letter-spacing: .02em; white-space: nowrap; }
.topbar__links { display: flex; gap: 22px; align-items: center; }
.topbar__links a { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.topbar__links a:hover { color: var(--ink); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(224,64,31,0); } 100% { box-shadow: 0 0 0 0 rgba(224,64,31,0); } }

/* ---------- Logotype ---------- */
.wordmark {
  font-family: var(--serif); font-weight: 700; letter-spacing: -.028em; line-height: .9;
  font-variation-settings: "opsz" 72; white-space: nowrap; display: inline-block;
}
.wordmark i { font-style: italic; font-weight: 400; letter-spacing: -.01em; padding-right: .03em; }
.wordmark::after { content: ""; display: inline-block; width: .15em; height: .15em; background: var(--signal); margin-left: .05em; vertical-align: baseline; }

/* ---------- Masthead (accueil) ---------- */
.masthead { padding-block: 26px 22px; }
.masthead .wrap { display: grid; grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr); align-items: end; gap: 24px; }
.masthead__side { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.masthead__side--right { text-align: right; justify-self: end; }
.masthead__side b { display: block; font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin-bottom: 4px; }
.masthead .wordmark { font-size: clamp(40px, 5.6vw, 80px); }
.masthead__tagline { padding-inline: var(--gutter); text-align: center; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-2); margin-top: 14px; }

/* ---------- Navigation principale ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50; background: rgba(245,242,235,.94);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink);
}
.site-nav .wrap { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.site-nav__brand { display: none; font-size: 22px; }
.site-nav.is-stuck .site-nav__brand, .site-nav--compact .site-nav__brand { display: inline-block; }
.site-nav__list { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.site-nav__list::-webkit-scrollbar { display: none; }
.site-nav__list a {
  display: block; padding: 8px 11px; font-size: 14.5px; font-weight: 600; white-space: nowrap; position: relative;
}
.site-nav__list a::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 2px; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.site-nav__list a:hover::after, .site-nav__list a[aria-current="page"]::after, .site-nav__list a[aria-current="true"]::after { transform: scaleX(1); }
.site-nav__list a.is-feature { color: var(--signal-ink); }
.site-nav__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; transition: background .2s; }
.icon-btn:hover { background: var(--paper-2); }
.icon-btn svg { width: 19px; height: 19px; }
.menu-toggle { display: none; }

.site-nav--compact { border-top: 0; }
.site-nav--compact .wrap { height: 68px; }

/* Menu mobile */
.mobile-menu { display: none; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--night); color: var(--night-text); margin-top: 96px; padding-top: 72px; }
.site-footer a { color: var(--night-muted); transition: color .2s; }
.site-footer a:hover { color: var(--night-text); }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px; padding-bottom: 56px; border-bottom: 1px solid var(--night-rule); }
.footer-brand .wordmark { font-size: 34px; color: var(--night-text); }
.footer-brand p:not(.wordmark) { color: var(--night-muted); font-size: 14.5px; margin-top: 18px; max-width: 34ch; line-height: 1.55; }
.footer-col h3 { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--night-text); margin-bottom: 16px; }
.footer-col li + li { margin-top: 9px; }
.footer-col a { font-size: 14.5px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-block: 24px 32px; font-family: var(--mono); font-size: 11.5px; color: var(--night-muted); }

/* ---------- Apparition au chargement ---------- */
@keyframes rise { from { opacity: .35; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.reveal-1 { animation-delay: .05s; } .reveal-2 { animation-delay: .15s; } .reveal-3 { animation-delay: .25s; } .reveal-4 { animation-delay: .35s; } .reveal-5 { animation-delay: .45s; }

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

/* ---------- Responsive structure ---------- */
@media (max-width: 1240px) {
  .site-nav__list .nav-home { display: none; }
  .site-nav__list a { padding-inline: 9px; }
  .site-nav__list a::after { left: 9px; right: 9px; }
}
@media (max-width: 1100px) {
  .footer-top { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
  .site-nav .wrap, .site-nav--compact .wrap { flex-wrap: wrap; height: auto; gap: 0 12px; }
  .site-nav__brand { display: inline-block; font-size: 20px; padding-block: 14px; }
  .site-nav__actions { padding-block: 6px; }
  .site-nav__actions .btn { display: none; }
  .menu-toggle { display: grid; }
  /* Onglets rubriques défilants : 2e ligne sur les pages internes, à côté du menu sur l'accueil */
  .site-nav__list { order: 3; flex: 0 0 auto; width: calc(100% + 2 * var(--gutter)); height: 46px; margin-inline: calc(var(--gutter) * -1); padding-inline: calc(var(--gutter) - 9px); border-top: 1px solid var(--rule); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .site-nav:not(.site-nav--compact) .site-nav__brand { display: none; }
  .site-nav:not(.site-nav--compact) .site-nav__list { order: 0; flex: 1 1 0; width: auto; min-width: 0; height: 56px; margin-inline: 0; padding-inline: 0; border-top: 0; }
  .mobile-menu { display: block; position: fixed; inset: 0; z-index: 90; background: var(--paper); padding: 20px var(--gutter); transform: translateY(-100%); transition: transform .4s cubic-bezier(.2,.7,.2,1); overflow-y: auto; visibility: hidden; }
  .mobile-menu.is-open { transform: none; visibility: visible; }
  .mobile-menu__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 3px double var(--ink); }
  .mobile-menu__head .wordmark { font-size: 22px; }
  .mobile-menu ul { margin-top: 8px; }
  .mobile-menu li a { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); font-family: var(--serif); font-size: 26px; font-weight: 600; }
  .mobile-menu .btn { width: 100%; margin-top: 24px; }
}
@media (max-width: 1024px) {
  .masthead .wrap { grid-template-columns: 1fr; justify-items: center; }
  .masthead__side { display: none; }
}
@media (max-width: 860px) {
  .topbar__links a:not(.keep) { display: none; }
  .masthead { padding-block: 18px 14px; }
  .masthead .wordmark { font-size: min(8vw, 60px); }
  .masthead__tagline { font-size: 15px; margin-top: 8px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 520px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .topbar__date { font-size: 10.5px; }
  .topbar__links a.keep { display: none; }
  .footer-brand .wordmark { font-size: 28px; }
}
