/* TraininBlue — Avis & sessions Inter (version compacte) — après formation_details.css */
.formation-detail-page {
  --tb-blue: #135fc4;
  --tb-blue-d: #0d52b2;
  --tb-navy: #12233f;
  --tb-text: #26364a;
  --tb-muted: #6d7d91;
  --tb-line: #dce5ef;
  --tb-soft: #f3f8ff;
  --tb-gold: #f5a623;
  --tb-green: #16875c;
  --tb-green-bg: #edfbf4;
  --tb-green-line: #bce8d4;
  --tb-red: #b4372b;
  --tb-red-bg: #fdf1ef;
  --tb-red-line: #f2c9c3;
}

.formation-detail-page summary {
  list-style: none;
  cursor: pointer;
}

.formation-detail-page summary::-webkit-details-marker {
  display: none;
}

.formation-detail-page summary:focus-visible,
.formation-detail-page .tb-btn:focus-visible {
  outline: 2px solid var(--tb-primary, #456fb8);
  outline-offset: 2px;
}

.formation-detail-page .tb-stars {
  color: var(--tb-gold);
  letter-spacing: 1px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.formation-detail-page .tb-empty {
  margin: 0;
  padding: 12px;
  text-align: center;
  color: var(--tb-muted);
  background: #f8fafd;
  border: 1px dashed #cdd9e8;
  border-radius: 8px;
  font-size: 12px;
}

.formation-detail-page .tb-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--tb-primary, #456fb8);
  border-radius: 8px;
  background: var(--tb-primary, #456fb8);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 1px 3px rgba(69, 111, 184, 0.28);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.formation-detail-page summary:hover .tb-toggle {
  background: var(--tb-primary-hover, #3a5f9e);
  border-color: var(--tb-primary-hover, #3a5f9e);
  color: #fff;
  box-shadow: 0 2px 6px rgba(69, 111, 184, 0.35);
}

.formation-detail-page summary:focus-visible .tb-toggle {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.formation-detail-page .tb-chev {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
}

.formation-detail-page .tb-chev::after {
  content: "";
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.6px 1.6px 0;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.2s;
}

.formation-detail-page details[open] > summary .tb-chev::after {
  transform: translateY(1px) rotate(-135deg);
}

.formation-detail-page details[open] > summary .lbl-c,
.formation-detail-page details:not([open]) > summary .lbl-o {
  display: none;
}

.formation-detail-page .tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--tb-primary, #456fb8);
  color: #fff;
  border: 1px solid var(--tb-primary, #456fb8);
  border-radius: 6px;
  padding: 7px 12px;
  font: 700 12px/1 inherit;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.formation-detail-page .tb-btn:hover {
  background: var(--tb-primary-hover, #3a5f9e);
  border-color: var(--tb-primary-hover, #3a5f9e);
  color: #fff;
}

.formation-detail-page .tb-btn:active {
  background: var(--tb-primary-active, #2f5088);
  border-color: var(--tb-primary-active, #2f5088);
}

.formation-detail-page .tb-btn--disabled {
  background: #eef1f5;
  border-color: #e0e6ee;
  color: #8a96a5;
  cursor: not-allowed;
}

.formation-detail-page .tb-btn--disabled:hover {
  background: #eef1f5;
  color: #8a96a5;
}

.formation-detail-page .hero-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  column-gap: 14px;
  row-gap: 8px;
  margin-bottom: 8px;
}

.formation-detail-page .hero-title-row h1 {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.formation-detail-page .hero-title-row .tb-avis {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  justify-self: end;
  align-self: start;
  flex-shrink: 0;
}

/* Ouvert : une seule colonne → le panneau avis = toute la largeur de .main */
.formation-detail-page .hero-title-row:has(.tb-avis[open]) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
}

.formation-detail-page .hero-title-row .tb-avis[open] {
  display: contents;
}

.formation-detail-page .hero-title-row:has(.tb-avis[open]) .tb-avis-summary {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  align-self: start;
}

.formation-detail-page .hero-title-row:has(.tb-avis[open]) .tb-avis-panel {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.formation-detail-page .tb-avis {
  margin: 0;
}

@media (max-width: 720px) {
  .formation-detail-page .hero-title-row:not(:has(.tb-avis[open])) {
    grid-template-columns: minmax(0, 1fr);
  }

  .formation-detail-page .hero-title-row:not(:has(.tb-avis[open])) h1 {
    grid-column: 1;
    grid-row: 1;
  }

  .formation-detail-page .hero-title-row:not(:has(.tb-avis[open])) .tb-avis {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }
}

.formation-detail-page .tb-avis-summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  background: #fff;
  border: 1px solid var(--tb-line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--tb-text);
}

.formation-detail-page .tb-avis-summary .tb-toggle {
  margin-left: 6px;
}

.formation-detail-page .tb-avis-score {
  font-size: 14px;
  color: var(--tb-navy);
}

.formation-detail-page .tb-avis-count {
  color: var(--tb-muted);
  font-size: 12px;
}

.formation-detail-page .tb-avis-panel {
  margin-top: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--tb-line);
  border-radius: 10px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.formation-detail-page .tb-avis-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  max-width: none;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #c3d3e8 transparent;
}

.formation-detail-page .tb-rev {
  padding: 10px 12px;
  background: #fafcfe;
  border: 1px solid #e6edf5;
  border-radius: 8px;
}

.formation-detail-page .tb-rev-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.formation-detail-page .tb-rev-avatar {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e4efff;
  color: var(--tb-blue);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}

.formation-detail-page .tb-rev-id {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.formation-detail-page .tb-rev-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--tb-navy);
}

.formation-detail-page .tb-rev-date {
  font-size: 11px;
  color: var(--tb-muted);
}

.formation-detail-page .tb-rev-rating {
  font-size: 12px;
  font-weight: 800;
  color: var(--tb-navy);
  white-space: nowrap;
}

.formation-detail-page .tb-rev-rating .tb-stars {
  font-size: 12px;
  margin-right: 3px;
}

.formation-detail-page .tb-rev-text {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #3b4b60;
  font-style: normal;
}

.formation-detail-page .tb-sessions {
  margin: 0 0 16px;
  background: #fff;
  border: 1px solid var(--tb-line);
  border-radius: 10px;
  overflow: hidden;
}

.formation-detail-page .tb-sessions-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 10px 12px 10px 14px;
}

.formation-detail-page .tb-sessions-summary .tb-toggle {
  margin-left: auto;
  flex-shrink: 0;
}

.formation-detail-page .tb-sessions-summary:hover {
  background: #fafcff;
}

.formation-detail-page .tb-sessions-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 800;
  color: #24364c;
}

.formation-detail-page .tb-sessions-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--tb-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.formation-detail-page .tb-sessions-next {
  font-size: 12px;
  color: var(--tb-muted);
}

.formation-detail-page .tb-sessions-panel {
  padding: 0 14px 8px;
  border-top: 1px solid #edf1f6;
}

.formation-detail-page .tb-sess-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.formation-detail-page .tb-sess {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #edf1f6;
}

.formation-detail-page .tb-sess:last-child {
  border-bottom: 0;
}

.formation-detail-page .tb-sess-dates {
  font-size: 13px;
  font-weight: 700;
  color: var(--tb-navy);
}

.formation-detail-page .tb-sess-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--tb-muted);
}

.formation-detail-page .tb-sess-meta i {
  font-style: normal;
  color: var(--tb-blue);
  margin-right: 4px;
}

.formation-detail-page .tb-sess-meta i + i,
.formation-detail-page .tb-sess-meta span + i {
  margin-left: 12px;
}

.formation-detail-page .tb-sess.is-full .tb-sess-dates {
  color: #7b8797;
}

.formation-detail-page .tb-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid;
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.formation-detail-page .tb-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.formation-detail-page .tb-badge--ok {
  color: var(--tb-green);
  background: var(--tb-green-bg);
  border-color: var(--tb-green-line);
}

.formation-detail-page .tb-badge--open {
  color: #3466aa;
  background: #f0f6ff;
  border-color: #cadcf5;
}

.formation-detail-page .tb-badge--full {
  color: var(--tb-red);
  background: var(--tb-red-bg);
  border-color: var(--tb-red-line);
}

.formation-detail-page .tb-sess-price {
  font-size: 14px;
  font-weight: 800;
  color: #24364c;
  white-space: nowrap;
}

.formation-detail-page .tb-sessions-title .section-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #eaf3ff;
  color: #135fc4;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
}

@media (max-width: 760px) {
  .formation-detail-page .tb-avis-list {
    grid-template-columns: 1fr;
    max-height: 300px;
  }

  .formation-detail-page .tb-sess {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
  }

  .formation-detail-page .tb-sess-main {
    grid-column: 1 / 2;
  }

  .formation-detail-page .tb-sess .tb-badge {
    grid-column: 2 / 3;
    grid-row: 1;
  }

  .formation-detail-page .tb-sess-price {
    grid-column: 1 / 2;
  }

  .formation-detail-page .tb-sess .tb-btn {
    grid-column: 2 / 3;
  }

  .formation-detail-page .tb-sessions-next {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .formation-detail-page .tb-chev::after,
  .formation-detail-page .tb-btn,
  .formation-detail-page .tb-toggle {
    transition: none;
  }
}
