/* Page publique du règlement (contenu géré depuis le dashboard). */
.rules-hero {
  padding: 8rem 0 2.5rem;
  text-align: center;
}

.rules-hero__title {
  margin: 0 0 0.75rem;
  color: #ffffff;
}

.rules-hero__subtitle {
  margin: 0 0 1.75rem;
  color: #ffffff;
}

.rules-toc {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.rules-toc__chip {
  padding: 0.45rem 1.15rem;
  border: 2px solid #2379ee;
  border-radius: 100px;
  color: #ffffff !important;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s;
}

.rules-toc__chip:hover,
.rules-toc__chip:focus-visible {
  background: #2379ee;
}

.rules-page {
  padding: 2.5rem 0 5rem;
}

.rules-page .container {
  max-width: 1000px;
}

.rules-section {
  background: transparent;
  padding-top: 2rem;
  scroll-margin-top: 4.5rem;
}

.rules-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  margin-bottom: 1rem;
}

.rules-section__title {
  margin: 0;
  color: #ffffff;
  font-size: 1.8rem;
}

.rules-section__count {
  color: #9a9a9a;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
}

.rules-section__intro {
  margin: 0 0 1rem;
  color: #d8d8d8;
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rules-card {
  display: flex;
  gap: 1.1rem;
  padding: 1.25rem 1.4rem;
  border-radius: 14px;
  background: #2b2b2b;
  scroll-margin-top: 5rem;
  transition: background 0.2s;
}

.rules-card:target {
  background: #2f3540;
  box-shadow: inset 0 0 0 2px #2379ee;
}

.rules-card__number {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 50%;
  background: #2379ee;
  color: #ffffff !important;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  line-height: 40px;
  text-align: center;
}

.rules-card__body {
  flex: 1;
  min-width: 0;
}

.rules-card__title {
  margin: 0.45rem 0 0.5rem;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.rules-card__content {
  color: #e2e2e2;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.rules-card__content em {
  color: #bdbdbd;
}

.rules-empty {
  padding: 3rem 0;
  color: #ffffff;
  text-align: center;
}

@media (max-width: 767px) {
  .rules-hero { padding-top: 6.5rem; }
  .rules-card { gap: 0.8rem; padding: 1rem; }
  .rules-card__number { flex-basis: 32px; height: 32px; line-height: 32px; font-size: 0.85rem; }
  .rules-card__title { margin-top: 0.2rem; font-size: 1.05rem; }
  .rules-card__content { font-size: 0.95rem; }
  .rules-section__title { font-size: 1.45rem; }
}

/* Recherche (assets/controllers/rules_search_controller.js) : reste visible sous la barre de navigation */
.rules-search {
  position: sticky;
  top: 4.75rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
  padding: 0.75rem 0;
  background: #232323;
}

.rules-search__field {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0 1.1rem;
  border: 1.5px solid #3d3d3d;
  border-radius: 100px;
  background: #2b2b2b;
  transition: border-color 0.15s;
}

.rules-search__field:focus-within {
  border-color: #2379ee;
}

.rules-search__field svg {
  flex: 0 0 1.15rem;
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: #9a9a9a;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.rules-search__field input {
  width: 100%;
  min-height: 3rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
}

.rules-search__field input::placeholder {
  color: #8a8a8a;
}

.rules-search__count {
  color: #9a9a9a;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  white-space: nowrap;
}

.rules-search__count:empty {
  display: none;
}

.rules-search__empty {
  margin: 1.5rem 0;
  padding: 2rem 1.5rem;
  border-radius: 14px;
  background: #2b2b2b;
  color: #d8d8d8;
  font-family: 'Poppins', sans-serif;
  text-align: center;
}

.rules-search__reset {
  padding: 0;
  border: 0;
  background: none;
  color: #2379ee;
  font: inherit;
  text-decoration: underline;
}

.rules-mark {
  padding: 0 0.1em;
  border-radius: 3px;
  background: rgba(35, 121, 238, 0.35);
  color: #ffffff;
}

/* Sommaire pendant une recherche : sections sans résultat grisées */
.rules-toc__chip.is-empty {
  opacity: 0.35;
  pointer-events: none;
}

/* Pendant une recherche : sections plus serrées */
.is-searching .rules-section {
  padding-top: 1.25rem;
}

@media (max-width: 767px) {
  .rules-search { top: 4.25rem; padding: 0.5rem 0; }
  .rules-search__field input { min-height: 2.75rem; font-size: 0.95rem; }
  .rules-search__count { font-size: 0.8rem; }
}
