/**
 * Guide des tailles — L'Esprit du Combattant.
 *
 * Deux règles de survie dans un thème inconnu :
 *
 *  1. TOUT fond est déclaré, y compris celui des lignes impaires du tableau.
 *     Une ligne sans fond laisse passer le zébrage clair du thème, et le texte
 *     clair devient invisible dessus.
 *
 *  2. Les boutons sont remis à zéro avant d'être habillés. Sans cela, le style
 *     « button » du thème traverse et repeint la croix de fermeture.
 *
 * Les règles du composant sont écrites « .edc-sg .edc-sg__xxx » pour peser plus
 * lourd que la remise à zéro « .edc-sg button », qui porte un nom d'élément.
 */

.edc-sg,
.edc-sg *,
.edc-sg *::before,
.edc-sg *::after {
  box-sizing: border-box;
}

.edc-sg {
  --edc-sg-gold: #d8a83e;
  --edc-sg-gold-light: #f0c55a;
  --edc-sg-gold-dark: #7c5e22;
  --edc-sg-text: #f5f5f2;
  --edc-sg-muted: #9a9a93;
  --edc-sg-panel: #121417;
  --edc-sg-row: #1a1d21;
  --edc-sg-line: #2a2d31;

  margin: 14px 0;
  color: var(--edc-sg-text);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Remise à zéro ---------- */

.edc-sg button {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
}

.edc-sg table {
  border-collapse: collapse;
  border-spacing: 0;
  background: none;
  margin: 0;
}

.edc-sg th,
.edc-sg td {
  background: none;
  border: none;
}

/* ---------- Le bouton d'ouverture ----------
   Reprise du bouton secondaire du site : 44 px de haut, contour doré,
   capitales espacées. Un lien de 12 px ne se voit pas sur fond sombre. */

.edc-sg .edc-sg__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--edc-sg-gold-dark);
  border-radius: 2px;
  background: transparent;
  color: var(--edc-sg-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: .2s;
}

.edc-sg .edc-sg__trigger:hover {
  border-color: var(--edc-sg-gold);
  color: var(--edc-sg-gold);
  transform: translateY(-1px);
}

.edc-sg .edc-sg__trigger:focus-visible {
  outline: 2px solid var(--edc-sg-gold);
  outline-offset: 3px;
}

/* Variante discrète, pour qui préfère un lien. */
.edc-sg--link .edc-sg__trigger {
  min-height: 0;
  padding: 0;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  color: var(--edc-sg-gold);
  font-weight: 500;
}

.edc-sg--link .edc-sg__trigger:hover {
  border-bottom-color: var(--edc-sg-gold);
  transform: none;
}

.edc-sg .edc-sg__icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--edc-sg-gold);
}

/* ---------- La fenêtre ---------- */

.edc-sg .edc-sg__dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  padding: 0;
  border: 1px solid var(--edc-sg-gold-dark);
  border-radius: 4px;
  background: var(--edc-sg-panel);
  color: var(--edc-sg-text);
  overflow: hidden;
}

.edc-sg .edc-sg__dialog::backdrop {
  background: rgba(4, 5, 6, .78);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* Navigateur sans <dialog> : le script retombe sur l'attribut open. */
.edc-sg .edc-sg__dialog:not([open]) { display: none; }

.edc-sg .edc-sg__panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px);
  background: var(--edc-sg-panel);
}

.edc-sg .edc-sg__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--edc-sg-line);
  background: rgba(255, 255, 255, .03);
}

.edc-sg .edc-sg__close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--edc-sg-line);
  border-radius: 50%;
  background: transparent;
  color: var(--edc-sg-muted);
  cursor: pointer;
  transition: .2s;
}

.edc-sg .edc-sg__close:hover {
  border-color: var(--edc-sg-gold);
  color: var(--edc-sg-gold);
}

.edc-sg .edc-sg__close:focus-visible {
  outline: 2px solid var(--edc-sg-gold);
  outline-offset: 2px;
}

.edc-sg .edc-sg__close svg { display: block; width: 15px; height: 15px; }

.edc-sg .edc-sg__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  background: var(--edc-sg-panel);
  scrollbar-width: thin;
  scrollbar-color: var(--edc-sg-gold-dark) transparent;
}

.edc-sg .edc-sg__body::-webkit-scrollbar { width: 6px; }
.edc-sg .edc-sg__body::-webkit-scrollbar-thumb { background: var(--edc-sg-gold-dark); border-radius: 3px; }

/* ---------- Bloc dépliant et affichage direct ---------- */

.edc-sg .edc-sg__content {
  margin-top: 12px;
  padding: 15px 16px 16px;
  border: 1px solid var(--edc-sg-line);
  border-radius: 3px;
  background: var(--edc-sg-panel);
}

.edc-sg .edc-sg__content[hidden] { display: none !important; }

.edc-sg .edc-sg__title {
  margin: 0;
  color: var(--edc-sg-text);
  font-family: var(--edc-sg-font-title, inherit);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.edc-sg .edc-sg__content .edc-sg__title { margin-bottom: 10px; }

/* ---------- Contenu ---------- */

.edc-sg .edc-sg__intro { color: var(--edc-sg-muted); }
.edc-sg .edc-sg__intro p { margin: 0 0 10px; color: var(--edc-sg-muted); }
.edc-sg .edc-sg__intro p:last-child { margin-bottom: 0; }

/* Un tableau large défile dans son cadre, jamais la page. */
.edc-sg .edc-sg__scroll {
  margin: 14px 0 0;
  overflow-x: auto;
  border: 1px solid var(--edc-sg-line);
  border-radius: 3px;
  scrollbar-width: thin;
  scrollbar-color: var(--edc-sg-gold-dark) transparent;
}

.edc-sg .edc-sg__scroll::-webkit-scrollbar { height: 6px; }
.edc-sg .edc-sg__scroll::-webkit-scrollbar-thumb { background: var(--edc-sg-gold-dark); border-radius: 3px; }

.edc-sg .edc-sg__table {
  width: 100%;
  min-width: 280px;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: var(--edc-sg-panel);
}

.edc-sg .edc-sg__table th,
.edc-sg .edc-sg__table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--edc-sg-line);
}

.edc-sg .edc-sg__table thead th {
  color: var(--edc-sg-gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--edc-sg-gold-dark);
}

/* Le fond est posé sur les CELLULES, pas sur les lignes.
   Le thème royal-elementor-kit pose « table tbody > tr:nth-child(odd) > td,
   table tbody > tr:nth-child(odd) > th { background-color: #f7f7f7 } ».
   Le fond d une cellule se dessine PAR-DESSUS celui de sa ligne : colorer la
   ligne ne sert a rien, quelle que soit la priorite. Il faut viser la cellule,
   et peser plus lourd que (0,1,4) — d ou les deux classes et le chemin direct. */
.edc-sg .edc-sg__table tbody > tr > th,
.edc-sg .edc-sg__table tbody > tr > td { background-color: var(--edc-sg-panel); }

.edc-sg .edc-sg__table tbody > tr:nth-child(even) > th,
.edc-sg .edc-sg__table tbody > tr:nth-child(even) > td { background-color: var(--edc-sg-row); }

/* Le meme theme reblanchit la ligne au survol. */
.edc-sg .edc-sg__table tbody > tr:hover > th,
.edc-sg .edc-sg__table tbody > tr:hover > td { background-color: var(--edc-sg-row); }

.edc-sg .edc-sg__table thead > tr > th { background-color: #1b1e22; }

.edc-sg .edc-sg__table tbody th {
  color: var(--edc-sg-text);
  font-weight: 700;
  white-space: nowrap;
}

.edc-sg .edc-sg__table tbody td { color: var(--edc-sg-muted); }

.edc-sg .edc-sg__table tbody tr:last-child th,
.edc-sg .edc-sg__table tbody tr:last-child td { border-bottom: none; }

/* ---------- Conseil, provenance, mention ---------- */

.edc-sg .edc-sg__note {
  margin-top: 14px;
  padding: 11px 13px;
  border-left: 3px solid var(--edc-sg-gold);
  background: rgba(216, 168, 62, .09);
  color: var(--edc-sg-text);
  font-size: 12.5px;
}

.edc-sg .edc-sg__note p { margin: 0 0 8px; color: var(--edc-sg-text); }
.edc-sg .edc-sg__note p:last-child { margin-bottom: 0; }

.edc-sg .edc-sg__src {
  margin: 12px 0 0;
  color: var(--edc-sg-muted);
  font-size: 11.5px;
  font-style: italic;
}

.edc-sg .edc-sg__help {
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--edc-sg-line);
  color: var(--edc-sg-muted);
  font-size: 12.5px;
}

.edc-sg .edc-sg__help a { color: var(--edc-sg-gold); text-decoration: underline; }
.edc-sg .edc-sg__help a:hover { color: var(--edc-sg-gold-light); }

@media (max-width: 480px) {
  .edc-sg .edc-sg__trigger { width: 100%; }
  .edc-sg .edc-sg__table th,
  .edc-sg .edc-sg__table td { padding: 8px 10px; }
  .edc-sg .edc-sg__body { padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .edc-sg .edc-sg__trigger,
  .edc-sg .edc-sg__close { transition: none; }
  .edc-sg .edc-sg__trigger:hover { transform: none; }
}
