/* ============================================================
   RLG Design System — Components partagés
   À charger AVEC rlg-tokens.css.
   Préfixe : .rlg-* — n'entre pas en collision avec .v7__* / .s2__* / .s3__*
   ============================================================ */

/* ============================== SECTION SURFACES ============================== */
.rlg-sec               { padding: var(--rlg-sp-section) 48px; position: relative; }
.rlg-sec--sm           { padding: var(--rlg-sp-section-sm) 48px; }
.rlg-sec--ivoire       { background: var(--rlg-ivoire);       color: var(--rlg-encre); }
.rlg-sec--ivoire-soft  { background: var(--rlg-ivoire-soft);  color: var(--rlg-encre); }
.rlg-sec--ivoire-deep  { background: var(--rlg-ivoire-deep);  color: var(--rlg-encre); }
.rlg-sec--encre        { background: var(--rlg-encre);        color: var(--rlg-ivoire); }
.rlg-sec--sapin        { background: var(--rlg-sapin);        color: var(--rlg-ivoire); }
.rlg-sec--sapin-deep   { background: var(--rlg-sapin-deep);   color: var(--rlg-ivoire); }
.rlg-sec--sapin-light  { background: var(--rlg-sapin-light);  color: var(--rlg-encre); }

/* ============================== EYEBROW + SECTION HEADER ============================== */
.rlg-eb {
  font-family: var(--rlg-f-sans); font-size: 12px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--rlg-or-deep);
  display: inline-flex; align-items: center; gap: 14px;
}
.rlg-eb::before, .rlg-eb--both::after { content: ""; width: 32px; height: 1px; background: currentColor; }
.rlg-eb--start::before { display: block; }
.rlg-eb--start::after  { display: none; }

.rlg-sec--encre .rlg-eb,
.rlg-sec--sapin .rlg-eb,
.rlg-sec--sapin-deep .rlg-eb { color: var(--rlg-or); }

.rlg-sec-h {
  text-align: center;
  max-width: 760px; margin: 0 auto 80px; padding: 0 32px;
}
.rlg-sec-h h2 {
  font-family: var(--rlg-f-display); font-style: italic;
  font-size: var(--rlg-fs-display-md); line-height: .98;
  margin: 18px 0 0; font-weight: 400; letter-spacing: -.02em; text-wrap: balance;
}
.rlg-sec-h p {
  font-family: var(--rlg-f-serif); font-style: italic;
  font-size: 22px; line-height: 1.4; opacity: .82;
  margin: 22px auto 0; max-width: 56ch; text-wrap: balance;
}
.rlg-sec--encre .rlg-sec-h p,
.rlg-sec--sapin-deep .rlg-sec-h p { color: var(--rlg-or-pale); opacity: 1; }

/* ============================== BRIDGE — transition narrative entre sections ============================== */
.rlg-bridge {
  padding: 64px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.rlg-bridge--ivoire-to-encre   { background: linear-gradient(to bottom, var(--rlg-ivoire), var(--rlg-encre)); color: var(--rlg-or-pale); }
.rlg-bridge--encre-to-sapin    { background: linear-gradient(to bottom, var(--rlg-encre), var(--rlg-sapin-light)); color: var(--rlg-or-pale); }
.rlg-bridge--sapin-to-ivoire   { background: linear-gradient(to bottom, var(--rlg-sapin-light), var(--rlg-ivoire-deep)); color: var(--rlg-or-deep); }
.rlg-bridge--ivoire-deep-to-encre { background: linear-gradient(to bottom, var(--rlg-ivoire-deep), var(--rlg-encre)); color: var(--rlg-or-pale); }
.rlg-bridge--encre-to-ivoire   { background: linear-gradient(to bottom, var(--rlg-encre), var(--rlg-ivoire)); color: var(--rlg-or-pale); }

.rlg-bridge::before {
  content: ""; position: absolute; left: 50%; top: 0; height: 48px; width: 1px;
  background: var(--rlg-or); transform: translateX(-50%);
}
.rlg-bridge::after {
  content: ""; position: absolute; left: 50%; top: 44px; width: 8px; height: 8px;
  background: var(--rlg-or); border-radius: 50%; transform: translateX(-50%);
}
.rlg-bridge p {
  font-family: var(--rlg-f-display); font-style: italic;
  font-size: clamp(20px, 2.2vw, 30px); line-height: 1.35;
  margin: 80px auto 0; max-width: 36ch; text-wrap: balance;
  font-weight: 400;
}
.rlg-bridge .rlg-bridge-eb {
  font-family: var(--rlg-f-sans); font-size: 11px; font-weight: 700;
  letter-spacing: .26em; text-transform: uppercase;
  margin-top: 80px; margin-bottom: 14px;
  display: inline-block;
}
.rlg-bridge .rlg-bridge-eb + p { margin-top: 0; }

/* ============================== INCLUSION BLOCK — citation typographique inclusive ============================== */
.rlg-inclusion {
  position: relative;
  background: var(--rlg-sapin-deep); color: var(--rlg-ivoire);
  padding: 56px 64px;
  border-left: 4px solid var(--rlg-or);
  overflow: hidden;
  isolation: isolate;
}
.rlg-inclusion::before {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 220px; height: 220px; border-radius: 50%;
  border: 1px solid rgba(217,168,95,.25);
  pointer-events: none;
}
.rlg-inclusion-eb {
  font-family: var(--rlg-f-sans); font-size: 11px; letter-spacing: .26em;
  text-transform: uppercase; font-weight: 700; color: var(--rlg-or);
  margin-bottom: 20px;
  display: inline-flex; gap: 12px; align-items: center;
}
.rlg-inclusion-eb::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.rlg-inclusion-lines {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--rlg-f-display); font-style: italic;
  font-size: clamp(24px, 2.6vw, 34px); line-height: 1.25;
  color: var(--rlg-ivoire); letter-spacing: -.01em;
  margin: 0 0 24px; max-width: 26ch;
}
.rlg-inclusion-lines span { display: block; }
.rlg-inclusion-lines .accent { color: var(--rlg-or-pale); }
.rlg-inclusion-caption {
  font-family: var(--rlg-f-serif); font-style: italic;
  font-size: 19px; line-height: 1.5; color: var(--rlg-or-pale);
  max-width: 52ch; margin: 0;
  border-top: 1px solid rgba(217,168,95,.3);
  padding-top: 22px;
}

/* ============================== RAIL — barre latérale de progression ============================== */
.rlg-rail {
  position: fixed; left: 28px; top: 50%; z-index: 30;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 22px;
  pointer-events: auto;
  opacity: 0; transition: opacity .5s var(--rlg-ease-soft);
}
.rlg-rail.is-visible { opacity: 1; }
.rlg-rail-item {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--rlg-encre);
  font-family: var(--rlg-f-sans); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; font-weight: 700;
}
.rlg-rail-item .num {
  font-family: var(--rlg-f-display); font-style: italic;
  font-size: 18px; color: var(--rlg-or-deep); line-height: 1;
  min-width: 24px; transition: color .25s var(--rlg-ease-soft);
}
.rlg-rail-item .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: transparent; border: 1.5px solid var(--rlg-or-deep);
  transition: background .25s var(--rlg-ease-soft), transform .25s var(--rlg-ease-soft);
}
.rlg-rail-item .lbl {
  max-width: 0; overflow: hidden; white-space: nowrap;
  transition: max-width .35s var(--rlg-ease-soft), padding .35s var(--rlg-ease-soft);
  color: var(--rlg-encre);
}
.rlg-rail-item:hover .lbl, .rlg-rail-item.is-active .lbl { max-width: 200px; padding-left: 4px; }
.rlg-rail-item.is-active .dot { background: var(--rlg-or); transform: scale(1.3); }
.rlg-rail-item.is-active .num { color: var(--rlg-or-deep); }

/* Mode rail-on-dark : couleurs inversées quand la section active est sombre */
.rlg-rail--on-dark .rlg-rail-item .num { color: var(--rlg-or); }
.rlg-rail--on-dark .rlg-rail-item .dot { border-color: var(--rlg-or); }
.rlg-rail--on-dark .rlg-rail-item .lbl { color: var(--rlg-or-pale); }

@media (max-width: 1100px) {
  .rlg-rail { display: none; }
}

/* ============================== TOOLS GRID — grille d'outils numérotés ============================== */
.rlg-tools {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
  margin: 24px 0;
}
.rlg-tool {
  padding: 24px 26px;
  background: rgba(244,236,220,.04);
  border: 1px solid var(--rlg-hairline-on-dark);
  display: grid; grid-template-columns: 36px 1fr; gap: 16px;
  align-items: start;
  transition: background .35s var(--rlg-ease-soft), border-color .35s var(--rlg-ease-soft);
}
.rlg-tool:hover {
  background: rgba(217,168,95,.08);
  border-color: rgba(217,168,95,.4);
}
.rlg-tool-num {
  font-family: var(--rlg-f-display); font-style: italic;
  font-size: 28px; line-height: 1; color: var(--rlg-or);
}
.rlg-tool h4 {
  font-family: var(--rlg-f-display); font-style: italic;
  font-size: 22px; line-height: 1.1; margin: 0 0 8px;
  font-weight: 400; letter-spacing: -.01em;
  color: inherit;
}
.rlg-tool p {
  font-family: var(--rlg-f-sans); font-size: 14px; line-height: 1.55;
  margin: 0; color: var(--rlg-brume);
}
.rlg-sec--ivoire .rlg-tool,
.rlg-sec--ivoire-deep .rlg-tool,
.rlg-sec--ivoire-soft .rlg-tool {
  background: var(--rlg-blanc);
  border-color: var(--rlg-hairline-or);
}
.rlg-sec--ivoire .rlg-tool p,
.rlg-sec--ivoire-deep .rlg-tool p,
.rlg-sec--ivoire-soft .rlg-tool p { color: var(--rlg-encre); opacity: .8; }

/* ============================== UTILS ============================== */
.rlg-pipes {
  font-family: var(--rlg-f-display); font-style: italic;
  color: var(--rlg-or); font-size: 56px; line-height: 1; letter-spacing: -.04em;
}

/* ============================== BOUTONS ============================== */
.rlg-btn-primary,
.rlg-btn-secondary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 32px; border-radius: 999px;
  font-family: var(--rlg-f-sans); font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  border: 1.5px solid transparent;
  transition: background var(--rlg-dur-fast) var(--rlg-ease-soft),
              color var(--rlg-dur-fast) var(--rlg-ease-soft),
              transform var(--rlg-dur-fast) var(--rlg-ease-soft),
              box-shadow var(--rlg-dur-fast) var(--rlg-ease-soft),
              border-color var(--rlg-dur-fast) var(--rlg-ease-soft);
  cursor: pointer;
}
.rlg-btn-primary { background: var(--rlg-or); color: var(--rlg-encre); }
.rlg-btn-primary:hover { background: var(--rlg-ivoire); transform: translateY(-2px); box-shadow: var(--rlg-shadow-or); }

.rlg-btn-secondary { background: transparent; color: var(--rlg-ivoire); border-color: var(--rlg-ivoire); }
.rlg-btn-secondary:hover { background: var(--rlg-ivoire); color: var(--rlg-encre); transform: translateY(-2px); }

/* Variante boutons secondaires sur fond clair */
.rlg-sec--ivoire .rlg-btn-secondary,
.rlg-sec--ivoire-soft .rlg-btn-secondary,
.rlg-sec--ivoire-deep .rlg-btn-secondary,
.rlg-sec--sapin-light .rlg-btn-secondary { color: var(--rlg-encre); border-color: var(--rlg-encre); }
.rlg-sec--ivoire .rlg-btn-secondary:hover,
.rlg-sec--ivoire-soft .rlg-btn-secondary:hover,
.rlg-sec--ivoire-deep .rlg-btn-secondary:hover,
.rlg-sec--sapin-light .rlg-btn-secondary:hover { background: var(--rlg-encre); color: var(--rlg-ivoire); }

/* Lien-CTA sobre (souligné or) */
.rlg-btn-link {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 0; border-bottom: 2px solid var(--rlg-or);
  font-family: var(--rlg-f-sans); font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  color: var(--rlg-encre);
  transition: color var(--rlg-dur-fast) var(--rlg-ease-soft), border-color var(--rlg-dur-fast) var(--rlg-ease-soft);
}
.rlg-btn-link:hover { color: var(--rlg-or-deep); border-bottom-color: var(--rlg-or-deep); }
.rlg-sec--encre .rlg-btn-link, .rlg-sec--sapin-deep .rlg-btn-link { color: var(--rlg-ivoire); }

/* Focus ring uniforme */
.rlg-btn-primary:focus-visible,
.rlg-btn-secondary:focus-visible,
.rlg-btn-link:focus-visible { outline: 0; box-shadow: var(--rlg-focus-ring); }

/* ============================== NAV (sticky, badge logo) ============================== */
.rlg-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--rlg-z-nav);
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 40px;
  color: var(--rlg-encre);
  background: rgba(251,248,241,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rlg-gris-1);
  transition: background var(--rlg-dur-base) var(--rlg-ease-soft),
              color var(--rlg-dur-base) var(--rlg-ease-soft),
              border-color var(--rlg-dur-base) var(--rlg-ease-soft),
              padding var(--rlg-dur-base) var(--rlg-ease-soft);
}
.rlg-nav.is-scrolled { padding: 10px 40px; box-shadow: var(--rlg-shadow-sm); }

/* Variante nav-on-hero : transparente sur photo, devient claire au scroll */
.rlg-nav--on-hero { background: transparent; color: var(--rlg-ivoire); border-bottom-color: transparent; }
.rlg-nav--on-hero.is-scrolled { background: rgba(251,248,241,0.95); color: var(--rlg-encre); border-bottom-color: var(--rlg-gris-1); }

.rlg-nav-logo { display: flex; align-items: center; gap: 12px; }
.rlg-nav-logo-badge {
  background: var(--rlg-blanc); padding: 14px 22px; border-radius: 10px;
  display: inline-flex; align-items: center;
  box-shadow: var(--rlg-shadow-logo);
  transition: padding var(--rlg-dur-base) var(--rlg-ease-soft),
              box-shadow var(--rlg-dur-base) var(--rlg-ease-soft),
              transform var(--rlg-dur-base) var(--rlg-ease-soft);
}
.rlg-nav.is-scrolled .rlg-nav-logo-badge { padding: 10px 16px; box-shadow: var(--rlg-shadow-logo-sm); }
.rlg-nav-logo-badge:hover { transform: rotate(-2deg) scale(1.05); box-shadow: 0 12px 32px rgba(14,37,64,.28), 0 0 0 1px var(--rlg-or) inset; }
.rlg-nav-logo img { height: 72px; width: auto; display: block; transition: height var(--rlg-dur-base) var(--rlg-ease-soft); }
.rlg-nav.is-scrolled .rlg-nav-logo img { height: 52px; }

.rlg-nav-c { display: flex; gap: 26px; justify-content: center; }
.rlg-nav-c a {
  color: inherit; text-decoration: none; font-size: 13px; font-weight: 500;
  letter-spacing: .04em; padding: 6px 0; position: relative;
}
.rlg-nav-c a.is-active { color: var(--rlg-or-deep); }
.rlg-nav-c a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 2px;
  height: 1px; background: var(--rlg-or);
  transition: right var(--rlg-dur-base) var(--rlg-ease-soft);
}
.rlg-nav-c a:hover::after, .rlg-nav-c a.is-active::after { right: 0; }

.rlg-nav-r { display: flex; justify-content: flex-end; gap: 16px; align-items: center; }

@media (max-width: 1100px) {
  .rlg-nav-c { display: none; }
  .rlg-nav { grid-template-columns: 1fr auto; }
  .rlg-nav-logo img { height: 56px; }
  .rlg-nav.is-scrolled .rlg-nav-logo img { height: 42px; }
}

/* ============================== CERCLE SIGNALÉTIQUE ROTÉ ============================== */
.rlg-circle-stamp {
  width: 130px; height: 130px; border: 1.5px solid var(--rlg-or-deep);
  border-radius: 50%; background: var(--rlg-ivoire);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 12px;
  font-family: var(--rlg-f-sans); font-size: 10px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--rlg-encre);
  line-height: 1.4;
  rotate: 8deg;
}
.rlg-circle-stamp--lg { width: 170px; height: 170px; padding: 16px; }
.rlg-circle-stamp--ccw { rotate: -8deg; }
.rlg-circle-stamp--on-dark {
  background: rgba(14,37,64,.45); backdrop-filter: blur(4px);
  border-color: var(--rlg-or); color: var(--rlg-or);
}
.rlg-circle-stamp em {
  font-style: italic; font-family: var(--rlg-f-display);
  font-size: 22px; color: var(--rlg-or-deep); display: block;
  line-height: 1; margin: 4px 0;
  letter-spacing: -0.01em; text-transform: none; font-weight: 400;
}
.rlg-circle-stamp--on-dark em { color: var(--rlg-ivoire); font-size: 24px; }

/* ============================== PHOTO ENCADRÉE OR (carte d'identité visuelle) ============================== */
.rlg-photo-or {
  position: relative; aspect-ratio: 4/5;
  transition: transform var(--rlg-dur-slow) var(--rlg-ease-soft);
}
.rlg-photo-or:hover { transform: translate(-4px, -4px); }
.rlg-photo-or img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.rlg-photo-or::before {
  content: ""; position: absolute; left: -16px; bottom: -16px;
  width: 100%; height: 100%; background: var(--rlg-or); z-index: 0;
}
.rlg-photo-or .rlg-circle-stamp {
  position: absolute; right: -32px; top: -32px; z-index: 2;
}

/* ============================== META-GRID — bandeau de specs (paiement, contact, etc.) ============================== */
.rlg-meta-grid {
  display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 0;
  background: var(--rlg-ivoire);
  border-left: 4px solid var(--rlg-or);
}
.rlg-meta-grid > div {
  padding: 24px 28px;
  font-family: var(--rlg-f-sans); font-size: 13px; line-height: 1.6;
  color: var(--rlg-encre);
  border-right: 1px solid var(--rlg-hairline);
}
.rlg-meta-grid > div:last-child { border-right: 0; }
.rlg-meta-grid b {
  display: block; font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--rlg-or-deep); font-weight: 700;
  margin-bottom: 8px;
}
.rlg-meta-grid--3 { --cols: 3; }
.rlg-meta-grid--2 { --cols: 2; }
.rlg-meta-grid--blanc { background: var(--rlg-blanc); }

@media (max-width: 1100px) {
  .rlg-meta-grid { grid-template-columns: 1fr; }
  .rlg-meta-grid > div { border-right: 0; border-bottom: 1px solid var(--rlg-hairline); }
  .rlg-meta-grid > div:last-child { border-bottom: 0; }
}

/* ============================== PLATES TYPOGRAPHIQUES (panneaux d'exercices) ============================== */
.rlg-plate {
  min-height: 580px;
  padding: 72px 56px; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.rlg-plate-eb {
  font-family: var(--rlg-f-sans); font-size: 11px; letter-spacing: .26em;
  text-transform: uppercase; font-weight: 700;
  display: inline-flex; align-items: center; gap: 14px; margin-bottom: 36px;
  color: var(--rlg-or-deep);
}
.rlg-plate-eb::before { content: ""; width: 32px; height: 1px; background: currentColor; }
.rlg-plate-foot {
  margin-top: auto; padding-top: 24px;
  font-family: var(--rlg-f-serif); font-style: italic; font-size: 17px;
  line-height: 1.4; max-width: 36ch;
  border-top: 1px solid currentColor;
  opacity: .7;
}
.rlg-plate--ivoire      { background: var(--rlg-ivoire);      color: var(--rlg-encre); }
.rlg-plate--ivoire-deep { background: var(--rlg-ivoire-deep); color: var(--rlg-encre); }
.rlg-plate--encre       { background: var(--rlg-encre);       color: var(--rlg-ivoire); }
.rlg-plate--encre .rlg-plate-eb,
.rlg-plate--nuit .rlg-plate-eb       { color: var(--rlg-or); }
.rlg-plate--nuit        { background: var(--rlg-nuit);        color: var(--rlg-ivoire); padding: 72px 64px; }
.rlg-plate--sapin-deep  { background: var(--rlg-sapin-deep);  color: var(--rlg-ivoire); }
.rlg-plate--sapin-deep .rlg-plate-eb { color: var(--rlg-or); }

/* ============================== ASIDE-CARD (encart latéral encre, filet or) ============================== */
.rlg-aside-card {
  position: relative;
  background: var(--rlg-encre); color: var(--rlg-ivoire);
  padding: 48px 36px;
  border-radius: 4px;
}
.rlg-aside-card::before {
  content: ""; position: absolute; left: -1px; top: 32px; bottom: 32px; width: 4px;
  background: var(--rlg-or);
}
.rlg-aside-card-eb {
  font-family: var(--rlg-f-sans); font-size: 11px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--rlg-or);
  margin-bottom: 18px;
}
.rlg-aside-card h4 {
  font-family: var(--rlg-f-display); font-style: italic;
  font-size: 26px; line-height: 1.2;
  color: var(--rlg-ivoire); margin: 0 0 18px; font-weight: 400;
}
.rlg-aside-card h5 {
  font-family: var(--rlg-f-sans); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--rlg-or);
  margin: 22px 0 10px; font-weight: 700;
}
.rlg-aside-card ul { list-style: none; padding: 0; margin: 0; }
.rlg-aside-card li {
  padding: 12px 0; border-bottom: 1px solid var(--rlg-hairline-on-dark);
  font-family: var(--rlg-f-sans); font-size: 14px; line-height: 1.5;
  color: var(--rlg-brume);
  display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: baseline;
}
.rlg-aside-card li:last-child { border-bottom: 0; }
.rlg-aside-card li .num {
  font-family: var(--rlg-f-display); font-style: italic;
  color: var(--rlg-or); font-size: 15px;
}

.rlg-reveal { opacity: 0; transform: translateY(20px); transition: opacity var(--rlg-dur-reveal) var(--rlg-ease-narrative), transform var(--rlg-dur-reveal) var(--rlg-ease-narrative); }
.rlg-reveal.is-in { opacity: 1; transform: none; }
.rlg-reveal--d1 { transition-delay: .08s; }
.rlg-reveal--d2 { transition-delay: .16s; }
.rlg-reveal--d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .rlg-reveal { opacity: 1; transform: none; transition: none; }
}
