/* Mise en page partagée des guides DomoRepère. */

body {
  background:
    radial-gradient(circle at 8% 22%, rgba(13, 102, 93, .055), transparent 24rem),
    var(--bg-light);
}

.site-header {
  box-shadow: 0 1px 0 rgba(39, 52, 54, .03);
}

.reading-progress {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  overflow: hidden;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #e4c98e 42%, var(--primary));
  transition: width .08s linear;
}

.article-hero {
  padding: 4rem 1.5rem 3.35rem;
  background:
    radial-gradient(circle at 82% 22%, rgba(201, 170, 114, .18), transparent 17rem),
    linear-gradient(128deg, #263537 0%, #1d4140 58%, #0d665d 118%);
}

.article-hero::before {
  position: absolute;
  right: 7%;
  bottom: -42px;
  width: 154px;
  height: 154px;
  border-radius: 30px;
  background-image: radial-gradient(rgba(255,255,255,.22) 1.2px, transparent 1.2px);
  background-size: 14px 14px;
  content: "";
  transform: rotate(9deg);
}

.article-hero::after {
  width: 420px;
  height: 420px;
  right: -190px;
  top: -250px;
}

.article-hero-inner {
  max-width: 1080px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .38rem;
  margin-bottom: 1.35rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .38rem .65rem;
  border: 1px solid rgba(229, 201, 149, .38);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  letter-spacing: .09em;
}

.eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  box-shadow: 0 0 0 4px rgba(201,170,114,.13);
}

h1 {
  margin-top: .75rem;
  max-width: 960px;
  font-size: clamp(2.15rem, 4.7vw, 3.7rem);
  text-wrap: balance;
}

.lead {
  max-width: 840px;
  font-size: clamp(1rem, 1.7vw, 1.12rem);
}

.meta {
  gap: .55rem;
}

.meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: .32rem .66rem;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}

.author-line {
  margin-top: .9rem;
}

.page-wrap {
  max-width: 1200px;
  padding: 3rem 1.5rem 4.5rem;
}

.content-grid {
  grid-template-columns: minmax(0, 800px) minmax(270px, 300px);
  gap: clamp(1.6rem, 3vw, 3rem);
}

.article-body {
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border-color: rgba(220, 229, 227, .9);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(39, 52, 54, .075);
}

.article-body > p:first-child {
  font-size: 1.12rem;
  line-height: 1.75;
}

.article-body h2 {
  position: relative;
  margin-top: 2.8rem;
  padding-top: .1rem;
  padding-left: 1rem;
  font-size: clamp(1.42rem, 2.4vw, 1.72rem);
  letter-spacing: -.018em;
  text-wrap: balance;
}

.article-body h2::before {
  position: absolute;
  top: .18rem;
  bottom: .1rem;
  left: 0;
  width: 4px;
  border-radius: 99px;
  background: linear-gradient(var(--primary), var(--accent));
  content: "";
}

.article-body h3 {
  font-size: 1.19rem;
}

.article-body p,
.article-body li {
  text-wrap: pretty;
}

.highlight-box,
.field-note,
.question-box,
.affiliate-box,
.sources {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
}

.highlight-box {
  padding: 1.35rem 1.4rem;
  background: linear-gradient(120deg, var(--primary-soft), #f7fbfa);
}

.highlight-box::after {
  position: absolute;
  right: -32px;
  bottom: -54px;
  width: 120px;
  height: 120px;
  border: 18px solid rgba(13,102,93,.055);
  border-radius: 50%;
  content: "";
}

.article-figure img {
  border-radius: 17px;
  box-shadow: 0 14px 32px rgba(39,52,54,.1);
}

.article-figure figcaption {
  padding-left: .15rem;
}

.sidebar {
  top: 91px;
}

.side-card {
  padding: 1.25rem;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(39, 52, 54, .065);
}

.side-kicker {
  display: block;
  margin-bottom: .18rem;
  color: var(--primary);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .095em;
  text-transform: uppercase;
}

.toc-card {
  padding: 0;
  overflow: hidden;
  border-top: 4px solid var(--primary);
}

.toc-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem .8rem;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font: inherit;
  text-align: left;
}

.toc-toggle strong {
  display: block;
  font-size: 1.02rem;
}

.toc-chevron {
  display: none;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.toc-nav {
  max-height: calc(100vh - 230px);
  padding: 0 .55rem 1rem .7rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #b9cfcb transparent;
}

.toc-nav ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc-nav li {
  counter-increment: toc;
}

.toc-nav li + li {
  margin-top: .12rem;
}

.toc-nav a {
  position: relative;
  display: grid;
  grid-template-columns: 1.55rem 1fr;
  gap: .35rem;
  align-items: start;
  padding: .48rem .55rem;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.32;
}

.toc-nav a::before {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-light);
  color: var(--primary);
  content: counter(toc);
  font-size: .68rem;
  font-weight: 800;
}

.toc-nav a:hover,
.toc-nav a[aria-current="true"] {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.toc-nav a[aria-current="true"]::before {
  background: var(--primary);
  color: #fff;
}

.takeaway-card {
  background:
    radial-gradient(circle at 110% -20%, rgba(201,170,114,.22), transparent 9rem),
    var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

.takeaway-card .side-kicker {
  color: #e7ca92;
}

.takeaway-card h2 {
  color: #fff;
  font-size: 1.06rem;
}

.takeaway-card ul {
  margin-top: .8rem;
}

.takeaway-card li {
  position: relative;
  padding-left: 1.25rem;
  color: #d5dfde;
  font-size: .84rem;
  line-height: 1.45;
}

.takeaway-card li::before {
  position: absolute;
  top: .26rem;
  left: 0;
  color: #e7ca92;
  content: "✓";
  font-weight: 900;
}

.next-links {
  gap: 1.15rem;
  margin-top: 1.5rem;
}

.next-card {
  position: relative;
  padding: 1.25rem;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.next-card:hover {
  border-color: #b9d3ce;
  box-shadow: 0 15px 34px rgba(39,52,54,.1);
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .page-wrap {
    padding-top: 1.5rem;
  }

  .content-grid {
    display: flex;
    flex-direction: column;
  }

  .article-shell {
    width: 100%;
  }

  .sidebar {
    position: static;
    order: -1;
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr);
    gap: 1rem;
  }

  .toc-card,
  .takeaway-card {
    margin: 0;
  }

  .toc-toggle {
    padding-bottom: 1rem;
    cursor: pointer;
  }

  .toc-chevron {
    display: block;
  }

  .toc-toggle[aria-expanded="true"] .toc-chevron {
    transform: rotate(225deg);
  }

  .toc-nav {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: sticky;
  }

  .nav-container {
    flex-direction: row;
    gap: .75rem;
    padding: .58rem .75rem;
  }

  .logo {
    flex: 0 0 auto;
  }

  .logo img {
    height: 40px;
  }

  .logo span {
    display: none;
  }

  nav {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav ul {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 1rem;
    width: max-content;
  }

  nav a {
    white-space: nowrap;
    font-size: .79rem;
  }

  .article-hero {
    padding: 2.7rem 1rem 2.45rem;
  }

  .article-hero::before {
    opacity: .55;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  .breadcrumb {
    margin-bottom: 1rem;
  }

  .meta span {
    padding: .28rem .55rem;
    font-size: .78rem;
  }

  .page-wrap {
    padding: 1rem .8rem 3.5rem;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .article-body {
    padding: 1.25rem 1.1rem 1.6rem;
    border-radius: 18px;
  }

  .article-body h2 {
    margin-top: 2.3rem;
    padding-left: .85rem;
  }

  .next-links {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
