/**
 * Cartes en retrait (#FAFAF8) + fil doré entre fond carte et contenu.
 * Accueil, Pour qui, Maïeusthésie, Qui suis-je, Contact — 1 section sur 2 après le hero.
 */

body.home.mc-accueil #ldc-main,
body.mc-pourqui #ldc-main,
body.mc-maieusthesie #ldc-main,
body.mc-qui-suis-je #ldc-main,
body.mc-contact #ldc-main {
  isolation: isolate;
  position: relative;
}

body.home.mc-accueil #ldc-main .page-thread-wrapper,
body.mc-pourqui #ldc-main .page-thread-wrapper,
body.mc-maieusthesie #ldc-main .page-thread-wrapper,
body.mc-qui-suis-je #ldc-main .page-thread-wrapper,
body.mc-contact #ldc-main .page-thread-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

/* Fil au-dessus des fonds de section, sous le contenu direct */
body.home.mc-accueil #ldc-main > section > *,
body.mc-pourqui #ldc-main > section > *,
body.mc-maieusthesie #ldc-main > section > *,
body.mc-qui-suis-je #ldc-main > section > *,
body.mc-contact #ldc-main > section > * {
  position: relative;
  z-index: 2;
}

body.home.mc-accueil #ldc-main > section,
body.mc-pourqui #ldc-main > section,
body.mc-maieusthesie #ldc-main > section,
body.mc-qui-suis-je #ldc-main > section,
body.mc-contact #ldc-main > section {
  position: relative;
  z-index: auto;
}

body.home.mc-accueil #ldc-main section.mc-sec,
body.mc-pourqui #ldc-main section.mc-sec,
body.mc-maieusthesie #ldc-main section.mc-sec,
body.mc-qui-suis-je #ldc-main section.mc-sec,
body.mc-contact #ldc-main section.mc-sec {
  z-index: auto;
}

body.home.mc-accueil #ldc-main section.mc-sec > *,
body.mc-pourqui #ldc-main section.mc-sec > *,
body.mc-maieusthesie #ldc-main section.mc-sec > *,
body.mc-qui-suis-je #ldc-main section.mc-sec > *,
body.mc-contact #ldc-main section.mc-sec > * {
  position: relative;
  z-index: 2;
}

body.home.mc-accueil #ldc-main > section.mc-sec.mc-sec--card,
body.mc-pourqui #ldc-main > section.mc-sec.mc-sec--card,
body.mc-maieusthesie #ldc-main > section.mc-sec.mc-sec--card,
body.mc-qui-suis-je #ldc-main > section.mc-sec.mc-sec--card,
body.mc-contact #ldc-main > section.mc-sec.mc-sec--card,
body.home.mc-accueil section.mc-sec.mc-sec--card,
body.mc-pourqui section.mc-sec.mc-sec--card,
body.mc-maieusthesie section.mc-sec.mc-sec--card,
body.mc-qui-suis-je section.mc-sec.mc-sec--card,
body.mc-contact section.mc-sec.mc-sec--card {
  position: relative;
  margin-left: 24px;
  margin-right: 24px;
  border-radius: 16px;
  background-color: transparent !important;
  box-sizing: border-box;
}

body.home.mc-accueil section.mc-sec.mc-sec--card::before,
body.mc-pourqui section.mc-sec.mc-sec--card::before,
body.mc-maieusthesie section.mc-sec.mc-sec--card::before,
body.mc-qui-suis-je section.mc-sec.mc-sec--card::before,
body.mc-contact section.mc-sec.mc-sec--card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  background-color: var(--mc-sec-card-bg, var(--mc-off, #fafaf8));
}

body.home.mc-accueil section.mc-sec.mc-sec--closing--white::before {
  background-color: var(--mc-closing-bg, #fafaf8);
}

@media (max-width: 768px) {
  body.home.mc-accueil section.mc-sec.mc-sec--card,
  body.mc-pourqui section.mc-sec.mc-sec--card,
  body.mc-maieusthesie section.mc-sec.mc-sec--card,
  body.mc-qui-suis-je section.mc-sec.mc-sec--card,
  body.mc-contact section.mc-sec.mc-sec--card {
    margin-left: 8px;
    margin-right: 8px;
    border-radius: 12px;
  }

  /*
   * Padding interne des cartes blanches — prioritaire sur le padding-inline: 0
   * des règles page (#ldc-main > section:not(#hero)).
   */
  body.home.mc-accueil #ldc-main > section.mc-sec.mc-sec--card,
  body.mc-pourqui #ldc-main > section.mc-sec.mc-sec--card,
  body.mc-maieusthesie #ldc-main > section.mc-sec.mc-sec--card,
  body.mc-qui-suis-je #ldc-main > section.mc-sec.mc-sec--card,
  body.mc-contact #ldc-main > section.mc-sec.mc-sec--card {
    box-sizing: border-box;
    padding-block: 16px;
    padding-inline: 14px;
  }

  /*
   * Idée 7 — liseret doré fin sur tout le contour du bloc clair (mobile).
   * inset 1 px, discret ; lueur externe légère au scroll (classe JS).
   */
  body.home.mc-accueil section.mc-sec.mc-sec--card,
  body.mc-pourqui section.mc-sec.mc-sec--card,
  body.mc-maieusthesie section.mc-sec.mc-sec--card,
  body.mc-qui-suis-je section.mc-sec.mc-sec--card,
  body.mc-contact section.mc-sec.mc-sec--card {
    box-shadow: inset 0 0 0 1px rgba(200, 150, 62, 0.32);
    -webkit-transition: box-shadow 0.55s ease;
    transition: box-shadow 0.55s ease;
  }

  #ldc-main section.mc-sec--card.ldc-sec-card--in-view {
    box-shadow:
      inset 0 0 0 1px rgba(200, 150, 62, 0.38),
      0 4px 16px rgba(200, 150, 62, 0.1);
  }

  /*
   * Idée 7 — lueur dorée au scroll (sections mc-sec--card, mobile).
   * Retirer ce bloc + initMobileCardShimmer() dans coeurdonnerie.js.
   */
  #ldc-main section.mc-sec--card .ldc-card-shimmer {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 20;
    overflow: hidden;
  }

  #ldc-main section.mc-sec--card .ldc-card-shimmer__beam {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    height: 40px;
    border-radius: 4px;
    background: linear-gradient(
      180deg,
      rgba(235, 200, 134, 0) 0%,
      rgba(235, 200, 134, 0.18) 25%,
      rgba(245, 223, 168, 0.55) 50%,
      rgba(235, 200, 134, 0.18) 75%,
      rgba(235, 200, 134, 0) 100%
    );
    box-shadow: 0 0 14px rgba(235, 200, 134, 0.22);
    opacity: 1;
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  #ldc-main section.mc-sec--card .ldc-card-shimmer {
    display: none;
  }
}
