/* ============================================================
   advanced-search.css — Page "Recherche avancée"
   Version 3.33.0 : page repensée. À gauche, les critères — des mots,
   puis UNE façon de chercher (un « axe ») parmi catégorie, parcours,
   thème, série, type d'article et livre biblique, choisie comme un
   bouton radio ; ses choix s'affichent dessous, avec le nombre
   d'articles de chacun. À droite, les résultats. Sur téléphone, tout
   s'empile.
   Les cartes de résultats réutilisent .schilo-archive-card (voir
   archive.css, chargé en dépendance) pour rester visuellement
   identiques aux archives/catégories.
   ============================================================ */

.schilo-adv-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

@media (min-width: 960px) {
  .schilo-adv-search {
    grid-template-columns: 340px minmax(0, 1fr);
    align-items: start;
    gap: 2rem;
  }
}

/* ── Panneau des critères ── */

.schilo-adv-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--schilo-bg-card, #fff);
  border: 1px solid var(--schilo-border, #dde2ea);
  border-radius: var(--schilo-radius-lg, 14px);
  box-shadow: var(--schilo-shadow-sm, 0 1px 3px rgba(0,0,0,.06));
}

/* Sur grand écran, le panneau reste en vue pendant le défilement des résultats, avec son propre défilement. */
@media (min-width: 960px) {
  .schilo-adv-panel {
    position: sticky;
    top: calc(var(--schilo-nav-h, 56px) + 16px);
    max-height: calc(100vh - var(--schilo-nav-h, 56px) - 32px);
    overflow-y: auto;
  }
}

.schilo-adv-step {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.schilo-adv-step__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--schilo-text-primary, #1a2230);
}

.schilo-adv-step__title small {
  font-size: 12px;
  font-weight: 400;
  color: var(--schilo-text-muted, #5f6b7d);
}

.schilo-adv-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--schilo-accent-dark, #0e3f88);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.schilo-adv-search__input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  background: var(--schilo-bg-card, #fff);
  border: 1px solid var(--schilo-border, #dde2ea);
  border-radius: 999px;
}

.schilo-adv-search__input-wrap:focus-within { border-color: var(--schilo-accent, #2872d4); }

.schilo-adv-search__input-wrap i {
  color: var(--schilo-text-muted, #5f6b7d);
  flex-shrink: 0;
}

.schilo-adv-search__input-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14.5px;
  color: var(--schilo-text-primary, #1a2230);
}

/* ── Axes : boutons radio présentés en tuiles (un seul choisi) ── */

.schilo-adv-axes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 640px) and (max-width: 959px) {
  .schilo-adv-axes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.schilo-adv-axis {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--schilo-bg-muted, #f4f6f9);
  border: 1px solid var(--schilo-border, #dde2ea);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--schilo-text-primary, #1a2230);
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease;
}

.schilo-adv-axis input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.schilo-adv-axis i { color: var(--schilo-accent, #2872d4); font-size: 17px; flex-shrink: 0; }

.schilo-adv-axis:hover { border-color: var(--schilo-accent, #2872d4); }

.schilo-adv-axis:focus-within {
  outline: 2px solid var(--schilo-accent, #2872d4);
  outline-offset: 2px;
}

.schilo-adv-axis.is-active {
  background: var(--schilo-accent-dark, #0e3f88);
  border-color: var(--schilo-accent-dark, #0e3f88);
  color: #fff;
}

.schilo-adv-axis.is-active i { color: #fff; }

.schilo-adv-axes__hint,
.schilo-adv-choices__help {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--schilo-text-muted, #5f6b7d);
}

.schilo-adv-axes__hint[hidden],
.schilo-adv-choices[hidden],
.schilo-adv-option[hidden],
.schilo-adv-options__none[hidden] { display: none; }

/* ── Choix de l'axe ── */

.schilo-adv-choices {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding-top: .6rem;
  border-top: 1px solid var(--schilo-border, #dde2ea);
}

.schilo-adv-choices__filter {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--schilo-border, #dde2ea);
  border-radius: 8px;
}

.schilo-adv-choices__filter:focus-within { border-color: var(--schilo-accent, #2872d4); }
.schilo-adv-choices__filter i { color: var(--schilo-text-muted, #5f6b7d); }

.schilo-adv-choices__filter input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13.5px;
  color: var(--schilo-text-primary, #1a2230);
}

.schilo-adv-options {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 420px;
  overflow-y: auto;
  margin-right: -6px;
  padding-right: 6px;
}

.schilo-adv-options__group {
  margin: 10px 4px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--schilo-text-muted, #5f6b7d);
}

.schilo-adv-options__group:first-child { margin-top: 0; }

.schilo-adv-options__none {
  margin: 8px 4px;
  font-size: 13px;
  color: var(--schilo-text-muted, #5f6b7d);
}

.schilo-adv-option__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--schilo-text-primary, #1a2230);
  cursor: pointer;
}

.schilo-adv-option__row:hover { background: var(--schilo-bg-muted, #f4f6f9); }

.schilo-adv-option__row input {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--schilo-accent-dark, #0e3f88);
}

.schilo-adv-option__label { flex: 1; min-width: 0; }

.schilo-adv-option__label small {
  font-size: 11.5px;
  color: var(--schilo-text-muted, #5f6b7d);
}

.schilo-adv-option--parent > .schilo-adv-option__row { font-weight: 600; }

.schilo-adv-option__count {
  flex-shrink: 0;
  min-width: 28px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--schilo-bg-muted, #f4f6f9);
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  color: var(--schilo-text-secondary, #556070);
}

.schilo-adv-option__row.is-checked { background: var(--schilo-accent-pale, #e2eefb); }

.schilo-adv-option__row.is-checked .schilo-adv-option__count {
  background: var(--schilo-accent-dark, #0e3f88);
  color: #fff;
}

/* Choix qui ne donnerait aucun article avec les mots saisis. */
.schilo-adv-option__row.is-empty {
  cursor: default;
  color: var(--schilo-text-muted, #5f6b7d);
}

.schilo-adv-option__row.is-empty .schilo-adv-option__label {
  text-decoration: line-through;
  text-decoration-color: rgba(95, 107, 125, .5);
}

.schilo-adv-option__row.is-empty:hover { background: transparent; }

.schilo-adv-option__children {
  margin: 1px 0 4px 16px;
  padding-left: 8px;
  border-left: 2px solid var(--schilo-border, #dde2ea);
}

.schilo-adv-choices__leave {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 6px 2px;
  background: transparent;
  border: 0;
  color: var(--schilo-accent-dark, #0e3f88);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.schilo-adv-choices__leave:hover { text-decoration: underline; }

.schilo-adv-search__reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  background: transparent;
  border: 1px dashed var(--schilo-border, #dde2ea);
  border-radius: 999px;
  color: var(--schilo-text-muted, #5f6b7d);
  font-size: 13.5px;
  cursor: pointer;
}

.schilo-adv-search__reset:hover {
  border-color: var(--schilo-accent, #2872d4);
  color: var(--schilo-accent-dark, #0e3f88);
}

.schilo-adv-search__results { min-width: 0; scroll-margin-top: calc(var(--schilo-nav-h, 56px) + 12px); }

.schilo-adv-panel__jump {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border-radius: 999px;
  background: var(--schilo-accent-dark, #0e3f88);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.schilo-adv-panel__jump:hover { color: #fff; filter: brightness(1.15); }
.schilo-adv-panel__jump[hidden] { display: none; }

@media (min-width: 960px) {
  .schilo-adv-panel__jump { display: none !important; }
}

/* ── Critères actifs (chips retirables) ── */

.schilo-adv-search__active[hidden] {
  display: none;
}

.schilo-adv-search__active {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schilo-adv-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 12px;
  background: var(--schilo-accent-pale, #e2eefb);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--schilo-accent-dark, #0e3f88);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  max-width: 260px;
  cursor: pointer;
}

.schilo-adv-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schilo-adv-chip i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  flex-shrink: 0;
}

.schilo-adv-chip:hover {
  border-color: var(--schilo-accent, #2872d4);
}

.schilo-adv-chip:hover i {
  background: var(--schilo-accent, #2872d4);
  color: #fff;
}

/* ── Résultats ── */

.schilo-adv-search__results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin-bottom: 12px;
}

.schilo-adv-search__count {
  margin: 0;
  font-size: 13.5px;
  color: var(--schilo-text-muted, #6b7280);
}

/* [hidden] doit gagner sur le display:flex ci-dessous (specificite egale
   sinon a l'attribut natif que ces elements pilotent en JS via .hidden). */
.schilo-adv-search__empty[hidden],
.schilo-adv-search__start[hidden] {
  display: none;
}

.schilo-adv-search__empty,
.schilo-adv-search__start {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 20px;
  color: var(--schilo-text-muted, #6b7280);
  text-align: center;
}

.schilo-adv-search__empty i,
.schilo-adv-search__start i { font-size: 32px; }

.schilo-adv-search__start i { color: var(--schilo-accent, #2872d4); }

.schilo-adv-search__loadmore-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.schilo-adv-search__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--schilo-border, #dde2ea);
  border-top-color: var(--schilo-accent, #2872d4);
  border-radius: 50%;
  animation: schilo-adv-spin .7s linear infinite;
}

@keyframes schilo-adv-spin {
  to { transform: rotate(360deg); }
}

/* ── Mode "liste réduite" (titres seuls, sans résumé) ──
   Spécifique à cette page (le 3e bouton n'existe que dans son
   .schilo-archive-view-toggle) : Schilo.ArchiveView (schilo.js) applique
   déjà génériquement la classe schilo-archive-posts--compact, reste à en
   définir l'apparence + masquer ce qui n'est pas le titre. */

.schilo-archive-posts--compact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.schilo-archive-posts--compact .schilo-archive-card {
  display: block;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--schilo-border, #dde2ea);
  box-shadow: none;
  background: transparent;
}

.schilo-archive-posts--compact .schilo-archive-card__thumb-link,
.schilo-archive-posts--compact .schilo-archive-card__cat,
.schilo-archive-posts--compact .schilo-archive-card__excerpt,
.schilo-archive-posts--compact .schilo-archive-card__footer {
  display: none;
}

.schilo-archive-posts--compact .schilo-archive-card__body {
  padding: 10px 4px;
}

.schilo-archive-posts--compact .schilo-archive-card__title {
  margin: 0;
  font-size: 15px;
}


/* ── Responsive ── */

@media (max-width: 959px) {
  .schilo-adv-options { max-height: 320px; }
}
