/* Subventions : un montant par profil, puis où faire la demande.
   Page-scoped; reads the site tokens (--ink, --paper, --green, --hero-pad-x…). */

.sv {
  --sv-fig: clamp(64px, 10.4vw, 156px);
  --sv-h: clamp(30px, 4.4vw, 64px);
  --sv-m: clamp(19px, 1.7vw, 24px);
  --sv-b: clamp(16px, 1.15vw, 18px);
  --sv-s: 16px;
  --sv-on-ink: #f4f3ef;
  --sv-on-ink-soft: rgba(244, 243, 239, .66);
  --sv-green-light: #f3f1ec;
  --sv-gap: clamp(20px, 3vw, 48px);
  --sv-cols: minmax(0, 1.5fr) minmax(0, 1fr) clamp(150px, 15vw, 220px);
  color: var(--ink);
}

.sv-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--sv-h);
  line-height: 1;
  letter-spacing: -.035em;
  text-wrap: balance;
}

/* ---------------------------------------------------------------- top */

/* hero: the site's .appr-hero, the title kept to two lines */
.sv-hero .appr-hero__title { max-width: none; }
.sv-hero { padding-inline: var(--hero-pad-x); }

.sv-top {
  padding: clamp(96px, 11vw, 168px) var(--hero-pad-x);
  background: var(--paper);
}

.sv-intro {
  display: grid;
  grid-template-columns: var(--sv-cols);
  column-gap: var(--sv-gap);
  align-items: end;
}

.sv-intro .sv-h2 { grid-column: 1; }

.sv-lead {
  grid-column: 2 / -1;
  margin: 0;
  font-size: var(--sv-b);
  line-height: 1.55;
  color: var(--ink);
  max-width: 44ch;
}

.sv-profils {
  margin-top: clamp(48px, 6vw, 96px);
  display: grid;
  gap: clamp(48px, 5.5vw, 88px);
}

.sv-profil {
  position: relative;
  display: grid;
  grid-template-columns: var(--sv-cols);
  grid-template-areas: "fig text photo";
  column-gap: var(--sv-gap);
  align-items: center;
}

.sv-profil__montant {
  grid-area: fig;
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--sv-fig);
  line-height: .95;
  letter-spacing: -.045em;
  white-space: nowrap;
  padding-bottom: .04em;
}

.sv-profil__montant span { display: inline-block; }

.sv-profil__texte { grid-area: text; }

.sv-profil__nom {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--sv-m);
  line-height: 1.15;
  letter-spacing: -.015em;
}

.sv-profil__texte p {
  margin: 0;
  font-size: var(--sv-b);
  line-height: 1.5;
  color: var(--ink);
  max-width: 36ch;
}

.sv-profil__lien {
  display: inline-flex;
  gap: .4em;
  margin-top: 16px;
  font-size: var(--sv-b);
  font-weight: 500;
  color: var(--green);
  text-decoration: none;
}

/* the whole row is the link's hit area */
.sv-profil__lien::after {
  content: "";
  position: absolute;
  inset: 0;
}

.sv-profil__lien span { transition: transform .3s var(--ease-out); }
.sv-profil:hover .sv-profil__lien span { transform: translateX(4px); }

.sv-profil__lien:focus-visible { outline: none; }
.sv-profil:has(.sv-profil__lien:focus-visible) {
  outline: 2px solid var(--green);
  outline-offset: 12px;
}

.sv-profil__photo {
  grid-area: photo;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-card);
}

.sv-profil__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .9s var(--ease-out);
}

.sv-profil:hover .sv-profil__photo img { transform: scale(1.05); }

/* ---------------------------------------------------------------- liste */

.sv-liste {
  padding: clamp(96px, 11vw, 168px) var(--hero-pad-x);
  background: var(--ink);
  color: var(--sv-on-ink);
}

.sv-liste__tete {
  display: grid;
  grid-template-columns: var(--sv-cols);
  column-gap: var(--sv-gap);
  align-items: end;
}

.sv-liste__tete .sv-h2 { grid-column: 1; }
.sv-liste__aide { grid-column: 2 / -1; }

.sv-liste__aide > p:first-child {
  margin: 0 0 20px;
  font-size: var(--sv-b);
  line-height: 1.5;
}

.sv-filtre { display: flex; flex-wrap: wrap; gap: 8px; }

.sv-filtre__btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font: 500 16px/1.2 var(--font-body);
  color: var(--sv-on-ink);
  background: rgba(244, 243, 239, .1);
  cursor: pointer;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out), transform .15s var(--ease-out);
}

.sv-filtre__btn:hover { background: rgba(244, 243, 239, .18); }
.sv-filtre__btn:active { transform: scale(.97); }
.sv-filtre__btn:focus-visible { outline: 2px solid var(--sv-on-ink); outline-offset: 3px; }

.sv-filtre__btn[aria-pressed="true"] {
  background: var(--sv-on-ink);
  color: var(--ink);
}

.sv-filtre__total {
  margin: 16px 0 0;
  min-height: 1.5em;
  font-size: var(--sv-b);
  line-height: 1.5;
  color: var(--sv-green-light);
}

.sv-groupe { margin-top: clamp(56px, 6vw, 88px); }

.sv-groupe__titre {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--sv-m);
  letter-spacing: -.015em;
  color: var(--sv-green-light);
}

.sv-lignes { list-style: none; margin: 0; padding: 0; }

.sv-lignes a {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) clamp(180px, 22vw, 320px);
  column-gap: var(--sv-gap);
  align-items: baseline;
  margin-inline: -16px;
  padding: .5em 16px;
  border-radius: 12px;
  font-size: var(--sv-m);
  line-height: 1.3;
  color: var(--sv-on-ink);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: background-color .2s var(--ease-out);
}

.sv-lignes a:hover { background: rgba(244, 243, 239, .07); }
.sv-lignes a:focus-visible { outline: 2px solid var(--sv-on-ink); outline-offset: 0; }

.sv-l__org {
  color: var(--sv-on-ink-soft);
  text-align: right;
  white-space: nowrap;
}

.sv-l__org span { display: inline-block; transition: transform .25s var(--ease-out); }
.sv-lignes a:hover .sv-l__org span { transform: translate(2px, -2px); }

/* filtre : un ancien propriétaire voit ce qui s'applique à lui */
.sv-liste[data-filtre="deja"] [data-groupe="premier"] { display: none; }

.sv-avis {
  margin: clamp(64px, 7vw, 104px) 0 0;
  max-width: 68ch;
  font-size: var(--sv-s);
  line-height: 1.6;
  color: var(--sv-on-ink-soft);
}

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: no-preference) {
  .js .sv-profil.reveal .sv-profil__montant span {
    transform: translateY(105%);
    transition: transform 1.1s var(--ease-out) .15s;
  }
  .js .sv-profil.reveal.is-visible .sv-profil__montant span { transform: none; }

  .js .sv-groupe.reveal li {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  }
  .js .sv-groupe.reveal.is-visible li { opacity: 1; transform: none; }
  .js .sv-groupe.reveal.is-visible li:nth-child(2) { transition-delay: .06s; }
  .js .sv-groupe.reveal.is-visible li:nth-child(3) { transition-delay: .12s; }
  .js .sv-groupe.reveal.is-visible li:nth-child(4) { transition-delay: .18s; }
  .js .sv-groupe.reveal.is-visible li:nth-child(5) { transition-delay: .24s; }
  .js .sv-groupe.reveal.is-visible li:nth-child(6) { transition-delay: .3s; }
}

/* ---------------------------------------------------------------- tablet & phone */

@media (max-width: 960px) {
  .sv-intro,
  .sv-liste__tete { display: block; }
  .sv-lead { margin-top: 20px; }
  .sv-liste__aide { margin-top: 24px; }

  .sv-profils { gap: 88px; }

  .sv-profil {
    grid-template-columns: clamp(88px, 22vw, 160px) minmax(0, 1fr);
    grid-template-areas: "fig fig" "photo text";
    row-gap: 18px;
    align-items: start;
  }
  .sv-profil__montant { font-size: clamp(60px, 17vw, 128px); }

  .sv-lignes a {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "nom nom" "val org";
    row-gap: 4px;
    padding-block: 12px;
    font-size: 17px;
  }
  .sv-l__nom { grid-area: nom; font-size: var(--sv-m); }
  .sv-l__val { grid-area: val; }
  .sv-l__org { grid-area: org; }
}

@media (max-width: 600px) {
  .sv-h2, .sv-hero .appr-hero__title { font-size: 30px; }
  .sv-lignes a { font-size: 16px; }
}


