/* ADC - Avis Google : styles front.
 * Toutes les couleurs peuvent etre surchargees depuis l'administration du module
 * (variables CSS --adcgr-*). Par defaut, police et couleur du texte heritent du theme. */

.adcgr {
  margin: 2rem 0;
  color: var(--adcgr-text, inherit);
  font-family: inherit;
}

.adcgr__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.25rem;
}

.adcgr__title {
  margin: 0;
}

.adcgr__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.adcgr__score {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.adcgr__count {
  font-size: 0.9rem;
  opacity: 0.75;
}

/* Etoiles : la largeur coloree suit la note (--rating, de 0 a 5, decimales acceptees). */
.adcgr-stars {
  --adcgr-pct: calc(var(--rating, 5) / 5 * 100%);
  display: inline-block;
  font-size: 1.15em;
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: transparent;
  background: linear-gradient(
    90deg,
    var(--adcgr-star, #fbbc04) var(--adcgr-pct),
    rgba(0, 0, 0, 0.18) var(--adcgr-pct)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Disposition */
.adcgr__list {
  display: grid;
  grid-template-columns: repeat(var(--adcgr-cols, 3), minmax(0, 1fr));
  gap: 1rem;
}

.adcgr--slider .adcgr__list {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.adcgr--slider .adcgr__card {
  flex: 0 0 min(340px, 85%);
  scroll-snap-align: start;
}

@media (max-width: 991px) {
  .adcgr--grid .adcgr__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .adcgr--grid .adcgr__list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Carte */
.adcgr__card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem;
  background: var(--adcgr-bg, #fff);
  border: 1px solid var(--adcgr-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--adcgr-radius, 8px);
}

.adcgr__author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.adcgr__avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.adcgr__avatar--initial {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: var(--adcgr-accent, #777);
}

.adcgr__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.adcgr__name {
  overflow: hidden;
  font-weight: 700;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

a.adcgr__name:hover {
  text-decoration: underline;
}

.adcgr__date {
  font-size: 0.85rem;
  opacity: 0.65;
}

.adcgr__text {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Pied */
.adcgr__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.adcgr__attr {
  font-size: 0.85rem;
  opacity: 0.65;
}

.adcgr__more {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  color: var(--adcgr-accent, inherit);
  text-decoration: none;
  border: 1px solid var(--adcgr-accent, currentColor);
  border-radius: var(--adcgr-radius, 8px);
  transition: background 0.15s, color 0.15s;
}

.adcgr__more:hover,
.adcgr__more:focus {
  color: var(--adcgr-bg, #fff);
  background: var(--adcgr-accent, currentColor);
}
