/* ==========================================================================
   css/lecture.css — Atelier de lecture (lecture/*.php)
   S'appuie sur les variables du Template Impérial (css/imperial.css).
   ========================================================================== */

.lect-page { line-height: 1.6; }
.lect-page [hidden] { display: none !important; }
.lect-intro { font-family: 'Lora', serif; font-size: 16px; color: var(--texte-fr); max-width: 860px; margin: 14px auto 22px; }

.lect-txt p { margin: 0 0 8px; }
.lect-txt ul { margin: 4px 0 8px; padding-inline-start: 20px; }
.lect-txt[lang="ar"] { font-family: 'Amiri', 'Traditional Arabic', serif; font-size: 1.15em; }
.lect-ar { font-family: 'Amiri', 'Traditional Arabic', serif; font-size: 1.12em; unicode-bidi: isolate; }
.lect-fallback { display: inline-block; margin-inline-start: 6px; font-size: 10px; padding: 0 5px; border: 1px solid var(--or-fade); border-radius: 3px; color: #6b5a3e; vertical-align: middle; cursor: help; }

/* --- Sous-navigation de la section ------------------------------------- */
.lect-subnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 16px 0 10px; }
.lect-subnav-btn, .lect-tab {
  font-family: 'Cinzel', serif; font-size: 13px; padding: 7px 14px; border: 1px solid var(--or);
  background: var(--parchemin); color: #4a3c1a; text-decoration: none; border-radius: 3px; cursor: pointer;
}
.lect-subnav-btn:hover, .lect-tab:hover { background: rgba(212,175,55,0.16); text-decoration: none; }
.lect-subnav-btn.active, .lect-tab.active { background: var(--rouge); color: #fff; border-color: var(--rouge); }

/* --- Présentation (lecture/index.php) --------------------------------------- */
.lect-door-k { font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: .12em; color: var(--rouge); font-weight: 700; }
.lect-door-n { font-family: 'Cinzel', serif; font-size: 40px; font-weight: 700; line-height: 1; color: var(--rouge); margin-top: 4px; }
.lect-door-n small { font-size: 14px; font-weight: 400; letter-spacing: .04em; color: #8a7756; }
.lect-pill-sour { background: var(--rouge-fade); color: var(--rouge); }
.lect-method { list-style: none; counter-reset: m; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.lect-method li { counter-increment: m; position: relative; padding: 46px 18px 16px; background: #fff; border: 1px solid var(--or-fade); border-top: 3px solid var(--or); border-radius: 4px; font-family: 'Lora', serif; font-size: 15px; color: #4a3c28; }
.lect-method li::before { content: counter(m); position: absolute; top: 12px; inset-inline-start: 18px; width: 26px; height: 26px; border-radius: 50%; background: var(--rouge); color: #fff; text-align: center; line-height: 26px; font-family: 'Cinzel', serif; font-size: 14px; }
.lect-home section + section { margin-top: 8px; }

/* --- Filtres --------------------------------------------------------------- */
.lect-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0 16px; }
.lect-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 4px 10px; border: 1px solid var(--or-fade); background: var(--parchemin); color: var(--texte); border-radius: 14px; cursor: pointer; text-decoration: none; }
.lect-chip:hover { border-color: var(--or); text-decoration: none; }
.lect-chip.active { border-color: var(--rouge); box-shadow: inset 0 0 0 1px var(--rouge); }

.lect-page .lect-search { flex: 1 1 200px; min-width: 160px; padding: 7px 12px; font-size: 14px; background: #fff; color: var(--texte); border: 1px solid var(--or); border-radius: 3px; }
.lect-page .lect-search::placeholder { color: #9a8a6a; }
.lect-pipe-step { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; padding: 4px; }

/* --- Cartes ---------------------------------------------------------------- */
.lect-cards { display: grid; gap: 14px; }
.lect-card { border: 1px solid var(--or-fade); border-inline-start: 3px solid var(--or); background: var(--parchemin); padding: 12px 16px; scroll-margin-top: 90px; }
.lect-card.lect-target { border-inline-start-color: var(--rouge); box-shadow: 0 0 0 2px rgba(139,0,0,0.15); }
.lect-card[data-status="PROPOSÉ"] { border-inline-start-color: #854f0b; }
.lect-card[data-status="REJETÉ"] { border-inline-start-color: #999; opacity: .85; }

/* --- Liens dans le texte --------------------------------------------------- */
a.lect-vref { font-family: 'Cinzel', serif; font-weight: 700; font-size: .88em; color: var(--rouge); text-decoration: none; border-bottom: 1px dotted var(--rouge); unicode-bidi: isolate; white-space: nowrap; }
a.lect-vref:hover { background: var(--rouge-fade); }
a.lect-code { font-weight: 700; color: var(--rouge); text-decoration: none; border-bottom: 1px dotted var(--rouge); unicode-bidi: isolate; }

/* --- Fiches rédigées ------------------------------------------------------- */
.lect-txt[lang="ar"] .lect-ar, .lect-fiche[lang="ar"] .lect-ar { font-size: 1em; }
.lect-fiche[lang="ar"] { font-family: 'Amiri', 'Traditional Arabic', serif; font-size: 1.12em; }

.lect-exs { display: grid; gap: 10px; margin: 6px 0 12px; }
.lect-ex { margin: 0; padding: 10px 14px; background: #fff; border: 1px solid var(--or-fade); border-inline-start: 3px solid #0f6e56; border-radius: 3px; }
.lect-ex-contre_exemple { border-inline-start-color: var(--rouge); }
.lect-ex-exception { border-inline-start-color: #854f0b; }
.lect-ex figcaption { font-size: 12px; color: #6b5a3e; margin-bottom: 4px; }
.lect-ex-role { font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--rouge); margin-inline-end: 6px; }
.lect-ex-ar { margin: 2px 0 6px; padding: 0; border: 0; font-family: 'Amiri', 'Traditional Arabic', serif; font-size: 22px; line-height: 1.9; text-align: right; color: var(--texte); }
.lect-ex-tr { font-family: 'Lora', serif; font-style: italic; color: var(--texte-fr); font-size: 15px; text-align: left; }
.lect-ex-note { font-size: 13px; color: #4a3c1a; margin-top: 6px; }
.lect-verdict { margin-top: 8px; padding: 8px 12px; background: var(--rouge-fade); border-inline-start: 3px solid var(--rouge); }
.lect-verdict .lect-txt p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Règles de lecture : index par thèmes et page de lecture d'une fiche
   ========================================================================== */
.lect-rules { line-height: 1.65; }
.lect-rules-intro { font-size: 17px; text-align: center; max-width: 760px; }
.lect-sec-h { font-family: 'Cinzel', serif; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--rouge); margin: 30px 0 14px; display: flex; align-items: center; gap: 12px; }
.lect-sec-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--or), transparent); }
[dir="rtl"] .lect-sec-h::after { background: linear-gradient(270deg, var(--or), transparent); }
[dir="rtl"] .lect-sec-h { letter-spacing: 0; }

/* Pastilles de statut */
.lect-pill { display: inline-block; font-family: 'Lora', serif; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 10px; border-radius: 20px; white-space: nowrap; }
.lect-pill-ok { background: #e6f2ec; color: #0b4a3a; }
.lect-pill-rej { background: #f1ece4; color: #6b5a3e; }
.lect-pill-obs { background: #e9eef6; color: #2f4a6b; }
.lect-legend-line { margin: 10px 0 0; font-size: 14px; color: #6b5a3e; font-style: italic; }

/* Cartes */
.lect-rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.lect-rc { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 16px; background: #fff; border: 1px solid var(--or-fade); border-top: 3px solid var(--or); border-radius: 4px; color: var(--texte); text-decoration: none; box-shadow: 0 1px 2px rgba(80,60,20,.06); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.lect-rc:hover, .lect-rc:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(80,60,20,.14); border-top-color: var(--rouge); text-decoration: none; color: var(--texte); }
.lect-rc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lect-rc-meta { font-size: 12px; color: #8a7756; }
.lect-rc-title { font-family: 'Cinzel', serif; font-size: 17px; line-height: 1.35; color: #3d2f12; }
[dir="rtl"] .lect-rc-title, .lect-rc[lang="ar"] .lect-rc-title { font-family: 'Amiri', serif; font-size: 20px; }
.lect-rc-lead { font-family: 'Lora', serif; font-size: 14.5px; color: #4a3c28; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lect-rc-go { margin-top: auto; padding-top: 4px; font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: .06em; color: var(--rouge); }
.lect-rc:hover .lect-rc-go span { display: inline-block; transform: translateX(3px); transition: transform .18s; }
[dir="rtl"] .lect-rc:hover .lect-rc-go span { transform: translateX(-3px); }
.lect-rc-rej { background: #fbf9f4; border-top-color: #c9bda3; }
.lect-rc-rej .lect-rc-title { color: #6b5a3e; }
.lect-rc-big { padding: 22px 24px 18px; border-top-width: 4px; background: linear-gradient(180deg, #fff 0%, var(--parchemin) 100%); }
.lect-rc-big .lect-rc-title { font-size: 19px; }
.lect-rc-big .lect-rc-lead { -webkit-line-clamp: 6; font-size: 15px; }

/* Par où commencer */
.lect-howto { list-style: none; counter-reset: h; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; padding: 0; margin: 18px 0 0; font-size: 13.5px; color: #5a4632; }
.lect-howto li { counter-increment: h; display: flex; align-items: baseline; gap: 6px; }
.lect-howto li::before { content: counter(h); font-family: 'Cinzel', serif; font-weight: 700; color: var(--rouge); }

/* Barre d'outils */
.lect-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 34px 0 10px; padding: 10px 12px; background: rgba(253,250,243,.96); border: 1px solid var(--or-fade); border-radius: 6px; backdrop-filter: blur(4px); }
.lect-toolbar .lect-search { flex: 1 1 240px; padding: 9px 14px; font-size: 15px; border: 1px solid var(--or); border-radius: 22px; background: #fff; color: var(--texte); }
.lect-seg { display: inline-flex; border: 1px solid var(--or); border-radius: 22px; overflow: hidden; }
.lect-seg-b { border: 0; background: #fff; padding: 7px 14px; font-size: 13px; color: #4a3c1a; cursor: pointer; }
.lect-seg-b + .lect-seg-b { border-inline-start: 1px solid var(--or-fade); }
.lect-seg-b b { font-weight: 700; color: var(--rouge); margin-inline-start: 4px; }
.lect-seg-b.active { background: var(--rouge); color: #fff; }
.lect-seg-b.active b { color: #fff; }
.lect-theme-nav { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 6px; }
.lect-theme-nav a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 12px 4px 4px; border-radius: 20px; background: var(--parchemin); border: 1px solid var(--or-fade); color: #4a3c1a; text-decoration: none; }
[dir="rtl"] .lect-theme-nav a { padding: 4px 4px 4px 12px; }
.lect-theme-nav a:hover { border-color: var(--rouge); color: var(--rouge); text-decoration: none; }
.lect-theme-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--rouge); color: #fff; font-family: 'Cinzel', serif; font-size: 12px; font-weight: 700; flex: none; }

/* Sections thématiques */
.lect-theme { margin-top: 44px; scroll-margin-top: 130px; }
.lect-theme-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--or-fade); }
.lect-theme-num-lg { width: 44px; height: 44px; font-size: 20px; box-shadow: 0 0 0 4px var(--rouge-fade); }
.lect-theme-title { font-family: 'Cinzel', serif; font-size: 22px; color: #3d2f12; margin: 2px 0 2px; }
.lect-theme-desc { margin: 0; font-family: 'Lora', serif; font-size: 15px; color: #5a4632; }
.lect-theme-n { font-size: 12px; color: #8a7756; white-space: nowrap; margin-inline-start: 6px; }
.lect-rej { margin-top: 16px; }
.lect-rej > summary { cursor: pointer; display: inline-block; font-size: 13px; color: #6b5a3e; padding: 6px 14px; border: 1px dashed #c9bda3; border-radius: 20px; list-style: none; }
.lect-rej > summary::-webkit-details-marker { display: none; }
.lect-rej > summary::before { content: "+ "; font-weight: 700; color: var(--rouge); }
.lect-rej[open] > summary::before { content: "− "; }
.lect-rej[open] > summary { margin-bottom: 14px; }
.lect-notfound { text-align: center; padding: 10px; background: var(--rouge-fade); border: 1px solid var(--rouge); margin: 10px auto; max-width: 600px; }

/* Page de lecture d'une fiche */
.lect-read { max-width: 760px; margin: 18px auto 0; }
.lect-crumbs { font-size: 13px; color: #8a7756; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.lect-crumbs a { color: #6b5a3e; text-decoration: none; border-bottom: 1px dotted var(--or); }
.lect-crumbs a:hover { color: var(--rouge); }
.lect-read-kicker { display: flex; align-items: center; gap: 8px; font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--rouge); }
[dir="rtl"] .lect-read-kicker { letter-spacing: 0; font-size: 14px; }
.lect-read-pos { margin-inline-start: auto; color: #a8957a; letter-spacing: .04em; }
.lect-read-title { font-family: 'Cinzel', serif; font-size: 32px; line-height: 1.25; color: #2e2410; margin: 12px 0 12px; text-align: inherit; }
.lect-read-title[lang="ar"], [dir="rtl"] .lect-read-title { font-family: 'Amiri', serif; font-size: 36px; }
.lect-read-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: #8a7756; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--or-fade); }
.lect-read-meta span + span::before { content: "·"; margin-inline-end: 14px; color: var(--or); }
.lect-read-meta .lect-pill + span::before { content: none; }
.lect-fiche-lead { font-family: 'Lora', serif; font-size: 20px; line-height: 1.6; color: #2e2410; padding: 4px 0 4px 22px; border-inline-start: 4px solid var(--rouge); margin: 0 0 28px; }
[dir="rtl"] .lect-fiche-lead { padding: 4px 22px 4px 0; }
.lect-fiche-lead p { margin: 0; }
.lect-fiche[lang="ar"] .lect-fiche-lead { font-family: 'Amiri', serif; font-size: 23px; }
.lect-fiche-body { font-family: 'Lora', serif; font-size: 16.5px; line-height: 1.75; color: #33291a; }
.lect-fiche-body p { margin: 0 0 16px; }
.lect-fiche-body ul { margin: 0 0 16px; padding-inline-start: 22px; }
.lect-fiche-body li { margin: 6px 0; }
.lect-fiche[lang="ar"] .lect-fiche-body { font-family: 'Amiri', serif; font-size: 19px; line-height: 1.9; }
.lect-fiche-h { font-family: 'Cinzel', serif; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--rouge); margin: 36px 0 14px; text-align: center; }
.lect-fiche-h::before, .lect-fiche-h::after { content: "۞"; color: var(--or); margin: 0 10px; letter-spacing: 0; }
.lect-rules .lect-exs { gap: 16px; }
.lect-rules .lect-ex { padding: 16px 20px; border-radius: 6px; border: 1px solid var(--or-fade); border-inline-start: 4px solid #0f6e56; background: #fff; box-shadow: 0 1px 3px rgba(80,60,20,.06); }
.lect-rules .lect-ex-contre_exemple { border-inline-start-color: var(--rouge); }
.lect-rules .lect-ex-exception { border-inline-start-color: #b07a1c; }
.lect-rules .lect-ex-ar { font-size: 26px; line-height: 2; margin: 6px 0 8px; }
.lect-rules .lect-ex-tr { font-size: 16px; }
.lect-rules .lect-ex-note { font-size: 14px; color: #5a4632; border-top: 1px dotted var(--or-fade); padding-top: 8px; margin-top: 10px; }
.lect-rules .lect-verdict { margin: 32px 0 8px; padding: 18px 22px; border-radius: 6px; border: 1px solid var(--or); border-inline-start: 5px solid var(--rouge); background: linear-gradient(135deg, #fffdf7 0%, var(--parchemin) 100%); }
.lect-verdict-k { display: block; font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--rouge); margin-bottom: 6px; }
.lect-rules .lect-verdict .lect-txt { font-family: 'Lora', serif; font-size: 17px; color: #2e2410; }
.lect-read-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 36px 0 0; }
.lect-read-nav { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border: 1px solid var(--or-fade); border-radius: 6px; background: var(--parchemin); text-decoration: none; color: var(--texte); transition: border-color .18s, background .18s; }
.lect-read-nav:hover { border-color: var(--rouge); background: #fff; text-decoration: none; color: var(--texte); }
.lect-read-next { text-align: end; grid-column: 2; }
.lect-read-nav-k { font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--rouge); }
.lect-read-nav-t { font-family: 'Lora', serif; font-size: 15px; color: #3d2f12; }
.lect-related { max-width: 1000px; margin: 40px auto 0; }
.lect-back { text-align: center; margin: 22px 0 0; }
.lect-back a { font-family: 'Cinzel', serif; font-size: 13px; color: var(--rouge); text-decoration: none; }
a.lect-rule-link { font-style: italic; font-weight: 600; white-space: normal; }

@media (max-width: 768px) {
  .lect-read-title { font-size: 25px; }
  .lect-fiche-lead { font-size: 18px; }
  .lect-rules .lect-ex-ar { font-size: 22px; }
  .lect-read-pager { grid-template-columns: 1fr; }
  .lect-read-next { grid-column: 1; }
  .lect-theme-title { font-size: 19px; }
}

/* Sourates : index (1 → 114) et fiches */
.lect-sgrid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 18px 0 8px; }
.lect-sc { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 10px; text-decoration: none; color: var(--texte); background: #fffdf7; border: 1px solid rgba(160,120,40,.22); transition: transform .15s, box-shadow .2s, background .2s; }
.lect-sc:hover, .lect-sc:focus { text-decoration: none; color: var(--texte); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(90,60,10,.10); }
.lect-sc[hidden] { display: none; }
.lect-sc-pub { border-top: 3px solid #b8932f; }
.lect-sc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lect-sc-num { width: 40px !important; height: 40px !important; font-size: 15px !important; margin: 0 !important; }
.lect-sc-meta { font-size: 12px; color: #6b5a3e; }
.lect-sc-title { font-family: 'Lora', serif; font-size: 19px; font-weight: 700; color: #3a2a10; line-height: 1.3; }
.lect-sc-lead { font-size: 14px; line-height: 1.55; color: #4a3c1a; }
.lect-sc-soon { background: transparent; border-style: dashed; opacity: .78; }
.lect-sc-soon:hover { opacity: 1; }
.lect-sc-soonl { font-size: 12.5px; font-style: italic; color: #8a7a5a; }
.lect-sc-soon .sura-medallion { opacity: .55; }
.lect-stext { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 24px; padding: 18px 20px; background: #fffaf0; border: 1px solid rgba(160,120,40,.22); border-radius: 10px; }
.lect-stext-p + .lect-stext-p { border-top: 1px dashed rgba(160,120,40,.25); padding-top: 10px; }
.lect-stext-ar { font-family: 'Amiri', 'Traditional Arabic', serif; font-size: 26px; line-height: 2; margin: 0; text-align: right; }
.lect-stext-tr { margin: 2px 0 0; font-size: 15.5px; line-height: 1.6; color: #4a3c1a; text-align: left; }
.lect-seealso { list-style: none; padding: 0; margin: 4px 0 22px; }
.lect-seealso li { padding: 8px 0; border-bottom: 1px solid rgba(160,120,40,.15); line-height: 1.55; }
.lect-seealso-k { font-weight: 700; margin-inline-end: 6px; }
.lect-read-textlink { font-size: 13px; }
.lect-soon { font-style: italic; color: #6b5a3e; margin: 18px 0; }
