/* ============================================================
   Éthique des Algorithmes de Recommandation
   Style éditorial — sérif Newsreader + accent ambre
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Newsreader:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
    --bg: #ffffff;
    --ink: #111111;
    --ink-soft: #2a2a2a;
    --ink-muted: #707070;
    --rule: #e8e8e8;
    --highlight: #faf6f0;
    --accent: #1a09b4;
    --accent-soft: #f3f2fe;
    --accent-border: #f4dfc1;

    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --serif: 'Newsreader', Georgia, 'Times New Roman', serif;

    --measure: 42rem;
    --measure-wide: 60rem;
}

html.dark-mode {
    --bg: #000000;
    --ink: #f5f5f5;
    --ink-soft: #d4d4d4;
    --ink-muted: #888888;
    --rule: #262626;
    --highlight: #111111;
    --accent: #f59e0b;
    --accent-soft: #1a1408;
    --accent-border: #3d2c10;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-soft);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
header {
    border-bottom: 1px solid var(--ink);
    padding: 2.25rem 2rem 1.75rem;
}

.header-inner {
    max-width: var(--measure-wide);
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.eyebrow {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    margin-bottom: 0.5rem;
}

header h1 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(1.85rem, 3.5vw, 2.5rem);
    line-height: 1.1;
    color: var(--ink);
    letter-spacing: -0.01em;
    max-width: 28ch;
}

header .subtitle {
    font-family: var(--serif);
    font-style: italic;
    color: var(--ink-muted);
    font-size: 1.05rem;
    margin-top: 0.55rem;
    max-width: 50ch;
    font-weight: 400;
}

/* ---------- Theme toggle (pill + moon icon) ---------- */
.theme-toggle-btn {
    background: transparent !important;
    border: 1px solid var(--ink) !important;
    color: var(--ink) !important;
    font-family: var(--sans) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 0.45rem 0.95rem !important;
    border-radius: 999px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    position: static !important;
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.theme-toggle-btn:hover {
    background: var(--ink) !important;
    color: var(--bg) !important;
}

.theme-toggle-btn:hover .theme-icon path {
    fill: var(--bg);
    stroke: var(--bg);
}

.theme-icon {
    display: block;
    flex-shrink: 0;
}

.theme-icon path {
    fill: var(--ink);
    stroke: var(--ink);
    transition: all 0.15s ease;
}

/* ---------- Navigation ---------- */
nav {
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    position: sticky;
    top: 0;
    z-index: 50;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: var(--measure-wide);
    margin: 0 auto;
    padding: 0 2rem;
}

nav ul li {
    position: relative;
}

nav ul li a {
    display: inline-block;
    padding: 0.95rem 1rem;
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

nav ul li a:hover {
    color: var(--ink);
}

nav ul li a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

nav ul li .dropdown-toggle::after {
    content: ' ▾';
    font-size: 0.75em;
    margin-left: 2px;
    color: var(--ink-muted);
}

nav ul li .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg);
    border: 1px solid var(--rule);
    min-width: 240px;
    z-index: 100;
    padding: 0.4rem 0;
    border-radius: 4px;
}

nav ul li:hover .dropdown-menu,
nav ul li:focus-within .dropdown-menu {
    display: block;
}

nav ul li .dropdown-menu a {
    display: block;
    padding: 0.55rem 1.2rem;
    font-size: 13.5px;
    border-bottom: none;
    margin-bottom: 0;
    color: var(--ink-soft);
    font-weight: 400;
}

nav ul li .dropdown-menu a:hover {
    background: var(--highlight);
    color: var(--accent);
    border-bottom-color: transparent;
}

/* ---------- Main column ---------- */
main {
    max-width: var(--measure-wide);
    margin: 0 auto;
    padding: 3.5rem 2rem 5rem;
}

/* ---------- Typography ---------- */
h2 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(1.55rem, 2.6vw, 1.95rem);
    line-height: 1.2;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin: 3.5rem 0 1rem;
}

main>h2:first-of-type,
h2:first-child {
    margin-top: 0;
}

h2[data-num]::before {
    content: attr(data-num);
    display: block;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h3 {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ink);
    margin: 2rem 0 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

h2+h3 {
    margin-top: 1rem;
}

h4 {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink);
    margin: 1.5rem 0 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--ink-soft);
    text-wrap: pretty;
}

p strong,
li strong {
    color: var(--ink);
    font-weight: 600;
}

em {
    color: var(--ink);
    font-style: italic;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: opacity 0.15s;
}

a:hover {
    opacity: 0.7;
}

ul,
ol {
    margin: 0 0 1.25rem 1.25rem;
    padding-left: 0;
}

ul {
    list-style: disc;
}

ul li,
ol li {
    margin-bottom: 0.5rem;
    color: var(--ink-soft);
    padding-left: 0.25rem;
}

ul li::marker {
    color: var(--accent);
}

/* ---------- Lede & blockquote ---------- */
.lede {
    font-family: var(--serif);
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--ink);
    margin-bottom: 2rem;
    font-weight: 400;
}

blockquote {
    font-family: var(--serif);
    font-size: 1.2rem;
    line-height: 1.45;
    color: var(--ink);
    margin: 2rem 0;
    padding: 0.25rem 0 0.25rem 1.4rem;
    border-left: 2px solid var(--accent);
    background: transparent !important;
    font-weight: 400;
    font-style: italic;
}

.central-question {
    font-family: var(--serif);
    font-size: 1.35rem;
    line-height: 1.4;
    color: var(--ink);
    padding: 1.75rem 0;
    margin: 2rem 0;
    border-top: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
    font-weight: 500;
}

.central-question .label {
    display: block;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-style: normal;
}

/* ---------- Tables ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.94rem;
    border-top: 1px solid var(--ink);
}

table th,
table td {
    padding: 0.85rem 1rem 0.85rem 0;
    text-align: left;
    vertical-align: top;
    border: none;
    border-bottom: 1px solid var(--rule);
    color: var(--ink-soft);
}

table th {
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table td:first-child,
table th:first-child {
    padding-left: 0;
}

table td:last-child,
table th:last-child {
    padding-right: 0;
}

table td strong {
    color: var(--ink);
}

/* ---------- Stakeholder list ---------- */
.stakeholders {
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.stakeholders>li {
    list-style: none;
    padding: 1.3rem 0;
    border-top: 1px solid var(--rule);
    display: grid;
    grid-template-columns: 1fr 2.5fr;
    gap: 2rem;
}

.stakeholders>li::marker {
    content: '';
}

.stakeholders>li:last-child {
    border-bottom: 1px solid var(--rule);
}

.stakeholders>li>strong {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--ink);
    display: block;
}

.stakeholders>li>.desc {
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ---------- Figures ---------- */
figure {
    margin: 2rem 0;
    text-align: center;
}

figure img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--rule);
    border-radius: 2px;
    background: var(--bg);
    padding: 0.5rem;
}

figcaption {
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--ink-muted);
    margin: 0.6rem auto 0;
    text-align: left;
    max-width: 60ch;
}

/* ---------- Details (les éthiques) ---------- */
details {
    border-top: 1px solid var(--ink);
    padding: 0;
    margin: 0;
}

details:last-of-type {
    border-bottom: 1px solid var(--ink);
}

details>summary {
    cursor: pointer;
    list-style: none;
    padding: 1.4rem 0;
    margin: 0;
    border: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: color 0.15s;
}

details>summary:hover {
    color: var(--accent);
}

details>summary::-webkit-details-marker {
    display: none;
}

details>summary::after {
    content: '+';
    margin-left: auto;
    font-size: 1.5rem;
    color: var(--accent);
    line-height: 1;
    font-weight: 400;
}

details[open]>summary::after {
    content: '–';
}

details>summary h2 {
    display: inline;
    border: none;
    margin: 0;
    padding: 0;
    font-size: 1.3rem;
    flex: 1;
}

details>summary h2::before {
    display: none;
}

.eth-num {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    min-width: 1.5rem;
    letter-spacing: 0.08em;
}

details>.details-body {
    padding: 0 0 2rem;
}

.section-separator {
    display: none;
}

/* ---------- Team grid ---------- */
.team-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.5rem 1.5rem;
    margin-top: 2.5rem;
    justify-items: center;
}

.team-member {
    background: transparent;
    border: none;
    padding: 0;
    text-align: center;
    box-shadow: none;
    width: 100%;
    max-width: 160px;
}

.team-member img {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 0;
    object-fit: cover;
    border: 1px solid var(--rule);
    margin: 0 0 0.85rem 0;
    display: block;
}

.team-member h3 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--ink);
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}

.team-member p {
    font-size: 12px;
    color: var(--ink-muted);
    margin-top: 0.2rem;
    text-align: center;
}

/* ---------- Footer ---------- */
footer {
    border-top: 1px solid var(--rule);
    padding: 2rem;
    text-align: center;
    color: var(--ink-muted);
    background: var(--bg);
    margin-top: 4rem;
    font-size: 13px;
}

footer p {
    margin: 0;
    color: var(--ink-muted);
}

/* ---------- Section anchors ---------- */
.section-anchor {
    scroll-margin-top: 80px;
}

/* ---------- Article meta ---------- */
.article-meta {
    font-size: 12px;
    color: var(--ink-muted);
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--rule);
}

/* ---------- References ---------- */
.references {
    margin-top: 1.5rem;
    padding-left: 0;
    counter-reset: ref;
    list-style: none;
}

.references li {
    list-style: none;
    padding-left: 2.25rem;
    position: relative;
    border-top: 1px solid var(--rule);
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    margin: 0;
    font-size: 0.93rem;
}

.references li::before {
    counter-increment: ref;
    content: counter(ref, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0.9rem;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.05em;
}

.references li:last-child {
    border-bottom: 1px solid var(--rule);
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
    header {
        padding: 1.75rem 1.25rem 1.25rem;
    }

    main {
        padding: 2rem 1.25rem 3rem;
    }

    nav ul {
        padding: 0 0.5rem;
    }

    nav ul li a {
        padding: 0.85rem 0.7rem;
        font-size: 13px;
    }

    nav ul li .dropdown-menu {
        left: 0;
        transform: none;
    }

    .stakeholders>li {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .central-question {
        font-size: 1.15rem;
    }

    blockquote {
        font-size: 1.1rem;
    }

    .team-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- Dark mode ---------- */
html.dark-mode figure img {
    background: var(--bg);
    border-color: var(--rule);
    filter: invert(0.92) hue-rotate(180deg);
}