/* ══════════════════════════════════════════════════════════════════
   fiche-pdf.css — fiche imprimable d'une étude (templates/article/pdf.html.twig)
   A4 ; page de garde pleine page ; titre et numéro de page en marge des
   pages suivantes ; à l'écran, un aperçu feuille par feuille.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --f-ink: #1b2430;
  --f-muted: #5b6676;
  --f-faint: #56606f; /* 3.48.0 : #8a94a3 auparavant, contraste 2,9 ; 5,3 au moins, même sur les fonds pastel */
  --f-line: #dfe4ea;
  --f-soft: #f3f5f8;
  --f-navy: #1e2a3a;
  --f-navy-2: #273548;
  --f-accent: #2872d4;
  --f-accent-pale: #e6effb;
  --f-accent-dark: #0e3f88;
  --f-green: #0f6e56;
  --f-green-pale: #e3f4ee;
}

/* ── Pages ─────────────────────────────────────────────────────── */
@page {
  size: A4;
  margin: 18mm 16mm 18mm 16mm;
}
@page fiche {
  @top-left { font: 8pt Inter, sans-serif; color: #56606f; vertical-align: bottom; padding-bottom: 3mm; }
  @top-right { font: 500 8pt Inter, sans-serif; color: #2872d4; vertical-align: bottom; padding-bottom: 3mm; }
  /* En haut : le titre de l'étude et le site ; en bas : le site et le titre, puis le numéro (textes posés par pdf.html.twig). */
  @bottom-left { font: 8pt Inter, sans-serif; color: #5b6676; vertical-align: top; padding-top: 3mm; border-top: 0.5pt solid #dfe4ea; }
  @bottom-right { content: counter(page) " / " counter(pages); font: 500 8pt Inter, sans-serif; color: #2872d4; vertical-align: top; padding-top: 3mm; border-top: 0.5pt solid #dfe4ea; }
}
@page garde { margin: 0; }

* { box-sizing: border-box; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 10.5pt;
  line-height: 1.6;
  color: var(--f-ink);
  background: #e9ecf1;
}
a { color: var(--f-accent-dark); text-decoration: none; }
/* Un lien au fil d'un paragraphe se distingue du texte autrement que par sa couleur (accessibilité). */
p a, li > a:not([class]) { text-decoration: underline; text-underline-offset: 2px; }

.fiche-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 7.5pt; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--f-muted);
}
.fiche-section-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 9pt; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--f-accent-dark);
  border-bottom: 1px solid var(--f-line); padding-bottom: 4px; margin: 0 0 10px;
}

/* ── Barre d'outils (écran) ────────────────────────────────────── */
.fiche-toolbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--f-navy); color: #fff; font-size: 13px;
}
.fiche-toolbar__name { font-weight: 500; margin-right: auto; }
.fiche-toolbar__print {
  display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 99px; cursor: pointer;
  background: var(--f-accent); color: #fff; font: 500 13px Inter, sans-serif; padding: 8px 16px;
}
.fiche-toolbar__print:hover { background: #1f5fb4; }
a.fiche-toolbar__print { text-decoration: none; }
.fiche-toolbar__back { color: #cdd6e3; }

/* ── Feuilles (écran) ──────────────────────────────────────────── */
.fiche-cover, .fiche-study, .fiche-end {
  width: 210mm; margin: 18px auto; background: #fff; box-shadow: 0 1px 6px rgba(20, 30, 45, .15);
}
.fiche-study, .fiche-end { padding: 18mm 16mm; }

/* ── Page de garde ─────────────────────────────────────────────── */
.fiche-cover {
  page: garde;
  min-height: 297mm; display: flex; flex-direction: column;
  break-after: page;
}
.fiche-cover__band {
  display: flex; align-items: center; gap: 10px;
  background: var(--f-navy); color: #fff; padding: 12mm 16mm 10mm;
}
.fiche-logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--f-accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
}
.fiche-cover__site { display: flex; flex-direction: column; font-size: 13pt; font-weight: 500; line-height: 1.15; }
.fiche-cover__site small { font-size: 8.5pt; font-weight: 400; color: #b5c3d6; }
.fiche-cover__kind { margin-left: auto; font-size: 8pt; letter-spacing: .1em; text-transform: uppercase; color: #b5c3d6; }

.fiche-cover__main { flex: 1; padding: 12mm 16mm 6mm; display: flex; flex-direction: column; gap: 9mm; }
.fiche-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fiche-chip { font-size: 8pt; padding: 2px 9px; border-radius: 99px; background: var(--f-soft); color: var(--f-muted); border: 1px solid var(--f-line); }
.fiche-chip--code { background: var(--f-accent-pale); color: var(--f-accent-dark); border-color: transparent; font-weight: 500; letter-spacing: .04em; }
.fiche-chip--soft { background: #fff; }
.fiche-cover__title {
  font-family: Lora, Georgia, serif; font-weight: 500; font-size: 28pt; line-height: 1.15; margin: -4mm 0 0; color: var(--f-navy);
}
.fiche-cover__excerpt {
  margin: -5mm 0 0; font-family: Lora, Georgia, serif; font-style: italic; font-size: 12pt; line-height: 1.5; color: var(--f-muted);
  border-left: 3px solid var(--f-accent); padding-left: 12px;
}
.fiche-cover__summary { background: var(--f-soft); border-radius: 10px; padding: 10px 14px; }
.fiche-cover__summary p { margin: 4px 0 0; font-size: 10pt; }

.fiche-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
.fiche-facts > div { border: 1px solid var(--f-line); border-radius: 10px; padding: 7px 10px; }
.fiche-facts dt { display: flex; align-items: center; gap: 5px; font-size: 7.5pt; letter-spacing: .06em; text-transform: uppercase; color: var(--f-faint); }
.fiche-facts dd { margin: 2px 0 0; font-size: 11pt; font-weight: 500; color: var(--f-navy); }
/* Un fond pastel léger par case, pour donner du cachet à la page de garde. */
.fiche-facts > div:nth-child(7n+1) { background: #eaf2fd; border-color: #d3e3f8; }
.fiche-facts > div:nth-child(7n+2) { background: #e7f6ef; border-color: #c9e9da; }
.fiche-facts > div:nth-child(7n+3) { background: #fdf4e3; border-color: #f2e0bb; }
.fiche-facts > div:nth-child(7n+4) { background: #fcedf0; border-color: #f1d3da; }
.fiche-facts > div:nth-child(7n+5) { background: #f1eefc; border-color: #ddd5f3; }
.fiche-facts > div:nth-child(7n+6) { background: #e6f5f7; border-color: #c8e7ec; }
.fiche-facts > div:nth-child(7n+7) { background: #fdf0e8; border-color: #f2dac9; }

.fiche-reperes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.fiche-repere p { margin: 3px 0 0; font-size: 9pt; line-height: 1.5; color: var(--f-ink); }
.fiche-repere em { color: var(--f-faint); }

.fiche-cover__source {
  display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 14px;
  margin: 0 16mm 12mm; padding-top: 8px; border-top: 1px solid var(--f-line); font-size: 8.5pt; color: var(--f-muted);
}
.fiche-cover__source a { word-break: break-all; }
.fiche-cover__source .fiche-label { margin-bottom: 2px; }

/* ── L'étude ───────────────────────────────────────────────────── */
.fiche-study { page: fiche; }
.fiche-toc { background: var(--f-soft); border-radius: 10px; padding: 10px 14px 6px; margin-bottom: 8mm; break-inside: avoid; }
.fiche-toc .fiche-section-title { border-bottom-color: #d5dbe3; }
.fiche-toc ol { margin: 0; padding-left: 18px; columns: 2; column-gap: 24px; font-size: 9.5pt; }
.fiche-toc li { margin-bottom: 3px; break-inside: avoid; }
.fiche-toc a { color: var(--f-ink); }
/* Lexique, après l'étude : un mot et sa définition par entrée, jamais coupée. */
.fiche-glossary { margin-top: 8mm; break-before: page; }
.fiche-glossary dl { margin: 0; }
.fiche-glossary dl > div { break-inside: avoid; padding: 2mm 0 2mm 3mm; border-left: 3px solid #e3d4f3; margin-bottom: 2mm; }
.fiche-glossary dt { font-weight: 600; color: #4a1878; }
.fiche-glossary dd { margin: 1mm 0 0; font-size: 9.5pt; }
.fiche-glossary dd a { font-size: 8pt; color: var(--f-muted); }

/* Intertitres : sous leur section, en retrait, sans numéro. */
.fiche-toc li.fiche-toc__sub { list-style: none; margin-left: 4mm; font-size: 8.5pt; }
.fiche-toc li.fiche-toc__sub a { color: var(--f-muted); }
.fiche-summary { margin-bottom: 8mm; font-size: 10pt; color: var(--f-ink); }
.fiche-summary p { margin: 0 0 6px; }

/* Contenu de l'étude (sections rendues comme sur le site) */
.fiche-content .schilo-section { margin: 0 0 7mm; }
.fiche-content .schilo-section-title,
.fiche-content h2 {
  font-family: Lora, Georgia, serif; font-weight: 500; font-size: 15pt; line-height: 1.25; color: var(--f-navy);
  margin: 0 0 4mm; padding: 2.5mm 4mm; border-radius: 8px; border-left: 4px solid #6c9fe0; background: #eaf2fd;
  break-after: avoid;
}
/* Comme les cases de la page de garde : un bandeau pastel, une couleur par section. */
.fiche-content .schilo-section:nth-of-type(7n+2) .schilo-section-title { background: #e7f6ef; border-left-color: #5fb38e; }
.fiche-content .schilo-section:nth-of-type(7n+3) .schilo-section-title { background: #fdf4e3; border-left-color: #d9a845; }
.fiche-content .schilo-section:nth-of-type(7n+4) .schilo-section-title { background: #fcedf0; border-left-color: #d98a9b; }
.fiche-content .schilo-section:nth-of-type(7n+5) .schilo-section-title { background: #f1eefc; border-left-color: #9a88d6; }
.fiche-content .schilo-section:nth-of-type(7n+6) .schilo-section-title { background: #e6f5f7; border-left-color: #5bb0bd; }
.fiche-content .schilo-section:nth-of-type(7n+7) .schilo-section-title { background: #fdf0e8; border-left-color: #e09a6d; }
.fiche-content h3 { font-size: 11.5pt; font-weight: 500; color: var(--f-navy); margin: 5mm 0 2mm; break-after: avoid; }
.fiche-content p { margin: 0 0 3mm; orphans: 3; widows: 3; text-align: justify; hyphens: auto; }
.fiche-content ul, .fiche-content ol { margin: 0 0 3mm; padding-left: 6mm; }
.fiche-content li { margin-bottom: 1.5mm; }
.fiche-content strong { font-weight: 600; }
/* Libellé d'une fiche qui s'ouvre en fenêtre sur le site : la fiche est au lexique. */
.fiche-content .schilo-fiche-ref { font-weight: 600; color: #4a1878; }
.fiche-content blockquote {
  margin: 4mm 0; padding: 3mm 5mm; border-left: 3px solid var(--f-accent); background: var(--f-soft);
  font-family: Lora, Georgia, serif; font-style: italic; break-inside: avoid;
}
.fiche-content img { max-width: 100%; height: auto; border-radius: 6px; break-inside: avoid; }
.fiche-content table { width: 100%; border-collapse: collapse; font-size: 9pt; margin: 3mm 0; break-inside: avoid; }
.fiche-content th, .fiche-content td { border: 1px solid var(--f-line); padding: 4px 6px; text-align: left; vertical-align: top; }
/* En-tête de tableau : bandeau bleu pastel, libellés en petites capitales ; lignes alternées très légères. */
.fiche-content th {
  background: #e6effb; color: var(--f-navy); font-weight: 600; font-size: 7.5pt; letter-spacing: .06em; text-transform: uppercase;
  border-color: #d3e3f8; border-bottom: 2px solid #6c9fe0;
}
.fiche-content tbody tr:nth-child(even) td { background: #f8fafc; }

/* Citations bibliques : le texte et sa mention de droits, sans le sélecteur de version */
.fiche-content .usxv-toolbar, .fiche-content .usxv-status, .fiche-content button { display: none !important; }
.fiche-content .usx-brc, .fiche-content .usx-bvc {
  margin: 2mm 0 4mm; padding: 3mm 4mm; border-left: 3px solid var(--f-green); background: var(--f-green-pale);
  font-size: 9.5pt; break-inside: avoid;
}
.fiche-content .usx-brc-ref, .fiche-content .usx-bvc-ref { font-weight: 600; color: var(--f-green); }
.fiche-content .usx-brc-version, .fiche-content .usx-bvc-version { color: var(--f-green); }
.fiche-content .usx-brc-quote, .fiche-content .usx-bvc-body { margin-top: 1.5mm; }
.fiche-content .usx-brc-text { display: inline; }
.fiche-content .usx-brc-text::after { content: " "; }
.fiche-content .usx-bvc-line { margin: 0 0 1mm; text-align: left; }
.fiche-content .usx-brc-copyright, .fiche-content .usx-bvc-copyright { margin-top: 1.5mm; font-size: 7.5pt; color: #3d7a68; }
/* Le code couleur du site : une couleur par Évangile, mauve pour les autres livres. */
.fiche-content .usx-brc.citation-matthieu, .fiche-content .citation-matthieu .usx-bvc { background: #fce8e8; border-left-color: #d71f1f; }
.fiche-content .usx-brc.citation-marc, .fiche-content .citation-marc .usx-bvc { background: #d0efda; border-left-color: #0f490f; }
.fiche-content .usx-brc.citation-luc, .fiche-content .citation-luc .usx-bvc { background: #c8d0f0; border-left-color: #0a137e; }
.fiche-content .usx-brc.citation-jean, .fiche-content .citation-jean .usx-bvc { background: #f0ecc0; border-left-color: #484204; }
.fiche-content .usx-brc.citation-bible, .fiche-content .citation-bible .usx-bvc { background: #ede0f8; border-left-color: #7c4db8; }
.fiche-content .citation-matthieu :is(.usx-brc-ref, .usx-brc-version, .usx-bvc-ref, .usx-bvc-version, .usx-brc-copyright, .usx-bvc-copyright), .fiche-content .citation-matthieu .schilo-evangile-label { color: #8a0000; }
.fiche-content .citation-marc :is(.usx-brc-ref, .usx-brc-version, .usx-bvc-ref, .usx-bvc-version, .usx-brc-copyright, .usx-bvc-copyright), .fiche-content .citation-marc .schilo-evangile-label { color: #083008; }
.fiche-content .citation-luc :is(.usx-brc-ref, .usx-brc-version, .usx-bvc-ref, .usx-bvc-version, .usx-brc-copyright, .usx-bvc-copyright), .fiche-content .citation-luc .schilo-evangile-label { color: #060c55; }
.fiche-content .citation-jean :is(.usx-brc-ref, .usx-brc-version, .usx-bvc-ref, .usx-bvc-version, .usx-brc-copyright, .usx-bvc-copyright), .fiche-content .citation-jean .schilo-evangile-label { color: #2e2a02; }
.fiche-content .citation-bible :is(.usx-brc-ref, .usx-brc-version, .usx-bvc-ref, .usx-bvc-version, .usx-brc-copyright, .usx-bvc-copyright), .fiche-content .citation-bible .schilo-evangile-label { color: #4a1878; }
/* Un Évangile qui ne rapporte pas l'épisode : une simple mention. */
.fiche-content .usx-bnv { font-size: 9pt; color: var(--f-faint); }
.fiche-content .usx-bnv-ref, .fiche-content .usx-bnv-version { display: none; }
.fiche-content .schilo-evangiles-list > div { margin-bottom: 3mm; break-inside: avoid; }
.fiche-content .schilo-evangiles-list > div:has(.usx-bnv) { display: flex; gap: 6px; align-items: baseline; margin-bottom: 1.5mm; }

/* Encadrés, liens vers d'autres études, références des Évangiles */
.fiche-content .schilo-details-box { border: 1px solid var(--f-line); border-radius: 8px; padding: 3mm 4mm; margin: 3mm 0; break-inside: avoid; }
.fiche-content .schilo-details-icon { display: none; }
.fiche-content .schilo-links-list { list-style: none; padding: 0; }
.fiche-content .schilo-links-item { padding: 1mm 0; border-bottom: 1px dotted var(--f-line); }
.fiche-content .schilo-links-arrow { display: none; }
.fiche-content .schilo-links-link::after { content: " — " attr(href); font-size: 8pt; color: var(--f-faint); }
.fiche-content .schilo-evangile-label { font-weight: 600; color: var(--f-navy); margin-right: 4px; }
.fiche-content .bible-ref { color: var(--f-green); }
.fiche-content .ti { display: none; }

/* ── Dernière page ─────────────────────────────────────────────── */
.fiche-end { page: fiche; break-before: page; display: flex; flex-direction: column; gap: 7mm; }
.fiche-end__block { break-inside: avoid; }
.fiche-links { list-style: none; margin: 0; padding: 0; font-size: 9.5pt; }
.fiche-links li { padding: 2mm 0; border-bottom: 1px solid var(--f-soft); }
.fiche-links__kind {
  display: inline-block; min-width: 26mm; font-size: 7.5pt; letter-spacing: .06em; text-transform: uppercase; color: var(--f-accent);
}
.fiche-url { display: block; margin-left: 26mm; font-size: 8pt; color: var(--f-faint); word-break: break-all; }
.fiche-index { font-size: 9pt; margin: 0 0 2mm; }

.fiche-schilo {
  background: var(--f-navy); color: #fff; border-radius: 12px; padding: 8mm 10mm; break-inside: avoid;
}
.fiche-schilo__ref { font-size: 8pt; letter-spacing: .1em; text-transform: uppercase; color: #9fb4cf; }
.fiche-schilo blockquote {
  margin: 3mm 0 5mm; font-family: Lora, Georgia, serif; font-style: italic; font-size: 13pt; line-height: 1.5; color: #fff;
}
.fiche-schilo__title { font-weight: 500; font-size: 11pt; margin-bottom: 2mm; color: #fff; }
.fiche-schilo p { margin: 0 0 3mm; font-size: 9.5pt; color: #d5deea; }

.fiche-rights { font-size: 9pt; color: var(--f-muted); }
.fiche-rights p { margin: 0 0 2mm; }
.fiche-rights ul { margin: 0; padding-left: 5mm; }
.fiche-rights li { margin-bottom: 1.5mm; }

/* ── Impression ────────────────────────────────────────────────── */
@media print {
  body { background: #fff; }
  .fiche-toolbar { display: none; }
  .fiche-cover, .fiche-study, .fiche-end { width: auto; margin: 0; box-shadow: none; }
  .fiche-study, .fiche-end { padding: 0; }
  .fiche-cover { min-height: 297mm; height: 297mm; }
  a[href^="#"] { color: var(--f-ink); }
}

/* ── Écran étroit (téléphone) ──────────────────────────────────── */
@media screen and (max-width: 820px) {
  .fiche-cover, .fiche-study, .fiche-end { width: auto; margin: 10px; }
  .fiche-cover { min-height: 0; }
  .fiche-study, .fiche-end { padding: 16px; }
  .fiche-facts { grid-template-columns: repeat(2, 1fr); }
  .fiche-reperes, .fiche-cover__source { grid-template-columns: 1fr; }
  .fiche-toc ol { columns: 1; }
  .fiche-cover__title { font-size: 22pt; }
}
