/* Estimation de coût en agence : document A4 et page web, palette du site (noir, blanc, gris froid, bleu profond).
   Chargé après main.css : hérite des jetons --ink, --mute, --rule, --accent, --bg-alt, --navy. */

.estimation { max-width: 820px; margin: 0 auto; padding: calc(52px + clamp(3rem, 8vw, 5rem)) var(--gutter) var(--section-pad); }
.estimation h1, .estimation h2, .estimation h3 { text-wrap: balance; }
.estimation h2 { font-size: var(--text-xl); margin: var(--s-16) 0 var(--s-6); padding-top: var(--s-6); border-top: 1px solid var(--rule); }
.estimation h2:first-of-type { border-top: 0; padding-top: 0; }
.estimation h3 { font-size: var(--text-lg); margin: var(--s-8) 0 var(--s-3); }
.estimation p, .estimation li, .estimation td, .estimation th, .estimation dd { font-size: var(--text-base); line-height: 1.55; }
.estimation p + p { margin-top: var(--s-4); }
.estimation ul { padding-left: 1.3em; }
.estimation li + li { margin-top: var(--s-2); }
.estimation a:not(.btn) { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }   /* les boutons gardent leurs couleurs */

/* Couverture */
.est-couverture { padding: var(--s-10) 0 var(--s-8); border-bottom: 2px solid var(--accent); margin-bottom: var(--s-10); }
.est-kicker { display: block; font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.02em; color: var(--mute); margin-bottom: var(--s-3); }
.est-couverture h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; margin-bottom: var(--s-3); }
.est-sous-titre { font-size: var(--text-lg); color: var(--mute); margin-bottom: var(--s-8); }
.est-identite { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-4) var(--s-8); margin: 0; }
.est-identite dt { font-size: var(--text-sm); color: var(--mute); }
.est-identite dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); }

/* Le chiffre vit dans l'en-tête, au même rang que le client et l'adresse : pas de bloc mis en avant (décision du 12 septembre 2026) */
.est-identite dd { font-variant-numeric: tabular-nums; }
.est-note { margin-top: var(--s-6); font-size: var(--text-sm); color: var(--mute); }

/* En clair : la phrase bleue */
.est-en-clair { margin: var(--s-6) 0; padding-left: var(--s-4); border-left: 2px solid var(--accent); color: var(--accent); font-weight: 500; font-size: var(--text-lg); }

/* Sommaire */
.est-sommaire { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: var(--s-8); }
.est-sommaire li { break-inside: avoid; padding: var(--s-2) 0; border-bottom: 1px solid var(--rule); margin: 0; }
.est-sommaire a { text-decoration: none; color: var(--ink); }
.est-sommaire a:hover { color: var(--accent); }
@media (max-width: 600px) { .est-sommaire { columns: 1; } }

/* Tableaux */
.est-table-scroll { overflow-x: auto; }
.est-table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }   /* le tableau de chiffrage, large, est atteignable au clavier */
.est-scroll-hint { font-size: var(--text-sm) !important; color: var(--mute); margin: var(--s-3) 0 var(--s-2); }
@media (min-width: 760px) { .est-scroll-hint { display: none; } }
.est-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.est-table caption { text-align: left; font-weight: 600; padding-bottom: var(--s-3); color: var(--ink); }
.est-table th, .est-table td { text-align: left; vertical-align: top; padding: var(--s-3) var(--s-3) var(--s-3) 0; border-bottom: 1px solid var(--rule); font-size: var(--text-sm); }
.est-table thead th { font-weight: 600; border-bottom: 2px solid var(--accent); white-space: nowrap; }
.est-table tbody th { font-weight: 600; color: var(--ink); }
.est-table td.num, .est-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.est-table th abbr[title] { text-decoration: none; border-bottom: 0; cursor: help; }
.est-table tfoot th, .est-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--ink); }
.est-table--perimetre th { width: 32%; }

.est-sources-titre { margin-top: var(--s-6); }
.est-sources { margin-top: var(--s-2); }

/* Lots */
.est-lot { margin-top: var(--s-8); padding: var(--s-6); border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--card); break-inside: avoid; }
.est-lot h3 { margin: 0 0 var(--s-4); }
.est-lot h3 span { color: var(--accent); margin-right: var(--s-2); }
.est-lot-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); }
@media (max-width: 600px) { .est-lot-colonnes { grid-template-columns: 1fr; } }
.est-lot h4 { font-size: var(--text-sm); font-weight: 600; color: var(--mute); margin: 0 0 var(--s-2); }
.est-lot ul { margin: 0; }
.est-lot li { font-size: var(--text-sm); }
.est-lot-montant { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--rule); font-size: var(--text-sm); color: var(--mute); display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.est-lot-montant strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Mentions */
/* overflow-wrap : l'adresse du document (garbewajda.com/etudes/…) est un mot long
   qui débordait la page à 320 pixels de large (RGAA 10.11, relevé le 13 septembre 2026). */
.est-mentions { margin-top: var(--s-16); padding: var(--s-6); background: var(--bg-alt); border-radius: var(--r); font-size: var(--text-sm); color: var(--mute); overflow-wrap: anywhere; }
.est-mentions p + p { margin-top: var(--s-3); }
.est-telecharger { margin: var(--s-8) 0 0; display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* Dans le cadre d'aperçu du site : le document seul, comme une feuille posée sur la page */
html.dans-cadre .nav, html.dans-cadre footer, html.dans-cadre .a11y-bouton, html.dans-cadre .skip-link,
html.dans-cadre .est-telecharger, html.dans-cadre .langue-bandeau { display: none !important; }
html.dans-cadre body::before, html.dans-cadre body::after { display: none; }
html.dans-cadre .estimation { padding-top: var(--s-10); }
html.dans-cadre .est-couverture { padding-top: 0; }

/* Impression et PDF : A4, marges, pas de menu ni de pied de site */
@page { size: A4; margin: 16mm 16mm 18mm 16mm; }
@media print {
    html { font-size: 10.5pt; }
    body { background: #fff !important; color: #000; }
    body::before, body::after { display: none !important; }
    .estimation { max-width: none; padding: 0; }
    .est-couverture { padding-top: 0; }
    .est-en-clair { color: #14345f !important; border-color: #14345f !important; }
    .est-lot, .est-table-scroll, .est-mentions { break-inside: avoid; }
    .est-table thead { display: table-header-group; }
    .est-table tr { break-inside: avoid; }
    /* Le tableau de chiffrage compte jusqu'à douze colonnes : largeurs fixées (lot 20 %, jours 7 %, montant 12 %, le reste partagé
       entre les profils), en-têtes courts de la grille qui se coupent seulement aux points de césure prévus, corps réduit */
    .est-table { font-size: 8.5pt; }
    .est-table th, .est-table td { padding: 4pt 4pt 4pt 0; }
    .est-table tbody th { font-weight: 600; }
    .est-table-scroll { overflow: visible; }
    .est-table--chiffrage { table-layout: fixed; width: 100%; font-size: 7.5pt; }
    .est-table--chiffrage thead th:first-child { width: 20%; }
    .est-table--chiffrage thead th:nth-last-child(2) { width: 7%; }
    .est-table--chiffrage thead th:last-child { width: 12%; }
    .est-table--chiffrage thead th, .est-table--chiffrage thead th.num { white-space: normal; overflow-wrap: normal; hyphens: manual; line-height: 1.25; text-align: right; vertical-align: bottom; }
    .est-table--chiffrage thead th:first-child { text-align: left; }
    .est-table--chiffrage td, .est-table--chiffrage th { padding: 3pt 2pt 3pt 0; }
    .est-table--chiffrage td.num, .est-table--chiffrage th.num { padding-left: 4pt; }
    .estimation h2, .estimation h3 { break-after: avoid; }
    /* Les liens restent cliquables dans le PDF : l'adresse n'est pas répétée en toutes lettres */
    .est-sommaire a[href]::after { content: none; }
    .est-sources { list-style: none; padding: 0; }
    .est-sources li { font-size: 8.5pt; padding-left: 0; border-left: 0; margin-top: 2pt; }
    .est-telecharger, .est-scroll-hint, .no-print { display: none !important; }
    /* Le pied de page imprimé (adresse, titre, version, numéro de page) est rendu par les boîtes de marge @page
       déclarées dans le gabarit HTML, dans la marge basse de 18 mm : il ne peut pas chevaucher le texte. */
}
