/* ============================================================
   Carrée Marketing — Shared chrome (nav + footer + page shell)
   Self-contained, no Tailwind dependency. Matches the React homepage design.
   Tokens mirror the React app: bg #EFEFEF, ink #111827, red #E8191A.
   ============================================================ */

:root {
  --cm-bg: #EFEFEF;
  --cm-surface: #ffffff;
  --cm-ink: #111827;
  --cm-muted: #6b7280;
  --cm-line: #e5e7eb;
  --cm-red: #E8191A;
  --cm-navy: #1B2860;
  --cm-orange: #E8704E;
  --cm-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --cm-max: 1440px;
}

/* Reset within theme scope */
.cm-scope *,
.cm-scope *::before,
.cm-scope *::after { box-sizing: border-box; }

body.cm-themed {
  background: var(--cm-bg);
  color: var(--cm-ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

/* ----------------------------- NAVBAR ----------------------------- */
.cm-nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  max-width: var(--cm-max);
  margin: 0 auto;
  padding: 10px 12px;
}
@media (min-width: 640px) { .cm-nav-wrap { padding: 12px; } }

.cm-nav {
  background: var(--cm-surface);
  border-radius: 9999px;
  padding: 6px 6px 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.cm-nav-left { display: flex; align-items: center; gap: 24px; }

.cm-logo {
  width: 40px; height: 40px;
  background: var(--cm-ink);
  border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 11px; letter-spacing: -0.02em;
  flex-shrink: 0;
  text-decoration: none;
}

.cm-nav-links { display: none; align-items: center; gap: 24px; }
@media (min-width: 900px) { .cm-nav-links { display: flex; } }

.cm-nav-links a {
  color: var(--cm-ink);
  font-size: 14px;
  text-decoration: none;
  transition: color 300ms var(--cm-ease);
  white-space: nowrap;
}
.cm-nav-links a:hover { color: var(--cm-muted); }

/* Marchés dropdown */
.cm-drop { position: relative; }
.cm-drop > button {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--cm-ink); font-size: 14px; font-family: inherit; padding: 0;
}
.cm-drop > button svg { width: 14px; height: 14px; transition: transform 250ms var(--cm-ease); }
.cm-drop:hover > button svg { transform: rotate(180deg); }
.cm-drop-menu {
  position: absolute; top: 100%; left: 0; margin-top: 10px;
  min-width: 190px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  padding: 8px;
  opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity 200ms var(--cm-ease), transform 200ms var(--cm-ease);
}
.cm-drop:hover .cm-drop-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.cm-drop-menu a {
  display: block; padding: 9px 12px; border-radius: 9px;
  font-size: 14px; color: var(--cm-ink); text-decoration: none;
  transition: background 150ms var(--cm-ease), color 150ms var(--cm-ease);
}
.cm-drop-menu a:hover { background: #f5f5f5; color: var(--cm-red); }

.cm-nav-right { display: none; align-items: center; gap: 20px; }
@media (min-width: 900px) { .cm-nav-right { display: flex; } }

.cm-nav-meta {
  display: flex; align-items: center; gap: 6px;
  color: var(--cm-muted); font-size: 13px; white-space: nowrap;
}
.cm-nav-meta svg { width: 14px; height: 14px; }
.cm-avail { display: none; }
@media (min-width: 1100px) { .cm-avail { display: block; color: var(--cm-muted); font-size: 13px; white-space: nowrap; } }

/* CTA pill (dark, like React desktop nav) */
.cm-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cm-ink); color: #fff;
  padding: 8px 8px 8px 20px; border-radius: 9999px;
  text-decoration: none; font-size: 13px; font-weight: 500;
  transition: background 250ms var(--cm-ease);
}
.cm-cta:hover { background: #000; }
.cm-cta .cm-cta-circle {
  width: 24px; height: 24px; background: #fff; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cm-cta .cm-cta-circle svg { width: 12px; height: 12px; color: var(--cm-ink); transition: transform 350ms var(--cm-ease); }
.cm-cta:hover .cm-cta-circle svg { transform: rotate(-45deg); }
.cm-cta--red { background: var(--cm-red); }
.cm-cta--red:hover { background: #c81517; }
.cm-cta--red .cm-cta-circle svg { color: var(--cm-red); }

/* Mobile burger */
.cm-burger {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cm-ink); color: #fff;
  padding: 7px 8px 7px 14px; border-radius: 9999px;
  border: none; cursor: pointer; font-size: 14px; font-weight: 500; font-family: inherit;
}
@media (min-width: 900px) { .cm-burger { display: none; } }
.cm-burger svg { width: 16px; height: 16px; }

/* Mobile bottom sheet */
.cm-sheet-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: transparent; pointer-events: none;
  transition: background 300ms var(--cm-ease);
}
.cm-sheet-overlay.open { background: rgba(0, 0, 0, 0.6); pointer-events: auto; }
.cm-sheet {
  position: absolute; bottom: 0; left: 0; right: 0;
  margin: 0 12px 12px; background: #fff; border-radius: 20px;
  padding: 24px; display: flex; flex-direction: column; gap: 22px;
  transform: translateY(120%);
  transition: transform 500ms cubic-bezier(0.32, 0.72, 0, 1);
}
.cm-sheet-overlay.open .cm-sheet { transform: translateY(0); }
.cm-sheet-meta { display: flex; align-items: center; gap: 6px; color: var(--cm-muted); font-size: 13px; }
.cm-sheet-links { display: flex; flex-direction: column; gap: 16px; }
.cm-sheet-links a {
  color: var(--cm-ink); font-weight: 500; font-size: 26px; line-height: 30px;
  text-decoration: none; transition: color 200ms var(--cm-ease);
}
.cm-sheet-links a:hover { color: var(--cm-muted); }
.cm-sheet-sub { font-size: 14px; color: var(--cm-muted); font-weight: 400; padding-left: 12px; }
.cm-sheet-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.cm-sheet-close {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cm-ink); color: #fff; border: none; cursor: pointer;
  padding: 6px 8px 6px 12px; border-radius: 9999px; font-size: 14px; font-weight: 500; font-family: inherit;
}
.cm-sheet-close svg { width: 14px; height: 14px; }

/* ----------------------------- PAGE SHELL ----------------------------- */
.cm-page { max-width: var(--cm-max); margin: 0 auto; padding: 40px 20px 80px; }
@media (min-width: 640px) { .cm-page { padding: 56px 32px 96px; } }
@media (min-width: 1024px) { .cm-page { padding: 72px 48px 120px; } }

.cm-page-head { margin-bottom: 32px; }
.cm-badge {
  display: inline-flex; align-items: center;
  border: 1px solid var(--cm-line); border-radius: 9999px;
  padding: 5px 14px; font-size: 12px; font-weight: 500; color: var(--cm-ink);
  margin-bottom: 20px;
}
.cm-page-title {
  font-weight: 500; color: var(--cm-ink);
  font-size: clamp(1.9rem, 5vw, 3.4rem);
  line-height: 1.08; letter-spacing: -0.03em; margin: 0;
}
.cm-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cm-muted); margin-bottom: 18px; }
.cm-crumb a { color: var(--cm-muted); text-decoration: none; }
.cm-crumb a:hover { color: var(--cm-ink); }
.cm-crumb .sep { opacity: 0.5; }

/* Article body — readable prose for the_content() */
.cm-prose { max-width: 760px; color: #1f2937; font-size: 17px; line-height: 1.7; }
.cm-prose.full { max-width: none; }
.cm-prose > * + * { margin-top: 1.1em; }
.cm-prose h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin-top: 1.8em; color: var(--cm-ink); }
.cm-prose h3 { font-size: 1.3rem; font-weight: 600; line-height: 1.3; margin-top: 1.5em; color: var(--cm-ink); }
.cm-prose a { color: var(--cm-red); text-decoration: underline; text-underline-offset: 2px; }
.cm-prose img { border-radius: 14px; height: auto; max-width: 100%; }
.cm-prose ul, .cm-prose ol { padding-left: 1.4em; }
.cm-prose li + li { margin-top: 0.4em; }
.cm-prose blockquote {
  border-left: 3px solid var(--cm-red); padding-left: 18px;
  font-style: italic; color: #374151;
}

/* Featured image */
.cm-featured { border-radius: 18px; overflow: hidden; margin-bottom: 36px; max-height: 460px; }
.cm-featured img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Blog archive grid */
.cm-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 700px) { .cm-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cm-grid { grid-template-columns: repeat(3, 1fr); } }
.cm-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; }
.cm-card-media { aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #e5e7eb; }
.cm-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 700ms var(--cm-ease); }
.cm-card:hover .cm-card-media img { transform: scale(1.05); }
.cm-card-cat { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cm-red); }
.cm-card-title { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--cm-ink); }
.cm-card-excerpt { font-size: 14px; color: var(--cm-muted); line-height: 1.6; }

/* ----------------------------- FOOTER ----------------------------- */
.cm-footer { background: var(--cm-navy); color: #fff; margin-top: 0; }
.cm-footer-inner {
  max-width: var(--cm-max); margin: 0 auto; padding: 64px 20px 0;
  display: grid; grid-template-columns: 1fr; gap: 40px;
}
@media (min-width: 640px) { .cm-footer-inner { padding: 72px 32px 0; grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
@media (min-width: 1024px) { .cm-footer-inner { padding: 88px 48px 0; } }

.cm-footer-brand .cm-footer-logo { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.cm-footer-brand p { color: rgba(255, 255, 255, 0.6); font-size: 14px; line-height: 1.6; margin: 16px 0 0; max-width: 280px; }
.cm-social { display: flex; gap: 14px; margin-top: 22px; }
.cm-social a { color: rgba(255, 255, 255, 0.5); transition: color 200ms var(--cm-ease); }
.cm-social a:hover { color: #fff; }
.cm-social svg { width: 20px; height: 20px; }

.cm-footer h4 {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.15em; color: rgba(255, 255, 255, 0.4); margin: 0 0 20px;
}
.cm-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cm-footer ul a { color: rgba(255, 255, 255, 0.7); font-size: 14px; text-decoration: none; transition: color 200ms var(--cm-ease); }
.cm-footer ul a:hover { color: #fff; }
.cm-footer-addr { margin-top: 24px; font-size: 12px; color: rgba(255, 255, 255, 0.4); line-height: 1.7; }

.cm-footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: 56px; }
.cm-footer-bottom-inner {
  max-width: var(--cm-max); margin: 0 auto; padding: 24px 20px;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
  font-size: 12px; color: rgba(255, 255, 255, 0.4);
}
@media (min-width: 640px) { .cm-footer-bottom-inner { flex-direction: row; justify-content: space-between; padding: 24px 32px; } }
.cm-footer-bottom-inner a { color: rgba(255, 255, 255, 0.55); text-decoration: underline; }
.cm-footer-bottom-inner a:hover { color: #fff; }
