/* ============================================================
   RetailPOS — Page blog / article (refonte)
   Surcouche de demo-refonte-insp3.css.
   Chrome (pont de variables + menu + footer) repris de metiers-insp3.
   ============================================================ */

/* Pont de variables : l'ancien système (--cta, --text, --bg…) est mappé
   sur les tokens demo-refonte. Indispensable pour que les composants
   partagés (menu, footer, contact) et les styles inline résiduels
   s'affichent dans la palette refonte. */
:root {
  --accent: var(--orange);
  --accent-mid: rgba(242, 83, 26, .20);
  --cta: var(--orange);
  --cta-hover: var(--orange-deep);
  --bg: var(--cream);
  --bg2: var(--white);
  --text: var(--ink);
  --border: var(--line);
  --radius: 999px;
  --radius-card: 20px;
  --card-shadow: none;
  --card-shadow-lg: none;
  --blog-after-hero-bg: #faf9f5;
  --blog-after-hero-margin: clamp(14px, 1.8vw, 28px);
  --blog-after-hero-radius: var(--r-lg);
  --retailpos-layout-container: none;
  --retailpos-layout-gutter: clamp(14px, 1.8vw, 28px);
  --retailpos-layout-hero-top: 22px;
}

html,
body {
  width: 100%;
  max-width: 100%;
  background: #fff;
}

/* ============================================================
   HEADER / MENU (composant) — aligné sur la home / à-propos
   ============================================================ */
body > header {
  position: sticky;
  top: 0;
  height: auto;
  padding-top: 14px;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: block;
  width: 100%;
}

body > header .container {
  width: calc(100% - (clamp(14px, 1.8vw, 28px) * 2));
  max-width: none;
  margin-inline: clamp(14px, 1.8vw, 28px);
  padding: 0 14px 0 24px;
  min-height: 74px;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 18px;
}

body > header.scrolled .container {
  border-color: var(--line);
}

.logo {
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.logo-retail { color: var(--ink) !important; }
.logo-pos { color: var(--orange) !important; }

.nav-page-badge { display: none; }

.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--ink); }

.nav-links a.menu-demo-btn,
.mobile-drawer .drawer-cta {
  border-radius: 999px;
  background: var(--orange);
  font-weight: 500;
}

.nav-links a.menu-demo-btn:hover,
.mobile-drawer .drawer-cta:hover {
  background: var(--orange-deep);
  box-shadow: none;
}

.burger {
  width: 44px;
  height: 44px;
  justify-content: center;
  border-radius: 12px;
  border-color: var(--line);
  background: #fff;
}

.burger span { background: var(--ink); }

.mobile-drawer {
  top: 88px;
  height: calc(100vh - 88px);
  background: rgba(255, 255, 255, .96);
}

/* ============================================================
   FOOTER (composant) — aligné sur la home / à-propos
   ============================================================ */
.retailpos-footer {
  background: var(--dark);
  color: rgba(255, 255, 255, .68);
  border-top: 0;
}

.retailpos-footer__inner {
  max-width: none;
  padding-inline: clamp(14px, 1.8vw, 28px);
}

.retailpos-footer__logo,
.retailpos-footer__tagline,
.retailpos-footer__contact a[href^="tel:"],
.retailpos-footer__company strong { color: #fff; }

.retailpos-footer__logo span,
.retailpos-footer__eyebrow,
.retailpos-footer__contact a[href^="mailto:"] { color: var(--orange); }

.retailpos-footer__proof,
.retailpos-footer__col a,
.retailpos-footer__contact p,
.retailpos-footer__company p,
.retailpos-footer__bottom,
.retailpos-footer__col h2,
.retailpos-footer__contact-label { color: rgba(255, 255, 255, .62); }

.retailpos-footer__top,
.retailpos-footer__nav,
.retailpos-footer__bottom,
.retailpos-footer__contact-row { border-color: rgba(255, 255, 255, .12); }

.retailpos-footer__contact {
  background: rgba(255, 255, 255, .06);
  border-left-color: var(--orange);
}


/* ============================================================
   PAGE BLOG — article (template réutilisable)
   ============================================================ */

/* ---- En-tête article (réutilise .section > .wrap > .center + .lead comme index) ---- */
/* Intro : titre et chapô limités à 70% de la largeur, centrés. */
.blog-hero .center { max-width: 70%; }
.blog-hero h1 {
  max-width: 100%;
  text-wrap: balance;
}
.blog-hero .lead { max-width: none; margin-inline: auto; }
.blog-meta {
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 500;
}
.blog-meta__sep { margin: 0 .5rem; opacity: .6; }

/* ---- Image de couverture ---- */
.blog-cover {
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
}
.blog-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-cover--placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .95rem;
  background:
    linear-gradient(135deg, rgba(20, 20, 14, .03), rgba(20, 20, 14, .01)),
    repeating-linear-gradient(135deg, rgba(20, 20, 14, .05) 0 1px, transparent 1px 16px);
}

/* Fond continu après l'image hero */
main > .section:has(.blog-cover) {
  padding-bottom: 0 !important;
}

main > .section:has(.blog-layout),
main > .section:has(.blog-layout) + .section {
  width: calc(100% - (var(--blog-after-hero-margin) * 2));
  margin-inline: var(--blog-after-hero-margin);
  background: var(--blog-after-hero-bg);
}

main > .section:has(.blog-layout) {
  margin-top: var(--blog-after-hero-margin);
  padding-top: clamp(40px, 5vw, 64px) !important;
  border-radius: var(--blog-after-hero-radius) var(--blog-after-hero-radius) 0 0;
}

main > .section:has(.blog-layout) + .section {
  padding-top: clamp(28px, 4vw, 52px) !important;
  border-radius: 0 0 var(--blog-after-hero-radius) var(--blog-after-hero-radius);
}

/* ---- Layout : sommaire ancré + corps ---- */
.blog-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 860px);
  gap: clamp(28px, 4vw, 64px);
  justify-content: center;
  align-items: start;
  min-width: 0;
}
.blog-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 22px;
}
.blog-toc__label {
  display: block;
  margin-bottom: 14px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.blog-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid var(--line);
}
.blog-toc__list a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.4;
  text-decoration: none;
  transition: color .2s, border-color .2s;
}
.blog-toc__list a:hover { color: var(--ink); }
.blog-toc__list a.is-active {
  color: var(--orange);
  border-left-color: var(--orange);
  font-weight: 600;
}

/* ---- Corps de l'article ---- */
.blog-body {
  width: 100%;
  max-width: 860px;
  min-width: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.blog-body > h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  line-height: 1.12;
  margin: clamp(40px, 4vw, 56px) 0 16px;
  scroll-margin-top: 100px;
}
.blog-body > h2:first-child { margin-top: 0; }
.blog-body h3 { font-size: 1.2rem; line-height: 1.25; margin: 30px 0 10px; }
.blog-body p,
.blog-body li { color: var(--muted); font-size: 1.05rem; line-height: 1.75; }
.blog-body p { margin-bottom: 18px; }
.blog-body ul,
.blog-body ol { margin: 0 0 18px 1.2rem; display: flex; flex-direction: column; gap: 8px; }
.blog-body a { color: var(--orange); font-weight: 600; }
.blog-body a:hover { text-decoration: underline; }
.blog-body strong { color: var(--ink); font-weight: 700; }
.blog-body figure { margin: 28px 0; }
.blog-body figure img { width: 100%; border-radius: var(--r-card); border: 1px solid var(--line); display: block; }
.blog-body figcaption { margin-top: 10px; font-size: .85rem; color: var(--muted); text-align: center; }
.blog-body blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--orange);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 500;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 30px;
}
.article-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.article-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 22px;
}
.article-card h3 {
  margin-top: 0;
  color: var(--ink);
}
.article-card p:last-child,
.article-card ul:last-child { margin-bottom: 0; }
.article-kpi {
  display: grid;
  gap: 6px;
  background: var(--dark);
  color: #fff;
  border-radius: var(--r-card);
  padding: 22px;
}
.article-kpi strong {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}
.article-kpi span {
  color: rgba(255,255,255,.72);
  font-size: .95rem;
  line-height: 1.45;
}
.article-note {
  margin: 28px 0;
  padding: 22px 24px;
  border-radius: var(--r-card);
  background: var(--orange-tint);
  border: 1px solid rgba(242, 83, 26, .22);
}
.article-note p {
  margin: 0;
  color: var(--ink);
}
.article-list-plain {
  list-style: none;
  margin-left: 0 !important;
}
.article-list-plain li {
  padding-left: 18px;
  position: relative;
}
.article-list-plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .75em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

/* ---- CTA fin d'article (bande sapin) ---- */
.blog-cta {
  max-width: calc(220px + 860px + clamp(28px, 4vw, 64px));
  margin-inline: auto;
  background: var(--dark);
  color: #fff;
  border-radius: var(--r-lg);
  padding: clamp(40px, 5vw, 72px);
  text-align: center;
}
.blog-cta h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); margin-bottom: 14px; }
.blog-cta p {
  max-width: 560px;
  margin: 0 auto 28px;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(1.05rem, 1.25vw, 1.2rem);
  line-height: 1.5;
}

/* ---- Articles liés ---- */
.blog-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.5vw, 32px);
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, transform .2s;
}
.blog-card:hover { border-color: var(--orange); transform: translateY(-3px); }
.blog-card__img {
  aspect-ratio: 3 / 2;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.blog-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card__body { padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.blog-card__cat {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--orange);
}
.blog-card__body h3 { font-size: 1.1rem; line-height: 1.2; }
.blog-card__body p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .blog-hero .center { max-width: 100%; }
  .blog-layout { grid-template-columns: 1fr; }
  .blog-body {
    max-width: 100%;
    padding: 0;
    border-radius: 0;
  }
  .article-grid,
  .article-grid--3 { grid-template-columns: 1fr; }
  .blog-toc {
    position: static;
    top: auto;
    padding: 18px 20px;
  }
  .blog-toc__list { border-left: none; }
  .blog-toc__list a { padding-left: 0; border-left: none; }
  .blog-toc__list a.is-active { border-left: none; }
  .blog-related__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .blog-hero .center {
    width: 100%;
    max-width: 16rem;
  }
  .blog-hero h1 {
    font-size: clamp(1.5rem, 6.2vw, 1.72rem);
    line-height: 1.12;
    text-wrap: auto;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  .blog-hero .lead { font-size: .98rem; }
  .blog-body { padding: 0; }
  .blog-body > h2 {
    font-size: clamp(1.35rem, 6vw, 1.58rem);
    overflow-wrap: break-word;
    hyphens: auto;
  }
  .blog-body p,
  .blog-body li { font-size: 1rem; }
  .blog-cover { aspect-ratio: 4 / 3; }
}
