/* ============================================================
   pdf.css — modifié pour impression A5 simple (print.css)
   MODIFICATIONS vs pdf.css :
   1. #master-flow : colonne au lieu de 297mm
   2. .page-section : A5 autonome + marges miroir recto/verso
   3. @page A5 portrait au lieu de A4 landscape
   Tout le reste est IDENTIQUE à pdf.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,400&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;700&family=Cinzel:wght@400;700&display=swap');

:root {
    --p-width:      148.5mm;
    --p-height:     210mm;
    --m-top:        15mm;
    --m-bottom:     20mm;
    --m-inner:      22mm;
    --m-outer:      18mm;
    --gold:         #c5a059;
    --gold-light:   #e5d1a4;
    --bg-soft:      #fdfdfd;
    --text-dark:    #1a1a1a;
    --border-light: #eee;
    --dark-choco:   #3e2723;
    --milk-choco:   #5d4037;
    --paper:        #fdfaf7;
}

* {
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
* { hyphens: none !important; -webkit-hyphens: none !important; }

body {
    margin: 0;
    padding: 0;
    background: #f1f5f9;
    font-family: 'Inter', sans-serif;
}

/* ── MODIFICATION 1 : flux en colonne centrée ── */
#master-flow {
    width: var(--p-width);
    margin: 0 auto;
    padding: 60px 0 40px;
}

/* Barre de contrôle écran */
.control-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: #1a1008;
    border-bottom: 1px solid var(--gold);
}
.ctrl-logo {
    font-family: 'Cinzel', serif;
    font-size: 13px; font-weight: 600;
    letter-spacing: 2px; color: var(--gold); display: block;
}
.ctrl-sub {
    font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
    color: rgba(197,160,89,.45); margin-top: 2px; display: block;
}
.page-count-display { font-size: 11px; color: rgba(197,160,89,.6); letter-spacing: 1px; }
.btn-print {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 22px; background: var(--gold); border: none;
    border-radius: 5px; font-family: 'Cinzel', serif;
    font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; color: #1a1008; cursor: pointer; transition: all .2s;
}
.btn-print svg { width: 16px; height: 16px; }
.btn-print:hover { background: #d4b06a; transform: translateY(-1px); }

/* ── MODIFICATION 2 : page A5 autonome avec marges miroir ──
   page-at-left = recto (pages impaires) : reliure à gauche
   page-at-right = verso (pages paires)  : reliure à droite    */
.page-section {
    width: var(--p-width);
    height: var(--p-height);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-image: url('https://cip-insertion.soins.me/wp-content/uploads/mon-livre-numerique/media/filigrane.png');
    background-size: cover;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    margin-bottom: 8px;
    page-break-after: always;
    break-after: page;
}

/* Ecran : marges SYMÉTRIQUES pour la lisibilité */
.page-at-left  { 
    background-image: url('https://cip-insertion.soins.me/wp-content/uploads/mon-livre-numerique/media/filigrane3.png'); 
    padding: var(--m-top) var(--m-outer) var(--m-bottom) var(--m-outer); 
}
.page-at-right { 
    background-image: url('https://cip-insertion.soins.me/wp-content/uploads/mon-livre-numerique/media/filigrane2.png'); 
    padding: var(--m-top) var(--m-outer) var(--m-bottom) var(--m-outer); 
}

/* ── MODIFICATION 3 : @page A5 portrait au lieu de A4 landscape ── */
@media print {
    body { background: none !important; }
    .no-print, .control-bar { display: none !important; }
    #master-flow { padding: 0; width: var(--p-width); }
    .page-section { margin-bottom: 0; box-shadow: none; page-break-after: always; break-after: page; }
    /* Marges miroir à l'impression : inner = côté reliure */
    .page-at-left  { padding: var(--m-top) var(--m-outer) var(--m-bottom) var(--m-inner) !important; }
    .page-at-right { padding: var(--m-top) var(--m-inner) var(--m-bottom) var(--m-outer) !important; }
    @page { size: A5 portrait; margin: 0; }
}

/* ============================================================
    COUVERTURES & PAGES PLEINES (Correction virgules)
   ============================================================ */
.page-section[data-page="0"],
.page-section[data-page="1"],
.page-section[data-page="2"],
.page-section[data-page="4"],
.page-section[data-page="16"],
.page-section[data-page="30"],
.page-section[data-page="42"],
.page-section[data-page="57"],
.page-section[data-page="66"],
.page-section[data-page="78"],
.page-section[data-page="92"],
.page-section[data-page="99"],
.page-section[data-page="100"],
.page-section[data-page="101"],
.page-section[data-page="102"],
.page-section[data-page="103"],
.page-section[data-page="109"],
.page-section[data-page="110"],
.page-section[data-page="111"],
.page-section[data-page="112"],
.page-section[data-page="114"],
.page-section[data-page="113"],
.page-section[data-page="115"],
.page-section[data-page="116"],
.page-section[data-page="117"],
.page-section[data-page="118"],
.page-section[data-page="119"],
.page-section[data-page="120"] {
    background-image: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Cache le numéro de page UNIQUEMENT sur ces pages (Pas de virgule avant .page-num) */
.page-section[data-page="0"] .page-num-luxe,
.page-section[data-page="1"] .page-num-luxe,
.page-section[data-page="2"] .page-num-luxe,
.page-section[data-page="3"] .page-num-luxe,
.page-section[data-page="4"] .page-num-luxe,
.page-section[data-page="15"] .page-num-luxe,
.page-section[data-page="16"] .page-num-luxe,
.page-section[data-page="30"] .page-num-luxe,
.page-section[data-page="42"] .page-num-luxe,
.page-section[data-page="57"] .page-num-luxe,
.page-section[data-page="66"] .page-num-luxe,
.page-section[data-page="69"] .page-num-luxe,
.page-section[data-page="89"] .page-num-luxe,
.page-section[data-page="90"] .page-num-luxe,
.page-section[data-page="98"] .page-num-luxe,
.page-section[data-page="99"].page-num-luxe,
.page-section[data-page="105"].page-num-luxe,
.page-section[data-page="106"].page-num-luxe,
.page-section[data-page="109"].page-num-luxe,
.page-section[data-page="110"].page-num-luxe,
.page-section[data-page="111"].page-num-luxe,
.page-section[data-page="112"].page-num-luxe,
.page-section[data-page="113"].page-num-luxe,
.page-section[data-page="114"].page-num-luxe,
.page-section[data-page="115"].page-num-luxe,
.page-section[data-page="116"] .page-num-luxe {
    display: none !important;
}

/* Cache le header UNIQUEMENT sur ces pages (Pas de virgule avant .my-prestige-header) */
.page-section[data-page="0"] .my-prestige-header,
.page-section[data-page="1"] .my-prestige-header,
.page-section[data-page="4"] .my-prestige-header,
.page-section[data-page="16"] .my-prestige-header,
.page-section[data-page="29"] .my-prestige-header,
.page-section[data-page="30"] .my-prestige-header,
.page-section[data-page="41"] .my-prestige-header,
.page-section[data-page="42"] .my-prestige-header,
.page-section[data-page="56"] .my-prestige-header,
.page-section[data-page="57"] .my-prestige-header,
.page-section[data-page="65"] .my-prestige-header,
.page-section[data-page="66"] .my-prestige-header,
.page-section[data-page="77"] .my-prestige-header,
.page-section[data-page="78"] .my-prestige-header,
.page-section[data-page="91"] .my-prestige-header,
.page-section[data-page="92"] .my-prestige-header,
.page-section[data-page="99"] .my-prestige-header,
.page-section[data-page="105"] .my-prestige-header,
.page-section[data-page="106"] .my-prestige-header,
.page-section[data-page="109"] .my-prestige-header,
.page-section[data-page="110"] .my-prestige-header,
.page-section[data-page="111"] .my-prestige-header,
.page-section[data-page="112"] .my-prestige-header,
.page-section[data-page="113"] .my-prestige-header,
.page-section[data-page="113"] .my-prestige-header,
.page-section[data-page="114"] .my-prestige-header,
.page-section[data-page="116"] .my-prestige-header {
    display: none !important;
}
/* ── Tout ce qui suit est IDENTIQUE à pdf.css ── */

.my-prestige-header {
    margin-bottom: 8px;
    position: relative;
    z-index: 10;
    text-align: center;
}
.my-prestige-header h1 {
    color: var(--gold) !important;
    font-size: 1.5rem !important;
    margin: 0 !important;
    display: block !important;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.my-prestige-header .subtitle {
    display: block !important;
    margin-top: 2px;
    font-style: italic;
    font-size: 0.85rem;
    color: #666;
}

.page-num-luxe {
    position: absolute;
    bottom: 25px;
    left: 25px;
    right: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0.9;
    pointer-events: none;
}
.page-num-luxe .line {
    flex: 1; height: 1px;
    background: linear-gradient(to right, transparent, #c5a059, transparent);
}
.page-num-luxe .num {
    font-family: 'Cinzel', serif;
    font-size: 11px; font-weight: 600;
    letter-spacing: 2px; color: #c5a059;
}
.page-num-luxe .ornement { font-size: 8px; color: #c5a059; opacity: 0.8; }

.inner-text-body {
    flex-grow: 1;
    margin-bottom: 45px;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    line-height: 1.2;
}
.inner-text-body p { margin-bottom: 1em; text-align: justify; }

.full-page-container { width: 100%; height: 100%; }

.page-section .h-full { height: 100%; }

.text-body {
    position: relative; z-index: 2; flex-grow: 1;
    font-family: 'Libre Baskerville', serif;
    font-size: 11.3pt; line-height: 1.5; color: #1a1a1a; text-align: justify;
}
.text-body p { margin-bottom: 1em; }
.text-body .chapter-header, .text-body .chapter-number, .text-body .separator,
.text-body h1, .text-body h2, .text-body blockquote, .text-body .subtitle { display: none !important; }

.page-section:not([data-page="1"]):not([data-page="112"])
.text-body p:first-of-type::first-letter {
    float: left; margin-top: 3px; padding: 4px 8px 0 0;
    font-family: 'Cinzel', serif; font-size: 3.5rem;
    font-weight: 700; line-height: 0.8; color: var(--gold);
}

.quote-container {
    display: block !important; position: relative;
    margin: 1px 0; padding: 2px 0 6px 5px;
    border-left: 1pt solid var(--gold); background: none !important;
}
.quote-text {
    display: block; font-family: 'Libre Baskerville', serif;
    font-size: .95rem; line-height: 1.4; color: #413e3e; text-align: justify;
}

.text-bubble {
    margin-top: 5px; padding: 5px; background: #fdfaf5;
    border: 1px solid #f8f1e5; border-radius: 12px;
    font-style: italic; font-size: 0.95rem; line-height: 1.5; color: #6d4c41;
}

.concept-card {
    padding: 10px; background-color: rgba(247,247,247,0.4);
    border: 1px solid #e6ccb2; border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin: initial;
}
.concept-label {
    display: block; text-align: center; margin-bottom: 8px; padding-bottom: 4px;
    border-bottom: 1px solid var(--gold-light); font-family: 'Inter', sans-serif;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: var(--gold);
}
.concept-content { font-family: 'Libre Baskerville', serif; font-style: italic; font-size: 0.95rem; line-height: 1.4; color: #333; }

.toc-container { margin-top: 10px; padding: 0 2mm; column-count: 2; column-gap: 12mm; column-rule: 1px solid #f8f1e5; }
.toc-item { display: table; width: 100%; margin-bottom: 6px; break-inside: avoid; font-size: 8.5pt; }
.toc-is-chapter { font-weight: bold; color: var(--gold); margin-top: 10px; }
.toc-is-sub { padding-left: 8px; font-style: italic; color: #666; }
.toc-title { display: table-cell; white-space: nowrap; padding-right: 4px; }
.toc-dots { display: table-cell; width: 100%; border-bottom: 1px dotted var(--gold-light); }
.toc-page { display: table-cell; width: 25px; padding-left: 4px; text-align: right; color: var(--gold); font-weight: 700; white-space: nowrap; }

.tag-mini { display: inline-block; margin-right: 5px; padding: 2px 5px; border: 1px solid #000; font-size: 0.75rem; font-weight: bold; }

.info-trigger { display: inline-block; position: relative; width: 22px; height: 22px; margin-left: 8px; background: var(--gold); border-radius: 50%; font-size: 14px; line-height: 22px; text-align: center; color: white; cursor: pointer; }
.tooltip { visibility: hidden; position: absolute; bottom: 130%; left: 50%; z-index: 10; width: 260px; margin-left: -130px; padding: 12px; background-color: #5d4037; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); font-size: 0.9rem; font-weight: normal; text-align: left; color: #fff; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.info-trigger:hover .tooltip { visibility: visible; opacity: 1; }

.result-card { display: none; margin-top: 40px; padding: 30px; background: #fffcf9; border: 2px solid #b08968; border-left: 12px solid #5d4037; border-radius: 15px; }
.final-synth-container { margin-top: 30px; padding: 25px; background: #5d4037; border: 1px solid #3e2723; border-radius: 10px; font-size: 1.1rem; line-height: 1.6; color: white; }
.final-synth-title { display: block; margin-bottom: 15px; padding-bottom: 5px; border-bottom: 1px solid rgba(230,204,178,0.3); font-size: 0.9rem; font-weight: bold; text-transform: uppercase; color: #e6ccb2; }
.master-synthesis { display: none; margin-top: 40px; padding: 30px; border-left: 10px solid #d4af37; border-radius: 15px; background: var(--dark-choco); color: var(--paper); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.master-synthesis h3 { margin-top: 0; padding-bottom: 15px; border-bottom: 1px solid rgba(212,175,55,0.3); font-family: 'Playfair Display', serif; font-size: 1.8rem; color: #d4af37; }

.writing-zone { position: relative; min-height: 150px; margin-top: 15px; padding: 10px 15px; border: 1px solid #e6ccb2; border-radius: 8px; background: #fff; }
.writing-zone::before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin-top: 2.2rem; background-image: linear-gradient(#e6ccb2 1px, transparent 1px); background-size: 100% 2.5rem; pointer-events: none; }

.pillar-card { margin-bottom: 30px; padding-left: 20px; border-left: 5px solid #b08968; break-inside: avoid; }
.value-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 15px 0; }
.value-item { display: flex; align-items: center; padding: 8px 12px; border-left: 3px solid var(--gold); border-radius: 6px; background: rgba(197,160,89,0.05); font-size: 0.95rem; color: var(--dark-choco); }
.value-item::before { content: "☐"; margin-right: 8px; color: var(--gold); }
.checklist { list-style: none; padding: 0; margin: 15px 0; }
.checklist li { display: flex; align-items: center; margin-bottom: 8px; padding: 8px 10px; border-left: 3px solid var(--gold); border-radius: 6px; background: rgba(197,160,89,0.05); font-size: 0.95rem; }
.audit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 25px 0; }
.score-table td, .score-table-print td { padding: 8px 0; border-bottom: 1px solid #f8f1e5; font-size: 0.9rem; }
.signals-grid, .thermometer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }

.btn-main { padding: 18px 35px; background-color: #5d4037; border: none; border-radius: 50px; font-size: 1.1rem; font-weight: bold; color: white; cursor: pointer; }
.btn-save { width: 100%; margin-top: 30px; padding: 18px 40px; border: none; border-radius: 50px; background: linear-gradient(135deg, #5d4037, #3e2723); color: white; font-size: 1.1rem; font-weight: bold; cursor: pointer; }
.result-box { display: none; }
.modal { display: none; }
.status-feedback { display: none; }
.error-msg { display: none; }
.values-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.action-zone { margin: 40px 0; padding: 20px; text-align: center; }

.page-break { display: none !important; }

/* ── MODIFICATION 3 : @page A5 portrait au lieu de A4 landscape ── */
@media print {
    body { background: none !important; }
    .no-print, .control-bar { display: none !important; }
    #master-flow { padding: 0; width: var(--p-width); }
    .page-section { margin-bottom: 0; box-shadow: none; page-break-after: always; break-after: page; }
    .page-at-left, .page-at-right { 
        padding: var(--m-top) var(--m-outer) var(--m-bottom) var(--m-outer) !important; 
    }
    @page { size: A5 portrait; margin: 0; }
}