/**
 * Tableau récapitulatif Diffusio — paragraphe paragraphs (tr / tr_item)
 * Styles isolés, chargés via la library theme_mon_site/tr.
 * Une offre = une ligne. ≥ 768px : tableau classique (en-tête figé si > 6 offres).
 * < 768px : cartes empilées (même DOM, sémantique conservée via les rôles ARIA).
 */

.paragraph--type--tr.tr {
  color: #1a1a1a;
  font-family: "Anek Latin", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.tr .tr__title {
  margin: 0 0 1.25rem;
  color: #1a1a1a;
  font-family: "Anek Latin", Arial, Helvetica, sans-serif;
  font-weight: normal;
  font-size: 34px;
  line-height: 1.2;
}

/*
 * Desktop : aucun conteneur de scroll (ni vertical ni horizontal), pour que
 * l'en-tête de colonnes reste toujours figé (sticky) au scroll de la page.
 * Si le site a un header fixe, ajuster --tr-sticky-top.
 */
.tr .tr__scroll {
  overflow: visible;
}

.tr .tr__table {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
}

.tr .tr__caption {
  caption-side: top;
  padding: 0 0 0.75rem;
  text-align: left;
  color: #1a1a1a;
  font-size: 16px;
  line-height: 1.45;
}

.tr tbody th,
.tr tbody td {
  vertical-align: middle;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid #e4e4e4;
  color: #1a1a1a;
  font-size: 16px;
  line-height: 1.45;
  background-color: #fff;
}

/* Nom de l'offre (en-tête de ligne) */
.tr tbody th {
  min-width: 11rem;
  text-align: left;
}

.tr .tr__table td {
  text-align: center;
  font-weight: 400;
  white-space: nowrap;
}

/* .tr .tr__table td strong,
.tr .tr__table td b {
  font-weight: 400;
} */

.tr .tr__corner,
.tr .tr__col-head {
  position: sticky;
  top: var(--tr-sticky-top, 0);
  z-index: 2;
  padding: 0.95rem 1.1rem;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.45;
  border-bottom: 2px solid #1b6f5c;
  background: #f0f0f0;
  color: #1a1a1a;
}

.tr .tr__corner {
  text-align: left;
}

.tr .tr__offer-link {
  color: #1a1a1a;
  font-size: 16px;
  text-decoration: underline;
  font-weight: bold;
}

.tr .tr__offer-link:hover,
.tr .tr__offer-link:focus {
  text-decoration: underline;
}

.tr .tr__offer-link:focus-visible {
  outline: 2px solid #1b6f5c;
  outline-offset: 2px;
}

.tr .tr__row:nth-child(even) .tr__cell,
.tr .tr__row:nth-child(even) .tr__row-label {
  background-color: #fafafa;
}
.tr .tr__cell a,
.tr .tr__cell li,
.tr .tr__cell p {
  font-size: 16px;
}

.tr .tr__cell--note {
  white-space: nowrap;
}

.tr .tr__cell--tarif {
  color: #1a1a1a;
}

.tr .tr__empty {
  color: #4a4a4a;
}

/* Source des avis, date de mise à jour */
.tr .tr__source,
.tr .tr__updated {
  color: #4a4a4a;
  font-size: 14px;
}

.tr .tr__source {
  display: block;
}

.tr .tr__updated {
  margin: 0.5rem 0 0;
}

/* Les + */
.tr .tr__plus-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr .tr__plus-item {
  display: inline-block;
  margin: 0;
  padding: 0.25rem 0.55rem;
  background-color: #e8f3ef;
  color: #1a1a1a;
  border-radius: 0.25rem;
  font-weight: 400;
  line-height: 1.45;
}

.tr .tr__plus-item abbr {
  text-decoration: underline dotted;
  cursor: help;
}

/* Points forts */
.tr .tr__points-forts {
  color: #1a1a1a;
  font-weight: 400;
}

.tr .tr__points-forts > .field,
.tr .tr__points-forts > .field > .field__item,
.tr .tr__points-forts p {
  margin: 0;
  padding: 0;
}

.tr .tr__points-forts p + p {
  margin-top: 0.5em;
}

.tr .tr__points-forts ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* Aperçu item (édition Drupal) */
.tr-item.paragraph--type--tr-item {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  background: #f2f2f2;
  border-radius: 0.5rem;
}

.tr-item__identifiant {
  margin: 0 0 0.5rem;
}

/* Note Google (HTML de la fiche détail) — styles repris de diffusio-3 main.custom.css */
.tr .google-note {
  line-height: 1;
  position: relative;
  width: 140px;
}

.tr .google-note p {
  margin: 0;
  justify-content: flex-start !important;
}

.tr .google-note .lgrid-middle-noGutter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.tr .google-note p,
.tr .google-note a,
.tr .google-note span {
  line-height: 1;
}

.tr .google-note .stars img {
  height: 20px;
}

.tr .google-note .google-icon:after {
  display: none !important;
}

.tr .google-note .google-icon img {
  height: 25px !important;
}

.tr .google-note .icon-anjou-star:before,
.tr .google-note .icon-anjou-star.gris:before {
  color: #dadce0;
}

.tr .google-note .icon-anjou-star.jaune:before {
  color: #fbbc04;
}

.tr .google-note .mr-5 {
  margin-right: 5px;
}

/* Popup d'information */
.tr .google-note .info-popup {
  position: relative;
  display: none;
}

.tr .google-note .info-popup img {
  opacity: 0.6;
}

.tr .google-note .info-popup-content {
  display: none;
  position: absolute;
  top: 26px;
  left: 0;
  z-index: 3;
  width: 380px;
  max-width: 80vw;
  padding: 15px;
  border: solid 1px #1a1a1a;
  border-radius: 5px;
  background-color: #fff;
  color: #1a1a1a;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 2px 48px rgba(0, 0, 0, 0.06);
}

.tr .google-note .info-popup-trigger:hover .info-popup-content {
  display: block;
}

/* Mobile : un seul DOM, les lignes deviennent des cartes empilées */
@media (max-width: 767px) {
  .tr .tr__table,
  .tr .tr__table tbody,
  .tr .tr__table tr,
  .tr .tr__table th,
  .tr .tr__table td {
    display: block;
  }

  .tr .tr__table {
    min-width: 0;
  }

  /* Table en display:block : la caption doit sortir du modèle tableau pour occuper toute la largeur */
  .tr .tr__table .tr__caption {
    display: block;
    width: 100%;
  }

  /* En-têtes de colonnes masqués visuellement, conservés pour les lecteurs d'écran */
  .tr .tr__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .tr .tr__row {
    margin: 0 0 1rem;
    border: 1px solid #e4e4e4;
    border-top: 3px solid #1b6f5c;
    border-radius: 0.5rem;
    background: #fff;
    overflow: hidden;
  }

  .tr tbody th.tr__row-label {
    min-width: 0;
    padding: 0.75rem 1rem;
    background: #f0f0f0;
    border-bottom: 0;
  }

  /* Zone cliquable ≥ 44px */
  .tr .tr__offer-link {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    text-decoration: underline;
  }

  .tr tbody td.tr__cell {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.65rem 1rem;
    text-align: left;
    background-color: #fff;
  }

  .tr tbody td.tr__cell::before {
    content: attr(data-label);
    font-weight: 700;
  }

  .tr .tr__plus-list {
    justify-content: flex-start;
  }

  .tr .tr__cell--note {
    white-space: normal;
  }

  .tr .tr__corner,
  .tr .tr__col-head {
    position: static;
  }
}
