/* Accueil — section avis clients (maquette collaborations / projets exigeants) */

.home-avis {
  --ha-ink: #f8fafc;
  --ha-muted: #94a3b8;
  --ha-body: #cbd5e1;
  --ha-accent: var(--color-secondary, #f1894e);
  --ha-panel-bg: #0b1526;
  --ha-panel-bg-soft: linear-gradient(160deg, rgba(28, 48, 74, 0.62) 0%, rgba(10, 20, 36, 0.96) 48%, rgba(6, 12, 22, 0.99) 100%);
  --ha-border: rgba(148, 163, 184, 0.26);
  --ha-border-strong: rgba(210, 225, 245, 0.38);
  --ha-icon-box: 3.75rem;
  --ha-icon-img: 3rem;
  --ha-radius: 1.35rem;
  --ha-focus: rgba(34, 211, 238, 0.95);
  position: relative;
  isolation: isolate;
  color: var(--ha-ink);
}

main section.home-avis.py-24,
main section.home-avis[class*="sm:py-"],
main section.home-avis[class*="2xl:py-"] {
  padding-block: clamp(5rem, 6.5vw, 9rem) !important;
}

.home-avis__glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.home-avis__glow::before,
.home-avis__glow::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(72px);
  opacity: 0.65;
}

.home-avis__glow::before {
  top: -3rem;
  left: 8%;
  width: min(42vw, 34rem);
  height: 14rem;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.28), transparent 72%);
}

.home-avis__glow::after {
  right: 4%;
  top: 18%;
  width: min(36vw, 28rem);
  height: 16rem;
  background: radial-gradient(ellipse at center, rgba(129, 140, 248, 0.18), transparent 74%);
}

.home-avis__inner {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 1.1rem + 1.2vw, 2.35rem);
  width: 100%;
  max-width: var(--vitrine-wide-max, 96rem);
  margin-inline: auto;
}

/* ——— En-tête ——— */

.home-avis__header {
  display: grid;
  gap: 1.1rem 2.75rem;
  align-items: start;
}

/* Source de compression : max-width en rem fixe trop bas face à Genos + typography.css
   (main h2 { font-size: var(--fs-title) !important }). Largeur en em = suit le fluid type. */
main .home-avis .home-avis__title {
  margin: 0;
  max-width: min(100%, 14em);
  font-family: var(--font-title, ui-sans-serif, system-ui, sans-serif) !important;
  font-size: clamp(2.35rem, 1.55rem + 2.2vw, 3.75rem) !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em;
  color: #fff;
  text-wrap: wrap;
}

.home-avis__title-break {
  display: none;
}

.home-avis__title-accent {
  color: var(--ha-accent);
}

.home-avis__title-rule {
  display: block;
  width: 5.25rem;
  height: 0.25rem;
  margin-top: 0.85rem;
  background: var(--ha-accent);
  border-radius: 999px;
}

.home-avis__lead {
  margin: 0;
  max-width: 34rem;
  font-family: var(--font-body, ui-sans-serif, system-ui, sans-serif);
  font-size: clamp(1.05rem, 0.98rem + 0.28vw, 1.2rem);
  line-height: 1.7;
  color: #e2e8f0;
  text-wrap: pretty;
}

@media (min-width: 900px) {
  .home-avis__header {
    grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.9fr);
    column-gap: clamp(2rem, 3.2vw, 4.75rem);
    align-items: start;
  }

  .home-avis__title-break {
    display: inline;
  }

  main .home-avis .home-avis__title {
    /* Ligne 1 « Des collaborations construites » ≈ 13.6em Genos ; 14em suit la taille fluide */
    max-width: min(100%, 14em);
  }

  .home-avis__lead {
    max-width: 30rem;
    padding-top: 0;
    justify-self: start;
    align-self: start;
    text-align: left;
  }
}

@media (min-width: 1440px) {
  .home-avis__header {
    grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 0.85fr);
  }

  main .home-avis .home-avis__title {
    max-width: min(100%, 14em);
    font-size: clamp(3rem, 2.15rem + 1.35vw, 3.9rem) !important;
  }
}

@media (min-width: 1672px) {
  main .home-avis .home-avis__title {
    max-width: min(100%, 14em);
    font-size: 3.65rem !important;
  }
}

/* ——— Corps : carte + sélecteur ——— */

.home-avis__body {
  display: grid;
  gap: 1.35rem;
  align-items: start;
  min-width: 0;
}

@media (min-width: 1024px) {
  .home-avis__body {
    grid-template-columns: minmax(0, 2.05fr) minmax(19rem, 0.95fr);
    gap: clamp(1.35rem, 1rem + 1.1vw, 2.15rem);
    align-items: stretch;
  }

  .home-avis__body--waiting {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 1440px) {
  .home-avis__body {
    grid-template-columns: minmax(0, 2.15fr) minmax(22rem, 0.9fr);
  }
}

/* ——— Carte citation ——— */

.home-avis__quote {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  padding: clamp(1.75rem, 1.35rem + 1.4vw, 3rem);
  border: 1px solid var(--ha-border);
  border-radius: var(--ha-radius);
  background: var(--ha-panel-bg-soft);
  background-color: var(--ha-panel-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(56, 189, 248, 0.05),
    0 28px 56px rgba(0, 0, 0, 0.32);
}

@media (min-width: 1024px) {
  .home-avis__quote {
    min-height: 28rem;
  }
}

@media (min-width: 1440px) {
  .home-avis__quote {
    min-height: 32rem;
    padding: clamp(2.25rem, 1.6rem + 1.2vw, 3.35rem);
  }
}

/* Empile tous les panneaux : la hauteur suit le plus long (Plateforme web), sans saut. */
.home-avis__quote-stage {
  position: relative;
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  align-items: stretch;
}

.home-avis__panel {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 1.35rem + 1vw, 2.75rem);
  min-width: 0;
  min-height: 100%;
  height: auto;
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
}

.home-avis__panel.is-active {
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.home-avis.is-ready .home-avis__panel.is-active.is-entering {
  animation: home-avis-fade 0.28s ease;
}

@keyframes home-avis-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .home-avis.is-ready .home-avis__panel.is-active.is-entering {
    animation: none;
  }
}

.home-avis__eyebrow {
  margin: 0;
  font-size: clamp(0.8125rem, 0.75rem + 0.15vw, 0.9375rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ha-muted);
}

/* Largeur calibrée pour ~4 lignes avec le texte d’exemple (sans <br> dans les données). */
.home-avis__blockquote {
  margin: 0;
  max-width: min(100%, 34rem);
  min-width: 0;
}

.home-avis__quote-mark {
  display: inline;
  color: var(--ha-accent);
  font-family: inherit;
  font-size: 1em;
  font-weight: inherit;
  line-height: inherit;
}

main .home-avis .home-avis__quote-text {
  margin: 0;
  font-family: var(--font-title, ui-sans-serif, system-ui, sans-serif) !important;
  font-size: clamp(1.4rem, 1.1rem + 0.85vw, 2.15rem) !important;
  font-weight: 600 !important;
  line-height: 1.28 !important;
  letter-spacing: 0.005em;
  color: #fff;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: wrap;
}

@media (min-width: 1024px) {
  .home-avis__blockquote {
    max-width: min(100%, 28rem);
  }

  main .home-avis .home-avis__quote-text {
    font-size: clamp(1.65rem, 1.2rem + 0.65vw, 2.2rem) !important;
    line-height: 1.26 !important;
  }
}

@media (min-width: 1440px) {
  .home-avis__blockquote {
    max-width: min(100%, 30rem);
  }

  main .home-avis .home-avis__quote-text {
    font-size: clamp(1.9rem, 1.4rem + 0.55vw, 2.4rem) !important;
    line-height: 1.24 !important;
  }
}

@media (min-width: 1672px) {
  .home-avis__blockquote {
    max-width: min(100%, 32rem);
  }

  main .home-avis .home-avis__quote-text {
    font-size: 2.35rem !important;
    line-height: 1.22 !important;
  }
}

@media (min-width: 1920px) {
  .home-avis__blockquote {
    max-width: min(100%, 34rem);
  }

  main .home-avis .home-avis__quote-text {
    font-size: 2.5rem !important;
    line-height: 1.22 !important;
  }
}

.home-avis__divider {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 1px;
  margin: auto 0 0;
  background: rgba(226, 232, 240, 0.32);
  border: 0;
}

.home-avis__attribution {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding-top: 0.15rem;
}

main .home-avis .home-avis__author {
  margin: 0;
  font-family: var(--font-body, ui-sans-serif, system-ui, sans-serif) !important;
  font-size: clamp(1.125rem, 1.02rem + 0.28vw, 1.35rem) !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: #fff;
}

.home-avis__meta {
  margin: 0;
  font-size: clamp(1rem, 0.95rem + 0.18vw, 1.125rem);
  line-height: 1.5;
  color: var(--ha-muted);
  overflow-wrap: normal;
}

.home-avis__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 1.75rem;
  margin-top: auto;
  padding-top: clamp(1.75rem, 1.2rem + 1.2vw, 2.75rem);
}

/* Même principe que la citation : réserve la place du jeu de liens le plus haut. */
.home-avis__links-stage {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
}

.home-avis__links {
  grid-area: 1 / 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.75rem;
  min-width: 0;
  visibility: hidden;
  pointer-events: none;
}

.home-avis__links.is-active {
  visibility: visible;
  pointer-events: auto;
}

.home-avis__links.is-active.is-empty,
.home-avis__links.is-empty {
  /* is-empty reste dans la grille pour la taille, mais ne s’affiche jamais. */
  visibility: hidden;
  pointer-events: none;
}

.home-avis__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: #e2e8f0;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.home-avis__link--primary {
  color: var(--ha-accent);
  font-size: clamp(1.0625rem, 1rem + 0.22vw, 1.2rem);
  font-weight: 700;
}

.home-avis__link:hover {
  color: #ffb48a;
}

.home-avis__link--primary:hover {
  color: #ffc09a;
}

.home-avis__link:focus-visible {
  outline: 2px solid var(--ha-focus);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.home-avis__link-arrow {
  flex-shrink: 0;
  font-size: 0.95em;
  line-height: 1;
}

.home-avis__nav {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.home-avis__nav[hidden] {
  display: none !important;
}

.home-avis__arrow {
  appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(3rem, 2.7rem + 0.5vw, 3.5rem);
  height: clamp(3rem, 2.7rem + 0.5vw, 3.5rem);
  margin: 0;
  padding: 0;
  border: 1.5px solid rgba(226, 232, 240, 0.4);
  border-radius: 999px;
  background: transparent;
  color: #e2e8f0;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.home-avis__arrow svg {
  width: 1.25rem;
  height: 1.25rem;
}

.home-avis__arrow:hover {
  border-color: rgba(241, 137, 78, 0.85);
  color: #fff;
  background: rgba(241, 137, 78, 0.14);
}

.home-avis__arrow--next {
  border-color: transparent;
  background: var(--ha-accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(241, 137, 78, 0.28);
}

.home-avis__arrow--next:hover {
  border-color: transparent;
  background: #ff9a5c;
  color: #fff;
}

.home-avis__arrow:focus-visible {
  outline: 2px solid var(--ha-focus);
  outline-offset: 3px;
}

/* ——— État d’attente ——— */

.home-avis__waiting {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
  min-height: 16rem;
}

.home-avis__waiting-title {
  margin: 0;
  font-size: clamp(1.25rem, 1.1rem + 0.35vw, 1.55rem);
  font-weight: 700;
  color: #fff;
}

.home-avis__waiting-text {
  margin: 0;
  max-width: 42rem;
  font-size: clamp(1.05rem, 1rem + 0.2vw, 1.2rem);
  line-height: 1.65;
  color: var(--ha-body);
}

/* ——— Colonne projets ——— */

.home-avis__projects {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  padding: clamp(1.45rem, 1.15rem + 0.9vw, 2.15rem);
  border: 1px solid var(--ha-border);
  border-radius: var(--ha-radius);
  background: var(--ha-panel-bg-soft);
  background-color: var(--ha-panel-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 22px 44px rgba(0, 0, 0, 0.26);
}

main .home-avis .home-avis__projects-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-title, ui-sans-serif, system-ui, sans-serif) !important;
  font-size: clamp(1.75rem, 1.4rem + 0.85vw, 2.45rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.15 !important;
}

.home-avis__project-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
}

.home-avis__project-item {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
}

.home-avis__project {
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: var(--ha-icon-box) minmax(0, 1fr) 1.25rem;
  align-items: center;
  gap: 1rem 1.1rem;
  box-sizing: border-box;
  width: 100%;
  min-height: 5.25rem;
  margin: 0;
  padding: 0.95rem 1.05rem 0.95rem 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1rem;
  background: rgba(8, 16, 30, 0.78);
  color: #e2e8f0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

@media (min-width: 1024px) {
  .home-avis__project {
    min-height: 0;
    flex: 1 1 auto;
    height: 100%;
    padding-block: 1.15rem;
  }
}

.home-avis__project:hover {
  border-color: rgba(210, 225, 245, 0.3);
  background: rgba(18, 32, 54, 0.92);
}

.home-avis__project.is-active {
  border-color: var(--ha-border-strong);
  background: rgba(24, 42, 68, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(56, 189, 248, 0.07),
    0 12px 26px rgba(0, 0, 0, 0.22);
}

.home-avis__project:focus {
  outline: none;
}

.home-avis__project:focus-visible {
  outline: 2px solid var(--ha-focus);
  outline-offset: 3px;
  z-index: 1;
}

.home-avis__project-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--ha-icon-box);
  height: var(--ha-icon-box);
  min-width: var(--ha-icon-box);
  min-height: var(--ha-icon-box);
  overflow: hidden;
  border-radius: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background:
    linear-gradient(160deg, rgba(241, 137, 78, 0.16), transparent 55%),
    rgba(8, 16, 30, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 10px 22px rgba(0, 0, 0, 0.22),
    0 0 22px rgba(56, 189, 248, 0.1);
}

.home-avis__project.is-active .home-avis__project-icon,
.home-avis__project:hover .home-avis__project-icon {
  border-color: rgba(241, 137, 78, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(241, 137, 78, 0.12),
    0 12px 26px rgba(0, 0, 0, 0.24),
    0 0 26px rgba(56, 189, 248, 0.14);
}

.home-avis__project-icon img {
  display: block;
  width: var(--ha-icon-img) !important;
  height: var(--ha-icon-img) !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0;
  padding: 0;
  object-fit: contain;
  object-position: center;
  transform: scale(1.3);
  transform-origin: center center;
}

.home-avis__project-label {
  min-width: 0;
  font-size: clamp(1.05rem, 0.95rem + 0.3vw, 1.25rem);
  font-weight: 650;
  line-height: 1.3;
  color: #f8fafc;
  overflow-wrap: anywhere;
}

.home-avis__project-chevron {
  justify-self: end;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid rgba(226, 232, 240, 0.6);
  border-bottom: 2px solid rgba(226, 232, 240, 0.6);
  transform: rotate(-45deg);
  opacity: 0.8;
}

.home-avis__live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 768px) {
  .home-avis {
    --ha-icon-box: 4.35rem;
    --ha-icon-img: 3.45rem;
  }
}

@media (min-width: 1440px) {
  .home-avis {
    --ha-icon-box: 4.75rem;
    --ha-icon-img: 3.75rem;
  }
}

@media (max-width: 1023px) {
  .home-avis__footer {
    align-items: flex-start;
  }

  .home-avis__nav {
    margin-left: 0;
  }

  .home-avis__links.is-active {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  main .home-avis .home-avis__quote-text {
    font-size: clamp(1.35rem, 1.05rem + 1.1vw, 1.85rem) !important;
    line-height: 1.32 !important;
  }

  .home-avis__blockquote {
    max-width: 100%;
  }
}
