/* Feuille de style commune des pages d'usage TopAssist (gabarit article).
   Utilisée par toutes les pages topassist-* au format article : modifier ici
   s'applique à toutes. Les styles propres à une seule page restent dans celle-ci. */

:root {
    --primary-blue: #3D6B8E;
    --dark-blue: #2C5070;
    --light-bg: #F0F5FA;
    --white: #FFFFFF;
    --text-dark: #333333;
    --text-gray: #666666;
    --text-mute: #8a93a0;
    --border-light: #E8E8E8;
    --green: #4CAF50;
    --red: #E74C3C;
    --accent-orange: #E8913A;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.7;
    background: var(--light-bg);
    -webkit-font-smoothing: antialiased;
}

/* ===== En-tête ===== */
header.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 1.5rem;
}
.header-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.6rem; font-size: 1.5rem; font-weight: 700; color: var(--primary-blue); text-decoration: none; }
.logo-mark { width: 36px; height: 36px; border-radius: 8px; }
nav.site-nav { display: flex; gap: 1.5rem; align-items: center; }
nav.site-nav a { color: var(--text-dark); text-decoration: none; font-weight: 500; transition: color 0.3s; font-size: 0.95rem; }
nav.site-nav a:hover { color: var(--primary-blue); }
nav.site-nav a.cta {
    color: var(--primary-blue);
    border: 1.5px solid var(--primary-blue);
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-weight: 600;
}
nav.site-nav a.cta:hover { background: var(--primary-blue); color: var(--white); }
@media (max-width: 720px) {
    nav.site-nav a:not(.cta) { display: none; }
}

/* ===== Ouverture de l'article ===== */
.article-hero {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: var(--white);
    padding: 3.5rem 1.5rem 4rem;
}
.article-hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
}
.breadcrumbs { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 1.2rem; letter-spacing: 0.02em; }
.breadcrumbs a { color: rgba(255,255,255,0.85); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span[aria-current] { color: var(--white); }
.eyebrow {
    display: inline-block;
    background: var(--accent-orange);
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1.2rem;
}
.article-hero h1 {
    font-size: 2rem;
    line-height: 1.18;
    font-weight: 800;
    margin-bottom: 1.2rem;
    text-wrap: balance;
}
.article-hero .lede {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
    max-width: 60ch;
    text-wrap: pretty;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: 1.8rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
}
.article-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-figure {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}
.hero-figure img { display: block; width: 100%; height: auto; border-radius: 10px; }
/* Capture de téléphone en ouverture : hauteur limitée, centrée */
.hero-figure.hero-figure-phone img { width: auto; max-width: 100%; max-height: 480px; margin: 0 auto; }
.hero-figure figcaption {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    margin-top: 0.7rem;
    text-align: center;
    font-style: italic;
}
@media (min-width: 900px) {
    .article-hero { padding: 5rem 2rem 5.5rem; }
    .article-hero-inner { grid-template-columns: 1.15fr 0.85fr; gap: 4rem; }
    .article-hero h1 { font-size: 2.8rem; }
    .article-hero .lede { font-size: 1.2rem; }
}
@media (min-width: 1200px) {
    .article-hero h1 { font-size: 3.2rem; }
}

/* ===== Mise en page : sommaire + corps ===== */
.article-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}
/* Empêche un contenu large (sommaire, figure) d'élargir la colonne sur mobile */
.article-shell > * { min-width: 0; }
@media (min-width: 1024px) {
    .article-shell {
        grid-template-columns: 240px 1fr;
        gap: 4rem;
        padding: 4rem 2rem 5rem;
    }
}
.toc {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(61,107,142,0.06);
    border: 1px solid var(--border-light);
}
@media (min-width: 1024px) {
    .toc {
        position: sticky;
        top: 90px;
        align-self: start;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
    }
}
.toc h2 {
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-mute); margin-bottom: 1rem;
}
.toc ol { list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 0.55rem; }
.toc li { counter-increment: toc; }
.toc a {
    display: block; font-size: 0.9rem; color: var(--text-dark); text-decoration: none;
    padding: 0.45rem 0.6rem 0.45rem 2rem; border-radius: 8px; border-left: 2px solid transparent;
    position: relative; line-height: 1.35; transition: background 0.2s, color 0.2s;
}
.toc a::before {
    content: counter(toc, decimal-leading-zero);
    position: absolute; left: 0.5rem; color: var(--text-mute); font-weight: 600; font-size: 0.78rem;
}
.toc a:hover { background: var(--light-bg); color: var(--primary-blue); }
.toc a.is-active {
    background: rgba(61,107,142,0.08);
    color: var(--primary-blue);
    font-weight: 600;
}

/* ===== Corps de l'article ===== */
article.post {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    box-shadow: 0 4px 20px rgba(61,107,142,0.06);
    border: 1px solid var(--border-light);
    max-width: 760px;
}
@media (min-width: 768px) { article.post { padding: 3rem 3rem; } }
@media (min-width: 1024px) { article.post { padding: 3.5rem 4rem; } }

article.post h2 {
    font-size: 1.6rem; font-weight: 700; color: var(--text-dark);
    margin: 3rem 0 1rem; scroll-margin-top: 90px; line-height: 1.25;
}
article.post h2:first-child { margin-top: 0; }
article.post h2::before {
    content: ""; display: block; width: 36px; height: 3px;
    background: var(--accent-orange); margin-bottom: 0.9rem; border-radius: 3px;
}
article.post h3 {
    font-size: 1.2rem; font-weight: 700; color: var(--dark-blue); margin: 2rem 0 0.8rem;
}
article.post p {
    font-size: 1.02rem; line-height: 1.75; color: var(--text-dark);
    margin-bottom: 1.1rem; text-wrap: pretty;
}
article.post a { color: var(--primary-blue); text-decoration: underline; text-underline-offset: 3px; }
article.post a:hover { color: var(--dark-blue); }
article.post strong { color: var(--text-dark); font-weight: 700; }

article.post ul, article.post ol {
    margin: 0.5rem 0 1.5rem 0; padding-left: 0; list-style: none;
}
article.post ul li, article.post ol li {
    position: relative; padding: 0.35rem 0 0.35rem 1.6rem;
    font-size: 1.02rem; line-height: 1.7;
}
article.post ul li::before {
    content: ""; position: absolute; left: 0.2rem; top: 0.95rem;
    width: 6px; height: 6px; border-radius: 50%; background: var(--primary-blue);
}
article.post ol { counter-reset: ol-counter; }
article.post ol li {
    counter-increment: ol-counter; padding-left: 2.2rem;
}
article.post ol li::before {
    content: counter(ol-counter);
    position: absolute; left: 0; top: 0.4rem;
    width: 1.6rem; height: 1.6rem; border-radius: 50%;
    background: var(--primary-blue); color: var(--white);
    font-size: 0.78rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* Encadré fléché */
.arrow-callout {
    display: flex;
    gap: 0.9rem;
    background: var(--light-bg);
    border-left: 4px solid var(--primary-blue);
    padding: 1rem 1.2rem;
    border-radius: 0 12px 12px 0;
    margin: 1.5rem 0;
    font-size: 1rem;
    line-height: 1.6;
}
.arrow-callout::before {
    content: "→";
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1.2rem;
    line-height: 1.3;
}
.arrow-callout p { margin: 0 !important; font-size: 1rem !important; }

/* Figures dans le texte */
figure.inline {
    margin: 2rem 0;
    background: var(--light-bg);
    border-radius: 14px;
    padding: 1.2rem;
    border: 1px solid var(--border-light);
}
figure.inline img, figure.inline svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}
figure.inline figcaption {
    margin-top: 0.9rem;
    font-size: 0.85rem;
    color: var(--text-gray);
    line-height: 1.55;
    text-align: center;
}
figure.inline figcaption strong { color: var(--dark-blue); }

/* Deux images côte à côte dans une figure (ex. pages d'un rapport) */
.figure-pair {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 600px) { .figure-pair { grid-template-columns: 1fr 1fr; } }
.figure-pair img { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }

/* Capture d'écran de téléphone : largeur limitée et centrée */
figure.inline.figure-phone img {
    max-width: 280px;
    margin: 0 auto;
}

/* Tableau de données (couches, comparatifs) : défile horizontalement sur mobile */
.data-table-wrap {
    margin: 1.5rem 0;
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: 12px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    min-width: 520px;
}
.data-table th, .data-table td {
    text-align: left;
    vertical-align: top;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    line-height: 1.5;
}
.data-table th {
    background: var(--light-bg);
    color: var(--dark-blue);
    font-weight: 700;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table code, .file-tree code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    color: var(--dark-blue);
}

/* Arborescence de fichiers (contenu d'une archive exportée) */
.file-tree {
    margin: 1.5rem 0;
    padding: 1.2rem 1.4rem;
    background: var(--light-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.8;
    overflow-x: auto;
    white-space: pre;
    color: var(--text-dark);
}
.file-tree .note { color: var(--text-mute); }
/* Sur petit écran, les commentaires de l'arborescence sont masqués pour éviter le défilement */
@media (max-width: 600px) {
    .file-tree { font-size: 0.76rem; padding: 1rem; }
    .file-tree .note { display: none; }
}

/* Grille d'éléments avec pastille (prises de vue, formats, etc.) */
.pole-shots {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin: 1.5rem 0 2rem;
}
@media (min-width: 600px) { .pole-shots { grid-template-columns: 1fr 1fr; } }
.pole-shot {
    display: flex;
    gap: 0.9rem;
    background: var(--white);
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    align-items: flex-start;
}
.pole-shot .badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(61,107,142,0.10);
    color: var(--primary-blue);
    font-size: 1.1rem;
}
.pole-shot strong {
    display: block;
    font-size: 0.98rem;
    color: var(--text-dark);
    margin-bottom: 0.15rem;
}
.pole-shot span {
    font-size: 0.88rem;
    color: var(--text-gray);
    line-height: 1.55;
}

/* Cartes de questions (difficultés au retour au cabinet) */
.pain-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
    margin: 1.2rem 0 1.8rem;
}
@media (min-width: 640px) { .pain-grid { grid-template-columns: 1fr 1fr; } }
.pain-card {
    background: #FFF8F2;
    border: 1px solid #f0d8bf;
    border-left: 3px solid var(--accent-orange);
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.55;
}
.pain-card .q {
    display: block;
    font-weight: 700;
    color: var(--accent-orange);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}

/* Cartes de comparaison (avant / avec TopAssist) */
.compare-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}
@media (min-width: 640px) { .compare-grid { grid-template-columns: 1fr 1fr; } }
.compare-card {
    background: var(--white);
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    padding: 1.3rem;
}
.compare-card.is-before { border-top: 3px solid #C04638; }
.compare-card.is-after  { border-top: 3px solid var(--primary-blue); }
.compare-card h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-mute);
    margin-bottom: 0.4rem;
    font-weight: 700;
}
.compare-card p.title {
    font-size: 1.05rem; font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.7rem;
    line-height: 1.3;
}
.compare-card ul { margin: 0 !important; }
.compare-card ul li {
    font-size: 0.93rem !important;
    color: var(--text-gray);
    padding: 0.3rem 0 0.3rem 1.3rem !important;
    line-height: 1.55 !important;
}
.compare-card.is-before ul li::before { background: #C04638 !important; }

/* Étapes de méthode */
.method-steps {
    background: var(--light-bg);
    border-radius: 14px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border-light);
}
.method-steps h3 {
    margin-top: 0 !important;
    font-size: 0.95rem !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-mute) !important;
}
.method-steps ol { margin-bottom: 0 !important; margin-top: 1rem !important; }

/* Encadré QGIS (pleine largeur) */
.qgis-callout {
    margin: 2rem 0;
    background: linear-gradient(135deg, #E8F0F8 0%, #F0F5FA 100%);
    border: 1px solid rgba(61,107,142,0.18);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
}
.qgis-callout .mark {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--white);
    border: 1.5px solid var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}
.qgis-callout h4 {
    font-size: 1.05rem !important;
    margin: 0 0 0.3rem !important;
    color: var(--dark-blue) !important;
    font-weight: 700;
}
.qgis-callout p {
    font-size: 0.95rem !important;
    color: var(--text-gray) !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

/* FAQ */
.faq { margin: 1.5rem 0 0; display: flex; flex-direction: column; gap: 0.6rem; }
.faq details {
    background: var(--light-bg);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    transition: background 0.2s;
}
.faq details[open] {
    background: var(--white);
    border-color: var(--primary-blue);
    box-shadow: 0 4px 14px rgba(61,107,142,0.08);
}
.faq summary {
    font-weight: 600; font-size: 1rem; color: var(--text-dark);
    cursor: pointer; list-style: none;
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+"; font-size: 1.4rem; font-weight: 300;
    color: var(--primary-blue); transition: transform 0.25s; line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details > p {
    margin-top: 0.7rem !important;
    font-size: 0.95rem !important;
    color: var(--text-gray) !important;
    line-height: 1.65 !important;
}

/* Appel à l'action final */
.article-cta {
    margin-top: 3rem;
    background: linear-gradient(135deg, var(--dark-blue) 0%, #1a3a52 100%);
    color: var(--white);
    border-radius: 16px;
    padding: 2rem 1.8rem;
    text-align: center;
}
.article-cta h3 {
    color: var(--white) !important;
    font-size: 1.4rem !important;
    margin-bottom: 0.7rem !important;
    margin-top: 0 !important;
}
.article-cta p {
    color: rgba(255,255,255,0.85) !important;
    font-size: 0.98rem !important;
    margin-bottom: 1.5rem !important;
    max-width: 50ch;
    margin-left: auto;
    margin-right: auto;
}
.article-cta .cta-row {
    display: flex; flex-direction: column;
    gap: 0.8rem; justify-content: center; align-items: center;
}
@media (min-width: 600px) { .article-cta .cta-row { flex-direction: row; } }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.9rem 1.8rem; border-radius: 50px;
    text-decoration: none !important; font-weight: 600;
    transition: all 0.3s; font-size: 0.98rem; white-space: nowrap;
}
.btn-orange { background: var(--accent-orange); color: var(--white) !important; }
.btn-orange:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(232,145,58,0.4); }
.btn-ghost {
    background: transparent;
    color: var(--white) !important;
    border: 1.5px solid rgba(255,255,255,0.4);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* Pour aller plus loin */
.related {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}
.related h2 {
    font-size: 1.05rem !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-mute) !important;
}
.related h2::before { display: none !important; }
.related-grid { display: grid; grid-template-columns: 1fr; gap: 0.8rem; }
@media (min-width: 600px) { .related-grid { grid-template-columns: 1fr 1fr; } }
.related a {
    display: block;
    background: var(--light-bg);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    text-decoration: none !important;
    color: var(--text-dark) !important;
    transition: all 0.2s;
}
.related a:hover {
    border-color: var(--primary-blue);
    background: var(--white);
    box-shadow: 0 4px 14px rgba(61,107,142,0.08);
}
.related a strong {
    display: block;
    color: var(--primary-blue);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}
.related a span {
    font-size: 0.85rem;
    color: var(--text-gray);
    line-height: 1.5;
}

/* Pied de page */
footer.site-footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 2.5rem 1.5rem;
    text-align: center;
}
footer.site-footer a { color: var(--primary-blue); text-decoration: none; }
footer.site-footer a:hover { text-decoration: underline; }
footer.site-footer p { margin: 0.5rem 0; }
.footer-back {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-back a { color: rgba(255,255,255,0.7); }

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--dark-blue); color: var(--white);
    padding: 0.6rem 1rem; z-index: 999;
}
.skip-link:focus { left: 1rem; top: 1rem; }
