/* Documentation Digistat — feuille de style commune
 * Utilisée par les 4 guides (utilisateur métier, technique, PWA, client).
 * Couleurs : bleu Digistat (#0054a6) + gris neutre.
 */

:root {
    --digistat-blue: #0054a6;
    --digistat-blue-dark: #003d7a;
    --digistat-blue-light: #e6f0fa;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg: #ffffff;
    --bg-soft: #f9fafb;
    --warning: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --code-bg: #f3f4f6;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    padding: 0;
}

/* === HEADER === */
.site-header {
    background: var(--digistat-blue);
    color: #fff;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-header img.logo {
    height: 56px;
    width: auto;
    background: #fff;
    padding: 6px 10px;
    border-radius: 6px;
}

.site-header .title-block { flex: 1; }
.site-header h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}
.site-header .subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
}

/* === LAYOUT === */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .toc { position: static !important; }
}

/* === TABLE DES MATIÈRES (TOC) === */
.toc {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1rem;
}

.toc h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    font-weight: 700;
}

.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0.25rem 0; }
.toc a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 0.25rem 0.5rem;
    border-left: 2px solid transparent;
    transition: all 0.15s;
}
.toc a:hover {
    color: var(--digistat-blue);
    border-left-color: var(--digistat-blue);
    background: var(--digistat-blue-light);
}
.toc ul ul { padding-left: 1rem; font-size: 0.85rem; }

/* === CONTENU === */
.content { min-width: 0; }

.content h2 {
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--digistat-blue);
    color: var(--digistat-blue-dark);
}

.content h3 {
    font-size: 1.2rem;
    margin: 1.75rem 0 0.75rem;
    color: var(--digistat-blue);
}

.content h4 {
    font-size: 1.05rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--text);
    font-weight: 700;
}

.content p { margin: 0.75rem 0; }

.content a {
    color: var(--digistat-blue);
    text-decoration: none;
    border-bottom: 1px dotted var(--digistat-blue);
}
.content a:hover { border-bottom-style: solid; }

.content ul, .content ol { padding-left: 1.5rem; }
.content li { margin: 0.25rem 0; }

/* === BLOCS SPÉCIAUX === */
.callout {
    background: var(--digistat-blue-light);
    border-left: 4px solid var(--digistat-blue);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    border-radius: 0 6px 6px 0;
}
.callout.warning {
    background: #fef3c7;
    border-left-color: var(--warning);
}
.callout.danger {
    background: #fee2e2;
    border-left-color: var(--danger);
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.callout strong { display: block; margin-bottom: 0.25rem; }

/* === CARDS === */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}
.card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s;
}
.card:hover {
    border-color: var(--digistat-blue);
    box-shadow: 0 2px 8px rgba(0, 84, 166, 0.1);
    transform: translateY(-2px);
}
.card h4 { margin: 0 0 0.5rem; color: var(--digistat-blue); }
.card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* === TABLES === */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}
th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    background: var(--digistat-blue);
    color: #fff;
    font-weight: 600;
}
tbody tr:nth-child(even) { background: var(--bg-soft); }
tbody tr:hover { background: var(--digistat-blue-light); }

/* === CODE === */
code {
    background: var(--code-bg);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 0.88em;
}
pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}
pre code { background: none; padding: 0; color: inherit; }

/* === STATUS BADGES === */
.badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge.green { background: var(--success); color: #fff; }
.badge.orange { background: var(--warning); color: #fff; }
.badge.red { background: var(--danger); color: #fff; }
.badge.gray { background: var(--text-muted); color: #fff; }

/* === PLACEHOLDER (sections vides à compléter) === */
.placeholder {
    background: repeating-linear-gradient(
        45deg,
        var(--bg-soft),
        var(--bg-soft) 10px,
        #fafafa 10px,
        #fafafa 20px
    );
    border: 1px dashed var(--text-muted);
    border-radius: 6px;
    padding: 1.5rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* === FOOTER === */
.site-footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 3rem;
}

/* === IMPRESSION === */
@media print {
    .toc, .site-header, .site-footer { display: none; }
    .layout { grid-template-columns: 1fr; padding: 0; }
    .content h2 { page-break-before: always; }
    .content h2:first-of-type { page-break-before: avoid; }
    a { color: var(--text); border-bottom: none; }
}
