/* ====================================================
   MASSAJOBS — Site de capitalisation
   Design system — Style global
   ==================================================== */

/* --------- Reset & base --------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Palette */
    /* Palette officielle Massajobs */
    --color-massa-orange: #FF6D24;
    --color-massa-yellow: #FABA02;
    --color-massa-blue: #6687AC;
    --color-massa-grey: #E2E2E1;

    --color-bg: #FFFFFF;
    --color-bg-alt: #F5F5F4;
    --color-bg-deep: #3F5670;
    --color-text: #1A1F2E;
    --color-text-muted: #5A6172;
    --color-accent: #FF6D24;
    --color-accent-deep: #E55A14;
    --color-primary: #6687AC;
    --color-primary-light: #8AA5C5;
    --color-border: #E2E2E1;
    --color-white: #FFFFFF;

    /* Typography */
    --font-display: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    --space-7: 4rem;
    --space-8: 6rem;

    /* Containers */
    --width-narrow: 760px;
    --width-medium: 960px;
    --width-wide: 1200px;

    /* Misc */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(26, 31, 46, 0.06), 0 1px 2px rgba(26, 31, 46, 0.04);
    --shadow-md: 0 4px 16px rgba(26, 31, 46, 0.06), 0 2px 6px rgba(26, 31, 46, 0.04);
    --shadow-lg: 0 12px 40px rgba(26, 31, 46, 0.08), 0 4px 12px rgba(26, 31, 46, 0.05);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-accent);
}

/* --------- Typography --------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--color-text);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 600;
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    margin-bottom: var(--space-4);
}

h3 {
    font-size: clamp(1.375rem, 2.5vw, 1.75rem);
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
}

h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: var(--space-5);
    margin-bottom: var(--space-2);
}

p {
    margin-bottom: var(--space-3);
}

strong, b {
    font-weight: 600;
    color: var(--color-text);
}

/* Section "kicker" — small caps label above h2 */
.kicker {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    margin-bottom: var(--space-3);
}

.kicker-light {
    color: rgba(255, 255, 255, 0.72);
}

/* --------- Layout --------- */
.container {
    width: 100%;
    max-width: var(--width-wide);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.container-narrow {
    max-width: var(--width-narrow);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.container-medium {
    max-width: var(--width-medium);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.section {
    padding: var(--space-8) 0;
}

.section-tight {
    padding: var(--space-6) 0;
}

.section-light {
    background-color: var(--color-white);
}

.section-sand {
    background-color: var(--color-bg-alt);
}

.section-deep {
    background-color: var(--color-bg-deep);
    color: var(--color-bg);
}

.section-deep h1,
.section-deep h2,
.section-deep h3,
.section-deep h4 {
    color: var(--color-white);
}

/* --------- Header & Navigation --------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--width-wide);
    margin: 0 auto;
    padding: var(--space-3) var(--space-4);
}

.site-logo {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--color-text);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.site-logo__img {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: block;
}

.site-logo__text {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.site-logo strong {
    color: var(--color-text);
}

.site-logo small {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.site-nav a {
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 2px;
}

.site-nav a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}

.site-nav a:hover::after,
.site-nav a.active::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: var(--space-2);
    color: var(--color-text);
    font-size: 1.5rem;
}

@media (max-width: 880px) {
    .site-nav {
        position: fixed;
        top: 64px;
        right: -100%;
        bottom: 0;
        width: 70%;
        max-width: 320px;
        background: var(--color-bg);
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-5);
        gap: var(--space-4);
        border-left: 1px solid var(--color-border);
        transition: right var(--transition);
        box-shadow: var(--shadow-lg);
    }
    .site-nav.open {
        right: 0;
    }
    .menu-toggle {
        display: block;
    }
}

/* --------- Nav dropdown (sous-menu Méthode au survol) --------- */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown__menu {
    position: absolute;
    top: calc(100% + 10px);
    left: -1rem;
    min-width: 260px;
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

/* Pont invisible entre le trigger et le menu pour éviter la fermeture pendant le déplacement de la souris */
.nav-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown__menu a {
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.9375rem;
    white-space: nowrap;
    font-weight: 500;
    transition: background 150ms ease, color 150ms ease;
}

/* On désactive la barre soulignée orange (héritée de .site-nav a) à l'intérieur du dropdown */
.nav-dropdown__menu a::after {
    display: none;
}

.nav-dropdown__menu a:hover {
    background: var(--color-bg-alt);
    color: var(--color-accent);
}

@media (max-width: 880px) {
    .nav-dropdown {
        display: block;
        width: 100%;
    }
    .nav-dropdown__menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0.5rem 0 0 var(--space-4);
        min-width: 0;
    }
    .nav-dropdown::after {
        display: none;
    }
}

/* --------- Buttons --------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background: var(--color-accent-deep);
    border-color: var(--color-accent-deep);
    color: var(--color-white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-bg-deep);
    border-color: var(--color-bg-deep);
    color: var(--color-white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text);
    padding: 0.5rem 0;
}

.btn-ghost:hover {
    color: var(--color-accent);
}

.btn-arrow::after {
    content: "→";
    transition: transform var(--transition);
}

.btn-arrow:hover::after {
    transform: translateX(4px);
}

/* --------- Hero --------- */
.hero {
    padding: var(--space-8) 0 var(--space-7);
    position: relative;
    overflow: hidden;
}

.hero__inner {
    max-width: var(--width-wide);
    margin: 0 auto;
    padding: 0 var(--space-4);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: var(--space-7);
    align-items: center;
}

.hero__content {
    max-width: 600px;
}

@media (max-width: 880px) {
    .hero__inner {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    .hero__content {
        max-width: none;
    }
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-bg-alt);
    color: var(--color-primary);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-4);
}

.hero__eyebrow::before {
    content: "•";
    color: var(--color-accent);
    font-size: 1.5rem;
    line-height: 0;
}

.hero h1 {
    margin-bottom: var(--space-4);
}

.hero h1 em {
    font-style: italic;
    color: var(--color-accent);
    font-weight: 500;
}

.hero__lead {
    font-size: 1.1875rem;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: var(--space-5);
    max-width: 600px;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.hero__visual {
    position: relative;
    aspect-ratio: 4 / 5;
    max-height: 560px;
    width: 100%;
    border-radius: var(--radius-lg);
    background: var(--color-bg-alt);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Anciennes règles conservées pour compat éventuelle — non utilisées sur la home */
.hero__visual-quote {
    position: absolute;
    bottom: var(--space-4);
    left: var(--space-4);
    right: var(--space-4);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--color-text);
}

.hero__visual-quote cite {
    display: block;
    margin-top: var(--space-2);
    font-style: normal;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* --------- Cards (sections grid) --------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-5);
}

.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
    color: inherit;
}

.card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--color-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-3);
}

.card--accent .card__icon {
    background: rgba(255, 109, 36, 0.12);
}

.card--primary .card__icon {
    background: rgba(102, 135, 172, 0.12);
}

.card__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--color-text);
}

.card__lead {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: var(--space-3);
}

.card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.9375rem;
    margin-top: auto;
}

.card__link::after {
    content: "→";
    transition: transform var(--transition);
}

.card:hover .card__link::after {
    transform: translateX(4px);
}

/* Sub-cards (children of a card category) */
.card__children {
    margin-top: var(--space-3);
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-3);
}

.card__children a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--color-border);
}

.card__children a:last-child {
    border-bottom: 0;
}

.card__children a:hover {
    color: var(--color-accent);
}

.card__children a::after {
    content: "›";
    color: var(--color-text-muted);
    transition: transform var(--transition);
}

.card__children a:hover::after {
    transform: translateX(2px);
    color: var(--color-accent);
}

/* --------- Reading content (article body) --------- */
.reading {
    max-width: var(--width-narrow);
    margin: 0 auto;
    padding: var(--space-6) var(--space-4);
}

.reading h2 {
    margin-top: var(--space-7);
    margin-bottom: var(--space-3);
    scroll-margin-top: 80px;
}

.reading h2:first-child {
    margin-top: 0;
}

.reading h3 {
    margin-top: var(--space-5);
    margin-bottom: var(--space-2);
}

.reading p {
    margin-bottom: var(--space-3);
}

.reading ul,
.reading ol {
    margin: var(--space-3) 0 var(--space-3) var(--space-4);
    padding-left: var(--space-2);
}

.reading li {
    margin-bottom: var(--space-2);
    line-height: 1.65;
}

.reading li::marker {
    color: var(--color-accent);
}

.reading hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: var(--space-6) 0;
}

/* --------- Callouts (idée clé, tips, exemples) --------- */
.callout {
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    margin: var(--space-4) 0;
    border-left: 4px solid var(--color-primary);
}

.callout__title {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.callout p:last-child {
    margin-bottom: 0;
}

.callout--idea {
    background: #FFF1E8;
    border-left-color: var(--color-accent);
}

.callout--tip {
    background: #EEF2F7;
    border-left-color: var(--color-primary);
}

.callout--example {
    background: #FBF8F0;
    border-left-color: #b59459;
}

.callout--warning {
    background: #FFF4E5;
    border-left-color: #e08720;
}

/* --------- Liens de référence (numéros qui pointent vers la biblio) --------- */
.reading a[href^="#ref-"] {
    font-size: 0.78em;
    vertical-align: super;
    line-height: 0;
    padding: 0 1px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.reading a[href^="#ref-"]:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Dans les blockquotes (cite), garder la taille normale */
.reading blockquote cite a[href^="#ref-"] {
    font-size: 0.78em;
    vertical-align: baseline;
    line-height: normal;
    font-weight: 600;
    margin-left: 0.25em;
}

/* Surlignage de la référence quand on clique dessus */
.reading [id^="ref-"]:target {
    background: rgba(255, 109, 36, 0.12);
    padding: var(--space-2);
    margin-left: calc(-1 * var(--space-2));
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

/* --------- Surlignage (style surligneur jaune) --------- */
.reading .hl,
.reading mark {
    background: linear-gradient(180deg, transparent 55%, rgba(250, 186, 2, 0.45) 55%);
    padding: 0 2px;
    color: inherit;
    border-radius: 1px;
}

/* --------- Pull quote (citation en exergue) --------- */
.pull-quote {
    margin: var(--space-6) 0;
    padding: var(--space-5) var(--space-5) var(--space-5) var(--space-6);
    position: relative;
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-style: italic;
    line-height: 1.45;
    color: var(--color-text);
    border-left: 4px solid var(--color-accent);
}

.pull-quote::before {
    content: "\201C";
    position: absolute;
    top: -8px;
    left: var(--space-3);
    font-size: 4rem;
    line-height: 1;
    color: var(--color-accent);
    opacity: 0.3;
    font-family: serif;
}

.pull-quote cite {
    display: block;
    margin-top: var(--space-3);
    font-style: normal;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pull-quote cite::before {
    content: "— ";
}

/* --------- Tables --------- */
.table-wrapper {
    overflow-x: auto;
    margin: var(--space-4) 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.reading table,
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    font-size: 0.9375rem;
}

.reading table th,
.table th {
    background: var(--color-bg-alt);
    text-align: left;
    padding: var(--space-3);
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
}

.reading table td,
.table td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
    line-height: 1.55;
}

.reading table tr:last-child td,
.table tr:last-child td {
    border-bottom: 0;
}

.reading table tr:hover td,
.table tr:hover td {
    background: var(--color-bg);
}

/* --------- Section repliable (toggle d'une section entière H2) --------- */
.reading details.section-toggle {
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: var(--space-7) 0 var(--space-5);
    background: transparent;
    overflow: visible;
}

.reading details.section-toggle > summary {
    cursor: pointer;
    padding: 0;
    background: transparent;
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-4);
    transition: border-color var(--transition);
}

.reading details.section-toggle > summary::-webkit-details-marker {
    display: none;
}

.reading details.section-toggle > summary > h2 {
    margin: 0;
    flex: 1;
    transition: color var(--transition);
}

.reading details.section-toggle > summary::after {
    content: "+";
    margin-left: auto;
    font-size: 2rem;
    font-weight: 300;
    color: var(--color-accent);
    line-height: 1;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--color-accent);
    border-radius: 50%;
    transition: transform var(--transition), background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.reading details.section-toggle[open] > summary::after {
    content: "−";
    background: var(--color-accent);
    color: var(--color-white);
    transform: none;
}

.reading details.section-toggle > summary:hover {
    border-bottom-color: var(--color-accent);
}

.reading details.section-toggle > summary:hover h2 {
    color: var(--color-accent);
}

.reading details.section-toggle > summary:hover::after {
    background: var(--color-accent);
    color: var(--color-white);
}

.reading details.section-toggle[open] {
    padding-bottom: var(--space-4);
}

/* --------- Details / Accordion --------- */
.reading details {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0;
    margin: var(--space-3) 0;
    background: var(--color-white);
    overflow: hidden;
}

.reading details[open] {
    box-shadow: var(--shadow-sm);
}

.reading summary {
    cursor: pointer;
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    color: var(--color-text);
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: background var(--transition);
}

.reading summary::-webkit-details-marker {
    display: none;
}

.reading summary::after {
    content: "+";
    margin-left: auto;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-accent);
    transition: transform var(--transition);
}

.reading details[open] > summary::after {
    transform: rotate(45deg);
}

.reading summary:hover {
    background: var(--color-bg);
}

.details__body {
    padding: 0 var(--space-4) var(--space-4);
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-3);
}

/* --------- Article header (méta + intro) --------- */
.article-header {
    padding: var(--space-7) 0 var(--space-5);
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
}

.article-header__inner {
    max-width: var(--width-narrow);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.breadcrumb a {
    color: var(--color-text-muted);
}

.breadcrumb a:hover {
    color: var(--color-accent);
}

.breadcrumb__sep {
    margin: 0 0.4rem;
    opacity: 0.5;
}

.article-header h1 {
    margin-bottom: var(--space-3);
}

.article-header__lead {
    font-size: 1.125rem;
    line-height: 1.55;
    color: var(--color-text-muted);
}

/* --------- Footer --------- */
.site-footer {
    background: var(--color-bg-deep);
    color: rgba(255, 255, 255, 0.88);
    padding: var(--space-7) 0 var(--space-4);
    margin-top: var(--space-8);
}

.site-footer a {
    color: rgba(255, 255, 255, 0.88);
}

.site-footer a:hover {
    color: var(--color-accent);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--space-5);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

@media (max-width: 760px) {
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
}

.site-footer h4 {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-3);
}

.site-footer__brand {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: var(--space-2);
}

.site-footer__lead {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9375rem;
    line-height: 1.55;
    max-width: 380px;
}

.site-footer__links {
    list-style: none;
    padding: 0;
}

.site-footer__links li {
    margin-bottom: var(--space-2);
}

.site-footer__bottom {
    padding-top: var(--space-4);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8125rem;
}

.license-tag {
    font-family: var(--font-body);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

/* --------- Utility --------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: var(--space-3); }
.mb-5 { margin-bottom: var(--space-5); }

.divider-decorative {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-6) 0;
}

.divider-decorative::before,
.divider-decorative::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.divider-decorative span {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --------- TOC sidebar (sommaire latéral) --------- */
.article-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--space-6);
    max-width: var(--width-wide);
    margin: 0 auto;
    padding: var(--space-6) var(--space-4);
}

.article-layout .reading {
    padding: 0;
    max-width: 760px;
    margin: 0;
}

.toc {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    font-size: 0.875rem;
    align-self: start;
    padding-right: var(--space-2);
}

/* Scrollbar discrète pour le TOC */
.toc::-webkit-scrollbar {
    width: 4px;
}
.toc::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.toc__label {
    font-family: var(--font-body);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc__label::before {
    content: "";
    width: 16px;
    height: 1.5px;
    background: var(--color-accent);
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1.5px solid var(--color-border);
}

.toc li {
    margin: 0;
}

.toc li a {
    display: block;
    padding: 0.45rem 0 0.45rem var(--space-3);
    color: var(--color-text-muted);
    border-left: 2px solid transparent;
    margin-left: -1.5px;
    line-height: 1.4;
    font-size: 0.875rem;
    transition: all var(--transition);
    text-decoration: none;
}

.toc li a:hover {
    color: var(--color-text);
    border-left-color: var(--color-text-muted);
}

.toc li a.active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    font-weight: 600;
}

/* Bouton "Retour en haut" sous le TOC */
.toc__back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: var(--space-4);
    padding: 0.4rem 0.8rem;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.toc__back-to-top:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* Au-dessus de 1024px : layout en colonnes, sommaire visible */
/* En-dessous : layout en une seule colonne, sommaire masqué */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    .toc {
        display: none;
    }
}

/* --------- Pillars (home page — 5 entry blocks, zigzag) --------- */
.pillars {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    max-width: 1100px;
    margin: 0 auto;
}

.pillar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform 200ms ease, box-shadow 200ms ease;
    border: 1px solid var(--color-border);
    height: 380px;
}

.pillar:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.pillar:hover .pillar__title {
    color: var(--color-accent);
}

.pillar:hover .pillar__link {
    transform: translateX(4px);
}

.pillar__image {
    background-color: var(--color-bg-alt);
    overflow: hidden;
    min-height: 280px;
    position: relative;
}

.pillar__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 400ms ease;
}

/* Recadrages spécifiques pour faire ressortir le sujet de chaque photo */
.pillar__image img[src*="pillar-structure"] {
    object-position: 60% 75%;
}

.pillar__image img[src*="pillar-outils"] {
    object-position: 50% 25%;
}

.pillar:hover .pillar__image img {
    transform: scale(1.03);
}

.pillar__body {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pillar__title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.2vw, 1.875rem);
    font-weight: 700;
    color: var(--color-primary);
    margin: var(--space-2) 0 var(--space-3);
    line-height: 1.2;
    transition: color 200ms ease;
}

.pillar__lead {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: var(--space-4);
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pillar__link {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.9375rem;
    margin-top: auto;
    align-self: flex-start;
    transition: transform 200ms ease;
    display: inline-block;
}

/* Zigzag : on intervertit l'ordre des deux cellules pour les blocs pairs */
.pillar:nth-child(even) .pillar__image {
    grid-column: 2;
    grid-row: 1;
}
.pillar:nth-child(even) .pillar__body {
    grid-column: 1;
    grid-row: 1;
}

@media (max-width: 768px) {
    .pillar {
        grid-template-columns: 1fr;
        height: auto;
    }
    .pillar:nth-child(even) .pillar__image,
    .pillar:nth-child(even) .pillar__body {
        grid-column: 1;
        grid-row: auto;
    }
    .pillar__image {
        min-height: 220px;
        aspect-ratio: 4 / 3;
    }
    .pillar__body {
        padding: var(--space-5);
    }
    .pillar__lead {
        -webkit-line-clamp: unset;
    }
}

/* --------- Method cards (page Méthode — 4 cartes sobres avec photo en bandeau) --------- */
.method-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
    max-width: 980px;
    margin: 0 auto;
}

.method-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform 200ms ease, box-shadow 200ms ease;
    display: flex;
    flex-direction: column;
}

.method-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.method-card:hover .method-card__title {
    color: var(--color-accent);
}

.method-card__image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--color-bg-alt);
}

.method-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 400ms ease;
}

.method-card:hover .method-card__image img {
    transform: scale(1.03);
}

/* Recadrages spécifiques réutilisés (mêmes photos que sur l'accueil) */
.method-card__image img[src*="pillar-structure"] {
    object-position: 60% 75%;
}
.method-card__image img[src*="pillar-outils"] {
    object-position: 50% 25%;
}

.method-card__body {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.method-card__num {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.method-card__title {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 var(--space-3);
    line-height: 1.3;
    transition: color 200ms ease;
}

.method-card__lead {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0 0 var(--space-4);
    flex-grow: 1;
}

.method-card__link {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.875rem;
    align-self: flex-start;
}

@media (max-width: 720px) {
    .method-grid {
        grid-template-columns: 1fr;
    }
}

/* --------- Offer blocks (page Formations — encadrés sobres) --------- */
.offer-block {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.offer-block > .kicker {
    display: inline-block;
    margin-bottom: var(--space-2);
}

.offer-block h2 {
    margin-top: 0;
    margin-bottom: var(--space-3);
    color: var(--color-primary);
    font-size: 1.625rem;
    line-height: 1.25;
}

.offer-block__lead {
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    margin-bottom: var(--space-5);
    line-height: 1.6;
}

.offer-block h3 {
    color: var(--color-text);
    font-size: 1.0625rem;
    font-weight: 700;
    margin-top: var(--space-5);
    margin-bottom: var(--space-2);
}

.offer-block h3:first-of-type {
    margin-top: 0;
}

.offer-block ul {
    margin-top: var(--space-2);
    margin-bottom: var(--space-4);
}

.offer-block .callout {
    margin-top: var(--space-5);
}

/* --------- Print --------- */
/* --------- Impression --------- */
@media print {
    /* Reset typographique */
    html, body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
        line-height: 1.5;
    }

    /* Masquer la chrome navigationnelle */
    .site-header,
    .site-footer,
    .menu-toggle,
    .search-toggle,
    .search-modal,
    .toc,
    .breadcrumb,
    .nav-dropdown,
    .article-footer,
    .pillar__cta,
    .btn,
    nav,
    .skip-link {
        display: none !important;
    }

    /* Déplier tous les <details> pour que le contenu soit lisible */
    details {
        display: block !important;
    }
    details > summary {
        list-style: none !important;
        cursor: default !important;
        margin-bottom: 0.4em;
    }
    details > summary::-webkit-details-marker,
    details > summary::marker {
        display: none !important;
    }
    .section-toggle > summary::after {
        display: none !important;
    }

    /* Largeur agréable, marges naturelles via @page */
    .article-layout,
    .reading,
    .article-header__inner,
    .site-section .container {
        display: block !important;
        max-width: none !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .article-header {
        padding: 0 0 0.5cm 0 !important;
        border-bottom: 1px solid #ccc;
        margin-bottom: 0.5cm;
    }

    h1 { font-size: 22pt; margin: 0 0 0.3cm; }
    h2 { font-size: 15pt; margin-top: 0.6cm; page-break-after: avoid; }
    h3 { font-size: 12pt; page-break-after: avoid; }
    p, li { orphans: 3; widows: 3; }

    /* Callouts en print : bordure simple, fond clair */
    .callout {
        border: 1px solid #999 !important;
        background: #f6f6f6 !important;
        padding: 0.3cm !important;
        margin: 0.3cm 0 !important;
        page-break-inside: avoid;
        box-shadow: none !important;
    }
    .callout--idea { background: #fff8e0 !important; }
    .callout--tip  { background: #eaf3ea !important; }
    .callout--warning { background: #fdecea !important; }
    .callout--example { background: #eef2f9 !important; }

    /* Liens : afficher l'URL après pour conserver la trace */
    a[href^="http"]::after,
    a[href^="../"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #555;
        word-break: break-all;
    }
    /* Pas d'URL pour les ancres internes ni les notes de bas de page */
    a[href^="#"]::after { content: ""; }

    /* Surlignages jaunes : on les neutralise pour rester sobre */
    .hl, mark {
        background: transparent !important;
        color: inherit !important;
        font-weight: 600;
    }

    /* Tableaux */
    table { page-break-inside: auto; }
    tr    { page-break-inside: avoid; page-break-after: auto; }
    thead { display: table-header-group; }

    /* Pas de coupure au milieu d'un bloc collapsible ouvert */
    details, .callout, blockquote, figure, .table-wrapper {
        page-break-inside: avoid;
    }

    /* Citations */
    blockquote.pull-quote {
        border-left: 3px solid #999 !important;
        background: transparent !important;
        font-style: italic;
        margin: 0.4cm 0;
        padding: 0.1cm 0.4cm;
    }

    /* Marge de page propre */
    @page {
        size: A4;
        margin: 1.6cm 1.4cm;
    }
}

/* --------- Recherche interne --------- */
.search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-text);
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
    margin-left: var(--space-3);
    padding: 0;
}
.search-toggle:hover,
.search-toggle:focus-visible {
    background: var(--color-bg-alt);
    border-color: var(--color-massa-blue);
    color: var(--color-massa-blue);
    outline: none;
}
.search-toggle svg {
    width: 18px;
    height: 18px;
}
.search-toggle::after { display: none; }

@media (max-width: 880px) {
    .search-toggle {
        margin-left: auto;
        margin-right: var(--space-2);
    }
}

body.search-open {
    overflow: hidden;
}

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 1rem 1rem;
}
.search-modal.open {
    display: flex;
}
.search-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 26, 38, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.search-modal__panel {
    position: relative;
    width: 100%;
    max-width: 640px;
    background: var(--color-white);
    border-radius: 14px;
    box-shadow: 0 30px 60px -10px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid var(--color-border);
}
.search-modal__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--color-border);
}
.search-modal__icon {
    color: var(--color-text-muted);
    flex-shrink: 0;
}
.search-modal__input {
    flex: 1;
    border: 0;
    outline: none;
    font: inherit;
    font-size: 1.05rem;
    background: transparent;
    color: var(--color-text);
    padding: 0.25rem 0;
}
.search-modal__input::placeholder {
    color: var(--color-text-muted);
}
.search-modal__close {
    background: transparent;
    border: 0;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    transition: background 150ms ease, color 150ms ease;
}
.search-modal__close:hover {
    background: var(--color-bg-alt);
    color: var(--color-text);
}
.search-modal__status {
    padding: 0.5rem 1rem 0.25rem;
    color: var(--color-text-muted);
    font-size: 0.825rem;
    min-height: 1.5em;
}
.search-modal__list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0.5rem 0.75rem;
    overflow-y: auto;
    flex: 1;
}
.search-modal__list:empty {
    padding: 0;
}
.search-result {
    margin: 0;
    padding: 0;
}
.search-result__link {
    display: block;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    color: var(--color-text);
    text-decoration: none;
    transition: background 120ms ease;
}
.search-result__link:hover,
.search-result.is-active .search-result__link {
    background: var(--color-bg-alt);
}
.search-result__page {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-massa-blue);
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.search-result__heading {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.98rem;
    line-height: 1.35;
}
.search-result__snippet {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.search-result mark {
    background: rgba(250, 186, 2, 0.35);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}
.search-modal__footer {
    display: flex;
    gap: 1.25rem;
    justify-content: flex-start;
    padding: 0.55rem 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: var(--color-bg-alt);
    flex-wrap: wrap;
}
.search-modal__footer kbd {
    display: inline-block;
    padding: 1px 6px;
    margin-right: 4px;
    font-family: inherit;
    font-size: 0.72rem;
    border: 1px solid var(--color-border);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--color-white);
    color: var(--color-text);
}
@media (max-width: 540px) {
    .search-modal {
        padding: 2vh 0.5rem 0.5rem;
    }
    .search-modal__panel {
        max-height: 92vh;
    }
    .search-modal__footer {
        font-size: 0.7rem;
        gap: 0.6rem;
    }
}

/* --------- Contrôles de taille de texte (TOC sidebar) --------- */
.toc__reading-controls {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.78rem;
    color: var(--color-text-muted);
}
.toc__reading-label {
    display: block;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.toc__reading-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.toc__reading-btn {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.25rem 0.55rem;
    cursor: pointer;
    font: inherit;
    color: var(--color-text);
    font-weight: 600;
    line-height: 1.1;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.toc__reading-btn:hover,
.toc__reading-btn:focus-visible {
    background: var(--color-bg-alt);
    border-color: var(--color-massa-blue);
    color: var(--color-massa-blue);
    outline: none;
}
.toc__reading-value {
    min-width: 3.5em;
    text-align: center;
    color: var(--color-text);
    font-weight: 500;
}

/* Modifieurs de taille appliqués à .reading */
.reading.text-small {
    font-size: 0.92rem;
}
.reading.text-small h2 { font-size: 1.65rem; }
.reading.text-small h3 { font-size: 1.25rem; }

.reading.text-large {
    font-size: 1.13rem;
    line-height: 1.75;
}
.reading.text-large h2 { font-size: 2.1rem; }
.reading.text-large h3 { font-size: 1.5rem; }
.reading.text-large p,
.reading.text-large li { line-height: 1.75; }

/* Masquer en print pour ne pas imprimer la barre de contrôles */
@media print {
    .toc__reading-controls { display: none !important; }
}

/* --------- Barre de progression de lecture --------- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    z-index: 9998;
    pointer-events: none;
}
.reading-progress__fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--color-massa-orange), var(--color-massa-yellow));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 80ms linear;
}

/* --------- Tooltip bibliographique --------- */
.biblio-tooltip {
    position: absolute;
    z-index: 9990;
    width: min(440px, calc(100vw - 24px));
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 18px 40px -10px rgba(0,0,0,0.28);
    padding: 0.85rem 1rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-text);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
    --arrow-x: 50%;
}
.biblio-tooltip.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.biblio-tooltip::before {
    content: "";
    position: absolute;
    left: var(--arrow-x);
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
}
.biblio-tooltip[data-position="top"]::before {
    bottom: -6px;
    border-top: 0;
    border-left: 0;
}
.biblio-tooltip[data-position="bottom"]::before {
    top: -6px;
    border-bottom: 0;
    border-right: 0;
}
.biblio-tooltip__text {
    padding-right: 1.25rem;
}
.biblio-tooltip__text em,
.biblio-tooltip__text i { color: var(--color-text); }
.biblio-tooltip__jump {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.82rem;
    color: var(--color-massa-blue);
    text-decoration: none;
    font-weight: 600;
}
.biblio-tooltip__jump:hover { text-decoration: underline; }
.biblio-tooltip__close {
    position: absolute;
    top: 0.25rem;
    right: 0.4rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 1.3rem;
    line-height: 1;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
}
.biblio-tooltip__close:hover {
    background: var(--color-bg-alt);
    color: var(--color-text);
}

/* Petit flash sur la cible quand on clique "Voir dans la bibliographie" */
.biblio-flash {
    animation: biblioFlash 1.6s ease;
}
@keyframes biblioFlash {
    0%   { background: rgba(250, 186, 2, 0.45); }
    100% { background: transparent; }
}

/* --------- Tiroir TOC mobile --------- */
.toc-fab {
    display: none; /* visible uniquement en mobile */
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 9991;
    background: var(--color-massa-blue);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 0.6rem 1rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px -4px rgba(0,0,0,0.3);
    align-items: center;
    gap: 0.5rem;
}
.toc-fab svg {
    flex-shrink: 0;
}
.toc-fab:hover,
.toc-fab:focus-visible {
    background: var(--color-massa-orange);
    outline: none;
}
.toc-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 26, 38, 0.45);
    z-index: 9989;
    opacity: 0;
    transition: opacity 180ms ease;
}

@media (max-width: 1024px) {
    .toc-fab { display: inline-flex; }

    /* La TOC redevient un drawer latéral activé via body.toc-open */
    .toc {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        bottom: 0 !important;
        width: min(320px, 88vw);
        max-height: none !important;
        background: var(--color-white);
        z-index: 9990;
        padding: 1.25rem 1rem 1.25rem 1.25rem;
        box-shadow: -12px 0 30px -10px rgba(0,0,0,0.25);
        overflow-y: auto;
        transition: right 220ms ease;
        border-left: 1px solid var(--color-border);
    }
    body.toc-open .toc {
        right: 0 !important;
    }
    body.toc-open .toc-backdrop {
        display: block;
        opacity: 1;
    }
    body.toc-open {
        overflow: hidden;
    }
}

@media print {
    .reading-progress,
    .biblio-tooltip,
    .toc-fab,
    .toc-backdrop { display: none !important; }
}
