/* =========================================================================
   se_category_fields – styles front (CSS natif nesting)
   - Accordéons utilisables dans la "Description additionnelle" via le mode
     source TinyMCE.
   - Valeurs alignées sur le palette Tailwind v4 / Figma du projet
     (variables CSS globales `--color-*` + repli hardcodé).
   ========================================================================= */

/* -------------------------------------------------------------------------
   Typographie de la zone module
   ------------------------------------------------------------------------- */

.scf-category-extra {
  h2 {
    font-size: 16px;
    color: #0A3050;
    margin-bottom: 16px;
    font-weight: bold;

    &:not(:first-child) {
      margin-top: 24px;
    }
  }

  & p {
    font-size: 14px;
  }
}

.scf-category-extra__inner {
  &>*:first-child {
    margin-top: 0;
  }

  &>*:last-child {
    margin-bottom: 0;
  }
}

/* -------------------------------------------------------------------------
   FAQ
   ------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------
   Accordéon
   ------------------------------------------------------------------------- */

.scf-accordion {
  margin: 1.5rem 0;
  border-top: 1px solid var(--color-gray-200, #e5e7eb);

  & .scf-accordion-item {
    border-bottom: 1px solid var(--color-gray-200, #e5e7eb);

    &.is-open .scf-accordion-header::after {
      transform: translateY(-30%) rotate(-135deg);
    }
  }

  /* La question peut être enveloppée dans un titre (h1…h6) choisi en BO :
     on neutralise les marges/typo du titre pour conserver le rendu du bouton. */
  & .scf-accordion-heading {
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
  }

  & .scf-accordion-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin: 0;
    padding: 1.125rem 2.5rem 1.125rem 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: #0A3050;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    user-select: none;
    transition: color .15s ease;

    &:hover,
    &:focus-visible {
      color: var(--color-burnt-orange, #ed6a25);
      outline: none;
    }

    /* Chevron */
    &::after {
      content: "";
      position: absolute;
      right: .375rem;
      top: 50%;
      width: .75rem;
      height: .75rem;
      border-right: 2px solid currentColor;
      border-bottom: 2px solid currentColor;
      transform: translateY(-70%) rotate(45deg);
      transition: transform .25s ease;
    }
  }

  & .scf-accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
  }

  & .scf-accordion-content {
    padding: 0 0 1.125rem;
    color: var(--color-steel-gray, #4a5565);
    font-size: 14px;
    line-height: 1.65;

    &>*:first-child {
      margin-top: 0;
    }

    &>*:last-child {
      margin-bottom: 0;
    }

    & a {
      color: var(--color-burnt-orange, #ed6a25);
      text-decoration: underline;
      text-underline-offset: 2px;

      &:hover {
        text-decoration: none;
      }
    }

    p {
      font-size: 14px;
    }

    & ul,
    & ol {
      padding-left: 1.25rem;
      margin: .5rem 0;
    }
  }
}

/* Repli sans JS : tout reste accessible */
html:not(.js) .scf-accordion-panel,
.no-js .scf-accordion-panel {
  max-height: none;
}