/*
 * POLYALIS Presence V1 — Prestations
 *
 * Issue #96:
 * - align Prestations with the visual vocabulary approved on Home;
 * - keep the five-family business architecture intact;
 * - use local Bootstrap Icons instead of one-off inline SVG;
 * - preserve content-driven responsive behavior.
 */

main[data-shell-view="prestations"] {
  --prestations-ink: #181c16;
  --prestations-muted: #596154;
  --prestations-white: #ffffff;

  width: 100%;
  max-width: var(--presence-v1-layout-max);
  margin-inline: auto;
  color: var(--prestations-ink);
  background: var(--prestations-white);
}

main[data-shell-view="prestations"] p {
  margin-block-start: 0;
}

.v1-prestations-eyebrow,
.v1-prestations-family-kicker,
.v1-prestations-webm__label,
.v1-prestations-hero__map-label {
  color: var(--presence-v1-color-accent-dark);
  font-family: var(--presence-v1-font-body);
  font-size: 0.75rem;
  font-weight: var(--presence-v1-font-weight-bold);
  letter-spacing: 0.11em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Shared local Bootstrap icon masks */

.v1-prestations-icon {
  --v1-prestations-icon-image: none;

  display: inline-block;
  width: 1.7rem;
  height: 1.7rem;
  background-color: currentColor;
  -webkit-mask-image: var(--v1-prestations-icon-image);
  mask-image: var(--v1-prestations-icon-image);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.v1-prestations-icon--chat-dots {
  --v1-prestations-icon-image: url("/assets/icons/bootstrap/chat-dots.svg");
}

.v1-prestations-icon--lightbulb {
  --v1-prestations-icon-image: url("/assets/icons/bootstrap/lightbulb.svg");
}

.v1-prestations-icon--display {
  --v1-prestations-icon-image: url("/assets/icons/bootstrap/display.svg");
}

.v1-prestations-icon--sliders {
  --v1-prestations-icon-image: url("/assets/icons/bootstrap/sliders.svg");
}

.v1-prestations-icon--arrow-repeat {
  --v1-prestations-icon-image: url("/assets/icons/bootstrap/arrow-repeat.svg");
}

/* Hero */

.v1-prestations-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 88% 18%,
      color-mix(in srgb, var(--presence-v1-color-accent-soft) 72%, transparent),
      transparent 28rem
    ),
    linear-gradient(
      135deg,
      white 0%,
      var(--presence-v1-color-accent-very-soft) 100%
    );
  border-block-end: 1px solid var(--presence-v1-color-accent-soft);
}

.v1-prestations-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(
      to right,
      color-mix(in srgb, var(--presence-v1-color-accent-dark) 13%, transparent) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--presence-v1-color-accent-dark) 13%, transparent) 1px,
      transparent 1px
    );
  background-size:
    clamp(2.4rem, 4vw, 3.25rem)
    clamp(2.4rem, 4vw, 3.25rem);
  background-position: right top;
  opacity: 0.3;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    transparent 30%,
    rgb(0 0 0 / 0.35) 54%,
    black 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    transparent 30%,
    rgb(0 0 0 / 0.35) 54%,
    black 100%
  );
  pointer-events: none;
}

.v1-prestations-hero__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  min-block-size: clamp(38rem, 72vh, 52rem);
  padding-block: clamp(4.5rem, 10vw, 7rem);
}

.v1-prestations-hero__copy {
  min-width: 0;
  max-width: 56rem;
}

.v1-prestations-hero__title {
  max-width: 18ch;
  margin: 0;
  font-family: var(--presence-v1-font-display);
  font-size: clamp(2.55rem, 7vw, 5rem);
  font-weight: var(--presence-v1-font-weight-semibold);
  letter-spacing: -0.045em;
  line-height: 1.03;
  text-wrap: balance;
  overflow-wrap: normal;
}

.v1-prestations-hero__lead {
  max-width: 49rem;
  margin: clamp(1.4rem, 3vw, 2rem) 0 0;
  font-size: clamp(1.08rem, 2.2vw, 1.3rem);
  line-height: 1.65;
}

.v1-prestations-hero__relationship {
  max-width: 44rem;
  margin: 1.25rem 0 0;
  padding-inline-start: 1rem;
  border-inline-start: 0.25rem solid var(--presence-v1-color-accent);
  color: var(--presence-v1-color-accent-dark);
  font-weight: var(--presence-v1-font-weight-semibold);
  line-height: 1.55;
}

.v1-prestations-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  min-block-size: 3rem;
  margin-block-start: 1.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--presence-v1-color-accent);
  color: white;
  border: 2px solid var(--presence-v1-color-accent);
  border-radius: 999px;
  box-shadow: 0 0.75rem 2rem rgb(77 124 15 / 0.18);
  font-weight: var(--presence-v1-font-weight-semibold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.v1-prestations-primary:hover {
  background: var(--presence-v1-color-accent-dark);
  border-color: var(--presence-v1-color-accent-dark);
}

.v1-prestations-hero__map {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: rgb(255 255 255 / 0.9);
  border: 1px solid var(--presence-v1-color-accent-soft);
  border-radius: 0.75rem;
  box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 0.06);
  backdrop-filter: blur(0.25rem);
}

.v1-prestations-hero__map-label {
  margin: 0 0 1rem;
}

.v1-prestations-hero__map-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-start: 1px solid var(--presence-v1-color-accent-soft);
}

.v1-prestations-hero__map-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.875rem;
  align-items: center;
  padding-block: 0.875rem;
  border-block-end: 1px solid var(--presence-v1-color-accent-soft);
}

.v1-prestations-hero__map-number {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  background: var(--presence-v1-color-accent);
  color: white;
  border-radius: 50%;
  font-family: var(--presence-v1-font-display);
  font-size: 0.72rem;
  font-weight: var(--presence-v1-font-weight-bold);
}

.v1-prestations-hero__map-list strong,
.v1-prestations-hero__map-list small {
  display: block;
}

.v1-prestations-hero__map-list strong {
  font-family: var(--presence-v1-font-display);
  font-size: 1rem;
  line-height: 1.3;
}

.v1-prestations-hero__map-list small {
  margin-block-start: 0.2rem;
  color: var(--prestations-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Section heading */

.v1-prestations-section-heading {
  max-width: 56rem;
  margin-block-end: clamp(2rem, 5vw, 3rem);
}

.v1-prestations-section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.v1-prestations-section-heading p {
  max-width: 48rem;
  margin: 1rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.65;
}

/* Five equal-rank families */

.v1-prestations-family-map {
  padding-block: clamp(4rem, 8vw, 6.5rem);
  background: var(--prestations-white);
}

.v1-prestations-family-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.v1-prestations-family-card {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 1.6rem);
  background: white;
  border: 1px solid var(--presence-v1-color-accent-soft);
  border-block-start: 0.25rem solid var(--presence-v1-color-accent);
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.05);
}

.v1-prestations-family-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 1.25rem;
}

.v1-prestations-family-card__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  background: var(--presence-v1-color-accent-very-soft);
  color: var(--presence-v1-color-accent);
  border: 1px solid var(--presence-v1-color-accent-soft);
  border-radius: 50%;
}

.v1-prestations-family-card__number {
  color: var(--presence-v1-color-accent-dark);
  font-family: var(--presence-v1-font-display);
  font-size: 0.78rem;
  font-weight: var(--presence-v1-font-weight-bold);
  letter-spacing: 0.08em;
}

.v1-prestations-family-card h3 {
  margin: 0 0 0.625rem;
  font-family: var(--presence-v1-font-display);
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.25;
}

.v1-prestations-family-card p {
  margin: 0;
  color: var(--prestations-muted);
  line-height: 1.55;
}

/* Family detail blocks */

.v1-prestations-detail {
  padding-block: clamp(3.25rem, 7vw, 5rem);
  background: white;
  border-block-start: 1px solid var(--presence-v1-color-accent-soft);
}

.v1-prestations-detail--alt {
  background: color-mix(
    in srgb,
    var(--presence-v1-color-accent-very-soft) 38%,
    white
  );
}

.v1-prestations-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
}

.v1-prestations-family-kicker {
  margin: 0 0 0.75rem;
}

.v1-prestations-detail__heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.v1-prestations-detail__heading > p:last-child {
  max-width: 32rem;
  margin: 0.875rem 0 0;
  color: var(--prestations-muted);
  font-size: clamp(1.05rem, 2vw, 1.18rem);
  line-height: 1.55;
}

.v1-prestations-micro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.875rem;
}

.v1-prestations-micro {
  min-width: 0;
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--presence-v1-color-accent-soft);
  border-inline-start: 0.25rem solid var(--presence-v1-color-accent);
  border-radius: 0.65rem;
}

.v1-prestations-detail:not(.v1-prestations-detail--alt) .v1-prestations-micro {
  background: var(--presence-v1-color-accent-very-soft);
}

.v1-prestations-micro h3 {
  margin: 0 0 0.75rem;
  color: var(--presence-v1-color-accent-dark);
  font-family: var(--presence-v1-font-body);
  font-size: 0.8rem;
  font-weight: var(--presence-v1-font-weight-bold);
  letter-spacing: 0.045em;
  line-height: 1.3;
  text-transform: uppercase;
}

.v1-prestations-micro p {
  margin: 0;
  line-height: 1.58;
}

/* WEB-M — deliberately secondary */

.v1-prestations-webm {
  padding-block: clamp(4rem, 8vw, 6rem);
  background: white;
}

.v1-prestations-webm__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 70rem;
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--presence-v1-color-accent-very-soft);
  border: 1px solid var(--presence-v1-color-accent-soft);
  border-inline-start: 0.35rem solid var(--presence-v1-color-accent);
  border-radius: 0.75rem;
}

.v1-prestations-webm__label {
  margin: 0 0 0.625rem;
}

.v1-prestations-webm h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
}

.v1-prestations-webm__copy p {
  margin: 0;
  font-size: clamp(1.03rem, 1.8vw, 1.12rem);
  line-height: 1.65;
}

.v1-prestations-webm__copy p + p {
  margin-block-start: 0.875rem;
}

.v1-prestations-webm__note {
  color: var(--presence-v1-color-accent-dark);
  font-weight: var(--presence-v1-font-weight-semibold);
}

/* Proportional intervention */

.v1-prestations-levels {
  padding-block: clamp(4rem, 8vw, 6rem);
  background: var(--presence-v1-color-accent-very-soft);
}

.v1-prestations-levels__heading {
  max-width: 57rem;
  margin-block-end: clamp(2rem, 5vw, 3rem);
}

.v1-prestations-levels__heading .v1-prestations-eyebrow {
  margin-block-end: 0.75rem;
}

.v1-prestations-levels__heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.v1-prestations-levels__heading > p:last-child {
  max-width: 48rem;
  margin: 1rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.18rem);
  line-height: 1.65;
}

.v1-prestations-levels__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.v1-prestations-level {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 1.6rem);
  background: white;
  border: 1px solid var(--presence-v1-color-accent-soft);
  border-radius: 0.75rem;
}

.v1-prestations-level__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2rem;
  margin-block-end: 1.25rem;
  padding-inline: 0.65rem;
  background: var(--presence-v1-color-accent);
  color: white;
  border-radius: 999px;
  font-family: var(--presence-v1-font-display);
  font-size: 0.75rem;
  font-weight: var(--presence-v1-font-weight-bold);
  letter-spacing: 0.06em;
}

.v1-prestations-level h3 {
  margin: 0 0 0.75rem;
  font-family: var(--presence-v1-font-display);
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  line-height: 1.3;
}

.v1-prestations-level p {
  margin: 0;
  color: var(--prestations-muted);
  line-height: 1.55;
}

/* Final CTA — aligned with Home, not duplicated */

.v1-prestations-final {
  background: var(--presence-v1-color-accent-dark);
  color: white;
}

.v1-prestations-final__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  padding-block: clamp(2rem, 5vw, 3rem);
}

.v1-prestations-final__copy {
  min-width: 0;
}

.v1-prestations-final__copy h2 {
  margin: 0;
  color: white;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.25;
}

.v1-prestations-final__copy p {
  max-width: 52rem;
  margin: 0.6rem 0 0;
  color: white;
  font-size: clamp(1rem, 1.8vw, 1.1rem);
  line-height: 1.55;
}

.v1-prestations-final__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  min-block-size: 3rem;
  padding: 0.75rem 1.5rem;
  background: white;
  color: var(--presence-v1-color-accent-dark);
  border: 2px solid white;
  border-radius: 999px;
  font-weight: var(--presence-v1-font-weight-semibold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.v1-prestations-final__action:hover {
  background: var(--presence-v1-color-accent-very-soft);
}

/* Mobile enrichment at 522px */

@media (min-width: 32.625rem) and (max-width: 47.999rem) {
  .v1-prestations-primary {
    width: fit-content;
  }

  .v1-prestations-family-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v1-prestations-family-card:last-child {
    grid-column: 1 / -1;
    width: calc((100% - 1rem) / 2);
    justify-self: center;
  }

  .v1-prestations-levels__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v1-prestations-final__action {
    width: fit-content;
  }
}

/* Tablet */

@media (min-width: 48rem) {
  .v1-prestations-primary {
    width: fit-content;
  }

  .v1-prestations-hero__map-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.25rem;
  }

  .v1-prestations-hero__map-list li:last-child {
    grid-column: 1 / -1;
  }

  .v1-prestations-family-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .v1-prestations-family-card {
    grid-column: span 2;
  }

  .v1-prestations-family-card:nth-last-child(2) {
    grid-column: 2 / span 2;
  }

  .v1-prestations-family-card:last-child {
    grid-column: 4 / span 2;
  }

  .v1-prestations-micro-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v1-prestations-webm__card {
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
    gap: 2rem;
  }

  .v1-prestations-levels__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v1-prestations-final__action {
    width: fit-content;
  }
}

/* Desktop — local Presence switch = 1120px */

@media (min-width: 70rem) {
  .v1-prestations-hero__layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.65fr);
    gap: clamp(3.5rem, 6vw, 6rem);
    min-block-size: clamp(42rem, 76vh, 56rem);
    padding-block: clamp(5rem, 8vw, 7rem);
  }

  .v1-prestations-hero__map-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .v1-prestations-hero__map-list li:last-child {
    grid-column: auto;
  }

  .v1-prestations-family-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .v1-prestations-family-card,
  .v1-prestations-family-card:nth-last-child(2),
  .v1-prestations-family-card:last-child {
    grid-column: auto;
    width: auto;
  }

  .v1-prestations-detail__layout {
    grid-template-columns: minmax(17rem, 0.75fr) minmax(0, 1.55fr);
    gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: center;
  }

  .v1-prestations-webm__card {
    grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
    gap: 2.75rem;
  }

  .v1-prestations-levels__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .v1-prestations-final__inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .v1-prestations-final__action {
    width: auto;
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v1-prestations-primary,
  .v1-prestations-final__action {
    scroll-behavior: auto;
  }
}
