/* ══════════════════════════════════════════════════════════════════════════
   akasha-enseignements.css — AKASHA · LES ENSEIGNEMENTS (29/10/2026, §83)
   Recherche → « Explorer par thème » (pastilles) → nombre, tri → parchemins.
   Pastilles : fond améthyste translucide, filet doré fin, lueur douce à la sélection.
   Aucune animation infinie ; prefers-reduced-motion respecté. Chargée après akasha-bibliotheque.css.
   ══════════════════════════════════════════════════════════════════════════ */
#panelCodex .ens-search-row { margin-bottom: 14px; }
#panelCodex .ens-search-row input { width: min(560px, 100%); }

.ens-filters { --ens-gold: 211,174,87; --ens-ame: 74,42,128; max-width: 1080px; margin: 0 auto 18px; padding: 0 4px; }
.ens-explore { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 2px 0 10px; }
.ens-explore span {
  font-family: 'Cinzel', 'Cinzel Fallback', serif; font-size: 10.5px; letter-spacing: 3.2px; text-transform: uppercase;
  color: rgba(237,212,140,.78);
}
.ens-explore::before, .ens-explore::after { content: ""; height: 1px; width: min(90px, 14vw); background: linear-gradient(90deg, transparent, rgba(var(--ens-gold),.5)); }
.ens-explore::after { transform: scaleX(-1); }

/* une seule rangée ; « Plus de thèmes » à droite quand la place manque */
.ens-rowwrap { position: relative; display: flex; align-items: center; gap: 8px; justify-content: center; }
.ens-chips { display: flex; flex-wrap: nowrap; gap: 8px; overflow: hidden; min-width: 0; flex: 0 1 auto; padding: 4px 2px 6px; }
.ens-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 13px;
  font-family: 'Cormorant Garamond', serif; font-size: 15px; font-weight: 600; line-height: 1.1; letter-spacing: .2px; white-space: nowrap;
  color: #ece0c2; cursor: pointer;
  border: 1px solid rgba(var(--ens-gold),.42); border-radius: 999px;
  background: linear-gradient(180deg, rgba(var(--ens-ame),.42), rgba(28,16,58,.55));
  box-shadow: inset 0 1px 0 rgba(255,236,190,.07);
  transition: border-color .25s, background .25s, box-shadow .25s, color .25s, opacity .25s;
}
.ens-chip i { font-style: normal; font-size: 13px; color: rgba(237,212,140,.85); }
.ens-chip .ens-n { font-family: 'Cinzel', serif; font-size: 10.5px; font-weight: 600; color: rgba(236,224,194,.62); min-width: 1ch; }
.ens-chip .ens-n:empty { display: none; }
.ens-chip:focus-visible { outline: 2px solid rgba(241,216,145,.8); outline-offset: 2px; }
@media (hover: hover) {
  .ens-chip:hover { border-color: rgba(241,216,145,.75); color: #fff6dc; }
}
.ens-chip.is-on {
  color: #fff7e0; border-color: rgba(241,216,145,.95);
  background: linear-gradient(180deg, rgba(122,78,190,.62), rgba(52,28,98,.7));
  box-shadow: 0 0 0 1px rgba(241,216,145,.22), 0 0 18px rgba(201,168,255,.32), inset 0 1px 0 rgba(255,236,190,.16);
}
.ens-chip.is-on .ens-n { color: #f1d891; }
.ens-chip.is-empty { opacity: .48; }
.ens-chip[hidden] { display: none !important; }
.ens-chip.ens-internal { border-style: dashed; }

.ens-more { position: relative; flex: none; }
.ens-more[hidden] { display: none; }
.ens-more-btn .ens-caret { font-size: 10px; transition: transform .2s; }
.ens-more-btn[aria-expanded="true"] .ens-caret { transform: rotate(180deg); }
.ens-more-btn.is-on { border-color: rgba(241,216,145,.95); box-shadow: 0 0 14px rgba(201,168,255,.28); }
.ens-menu {
  position: absolute; z-index: 30; right: 0; top: calc(100% + 8px); width: max-content; max-width: min(320px, 86vw);
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 10px;
  border: 1px solid rgba(211,174,87,.45); border-radius: 14px;
  background: linear-gradient(180deg, rgba(30,18,62,.98), rgba(12,8,30,.98));
  box-shadow: 0 18px 40px -12px #000, 0 0 24px rgba(120,80,200,.18);
}
.ens-menu[hidden] { display: none; }
.ens-menu .ens-chip { justify-content: flex-start; }

/* nombre de résultats · réinitialiser · tri */
.ens-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.ens-count { font-family: 'Cormorant Garamond', serif; font-size: 15.5px; font-style: italic; color: rgba(233,220,188,.8); }
.ens-count b { font-family: 'Cinzel', serif; font-style: normal; font-weight: 600; color: #f1d891; margin-right: 2px; }
.ens-sug { opacity: .8; }
.ens-reset, .ens-empty-btn {
  font-family: 'Cinzel', serif; font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; cursor: pointer;
  padding: 7px 13px; min-height: 32px; border-radius: 999px; color: #e9d9b0;
  border: 1px solid rgba(211,174,87,.38); background: rgba(20,12,44,.6); transition: border-color .2s, color .2s;
}
.ens-reset[hidden] { display: none; }
@media (hover: hover) { .ens-reset:hover, .ens-empty-btn:hover { border-color: rgba(241,216,145,.85); color: #fff3d0; } }
.ens-sort { display: inline-flex; align-items: center; gap: 8px; font-family: 'Cinzel', serif; font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: rgba(233,220,188,.7); }
.ens-sort select {
  font-family: 'Cormorant Garamond', serif; font-size: 15px; color: #ece0c2; min-height: 34px; padding: 4px 28px 4px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(211,174,87,.38); background: rgba(20,12,44,.75); color-scheme: dark;
}
.ens-sort select:focus-visible { outline: 2px solid rgba(241,216,145,.8); outline-offset: 2px; }

/* cartes : thème principal, thèmes secondaires, statut d'accès */
#panelCodex .ak-card[hidden] { display: none !important; }
.ens-themes { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px; }
.ens-th {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-family: 'Cormorant Garamond', serif;
  font-size: 12.5px; font-weight: 600; line-height: 1.35; color: rgba(236,224,194,.75); border: 1px solid rgba(211,174,87,.22); background: rgba(60,34,110,.25);
}
.ens-th.is-main { color: #f3e3b6; border-color: rgba(211,174,87,.5); background: rgba(90,56,150,.35); }
.ens-th i { font-style: normal; font-size: 11px; opacity: .9; }
.ens-acc {
  display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; font-family: 'Cinzel', serif; font-size: 9.5px; letter-spacing: 1.2px;
  text-transform: uppercase; color: #f1d891; border: 1px solid rgba(241,216,145,.45); background: rgba(80,50,20,.25);
}
.ak-card.ens-in { animation: ens-in .32s ease-out both; }
@keyframes ens-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* fil d'Ariane : le maillon « Noosphère » se retire dans cette section (akasha-bibliotheque.js, sync) */
.akb-wb-crumb li[hidden] { display: none; }

/* titre gravé : la taille suit la largeur du parchemin et le mot le plus long (--pwl, _parchThumb) → plus de mot coupé */
.aparch-content { container-type: inline-size; }
@supports (font-size: 1cqi) {
  .aparch-title { font-size: clamp(8.5px, calc(100cqi / (var(--pwl, 8) * .86)), 12.5px) !important; overflow-wrap: normal; }
}

/* vide élégant */
.ens-empty { max-width: 520px; margin: 10px auto 30px; padding: 28px 22px; text-align: center; border: 1px solid rgba(211,174,87,.25); border-radius: 18px 18px 8px 8px;
  background: radial-gradient(circle at 50% 0%, rgba(120,80,200,.18), transparent 70%), rgba(14,9,32,.6); }
.ens-empty[hidden] { display: none; }
.ens-empty-glyph { font-size: 22px; color: rgba(241,216,145,.8); margin-bottom: 8px; }
.ens-empty-t { font-family: 'Cormorant Garamond', serif; font-size: 18px; color: #ece0c2; margin: 0 0 6px; }
.ens-empty-s { font-family: 'Cormorant Garamond', serif; font-size: 15px; font-style: italic; color: rgba(233,220,188,.65); margin: 0 0 16px; }

/* « Suggérer une idée » : présent mais discret, en retrait des deux onglets */
#panelCodex .subtab-bar .subtab-btn.subtab-suggest {
  font-size: 10px !important; letter-spacing: 1.2px; padding: 6px 11px !important; min-height: 0; opacity: .72;
  border-color: rgba(211,174,87,.2) !important; background: transparent !important; box-shadow: none !important; color: rgba(233,220,188,.75) !important;
}
#panelCodex .subtab-bar .subtab-btn.subtab-suggest::before { display: none !important; }
#panelCodex .subtab-bar .subtab-btn.subtab-suggest .ak-ico { width: 13px; height: 13px; }
@media (hover: hover) { #panelCodex .subtab-bar .subtab-btn.subtab-suggest:hover { opacity: 1; border-color: rgba(211,174,87,.5) !important; } }

/* téléphone et tablette : la rangée défile au doigt (plus de menu), cibles confortables */
@media (max-width: 900px) {
  .ens-rowwrap { justify-content: flex-start; }
  .ens-chips {
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding: 4px 16px 8px; margin: 0 -16px; width: calc(100% + 32px); flex: 1 1 auto;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 22px), transparent);
            mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 22px), transparent);
  }
  .ens-chips::-webkit-scrollbar { display: none; }
  .ens-chip { scroll-snap-align: start; min-height: 40px; }
}
@media (max-width: 600px) {
  .ens-filters { margin-bottom: 12px; padding: 0; }
  .ens-explore span { white-space: nowrap; letter-spacing: 2.2px; }
  .ens-explore::before, .ens-explore::after { flex: 1 1 0; width: auto; max-width: 70px; }
  /* « Suggérer une idée » : l'ampoule seule (le texte reste lu par les lecteurs d'écran) */
  #akashaApp #panelCodex .subtab-bar .subtab-btn.subtab-suggest {
    font-size: 0 !important; letter-spacing: 0 !important; min-width: 0 !important; width: auto !important; padding: 8px 9px !important; margin-left: 2px !important;
  }
  #panelCodex .subtab-bar .subtab-btn.subtab-suggest .ak-ico { width: 15px; height: 15px; margin: 0; }
  /* ENSEIGNEMENTS | VIDÉOS | ampoule tiennent sur une ligne */
  #akashaApp #panelCodex .subtab-bar .subtab-btn:not(.subtab-suggest) { padding: 8px 12px !important; letter-spacing: 1.4px !important; }
  .ens-bar { gap: 8px 12px; }
  .ens-count { font-size: 15px; width: 100%; text-align: center; }
  #panelCodex .ens-search-row input { min-width: 0 !important; width: 100%; }
}
@media (max-width: 360px) {
  #akashaApp #panelCodex .subtab-bar { gap: 6px; }
  #akashaApp #panelCodex .subtab-bar .subtab-btn:not(.subtab-suggest) { padding: 7px 9px !important; letter-spacing: 1px !important; }
  #akashaApp #panelCodex .subtab-bar .subtab-btn:not(.subtab-suggest) .ak-ico { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ens-chip, .ens-reset, .ens-empty-btn, .ens-more-btn .ens-caret { transition: none; }
  .ak-card.ens-in { animation: none; }
}
