.xpa-tt {
  position: relative;
  z-index: 1;
  background: var(--xpa-mutted-parchment);
  margin-top: clamp(50px, 7vw, 90px);
  padding: 20px;
}


/* Sélecteur de jour */
.xpa-tt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

/* NOTE: légende des statuts masquée pour l'instant. Repasser en `display: flex`
   pour la réafficher ; le markup et les styles sont conservés. */
.xpa-tt-legend {
  display: none;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 30px;
  padding: 5px 10px;
  background: var(--xpa-mutted-parchment);
  width: fit-content;
  list-style: none;
}

.xpa-tt-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.75;
}

.xpa-tt-legend-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid #232323;
  background: rgba(255, 255, 255, 0.5);
  color: #232323;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.xpa-tt-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid #232323;
  background: transparent;
  color: #232323;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.xpa-tt-tab:hover { background: rgba(35, 35, 35, 0.08); }
.xpa-tt-tab.is-active {
  background: #232323;
  color: var(--xpa-mutted-parchment);
}

/* Sections par jour */
.xpa-tt-day { margin-bottom: 50px; }
.xpa-tt-day:last-child { margin-bottom: 0; }

.xpa-tt-day-title {
    background-color: var(--xpa-orange);
    width: fit-content;
    font-size: 0.85rem;
    line-height: 1.5;
    text-transform: uppercase;
    margin: 0px 0px 0px -30px;
    padding: 4px 10px;
}
.xpa-tt:not(.is-all) .xpa-tt-day-title { display: none; }

.xpa-tt-scroll-wrap {
  position: relative;
}

.xpa-tt-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;        /* IE/Edge legacy */
}
.xpa-tt-scroll::-webkit-scrollbar {
  display: none;
  height: 0;
  width: 0;
}

.xpa-tt-scroll-fade {
  position: absolute;
  inset: 0 0 0 auto;
  width: 80px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: linear-gradient(
    to right,
    rgba(241, 240, 234, 0) 0%,
    var(--xpa-mutted-parchment) 75%
  );
}
.xpa-tt-scroll-wrap.is-scrollable .xpa-tt-scroll-fade {
  opacity: 1;
}

/* Grille */
.xpa-tt-grid {
  --slot-w: 46px;
  --label-w: 170px;
  display: grid;
  grid-template-columns: var(--label-w) repeat(var(--cols), var(--slot-w));
  grid-auto-rows: minmax(54px, auto);
  position: relative;
  width: max-content;
  min-width: 100%;
  background-color: var(--xpa-mutted-parchment);
}

/* En-tête horaire : même traitement que les th du tableau tarif. */
.xpa-tt-corner,
.xpa-tt-slot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--xpa-mutted-parchment);
  border-bottom: 1px solid var(--xpa-dark);
  font-family: var(--fontBrownM);
  font-size: 1rem;
  font-weight: normal;
  letter-spacing: 0.04em;
}

.xpa-tt-corner {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  left: 0;
  z-index: 6;
  justify-content: flex-start;
  padding: 0 12px;
  text-transform: uppercase;
}

/* Séparateurs verticaux au début de chaque heure. */
.xpa-tt-slot.is-hour {
  border-left: 1px solid rgba(35, 35, 35, 0.18);
}

/* Lignes : mêmes fonds alternés et filet bas que le tableau tarif. */
.xpa-tt-rowbg {
  position: relative;
  z-index: 0;
  border-bottom: 1px solid rgba(49, 47, 47, 0.15);
  background: rgba(49, 47, 47, 0.07);
}
.xpa-tt-rowbg.is-alt { background: var(--xpa-mutted-parchment); }

/* Mêmes séparateurs dans les lignes, à partir de la colonne des lieux. */
.xpa-tt-rowbg::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--label-w);
  background-image: repeating-linear-gradient(
    to right,
    rgba(35, 35, 35, 0.18) 0,
    rgba(35, 35, 35, 0.18) 1px,
    transparent 1px,
    transparent calc(var(--slot-w) * 2)
  );
  pointer-events: none;
}

/* Axe qui démarre à la demi-heure : décaler les filets d'un créneau
   pour les garder alignés sur les heures pleines. */
.xpa-tt-grid.is-half-hour-start .xpa-tt-rowbg::before {
  background-position: var(--slot-w) 0;
}

.xpa-tt-venue {
  grid-column: 1;
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: #232323;
  border-bottom: 1px solid rgba(49, 47, 47, 0.15);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Le fond du lieu suit la ligne juste au-dessus de lui. */
.xpa-tt-rowbg + .xpa-tt-venue {
  background-color: var(--xpa-mutted-parchment);
  background-image: linear-gradient(rgba(49, 47, 47, 0.07), rgba(49, 47, 47, 0.07));
}

.xpa-tt-rowbg.is-alt + .xpa-tt-venue {
  background: var(--xpa-mutted-parchment);
}

/* Événement */
.xpa-tt-event {
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-self: stretch;
  margin: 5px 3px;
  padding: 7px 9px;
  overflow: hidden;
  background: var(--tt-day, var(--xpa-green));
  color: #232323;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.xpa-tt-event:hover {
  background: #232323;
  color: var(--xpa-mutted-parchment);
  text-decoration: none;
}

/* IMP: Une couleur = un jour (palette partagée bloc + pastille d'onglet) */
.xpa-tt-event--c1,
.xpa-tt-tab-dot--c1 { --tt-day: #f88967 ; }
.xpa-tt-event--c2,
.xpa-tt-tab-dot--c2 { --tt-day: var(--xpa-orange) ; }
.xpa-tt-event--c3,
.xpa-tt-tab-dot--c3 { --tt-day: #c33509; }
.xpa-tt-event--c4,
.xpa-tt-tab-dot--c4 { --tt-day: var(--xpa-orange); }

/* Pastille de couleur sur les onglets de jour (légende) */
.xpa-tt-tab-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border: 1px solid currentColor;
  background: var(--tt-day, var(--xpa-green));
}

.xpa-tt-event-title {
  font-size: 0.9rem;
  font-weight: normal;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.xpa-tt-event-time {
  font-family: var(--fontBrownL);
  font-size: 0.72rem;
  font-weight: normal;
  letter-spacing: 0.04em;
  opacity: 0.75;
  white-space: nowrap;
}

/* Spectacle sans heure : le bloc est étroit, on autorise le retour à la ligne. */
.xpa-tt-event-time.is-time-tba {
  white-space: normal;
  font-size: 0.66rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.xpa-tt-event-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  line-height: 1;
}

.xpa-tt-badge {
  display: none;
  /*display: inline-flex;*/
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border: 1px solid #232323;
  background: rgba(255, 255, 255, 0.75);
  color: #232323;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.xpa-tt-empty {
  padding: 26px 0;
  font-size: 0.95rem;
  opacity: 0.6;
}

.xpa-tt-event-wrapper-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 500;
  width: 260px;
  max-width: calc(100vw - 24px);
  background: var(--tt-day, var(--xpa-mutted-parchment));
  border: 1px solid #232323;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  overflow: hidden;
}

.xpa-tt-preview-media {
  position: relative;
}
.xpa-tt-event-wrapper-preview.is-no-img .xpa-tt-preview-media {
  min-height: 64px;
}

.xpa-tt-preview-img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.xpa-tt-preview-genres {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: calc(100% - 16px);
}

.xpa-tt-preview-genre {
  padding: 2px 6px;
  background: rgba(35, 35, 35, 0.78);
  color: var(--xpa-mutted-parchment);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.xpa-tt-preview-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 12px;
}

.xpa-tt-preview-title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.xpa-tt-preview-company {
  font-size: 0.75rem;
  opacity: 0.7;
}

.xpa-tt-preview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.xpa-tt-preview-badge {
  padding: 2px 6px;
  border: 1px solid #232323;
  background: rgba(255, 255, 255, 0.6);
  color: #232323;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .xpa-tt-grid {
    --slot-w: 40px;
    --label-w: 120px;
  }
  .xpa-tt-grid { grid-auto-rows: minmax(50px, auto); }
  .xpa-tt-corner,
  .xpa-tt-slot { font-size: 0.75rem; }
  .xpa-tt-venue { font-size: 0.7rem; }
  .xpa-tt-event-title { font-size: 0.8rem; }
  .xpa-tt-event-time { font-size: 0.68rem; }
}
