/* ==========================================================================
   Réalisations — styles communs listing (#s-list) et fiche (#s-fiche)
   Préfixe :is(#s-list, #s-fiche) = spécificité d'un id, pour passer devant Divi.
   ========================================================================== */

:is(#s-list, #s-fiche) {
  --rap-navy: #0D2441;
  --rap-ink: #0D2441;
  --rap-muted: #5B6B80;
  --rap-bg: #FFFFFF;
  --rap-bg-soft: #F5F6F8;
  --rap-line: #E3E7ED;
  --rap-display: "IvyMode", "Marcellus", Georgia, serif;
  --rap-body: "Inter", Helvetica, Arial, sans-serif;
  --rap-r: 12px;
  --rap-max: 1240px;

  background: var(--rap-bg);
  color: var(--rap-ink);
  font-family: var(--rap-body);
  font-size: 16px;
  line-height: 1.6;
}

:is(#s-list, #s-fiche) *,
:is(#s-list, #s-fiche) *::before,
:is(#s-list, #s-fiche) *::after {
  box-sizing: border-box;
}

/* Reset Divi */
:is(#s-list, #s-fiche) :is(h1, h2, h3, h4) {
  font-family: var(--rap-display);
  font-weight: 400;
  margin: 0;
  padding: 0;
  line-height: 1.15;
  color: var(--rap-navy);
  text-wrap: balance;
}
:is(#s-list, #s-fiche) p {
  margin: 0;
  padding: 0;
}
:is(#s-list, #s-fiche) img {
  max-width: 100%;
  display: block;
}
:is(#s-list, #s-fiche) a {
  color: inherit;
}
:is(#s-list, #s-fiche) [hidden] {
  display: none !important;
}

:is(#s-list, #s-fiche) .rap-wrap {
  max-width: var(--rap-max);
  margin: 0 auto;
  padding-inline: 24px;
}

/* ---------- boutons ---------- */
:is(#s-list, #s-fiche) .rap-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 15px;
  padding: 12px 20px;
  font: 500 13px/1.2 var(--rap-body);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
:is(#s-list, #s-fiche) .rap-btn-w {
  background: #fff;
  color: var(--rap-navy);
}
:is(#s-list, #s-fiche) .rap-btn-n {
  background: var(--rap-navy);
  color: #fff;
}
:is(#s-list, #s-fiche) .rap-btn-ghost {
  background: transparent;
  color: var(--rap-navy);
  border-color: var(--rap-navy);
}

/* ---------- bandeau de tête ---------- */
:is(#s-list, #s-fiche) .rap-pagehead {
  background: var(--rap-bg-soft);
}
:is(#s-list, #s-fiche) .rap-pagehead > .rap-wrap:first-child {
  text-align: center;
}
:is(#s-list, #s-fiche) .rap-crumb {
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--rap-muted);
  margin-bottom: 34px;
}
:is(#s-list, #s-fiche) .rap-crumb a {
  text-decoration: none;
}
:is(#s-list, #s-fiche) .rap-crumb a:hover {
  color: var(--rap-navy);
}
:is(#s-list, #s-fiche) .rap-crumb b {
  font-weight: 500;
  color: var(--rap-navy);
}
:is(#s-list, #s-fiche) .rap-pagehead h1 {
  letter-spacing: -.022em;
  margin-inline: auto;
}

/* ---------- grille + cartes chantier ---------- */
:is(#s-list, #s-fiche) .rap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 48px;
  row-gap: 64px;
}
:is(#s-list, #s-fiche) .rap-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
:is(#s-list, #s-fiche) .rap-card:focus-visible {
  outline: 2px solid var(--rap-navy);
  outline-offset: 6px;
  border-radius: var(--rap-r);
}
:is(#s-list, #s-fiche) .rap-ph {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--rap-r);
  overflow: hidden;
  background: linear-gradient(135deg, #C9CFD8, #8E99A8);
}
:is(#s-list, #s-fiche) .rap-ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .6, .2, 1);
}
:is(#s-list, #s-fiche) .rap-card:hover .rap-ph img {
  transform: scale(1.04);
}
:is(#s-list, #s-fiche) .rap-ville {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 1;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--rap-navy);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.4;
  padding: 7px 15px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(13, 36, 65, .12);
}
:is(#s-list, #s-fiche) .rap-bd {
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
:is(#s-list, #s-fiche) .rap-card h3 {
  font-size: 28px;
  line-height: 1.25;
  margin-bottom: 22px;
}
:is(#s-list, #s-fiche) .rap-card .rap-btn {
  margin-top: auto;
  align-self: flex-start;
}
:is(#s-list, #s-fiche) .rap-card .rap-btn-ghost {
  border-color: var(--rap-line);
  transition: border-color .2s, background .2s, color .2s;
}
:is(#s-list, #s-fiche) .rap-card:hover .rap-btn-ghost {
  border-color: var(--rap-navy);
  background: var(--rap-navy);
  color: #fff;
}

/* ---------- bandeau CTA ---------- */
:is(#s-list, #s-fiche) .rap-band {
  background: var(--rap-navy);
  color: #fff;
}
:is(#s-list, #s-fiche) .rap-band .rap-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 44px;
  flex-wrap: wrap;
}
:is(#s-list, #s-fiche) .rap-band h2 {
  font-size: 30px;
  color: #fff;
}
:is(#s-list, #s-fiche) .rap-band p {
  opacity: .85;
  margin-top: 6px;
  max-width: 56ch;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  :is(#s-list, #s-fiche) .rap-grid {
    grid-template-columns: 1fr;
    row-gap: 44px;
  }
  :is(#s-list, #s-fiche) .rap-card h3 {
    font-size: 23px;
  }
  :is(#s-list, #s-fiche) .rap-band h2 {
    font-size: 26px;
  }
  :is(#s-list, #s-fiche) .rap-pagehead > .rap-wrap:first-child {
    text-align: left;
  }
  :is(#s-list, #s-fiche) .rap-pagehead h1 {
    max-width: none;
  }
  :is(#s-list, #s-fiche) .rap-crumb {
    margin-bottom: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(#s-list, #s-fiche) * {
    transition: none !important;
  }
}
