﻿/* ======================== 1. RESET & GLOBALE ======================== */
@import url("https://use.typekit.net/yem4moh.css");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

::selection {
    background-color: #00FF00;
    color: #000000;
}

::-moz-selection {
    background-color: #00FF00;
    color: #000000;
}

body {
    font-family: "arial", sans-serif;
    font-size: 16px; 
    line-height: 1.5;
    background-color: #FFFFFF; 
    color: #000000;
    min-height: 100vh;
    padding: 64px;
    display: flex;
    flex-direction: column;
    transition: padding 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@font-face {
    font-family: 'Impact';
    src: url('../font/impact.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* Global Typography Rules */
p, li, blockquote, figcaption {
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphenate-limit-chars: 6 3 3;
    hyphenate-limit-lines: 2;
    orphans: 3;
    widows: 3;
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
    text-wrap: pretty;
}

/* --- CORRECTIF POUR LES PARAGRAPHES DANS LES CITATIONS --- */
.boite-texte blockquote p {
    font-family: "Times New Roman", Times, serif;
}

body.home-page {
    height: 100vh;
    overflow: hidden;
}

/* SUPPRESSION BORDURES IMAGES */
img:not(#cursor-tooltip img),
.img-grid img,
.side-note-figure img {
    border: none !important;
}

/* ======================== 2. STYLE GÉNÉRAL BOUTONS & LIENS ======================== */
/* Style par défaut "Bouton Vert" pour les liens de navigation */
a,
.btn-arrow,
.note-link,
.back-link,
.ref-link,
.btn-sub {
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    background-color: #00FF00;
    color: #000000;
    border: 1px solid #000000;
    padding: 4px 6px 2px 6px; /* PADDING UNIFIÉ */
    line-height: 1.2;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* --- EXCEPTION : LIENS DANS LE TEXTE DES NOTES (URLS) --- */
/* Ils doivent ressembler à du texte normal, pas à des boutons */
.footnote-item p a,
.side-note-item a[target="_blank"] {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: #000000 !important;
    text-decoration: underline !important;
    display: inline !important;
    font-weight: normal !important;
}
.footnote-item p a:hover,
.side-note-item a[target="_blank"]:hover {
    color: #00FF00 !important; /* Petit effet au survol */
    background-color: transparent !important;
}

/* --- BOUTONS SOUS-NAVIGATION (Ancres) --- */
.btn-sub {
    background-color: #FFFFFF; /* Inactif */
    color: #000000;
    text-align: left;
    font-size: 14px;
    width: fit-content;
    max-width: 90%;
}

/* État Survol */
.btn-sub:hover {
    background-color: #FFFFFF !important;
    color: #000000 !important;
    border-color: #000000 !important;
    text-decoration: none !important;
}

/* État Actif */
.btn-sub.active {
    background-color: #00FF00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

/* HOVER GÉNÉRAL (Autres liens boutons) */
a:not(.footnote-item p a):hover,
.btn-arrow:hover,
.note-link:hover,
.back-link:hover,
.ref-link:hover {
    background-color: #FFFFFF !important;
    color: #000000 !important;
    border-color: #000000 !important;
    text-decoration: none !important;
}

/* ======================== 3. MENU & NAVIGATION ======================== */
.navbar {
    margin-bottom: 0;
    flex-shrink: 0;
    position: relative; 
    z-index: 10000;
    pointer-events: none; 
}

.nav-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    pointer-events: auto; 
}

.navbar a.active {
    background-color: #FFFFFF;
    color: #000000;
    border: 1px solid #000000;
}

/* ======================== 4. TITRES & LAYOUT ======================== */
.encadre,
.titre-page,
h1 {
    font-family: Impact, 'Anton', sans-serif;
    border: 1px solid #000000;
    background-color: #00FF00;
    color: #000000;
    padding: 4px 6px 2px 6px; /* PADDING UNIFIÉ */
    line-height: 1;
    display: inline-block;
    width: fit-content;
    text-align: left;
    margin: 0; /* PAS DE MARGIN TOP */
    transition: font-size 0.5s ease, padding 0.5s ease;
}

.encadre-titre {
    font-family: Arial, sans-serif;
    font-weight: regular;
    font-size: 14px; 
    border: 1px solid #000;
    background-color: #00FF00;
    padding: 4px 6px 2px 6px; /* PADDING UNIFIÉ */
    display: inline-block;
    margin-bottom: 24px;
    margin-top: 0;
}

.rainbow-bg {
    background: linear-gradient(to right, #ff0000, #ffd500, #ffff00, #00ff00, #00ffff, #ff00ff);
    color: #000;
    font-family: "Comic Sans MS", "Comic Neue", cursive, sans-serif;
    font-size: 14px;
}

h1 {
    font-size: 80px;
    font-weight: 400;
}

h2 {
    font-family: Arial, sans-serif;
    font-size: 28px; 
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 24px;
    transition: font-size 0.5s ease, padding 0.5s ease;
}

h3 {
    font-family: Arial, sans-serif;
    font-size: 22px; 
    font-weight: bold;
    margin-bottom: 16px;
    line-height: 1.3;
}

.header-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px; 
    flex-shrink: 0;
    position: relative;
    z-index: 10000;
    pointer-events: none;
    margin-top: 15px; /* MARGIN TOP 15PX */
}
.header-main h1, .header-main h2 { pointer-events: auto; margin-top: 0; }

/* LAYOUT COLUMNS */
.main-layout {
    display: flex;
    flex-direction: row;
    gap: 80px;
    margin-top: 15px; 
    padding-bottom: 0;
    align-items: stretch; /* Permet à la colonne titre de prendre toute la hauteur */
    transition: gap 0.5s ease, margin 0.5s ease;
    position: relative;
    z-index: 10000;
    pointer-events: none;
}

.col-titre, .col-contenu, .boite-texte, a, button, input {
    pointer-events: auto;
}

.col-titre {
    flex: 0 0 auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: padding 0.5s ease;
    width: fit-content; 
    min-width: 140px; 
    max-width: 180px; 
    position: relative; 
}

.visual-caption {
    font-family: Arial, sans-serif;
    font-size: 11px;
    color: #000000;
    margin-top: 10px;
    line-height: 1.2;
    padding-top: 4px;
}

.sticky-zone {
    position: sticky;
    top: 15px;
    z-index: 100;
    margin-bottom: 32px;
}

.visual-wrapper {
    position: relative;
    z-index: 1; 
}

.titre-page {
    font-size: 50px;
    margin-bottom: 15px; 
}

.sub-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.col-contenu {
    width: 100%;
    max-width: 1000px;
    flex: 1;
    margin-left: auto;
}

.article-section {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 32px;
    margin-bottom: 64px;
    scroll-margin-top: 32px;
}

.text-col {
    flex: 1;
    max-width: 1000px;
}

/* BOITE TEXTE */
.boite-texte {
    border: 1px solid #000000;
    padding: 32px;
    background-color: rgba(255, 255, 255, 0.95); 
    text-align: left;
    transition: padding 0.5s ease;
    position: relative;
    z-index: 20; 
}

.boite-texte p {
    font-family: Arial, sans-serif;
    font-size: 16px; 
    line-height: 1.6;
    margin-bottom: 16px;
    text-align: left;
    orphans: 3;
    widows: 3;
    hyphens: auto;
    -webkit-hyphens: auto;
    hyphenate-limit-chars: 6 3 3;
    hyphenate-limit-lines: 2;
    hyphenate-limit-last: none;
    text-wrap: pretty;
}

blockquote {
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    font-size: 18px; 
    line-height: 1.4;
    border-left: 4px solid #00FF00;
    margin: 32px 0;
    padding-left: 24px;
    color: #000;
    text-align: left;
    orphans: 3;
    widows: 3;
}

em, i { font-style: italic; }

.navigation-bottom {
    display: flex;
    justify-content: flex-end;
    margin-top: 32px;
    gap: 12px;
}

.btn-arrow {
    font-size: 24px;
    padding: 4px 12px 6px 12px;
}

/* ======================== 5. GALERIE HOME (Mèmes) ======================== */
.meme-gallery {
    position: fixed; 
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0; 
    overflow: hidden;
    margin: 0;
    pointer-events: auto;
}

.draggable {
    position: absolute;
    cursor: grab;
    user-select: none;
    z-index: 100;
    touch-action: none;
    transition: none; 
    transform: scale(0.6); 
    transform-origin: center;
}
.draggable.is-dragging { cursor: grabbing; }

.trail-clone {
    position: absolute;
    z-index: 1; 
    pointer-events: none;
    transform: scale(0.6);
    transform-origin: center;
    opacity: 1;
    transition: none; 
}

.meme-text-wrapper {
    padding: 4px 6px 2px 6px; /* PADDING UNIFIÉ */
    width: fit-content;
    border: 1px solid #000000;
    background-color: #ffffff;
}

.meme-input {
    border: none;
    font-family: Impact, 'Anton', sans-serif;
    font-size: 40px;
    color: rgb(255, 255, 255);
    text-transform: uppercase;
    text-align: center;
    background: transparent;
    min-width: 150px;
    width: auto;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000;
    transition: font-size 0.5s ease;
}

.footer-info-container {
    margin-top: auto;
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    align-items: flex-end; 
    position: relative;
    z-index: 10000;
    pointer-events: none;
    width: 100%; 
}

.texte-encadre-italic {
    font-style: italic;
    text-align: right;
    border: 1px solid #000000;
    background-color: #00FF00;
    padding: 4px 6px 2px 6px; /* PADDING UNIFIÉ */
    transition: font-size 0.5s ease, padding 0.5s ease;
    pointer-events: auto;
    margin-left: auto; 
    font-size: 14px;
}

/* ======================== 6. NOTES DE BAS DE PAGE ======================== */
.note-link {
    position: relative;
    display: inline-block;
    background-color: #00FF00;
    color: #000000;
    border: 1px solid #000000;
    font-size: 11px; 
    font-weight: bold;
    padding: 0 4px;
    margin-left: 2px;
    line-height: 1;
    vertical-align: super;
    cursor: pointer;
    transition: background-color 0.2s;
    scroll-margin-top: 150px;
}

/* AJOUT : .has-custom-tooltip pour cacher le span tooltip par défaut */
.note-link .tooltip,
.ref-link .tooltip,
.has-custom-tooltip .tooltip { 
    display: none !important; 
}

.footnotes-container {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #000;
}

.footnote-item {
    font-family: Arial, sans-serif;
    font-size: 12px; 
    margin-bottom: 8px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
    scroll-margin-top: 150px;
    margin-left: 0;
}
.footnote-item p { 
    margin: 0; 
    font-size: 12px; 
    line-height: 1.4; 
}

/* MODIFICATION : STYLE BOUTON RETOUR SANS FLÈCHE */
.back-link {
    font-weight: bold;
    color: #000;
    background-color: #00FF00;
    padding: 0px 6px;
    border: 1px solid #000;
    text-decoration: none;
    font-size: 11px;
    transition: background-color 0.2s;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* SUPPRESSION DE LA FLÈCHE */
.back-link::after {
    content: ""; /* VIDE */
    margin-left: 0;
}

.back-link:hover {
    background-color: #FFFFFF;
    color: #000000;
}

/* ======================== 7. STYLES ACADÉMIQUES & ÉTUDES ======================== */
.style-academic {
    font-family: "Times New Roman", Times, serif;
    font-size: 18px; 
    line-height: 1.5;
    text-align: left;
}

.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 32px 0;
}
.img-grid img {
    width: 100%;
    height: auto;
    border: 1px solid #000 !important;
    display: block;
}

ul.style-academic {
    list-style: none;
    padding: 16px 16px 16px 24px;
    margin: 24px 0;
    border-left: 4px solid #00FF00;
    background-color: transparent;
}
ul.style-academic li { margin-bottom: 12px; font-size: 16px; }

blockquote.style-academic {
    border-left: 4px solid #00FF00;
    padding-left: 24px;
    margin: 32px 0;
    font-style: italic;
    font-size: 16px;
}

/* ======================== 8. CARTES COMPLÉMENTS ======================== */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 24px;
    margin-bottom: 64px;
}

.card-onepage {
    border: 1px solid #000000;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    height: 100%;
    background-color: #FFFFFF;
    min-height: 140px; 
}

.card-tag {
    display: inline-block;
    width: fit-content;
    background-color: #00FF00;
    color: #000000;
    border: 1px solid #000000;
    padding: 4px 6px 2px 6px; /* PADDING UNIFIÉ */
    font-family: Arial, sans-serif;
    font-weight: 400;
    font-size: 12px;       
    line-height: 1;
    text-transform: none;
    margin-bottom: 16px;
}

.card-onepage h3 {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 18px; 
    margin: 0 0 24px 0; 
    text-decoration: underline;
    text-decoration-color: #00FF00;
    text-underline-offset: 3px;
    line-height: 1.3;
    color: #000;
    text-transform: none;
}

.card-onepage .btn-arrow {
    font-size: 12px !important;
    padding: 4px 8px !important;
    align-self: flex-start;
    margin-top: auto; 
    line-height: 1.2;
}
.card-onepage .btn-arrow:hover {
    background-color: #fff !important;
    color: #000 !important;
}

.card-desc {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 16px;
    color: #000;
}

/* ======================== 9. CHAT STYLES (Maxicat) ======================== */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 12px; 
    width: 100%;
    margin-top: 32px;
}

.chat-row {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.chat-row.romane {
    align-self: flex-end;
    text-align: right;
}
.chat-row.romane .chat-content {
    background-color: transparent; 
    border: 1px solid #000;        
    padding: 4px 6px 2px 6px;
    font-family: "Times New Roman", Times, serif; 
    font-style: italic;
    font-size: 14px; 
    color: #000;
    width: fit-content;
    margin-left: auto; /* Pousse le contenu à droite */
}

.chat-row.maxicat {
    align-self: flex-start;
    align-items: flex-start; 
}
.chat-row.maxicat .chat-content {
    background-color: transparent; 
    border: 1px solid #000;        
    padding: 4px 6px 2px 6px;
    font-family: Arial, sans-serif;
    font-size: 14px; 
    line-height: 1.4;
    text-align: left;
    width: fit-content;
}

/* Didascalie */
.didascalie {
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    font-weight: lighter;
    font-size: 13px;
    margin-top: 32px;
    line-height: 1.4;
    column-span: all;
}

/* Style des noms d'intervenants */
.speaker-label {
    font-family: Arial, sans-serif;
    font-size: 12px; 
    font-weight: bold;
    text-transform: none; 
    margin-bottom: 4px;
    color: #000;
    width: 100%;
}

.chat-row.romane .speaker-label {
    text-align: right;
}

.chat-row.maxicat .speaker-label {
    text-align: left;
}

.chat-row.paul {
    align-self: flex-start;
    align-items: flex-start; 
}
.chat-row.paul .chat-content {
    background-color: transparent; 
    border: 1px solid #000;        
    padding: 4px 6px 2px 6px;
    font-family: Arial, sans-serif;
    font-size: 14px; 
    line-height: 1.4;
    text-align: left;
    width: fit-content;
}
.chat-row.paul .speaker-label {
    text-align: left;
}

.chat-row .chat-content + .chat-content {
    margin-top: 6px;
}

/* Styles pour le visuel Hopecore */
.hopecore-image-container {
    position: relative;
    width: 100%;
}

.hopecore-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.hopecore-input {
    position: absolute;
    background-color: #000;
    color: #fff;
    border: none;
    font-family: Impact, 'Anton', sans-serif;
    text-transform: uppercase;
    text-align: center;
    padding: 2px 5px;
    font-size: 14px; /* Ajustez la taille de la police si nécessaire */
    box-sizing: border-box;
}

.remerciements-page {
    background-image: none;
}

/* Contexte de l'entretien */
.intro-full-width {
    width: 100%;
    margin-bottom: 0;
    border: none;
    padding: 0;
    column-count: 2;
    column-gap: 48px;
}
.intro-full-width p, 
.intro-full-width div {
    font-size: 16px; 
    line-height: 1.5;
}

.intro-title {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 14px;
    text-decoration: underline;
    text-decoration-color: #00FF00;
    margin-bottom: 12px;
    margin-top: 32px;
    column-span: all;
}
.intro-title:first-child { margin-top: 0; }

.info-card {
    border: 1px solid #000;
    padding: 4px 6px 2px 6px;
    margin-bottom: -1px;
    background-color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    width: fit-content;
    line-height: 1.5;
}

.synthesis-item {
    margin-bottom: 24px;
    border: none;
    background: transparent;
    padding: 0;
}
.synthesis-title {
    font-weight: bold;
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-decoration: underline;
    text-decoration-color: #00FF00;
    margin-bottom: 6px;
    display: block;
    text-transform: none;
}
.synthesis-text {
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.4;
}
.synthesis-quote {
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    border-left: 2px solid #00FF00;
    padding-left: 8px;
    margin: 6px 0;
    font-size: 14px;
}
.chat-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #000;
    margin-top: 8px;
}

/* ======================== 10. ONE-PAGE STRUCTURE ======================== */
/* AJOUT: .header-split avec margin-top: 15px */
.header-split {
    display: flex; flex-direction: row; align-items: flex-start; gap: 24px; margin-bottom: 15px; flex-wrap: wrap;
    margin-top: 15px; /* MARGIN TOP 15PX AJOUTÉ */
}
.header-def {
    font-family: Arial, sans-serif; font-size: 14px; line-height: 1.4; color: #000; max-width: 320px; text-align: left;
}
.paper-wrapper { max-width: 1400px; margin: 0; display: flex; flex-direction: column; gap: 0px; }
.paper-section { display: grid; grid-template-columns: 1fr 200px; gap: 48px; align-items: start; position: relative; margin-bottom: 25px; }
p {
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphenate-limit-chars: 6 3 3;
    hyphenate-limit-lines: 2;
    hyphenate-limit-last: none;
    orphans: 3;
    widows: 3;
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
    text-wrap: pretty;
}

.paper-text-col {
    column-width: 350px; column-gap: 48px; text-align: justify; 
    font-family: Arial, sans-serif; 
    font-size: 16px; 
    line-height: 1.6; color: #000; orphans: 3; widows: 3;
    text-rendering: optimizeLegibility;
    text-wrap: pretty;
}

.paper-text-col p {
    margin-bottom: 16px;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
    
    /* Limites de césure renforcées */
    -webkit-hyphenate-limit-chars: 10 4 4;
    hyphenate-limit-chars: 10 4 4;
    
    -webkit-hyphenate-limit-lines: 2;
    -ms-hyphenate-limit-lines: 2;
    hyphenate-limit-lines: 2;
    
    -webkit-hyphenate-limit-last: always;
    hyphenate-limit-last: always;
}

/* Pas de césure sur la première ligne d'un paragraphe */
.paper-text-col p::first-line {
    -webkit-hyphens: none !important;
    -ms-hyphens: none !important;
    hyphens: none !important;
}
.paper-text-col p { margin-bottom: 16px; }

.paper-text-col h3 {
    font-family: Arial, sans-serif; 
    font-weight: bold; 
    font-size: 14px; 
    margin-top: 24px; 
    margin-bottom: 8px; 
    text-decoration: underline; 
    text-decoration-color: #00FF00; 
    text-underline-offset: 3px; 
    break-after: avoid;
    break-inside: avoid;
    column-span: all;
}

.paper-notes-col { padding-top: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 32px; }

.side-note-item {
    font-family: Arial, sans-serif; 
    font-size: 9.5px; 
    line-height: 1.3; 
    text-align: left; color: #000; margin-left: 0; width: fit-content;
    scroll-margin-top: 150px; 
}
.side-note-figure {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-left: 0; margin-bottom: 8px; width: fit-content;
}
.side-note-num {
    display: inline-block; font-weight: bold; background-color: #00FF00; border: 1px solid #000; padding: 0 4px; min-width: 18px; text-align: center; height: fit-content; font-size: 11px; margin-bottom: 2px; line-height: 1.2;
}
.side-note-figure img {
    max-width: 120px; width: auto; height: auto; border: 1px solid #000; display: block;
}
.figure-caption {
    font-family: Arial, sans-serif; font-size: 11px; font-style: italic; max-width: 120px; line-height: 1.2; margin-top: 4px;
}
.ref-link {
    font-size: 11px; font-weight: bold; color: #000; background-color: #00FF00; border: 1px solid #000; padding: 0 4px; text-decoration: none; vertical-align: super; margin-left: 1px; cursor: help;
    scroll-margin-top: 150px; 
}
.ref-link:hover { background-color: #FFFFFF; }

body.page-unique .paper-text-col h2 {
    column-span: all; display: block; width: fit-content; background-color: #00FF00; color: #000000; border: 1px solid #000000; 
    padding: 4px 6px 2px 6px; /* PADDING UNIFIÉ */
    font-weight: 400; font-size: 14px; margin-top: 0; margin-bottom: 24px; line-height: 1.2; text-transform: none;
    text-align: left; /* Alignement gauche forcé */
}
body.page-unique .paper-quote {
    font-family: "Times New Roman", Times, serif; font-style: italic; font-size: 18px; line-height: 1.4; margin: 32px 0; color: #000; text-align: left; margin-left: 24px; hyphens: none; border: none; background-color: transparent; padding: 0; width: auto; 
}
body.page-unique .paper-notes-col { padding-top: 54px; }

/* --- MODIF: FORCE UNE SEULE COLONNE POUR LES PAGES D'INTERVIEW --- */
body.interview-page .paper-text-col {
    column-count: 1 !important;
}

/* ALIGNEMENT GAUCHE POUR INTERVIEW */
body.interview-page .paper-wrapper {
    margin: 0;
}

/* ======================== 11. RESPONSIVE GLOBAL ======================== */
@media (max-width: 900px) {
    body { padding: 20px; }
    h1 { font-size: 13vw; }
    .titre-page { font-size: 10vw; }
    .main-layout { flex-direction: column; gap: 30px; margin-top: 15px; }
    .header-main { margin-top: 15px; }
    .col-titre { position: static; width: 100%; border-bottom: none; padding-bottom: 20px; }
    .col-contenu { width: 100%; flex: 1; margin-left: 0; }
    .sub-nav { flex-direction: row; flex-wrap: wrap; }
    .header-main h2 { font-size: 16px; padding: 4px 6px; }
    .boite-texte { padding: 15px; }

    .footer-info-container { 
        font-family: Arial, sans-serif; font-size: 10px; margin-bottom: 0px; padding-bottom: 2px; line-height: 1.1; align-items: flex-start; gap: 4px; text-align: left; margin-left: 40px;
    }
    
    .texte-encadre-italic { 
        font-size: 12px; padding: 4px 6px; margin-left: auto; 
    }

    .draggable { max-width: 40vw; height: auto; }
    
    /* Repositionnement mobile pour éviter le dépassement tout en gardant l'aspect aléatoire */
    .meme-gallery .draggable:nth-child(1) { top: 28% !important; left: 2% !important; }
    .meme-gallery .draggable:nth-child(2) { top: 38% !important; left: 55% !important; }
    .meme-gallery .draggable:nth-child(3) { top: 48% !important; left: 62% !important; }
    .meme-gallery .draggable:nth-child(4) { top: 55% !important; left: 2% !important; }
    .meme-gallery .draggable:nth-child(5) { top: 62% !important; left: 30% !important; }
    .meme-gallery .draggable:nth-child(6) { top: 25% !important; left: 60% !important; }
    .meme-gallery .draggable:nth-child(7) { top: 72% !important; left: 5% !important; }
    .meme-gallery .draggable:nth-child(8) { top: 42% !important; left: 5% !important; }
    .meme-gallery .draggable:nth-child(9) { top: 78% !important; left: 50% !important; }
    .meme-gallery .draggable:nth-child(10) { top: 22% !important; left: 15% !important; } /* Input text */

    .meme-input { font-size: 24px; width: 160px;; }
    
    .footnote-item { 
        margin-left: 0 !important; 
        padding-left: 0 !important;
        align-self: flex-start !important; 
        align-items: flex-start !important; 
        justify-content: flex-start; 
        width: 100%; 
        margin-top: 20px; 
    }
    
    .paper-wrapper { gap: 0px; }
    .paper-section { display: flex; flex-direction: column; margin-bottom: 48px; }
    .paper-text-col { column-count: 1; }
    .paper-notes-col { 
        position: static; 
        margin-top: 0; 
        margin-bottom: 32px; 
        display: flex; 
        flex-direction: column; 
        gap: 16px; 
    }
    
    body.page-unique .header-split { margin-bottom: 20px; }
    body.page-unique .paper-notes-col { padding-top: 24px; gap: 8px; }
    body.page-unique .side-note-item { margin-bottom: 4px; }
    
    .intro-full-width { column-count: 1 !important; }

    .grid-cards {
        grid-template-columns: 1fr;
    }

    /* Fix pour les listes qui dépassent */
    ul.style-academic {
        width: 100%;
        box-sizing: border-box;
        padding-right: 0; /* Évite le dépassement à droite */
        overflow-wrap: break-word; /* Césure des mots longs */
    }

    /* Images plus petites sur mobile (pas plein écran) */
    .img-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Permet 2 images par ligne */
        gap: 10px;
    }
}

/* ======================== 12. TOOLTIP ======================== */
#cursor-tooltip {
    position: fixed; 
    top: 0; left: 0;
    background-color: #FFFFFF;
    color: #000000;
    border: 1px solid #000000;
    padding: 6px 10px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.3;
    z-index: 2147483647; 
    pointer-events: none; 
    box-shadow: none !important; 
    display: none;
    transition: none !important;
    max-width: 300px;
}

#cursor-tooltip.is-image {
    background-color: transparent !important; 
    border: none !important;
    padding: 0 !important;
    width: auto !important; 
}
#cursor-tooltip.is-image img {
    border: none !important;
    display: block;
    height: 8em !important; /* MODIFICATION : HAUTEUR AUGMENTÉE A 8em */
    width: auto;
    max-width: none;
    object-fit: contain;
}

.inline-tooltip-img {
    height: 4.5em; 
    width: auto;
    vertical-align: middle;
    margin: 0 4px;
    border: 1px solid #000;
    display: inline-block;
    cursor: help;
}

.back-link-num {
    display: inline-block;
    font-weight: bold;
    background-color: #00FF00;
    border: 1px solid #000;
    padding: 0 4px;
    min-width: 18px;
    text-align: center;
    height: fit-content;
    font-size: 11px;
    margin-bottom: 2px;
    line-height: 1.2;
    color: #000;
    text-decoration: none;
    cursor: pointer;
}
.back-link-num:hover {
    background-color: #000;
    color: #FFF;
    border-color: #000;
}

@media (max-width: 900px) {
    #cursor-tooltip {
        top: auto !important; 
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 90%; 
        max-width: 350px;
        text-align: center;
        box-shadow: none !important;
        /* MODIFICATIONS POUR LA LISIBILITÉ SUR MOBILE */
        background-color: #FFFFFF !important;
        border: 1px solid #000000 !important;
        padding: 10px !important;
    }
    #cursor-tooltip.active { display: block !important; }
    
    /* Pour les images sur mobile, on garde le fond blanc et la bordure */
    #cursor-tooltip.is-image {
        background-color: #FFFFFF !important;
        border: 1px solid #000000 !important;
        width: auto !important;
        min-width: 200px;
    }
}

/* ======================== NOUVEAUX STYLES VISUELS ======================== */
.visual-wrapper {
    width: 100%;
    /* Plus de flex gap car position absolue */
    /* position: relative; SUPPRIMÉ pour que les visuels se réfèrent à .col-titre */
    /* z-index: 1; DÉPLACÉ sur .visual-block */
}

.visual-block {
    width: 100%;
    position: absolute;
    left: 0;
    top: 0; /* Sera modifié par JS */
    z-index: 1; /* En dessous de la boite texte */
}

/* Espacement spécifique SUPPRIMÉ car géré par JS */
/* #visu-rate { margin-top: 400px; } */

.parallax-container {
    position: relative;
    width: 100%;
    height: auto; /* Hauteur automatique basée sur l'image de fond */
    line-height: 0; /* Supprime l'espace blanc sous les images inline */
    font-size: 0;   /* Supprime l'espace blanc sous les images inline */
    /* Perspective cavalière stricte (projection oblique) :
       - Pas de perspective (point de fuite)
       - Pas de rotation du conteneur (face avant non déformée)
       - L'effet de profondeur est géré uniquement par le décalage X/Y dans le script
    */
    transform: none;
    transform-style: preserve-3d;
    border: none; /* Bordure retirée */
    background: transparent; /* Fond transparent */
    overflow: visible; /* Permettre de voir les éléments sortir si besoin */
}

.parallax-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    display: block; /* Supprime le comportement inline */
    transition: transform 0.1s linear; /* Plus fluide pour le scroll */
    will-change: transform;
}

.parallax-bg {
    position: relative !important; /* Devient relative pour donner la hauteur au conteneur */
    z-index: 2; /* Passe devant */
    transform: translateZ(0px);
}

.parallax-fg {
    z-index: 1; /* Passe derrière */
    transform: translateZ(-40px); /* Décalage initial en Z (arrière) */
    /* box-shadow retiré car derrière */
}

.slider-container {
    width: 100%;
    border: none; /* Bordure retirée */
    padding: 0; /* Padding retiré pour réduire l'écart */
    background: transparent; /* Fond transparent */
    margin-top: 5px; /* Petit espacement seulement */
}

.slider-container img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 5px; /* Réduit */
}

.slider-container .controls {
    text-align: center;
}

.slider-container label {
    font-family: Arial, sans-serif;
    font-size: 12px;
    display: block;
    margin-bottom: 0; /* Réduit car vide souvent */
    height: 0; /* Force height 0 si vide */
    overflow: hidden;
}

.slider-container input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    height: 35px; /* Espace suffisant */
    margin: 0;
}

/* TRACK (Barre) : Rectangle avec bordure, hauteur 29px */
.slider-container input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 29px; 
    background: #ffffff;
    border: 1px solid #000000;
    cursor: pointer;
}

.slider-container input[type="range"]::-moz-range-track {
    width: 100%;
    height: 29px;
    background: #ffffff;
    border: 1px solid #000000;
    cursor: pointer;
}

/* THUMB (Molette) : Rectangle noir, même hauteur que track */
.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 29px; /* Augmenté de 2px pour couvrir les bordures */
    width: 40px; 
    background: #000000;
    cursor: pointer;
    margin-top: -1px; /* Centrage pour couvrir les bordures : (27px content - 29px thumb) / 2 */
    border: none;
    border-radius: 0;
}

.slider-container input[type="range"]::-moz-range-thumb {
    height: 29px; /* Augmenté de 2px */
    width: 40px;
    background: #000000;
    cursor: pointer;
    border: none;
    border-radius: 0;
    transform: translateY(0px); 
}

/* Masquer le slider de parallaxe sur Desktop */
#visu-grammaire .slider-container {
    display: none;
}

/* --- GRID 6x2 EFFECT (Visuel Partie 2) --- */
.grid-container-6x2 {
    display: grid;
    grid-template-columns: repeat(4, 40px); /* Réduit à 4 colonnes */
    grid-template-rows: repeat(2, 40px);
    width: max-content;
    margin: 0 auto; /* Centré */
    padding: 10px;
    margin-bottom: 20px; /* Marge réduite pour rapprocher la légende */
    margin-top: 80px; /* Marge augmentée pour descendre le visuel */
}

.grid-cell {
    position: relative;
    width: 60px; /* Taille fixe comme le 2ème visuel */
    height: 60px;
    margin-left: -10px; /* Chevauchement manuel */
    margin-top: -10px;
    transform: translate(var(--tx, 0px), var(--ty, 0px));
}

/* Décalage de la ligne du haut vers la gauche */
.grid-cell.row-1 {
    margin-left: -25px; /* Décalage en px */
}

.img-back, .img-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* box-shadow supprimé */
}

.img-back {
    z-index: 1;
}

.img-front {
    z-index: 2;
    transition: opacity 1s ease-in-out; /* Durée augmentée pour plus de fluidité */
}

/* Animation de stack supprimée car remplacée par flux JS */


/* On réapplique les délais de séquence via variable pour combiner avec le délai de cellule */
.stack-img.seq-1 { --seq-delay: 0s; }
.stack-img.seq-2 { --seq-delay: 2s; }
.stack-img.seq-3 { --seq-delay: 4s; }

/* Z-index des cellules pour gérer le chevauchement global (Gauche sur Droite) */
/* Col 1 (Gauche) doit être au-dessus de Col 2, etc. */
.grid-cell.col-1 { z-index: 6; }
.grid-cell.col-2 { z-index: 5; }
.grid-cell.col-3 { z-index: 4; }
.grid-cell.col-4 { z-index: 3; }
.grid-cell.col-5 { z-index: 2; }
.grid-cell.col-6 { z-index: 1; }

/* Ajustement des positions pour l'effet d'escalier (Diagonal) */
/* On remonte tout globalement pour dégager la légende */
.grid-cell.col-1 { margin-top: -27px; } 
.grid-cell.col-2 { margin-top: -18px; }   
.grid-cell.col-3 { margin-top: -9px; }  
.grid-cell.col-4 { margin-top: 0px; }
/* .grid-cell.col-5 et .grid-cell.col-6 supprimés */

/* ======================== FIN NOUVEAUX STYLES VISUELS ======================== */

/* --- HOMER TREE VISUAL (D3.js) --- */
#visu-homer {
    width: 100%;
}

#homer-graph-container {
    width: 100%;
    height: 300px; /* Hauteur ajustée pour aérer le bas */
    /* background-color: #f0f2f5; REMOVED */
    /* border-radius: 8px; REMOVED */
    overflow: visible; /* Changed from hidden to visible to avoid cutting */
    position: relative;
}

#homer-graph-container svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible; /* IMPORTANT: Permet de voir les éléments hors du cadre SVG */
}

.link { stroke: #000; stroke-width: 0.5px; stroke-linecap: round; }
.node-group { cursor: grab; }
.node-group:active { cursor: grabbing; }
.node-group.fixed { cursor: not-allowed; }
.node-image { pointer-events: all; }

/* Suppression des anciens styles statiques */
.homer-tree, .tree-node, .tree-row, .tree-connector {
    display: none;
}

/* Suppression des anciens connecteurs CSS */
.connector-vertical, .connector-branch, .branch-line {
    display: none;
}

.branch-line.left { left: 0; }
.branch-line.center { left: 50%; transform: translateX(-50%); }
.branch-line.right { right: 0; }

/* ======================== RESPONSIVE ======================== */
@media (max-width: 900px) {
    /* Afficher le slider de parallaxe sur Mobile */
    #visu-grammaire .slider-container {
        display: block;
    }

    body {
        padding: 20px;
    }

    .main-layout {
        flex-direction: column;
        gap: 40px;
    }

    .col-titre {
        width: 100%;
        max-width: none;
        margin-bottom: 20px;
    }

    .sticky-zone {
        position: static;
        margin-bottom: 20px;
    }

    .visual-wrapper {
        position: static;
        display: flex;
        flex-direction: column;
        gap: 40px;
        margin-top: 0;
    }

    .visual-block {
        position: relative;
        top: auto !important; /* Override JS styles */
        left: auto;
        width: 40%; /* Réduit encore (était 50%) */
        max-width: 200px;
        margin: 20px auto; /* Centré avec marge */
    }

    #visu-homer {
        margin-top: 0; /* Annule la marge desktop de 100px sur mobile */
    }

    .article-section {
        flex-direction: column;
    }
    
    .parallax-container {
        height: auto;
    }
}

/* --- STYLE DU MÈME HOPECORE CHIEN (Version Transparente) --- */

.hopecore-image-container {
    position: relative;
    overflow: hidden;
}

.hopecore-input {
    position: absolute;
    background-color: transparent; /* Fond transparent pour voir l'image/noir derrière */
    border: none; /* Pas de bordure */
    color: white; /* Texte en BLANC pour ressortir sur le rectangle noir */
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 1vw; /* Taille de police plus petite */
    padding: 0px;
    box-sizing: border-box;
    outline: none;
    z-index: 10;
    display: flex;
    align-items: center;
}

.hopecore-input::placeholder {
    color: rgba(255, 255, 255, 0.5); /* Placeholder en blanc semi-transparent */
}

.hopecore-input::placeholder {
    color: white;  /* Le placeholder est blanc comme le texte */
    opacity: 1;    /* Force l'opacité à 100% (Firefox le met en gris par défaut) */
}

/* On enlève la ligne bleue au focus pour garder l'immersion */
.hopecore-input:focus {
    border: none;
    outline: none;
}

/* POSITIONNEMENT */

/* Le petit carré pour le "'t" */
#zone-chien-1 {
    top: 47%;
    left: 21.2%;
    width: 9%;
    height: 8%;
    text-align: center;
}

/* Le grand rectangle */
#zone-chien-2 {
    top: 45%;
    left: 58.5%;
    width: 41.5%;
    height: 12%;
    padding-left: 10px; /* Petit décalage pour ne pas coller au bord gauche */
    text-align: left;
}

/* Ajustement Mobile */
@media (max-width: 600px) {
    .hopecore-input {
        font-size: 2.5vw; /* Un peu plus grand sur mobile pour rester lisible */
    }
}