/* =========================================================================
   Avis Google — Diag-Engine
   Couleurs : ajustez les variables ci-dessous pour coller à la charte.
   ========================================================================= */

.degr {
  --degr-accent: #16a34a;        /* vert Diag-Engine (bouton, liens) */
  --degr-accent-hover: #12833c;
  --degr-ink: #111827;           /* texte principal */
  --degr-muted: #6b7280;         /* dates, liens secondaires */
  --degr-card: #eef4ef;          /* fond des cartes */
  --degr-star: #fbbc04;          /* étoiles pleines */
  --degr-star-empty: #d1d5db;    /* étoiles vides */
  --degr-radius: 16px;
  --degr-gap: 20px;

  padding: 56px 16px;
  color: var(--degr-ink);
}

.degr__inner {
  max-width: 1280px;
  margin: 0 auto;
}

.degr__title {
  margin: 0 0 36px;
  text-align: center;
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--degr-ink);
}

.degr__layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

/* ---------- Bloc note globale ---------- */

.degr__summary {
  display: flex;
  align-items: center;
  gap: 16px;
}

.degr__summary-img {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
}

.degr__summary-name {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
}

.degr__summary-rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.degr__score {
  font-size: 1.35rem;
  font-weight: 700;
}

.degr__summary-count {
  display: inline-block;
  margin: 4px 0 12px;
  color: var(--degr-ink);
  text-decoration: none;
}

.degr__summary-count:hover {
  text-decoration: underline;
}

.degr__cta {
  display: block;
  width: max-content;
  padding: 10px 22px;
  border-radius: 8px;
  background: var(--degr-accent);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
  transition: background-color .2s ease;
}

.degr__cta:hover,
.degr__cta:focus-visible {
  background: var(--degr-accent-hover);
}

/* ---------- Étoiles (texte, sans image) ---------- */

.degr-stars {
  position: relative;
  display: inline-block;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--degr-star-empty);
  white-space: nowrap;
}

.degr-stars--lg {
  font-size: 1.5rem;
}

.degr-stars::before,
.degr-stars__fill::before {
  content: "\2605\2605\2605\2605\2605";
}

.degr-stars__fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  color: var(--degr-star);
}

/* ---------- Carrousel ---------- */

.degr__carousel {
  position: relative;
  min-width: 0;
}

.degr__track {
  display: flex;
  gap: var(--degr-gap);
  margin: 0;
  padding: 4px 2px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  align-items: flex-start;
}

.degr__track::-webkit-scrollbar {
  display: none;
}

.degr__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  background: #fff;
  color: var(--degr-ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity .2s ease, box-shadow .2s ease;
}

.degr__arrow:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
}

.degr__arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

.degr__arrow--prev { left: -20px; }
.degr__arrow--next { right: -20px; }

.degr__carousel--static .degr__arrow {
  display: none;
}

/* ---------- Carte avis ---------- */

.degr-card {
  flex: 0 0 calc((100% - 2 * var(--degr-gap)) / 3);
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 22px;
  border-radius: var(--degr-radius);
  background: var(--degr-card);
  scroll-snap-align: start;
  box-sizing: border-box;
}

.degr-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.degr-card__avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.degr-card__avatar--initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--degr-accent);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
}

.degr-card__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.degr-card__name {
  overflow: hidden;
  color: var(--degr-ink) !important;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.degr-card__name:hover {
  text-decoration: underline;
}

.degr-card__date {
  color: var(--degr-muted);
  font-size: .875rem;
}

.degr-card__source {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--degr-muted);
  font-size: .75rem;
  font-weight: 600;
}

.degr-card__rating {
  margin-bottom: 10px;
}

.degr-card__text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  font-size: 1rem;
  line-height: 1.5;
}

.degr-card--open .degr-card__text {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.degr-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}

.degr-card__more,
.degr-card__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--degr-muted) !important;
  font-size: .9rem;
  text-decoration: none;
  cursor: pointer;
}

.degr-card__more:hover,
.degr-card__link:hover {
  color: var(--degr-ink) !important;
  text-decoration: underline;
}

.degr-card__more[hidden] {
  display: none;
}

.degr-card__link {
  margin-left: auto;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .degr__layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .degr__summary {
    justify-content: center;
  }

  .degr-card {
    flex-basis: calc((100% - var(--degr-gap)) / 2);
  }

  .degr__arrow--prev { left: -8px; }
  .degr__arrow--next { right: -8px; }
}

@media (max-width: 640px) {
  .degr {
    padding: 40px 16px;
  }

  .degr-card {
    flex-basis: 86%;
  }

  .degr__arrow {
    display: none;
  }
}
