/* /generateur-coloriage-prenom */

.breadcrumb {
    padding: 16px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }

.prenom-hero { padding: 28px 0 8px; text-align: center; }
.prenom-hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0 0 12px; }
.prenom-lead {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.08rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.prenom-lead strong { color: var(--text); }
.prenom-updated { margin: 14px 0 0; font-size: 0.82rem; color: var(--text-light); }

/* ---- Outil ---- */
.prenom-tool { padding: 24px 0 40px; }
.prenom-tool-grid {
    display: grid;
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.prenom-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 22px;
    position: sticky;
    top: 16px;
}

.field { margin-bottom: 20px; }
.field label,
.field-label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.field-hint { margin: 6px 0 0; font-size: 0.78rem; color: var(--text-light); }

#prenomInput {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font);
    font-size: 1.5rem;
    font-weight: 800;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
}
#prenomInput:focus { outline: none; border-color: var(--primary); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    border: 1px solid var(--border);
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 5px 12px;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-group .opt { flex: 1 1 0; min-width: 90px; }

.opt {
    border: 2px solid var(--border);
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 9px 10px;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    line-height: 1.25;
}
.opt em { display: block; font-style: normal; font-weight: 400; font-size: 0.72rem; color: var(--text-light); }
.opt:hover { border-color: var(--primary-light); }
.opt.is-active { border-color: var(--primary); background: var(--primary-bg); color: var(--primary-dark); }
.opt.is-active em { color: var(--primary-dark); }

.opt-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.opt-grid-decor { grid-template-columns: repeat(2, 1fr); }
.opt-font { padding: 6px 2px; }
.opt-sample { display: block; font-size: 1.35rem; line-height: 1.1; color: var(--text); }
.opt-name { display: block; font-size: 0.62rem; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.opt-font.is-active .opt-name { color: var(--primary-dark); }

.btn-block { width: 100%; }
.prenom-reassure {
    margin: 10px 0 0;
    font-size: 0.76rem;
    color: var(--text-light);
    text-align: center;
    line-height: 1.5;
}

/* ---- Feuille ---- */
.prenom-preview { position: relative; }
.prenom-sheet-wrap {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
#prenomSheet { display: block; width: 100%; height: auto; }
.sheet-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: var(--text-light);
    font-weight: 700;
}
/* display:flex écrase le display:none que le navigateur applique à [hidden] :
   sans cette règle, « Tapez un prénom » reste affiché par-dessus le prénom. */
.sheet-empty[hidden] { display: none; }
.prenom-preview-note {
    margin: 10px 0 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ---- Contenu ---- */
.prenom-section { padding: 8px 0 48px; }
.prenom-prose { max-width: 760px; }
.prenom-prose h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.prenom-prose h3 { font-size: 1.12rem; margin: 26px 0 8px; }
.prenom-prose p { line-height: 1.7; margin: 0 0 14px; color: var(--text); }

.answer-box {
    background: var(--primary-bg);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 14px 18px;
    font-size: 1.02rem;
}

.steps { margin: 0 0 8px; padding-left: 22px; }
.steps li { margin-bottom: 12px; line-height: 1.7; }

.glyph-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 18px;
}
.glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-weight: 800;
    font-size: 1.05rem;
}

.table-scroll { overflow-x: auto; margin: 0 0 18px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
.data-table caption {
    caption-side: bottom;
    text-align: left;
    padding-top: 8px;
    font-size: 0.78rem;
    color: var(--text-light);
}
.data-table th, .data-table td {
    border-bottom: 1px solid var(--border);
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}
.data-table thead th { background: var(--primary-bg); color: var(--primary-dark); font-size: 0.8rem; }
.data-table tbody th { font-weight: 700; white-space: nowrap; }
.cell-ok { color: var(--green); font-weight: 700; }

.persona-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 0 0 8px;
}
.persona {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.persona h3 { margin: 0 0 6px; font-size: 1rem; }
.persona p { margin: 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 4px 0;
}
.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 12px 28px 12px 0;
    position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { display: inline; margin: 0; font-size: 1rem; font-weight: 700; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 4px;
    top: 10px;
    font-size: 1.3rem;
    color: var(--primary);
    line-height: 1;
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { margin: 0 0 14px; color: var(--text-muted); line-height: 1.7; font-size: 0.94rem; }

.prenom-next {
    margin-top: 40px;
    background: var(--primary-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.prenom-next h2 { margin-top: 0; }
.prenom-next p { color: var(--text-muted); }

@media (max-width: 900px) {
    .prenom-tool-grid { grid-template-columns: 1fr; }
    .prenom-panel { position: static; }
    .prenom-preview { order: -1; }
    .opt-grid { grid-template-columns: repeat(5, 1fr); }
    .persona-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .opt-grid { grid-template-columns: repeat(4, 1fr); }
    .opt-grid-decor { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Impression : seule la feuille sort ---- */
@media print {
    @page { size: A4 portrait; margin: 6mm; }

    body { background: #fff; }

    .site-header,
    .site-footer,
    .breadcrumb,
    .prenom-hero,
    .prenom-section,
    .prenom-panel,
    .flash-messages,
    [data-print-hide] {
        display: none !important;
    }

    .prenom-tool { padding: 0 !important; }
    .prenom-tool-grid { display: block !important; }
    .container { max-width: none !important; padding: 0 !important; margin: 0 !important; }

    .prenom-sheet-wrap {
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    #prenomSheet { width: 100%; height: auto; }
}
