/* Styles légers pour le bloc FAQ et HowTo */

.faq-visible h2 {
  margin-bottom: 24px;
}

.faq-visible .container-xl {
  margin: 24px 0;
}

.faq-visible .faq-accordion {
  margin-top: 24px;
}

.faq-visible .faq-item {
  border: 1px solid var(--bs-gray-300, #E5E7EB);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
  overflow: hidden;
  /* Assure que les éléments enfants respectent les coins arrondis */
}

.faq-visible .faq-question {
  margin: 0;
}

.faq-visible .faq-trigger {
  width: 100%;
  text-align: left;
  padding: 16px 48px 16px 20px;
  background: transparent;
  border: 0;
  font-weight: 600;
  font-family: Denim, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  cursor: pointer;
  position: relative;
  color: var(--bs-gray-900, #0F172A);
}

.faq-visible .faq-trigger:focus {
  outline: none;
}

/* Supprime le contour de focus au clic */
.faq-visible .faq-trigger::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%) rotate(0deg);
  transition: transform .2s ease;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23005FCC" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>') no-repeat center/16px 16px;
}

.faq-visible .faq-trigger[aria-expanded="true"]::after {
  transform: translateY(-50%) rotate(180deg);
}

/* État ouvert : Bleu site en fond, texte blanc */
.faq-visible .faq-trigger[aria-expanded="true"] {
  background: var(--bs-blue, #1b5cff);
  color: #ffffff;
}

/* Icône Chevron en blanc pour contraste sur fond bleu */
.faq-visible .faq-trigger[aria-expanded="true"]::after {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23FFFFFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>') no-repeat center/16px 16px;
}

.faq-visible .faq-panel {
  padding: 0 20px 16px;
  color: var(--bs-gray-700, #334155);
  font-size: 15px;
  line-height: 1.7;
  transition: max-height .25s ease, opacity .25s ease;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
}

.faq-visible .faq-item.is-open .faq-panel {
  max-height: 500px;
  opacity: 1;
}

@media (min-width: 768px) {
  .faq-visible .container-xl {
    margin: 40px 0;
  }

  .faq-visible .faq-accordion {
    margin-top: 32px;
  }

  .faq-visible .faq-trigger {
    font-size: 18px;
    padding: 20px 52px 20px 24px;
  }

  .faq-visible .faq-panel {
    font-size: 16px;
    padding: 0 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-visible .faq-panel {
    transition: none;
  }

  .faq-visible .faq-trigger::after {
    transition: none;
  }
}

/* Kategorien‑Überschriften in der sichtbaren FAQ */
.faq-visible .faq-category {
  margin: 24px 0 8px;
  padding: 0 20px;
  color: var(--bs-gray-700, #334155);
  font-weight: 600;
  font-family: Denim, sans-serif;
  font-size: 16px;
}

@media (min-width: 768px) {
  .faq-visible .faq-category {
    font-size: 18px;
    padding: 0 24px;
    margin: 32px 0 12px;
  }
}

/* Mini-Übersicht (klickbare Kategorienfilter) */
.faq-visible .faq-categories-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 8px;
  padding: 0 20px;
}

.faq-visible .faq-filter {
  border: 1px solid var(--bs-gray-400, #9CA3AF);
  background: transparent;
  color: var(--bs-gray-700, #374151);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-family: Denim, sans-serif;
  font-size: 15px;
  cursor: pointer;
}

.faq-visible .faq-filter:hover {
  background: rgba(156, 163, 175, .12);
}

.faq-visible .faq-filter:focus {
  outline: 2px solid rgba(156, 163, 175, .35);
  outline-offset: 2px;
}

.faq-visible .faq-filter.active {
  background: var(--bs-blue, #1b5cff);
  color: #fff;
  border-color: var(--bs-blue, #1b5cff);
}

@media (min-width: 768px) {
  .faq-visible .faq-categories-nav {
    padding: 0 24px;
    margin: 16px 0 12px;
  }

  .faq-visible .faq-filter {
    font-size: 16px;
  }
}

.faq-separator {
  border: 0;
  height: 1px;
  background: var(--bs-gray-300, #E5E7EB);
  opacity: .7;
  margin: 24px 0;
}

@media (min-width: 768px) {
  .faq-separator {
    margin: 32px 0;
  }
}

.faq-block {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}

.faq-block h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.faq-block details {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
}

.faq-block details[open] summary {
  font-weight: 600;
}

.faq-block summary {
  cursor: pointer;
}

.faq-block .howto {
  margin-top: 1.5rem;
}

.faq-block .howto ol {
  margin: 0.5rem 0 0 1.25rem;
}

.faq-block .howto li {
  margin: 0.35rem 0;
}

/* Override: annuler la marge du premier <section> sous <header> sur grands Ã©crans */
@media (min-width: 992px) {
  header~.page-container .page>main>section:not(.notification, .breadcrumb-section):first-of-type {
    margin-top: 0 !important;
  }
}

/* Centralized Optanon/Cookie banner overrides */
@media only screen and (min-width: 47em) {
  #optanon #optanon-popup-wrapper {
    top: 1em !important;
    max-height: calc(100vh - 1em);
    overflow: auto;
  }
}