/* Guide sécurité - étend styles.css, mêmes tokens. Thème sombre uniquement. */

.guide,
.ch-grid {
    position: relative;
    z-index: 1;
}

/* ---------- NAV EXTRAS ---------- */
.nav--guide {
    gap: clamp(1rem, 3vw, 2rem);
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-toggle--flag {
    font-size: 0.95rem;
    line-height: 1;
    letter-spacing: 0;
    padding: 0.32rem 0.6rem;
}

.nav__links a[aria-current="page"] {
    color: var(--text);
}

.nav__guide {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-right: auto;
    padding-left: 0.85rem;
    border-left: 1px solid var(--line);
    text-decoration: none;
    line-height: 1.15;
}
.nav__guide-name {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.nav__guide-tagline {
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ---------- PROGRESS ---------- */
.progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 20;
    background: transparent;
}
.progress__bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), #00c8b4);
    transition: width 0.12s linear;
}

/* ---------- SEARCH ---------- */
.search {
    position: relative;
    width: clamp(140px, 20vw, 240px);
}
.search__input {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s ease;
}
.search__input::placeholder {
    color: var(--text-dim);
}
.search__input:focus {
    border-color: var(--accent);
}

.search-results {
    max-width: 760px;
    margin-inline: auto;
    padding: clamp(2rem, 8vh, 4rem) clamp(1.25rem, 5vw, 2rem);
    position: relative;
    z-index: 1;
}
.search-results__label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 1.25rem;
}
.search-hit {
    display: block;
    padding: 1.2rem 1.3rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--bg-card), var(--bg-soft));
    transition:
        transform 0.25s ease,
        border-color 0.25s ease;
}
.search-hit + .search-hit {
    margin-top: 0.9rem;
}
.search-hit:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}
.search-hit__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}
.search-hit__title {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0.4rem 0 0.35rem;
}
.search-hit__snippet {
    display: block;
    font-size: 0.9rem;
    color: var(--text-dim);
}
.search-empty {
    color: var(--text-dim);
}

[hidden] {
    display: none !important;
}

/* ---------- HOME ---------- */
.guide {
    max-width: var(--maxw);
    margin-inline: auto;
    padding: clamp(2rem, 8vh, 4rem) clamp(1.25rem, 5vw, 2rem);
}
.guide__section {
    margin-top: clamp(3rem, 9vh, 5rem);
}
.guide-hero {
    max-width: 720px;
}
.eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 0.9rem;
}
.eyebrow--dim {
    color: var(--text-dim);
}
.guide-hero__title {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.1rem, 6vw, 3.4rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-wrap: pretty;
}
.guide-hero__title::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin-top: 1rem;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
}
.guide-hero__lead {
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    line-height: 1.7;
    color: #d6d6de;
    margin-top: 1.5rem;
    text-wrap: pretty;
}
.guide-hero__meta {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-dim);
    margin-top: 1rem;
}
.btn {
    display: inline-block;
    margin-top: 1.75rem;
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}
.btn:hover {
    transform: translateY(-2px);
    opacity: 0.92;
}

.rules {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.1rem;
    list-style: none;
}
.rules li {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.4rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--bg-card), var(--bg-soft));
}
.rules__num {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.rules__text {
    color: #d6d6de;
    font-size: 0.95rem;
    line-height: 1.6;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
    list-style: none;
}
.chapter-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    height: 100%;
    padding: 1.4rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--bg-card), var(--bg-soft));
    transition:
        transform 0.25s ease,
        border-color 0.25s ease;
}
.chapter-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}
.chapter-card__num {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--accent);
}
.chapter-card__title {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0.15rem 0 0.2rem;
}
.chapter-card__kicker {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.55;
}

.closing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.1rem;
}
.panel {
    padding: 1.6rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--bg-card), var(--bg-soft));
}
.panel h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.panel__lead {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin: 0.5rem 0 1.25rem;
}
.priority {
    list-style: none;
    display: grid;
    gap: 0.55rem;
}
.priority li {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
}
.priority li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.priority__num {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 1.2rem;
}
.panel--accent {
    border-left: 3px solid var(--accent);
}
.panel--accent p {
    margin-top: 1rem;
    line-height: 1.7;
    color: #d6d6de;
    text-wrap: pretty;
}
.panel--accent .panel__footnote {
    font-size: 0.88rem;
    color: var(--text-dim);
}

/* ---------- CHAPTER ---------- */
.ch-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
    max-width: var(--maxw);
    margin-inline: auto;
    padding: clamp(1.5rem, 5vh, 3rem) clamp(1.25rem, 5vw, 2rem);
}
.ch-toc {
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 7rem);
    overflow: auto;
    padding-right: 0.5rem;
}
.ch-toc__heading {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.9rem;
}
.ch-toc__list {
    list-style: none;
    display: grid;
    gap: 0.15rem;
}
.ch-toc__link {
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-dim);
    transition:
        color 0.2s ease,
        background 0.2s ease;
}
.ch-toc__link:hover {
    color: var(--text);
    background: var(--bg-soft);
}
.ch-toc__link[aria-current="page"] {
    color: var(--text);
    background: var(--bg-soft);
    box-shadow: inset 2px 0 0 var(--accent);
}
.ch-toc__num {
    font-size: 0.7rem;
    color: var(--accent);
    min-width: 1.1rem;
}

.breadcrumb {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}
.breadcrumb a:hover {
    color: var(--text);
}

.article {
    max-width: 760px;
    padding-bottom: clamp(2rem, 8vh, 4rem);
}
.article__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}
.article__title {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.9rem, 5.5vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0.6rem 0 0.75rem;
    text-wrap: pretty;
}
.article__kicker {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.6;
    text-wrap: pretty;
}
.article__rule {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 1.75rem 0 2.25rem;
}

/* Prose: mêmes valeurs que .prose du blog. */
.article__body {
    font-size: 1.02rem;
    line-height: 1.75;
    color: #d6d6de;
}
.article__body > * + * {
    margin-top: 1.25rem;
}
.article__body h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-top: 2.75rem;
    scroll-margin-top: 5rem;
}
.article__body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article__body a:hover {
    opacity: 0.8;
}
.article__body blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.25rem 0 0.25rem 1.1rem;
    color: var(--text-dim);
    font-style: italic;
}
.article__body pre {
    padding: 1.1rem;
    border-radius: var(--radius);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
}
.article__body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.article__body ul.bullets {
    padding-left: 1.35rem;
}
.article__body ul.bullets li + li {
    margin-top: 0.4rem;
}
.article__body ol.steps {
    list-style: none;
    display: grid;
    gap: 0.7rem;
}
.article__body ol.steps li {
    display: flex;
    gap: 0.85rem;
    align-items: baseline;
}
.steps__num {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 1.3rem;
}

.note {
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.65;
}

.checklist {
    display: grid;
    gap: 0.5rem;
}
.checklist label {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    font-size: 0.95rem;
    line-height: 1.55;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.checklist label:hover {
    border-color: var(--accent);
}
.checklist label:has(input:checked) {
    color: var(--text-dim);
    text-decoration: line-through;
    text-decoration-color: var(--text-dim);
}
.checklist input {
    width: 17px;
    height: 17px;
    margin-top: 0.2rem;
    flex: none;
    accent-color: var(--accent);
}

.links {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}
.links a {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    font-size: 0.92rem;
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s ease;
}
.links a:hover {
    border-color: var(--accent);
}
.links__host {
    font-size: 0.75rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 44%;
}

.check-summary {
    margin-top: 1.5rem;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
}
.pager a {
    display: block;
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--bg-soft);
    font-size: 0.92rem;
    transition: border-color 0.2s ease;
}
.pager a:hover {
    border-color: var(--accent);
}
.pager__next {
    text-align: right;
    grid-column: 2;
}
.pager__label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
}
.pager__title {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 0.7rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 0 0 8px 0;
    color: var(--text);
}
.skip-link:focus {
    left: 0;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
    .ch-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .ch-toc {
        display: none;
    }
    .nav--guide .nav__links {
        display: none;
    }
}

@media (max-width: 560px) {
    .nav--guide {
        flex-wrap: wrap;
        row-gap: 0.6rem;
    }
    .nav--guide .nav__actions {
        order: 3;
        flex: 1 0 100%;
    }
    .nav--guide .search {
        flex: 1;
        width: auto;
    }
    .nav__guide-tagline {
        display: none;
    }
    .pager {
        grid-template-columns: 1fr;
    }
    .pager__next {
        grid-column: 1;
        text-align: left;
    }
}

/* ---------- PRINT ---------- */
@media print {
    .no-print,
    .nav,
    .footer,
    .ch-toc {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
    }
    body::before {
        display: none;
    }
    .article,
    .article__body,
    .guide-hero__lead {
        color: #000;
        max-width: none;
    }
    .article__title,
    .article__body h2 {
        color: #000;
    }
}
