/* =====================================================================
   AlyniaRP — Bareme des sanctions.

   La page reprend les jetons de main.css et la modale d administration de
   reglement.css. Elle n ajoute que ce qui lui est propre : les encadres, les
   onglets de grille, et le tableau.

   Le tableau est un vrai <table> — c est un tableau de donnees, pas une mise
   en page. Sur telephone il se replie en fiches, chaque cellule reprenant
   son en-tete par un ::before, sans dupliquer le texte dans le HTML.
   ===================================================================== */

/* --- Encadres ---------------------------------------------------------- */

.bmEncadres{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap:1rem;
  margin-bottom:2rem;
}

.bmEncadre{
  position:relative;
  padding:1.3rem 1.4rem;
  border-radius:var(--radius);
  background:var(--card);
  border:1px solid var(--line-soft);
}

.bmEncadreT{
  margin-bottom:.6rem;
  font-size:1rem;
  font-weight:900;
  font-style:italic;
  letter-spacing:.02em;
}

.bmEncadreP{
  color:var(--dim);
  font-size:.92rem;
  line-height:1.6;
  /* Le texte vient d un tableur : ses retours a la ligne portent du sens. */
  white-space:pre-line;
}

/* --- Onglets et recherche ---------------------------------------------- */

.bmTete{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
  margin-bottom:.9rem;
}

.bmOnglets{ display:flex; gap:.4rem; flex-wrap:wrap; }

.bmOnglet{
  padding:.55rem 1rem;
  border-radius:var(--radius-sm);
  background:var(--elem);
  border:1px solid var(--line-soft);
  color:var(--dim);
  font-family:inherit;
  font-size:.82rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  cursor:pointer;
  transition:background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}

.bmOnglet:hover{ background:var(--elem-hi); color:var(--text); }

.bmOnglet.on{
  background:var(--accent-faint);
  border-color:var(--accent-soft);
  color:var(--accent);
}

.bmCherche{ flex:1; min-width:min(100%, 15rem); max-width:22rem; }

.bmResume{
  margin-bottom:1.1rem;
  color:var(--faint);
  font-size:.86rem;
}

/* --- Tableau ------------------------------------------------------------ */

/* Le cadre porte le defilement horizontal : sur un ecran etroit c est LUI
   qui glisse, jamais la page. */
.bmCadre{
  overflow-x:auto;
  border-radius:var(--radius);
  border:1px solid var(--line-soft);
  background:var(--card);
}

.bmTable{
  width:100%;
  border-collapse:collapse;
  font-size:.9rem;
}

.bmTable th{
  position:sticky;
  top:0;
  z-index:1;
  padding:.85rem 1rem;
  background:var(--panel);
  border-bottom:1px solid var(--line);
  color:var(--faint);
  font-size:.68rem;
  font-weight:900;
  font-style:italic;
  letter-spacing:.14em;
  text-transform:uppercase;
  text-align:left;
  white-space:nowrap;
}

.bmTable td{
  padding:.8rem 1rem;
  border-top:1px solid var(--line-soft);
  vertical-align:top;
  line-height:1.5;
}

.bmLigne:hover td{ background:rgba(255,255,255,.02); }

.bmFaute{ width:22%; min-width:11rem; }
.bmFauteT{ color:var(--text); font-weight:700; }

.bmDetail{ color:var(--dim); }

.bmSanction{ width:26%; min-width:12rem; position:relative; }

/* La peine est ce qu on vient chercher : elle porte l accent, comme les
   prix de la boutique portent l or. */
.bmPeine{ color:var(--accent); font-weight:700; }

.bmVide{
  padding:2rem 0;
  color:var(--faint);
  text-align:center;
}

.bmTable mark{
  padding:0 .12em;
  border-radius:3px;
  background:var(--accent-faint);
  color:var(--text);
}

/* --- Edition ------------------------------------------------------------ */

.bmPlus{
  margin-top:.9rem;
  margin-right:.5rem;
  padding:.6rem 1rem;
  border-radius:var(--radius-sm);
  background:var(--elem);
  border:1px dashed var(--line-hi);
  color:var(--dim);
  font-family:inherit;
  font-size:.82rem;
  font-weight:700;
  cursor:pointer;
  transition:background .18s var(--ease), color .18s var(--ease);
}

.bmPlus:hover{ background:var(--elem-hi); color:var(--text); }

.bmDanger{ border-color:var(--accent-soft); color:var(--accent); }

.bmSup{
  position:absolute;
  top:.5rem;
  right:.5rem;
  width:1.6rem;
  height:1.6rem;
  border:1px solid var(--line-soft);
  border-radius:var(--radius-sm);
  background:var(--elem);
  color:var(--faint);
  font-family:inherit;
  font-size:.95rem;
  line-height:1;
  cursor:pointer;
  transition:color .18s var(--ease), border-color .18s var(--ease);
}

.bmSup:hover{ color:var(--accent); border-color:var(--accent-soft); }

.bmTitreGrille{
  display:block;
  width:min(100%, 22rem);
  margin-bottom:.6rem;
}

.bmResumeEdit{ display:block; width:100%; margin-bottom:.9rem; }

/* --- Telephone : le tableau devient une pile de fiches ------------------ */

@media (max-width:760px){
  .bmTable thead{
    /* Masque accessible : l en-tete disparait a l ecran, mais chaque cellule
       reprend son intitule ci-dessous. */
    position:absolute;
    width:1px; height:1px;
    overflow:hidden;
    clip-path:inset(50%);
  }

  .bmTable, .bmTable tbody, .bmLigne, .bmTable td{ display:block; width:auto; }

  .bmCadre{ overflow-x:visible; background:none; border:0; }

  .bmLigne{
    margin-bottom:.8rem;
    border-radius:var(--radius);
    border:1px solid var(--line-soft);
    background:var(--card);
    padding:.4rem .2rem;
  }

  .bmTable td{
    border-top:0;
    padding:.45rem 1rem;
    min-width:0;
  }

  /* L intitule de colonne, repris depuis l attribut pose par le script. */
  .bmTable td::before{
    content:attr(data-col);
    display:block;
    margin-bottom:.15rem;
    color:var(--faint);
    font-size:.62rem;
    font-weight:900;
    font-style:italic;
    letter-spacing:.14em;
    text-transform:uppercase;
  }

  .bmTable td.bmFaute::before{ display:none; }

  .bmFaute{ font-size:1rem; padding-top:.75rem; }
  .bmSanction{ padding-bottom:.75rem; }
}
