:root {
    /* Palette de couleurs moderne et professionnelle (from CHARLES) */
    --primary-color: #1a5490;
    --primary-hover: #2f6fb3;
    --accent-color: #0ea5e9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Dark theme (from CHARLES) */
    --dark-bg-primary: #0f172a;
    --dark-bg-secondary: #1e293b;
    --dark-text-primary: #e2e8f0;
    --dark-text-secondary: #cbd5e1;
    --dark-border: #334155;

    /* EVA legacy colors (kept for compatibility) */
    --dark-theme-bg: #22272e;
    --dark-theme-txt: #adbac7;
    --grey-color: #777;
    --lighter-txt-light-theme: #545454;
    --darker-txt-dark-theme: #97A4B0;
    --third-color : #0a84ff;
    --right-width: 35%;
    --btn-tabs-height: 40px;

    /* Spacing & Layout (from CHARLES) */
    --max-content-width: 850px;
    --sidebar-width: 480px;
    --nav-height: 64px;
    --spacing-xs: 0.3rem;
    --spacing-sm: 0.8rem;
    --spacing-md: 1.2rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Typography (from CHARLES) */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Georgia", "Times New Roman", Times, serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas,
        monospace;

    /* Shadows (from CHARLES) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Transitions (from CHARLES) */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* Reset et Base (from CHARLES) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    color: var(--text-primary);
    background-color: #ffffff;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark {
    background-color: var(--dark-bg-primary);
    color: var(--dark-text-primary);
}

/*********/
/* Navigation modernisée (from CHARLES) */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-md);
    backdrop-filter: blur(8px);
}

body.dark nav {
    background-color: rgba(15, 23, 42, 0.95);
    border-bottom-color: var(--dark-border);
}

nav li {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Boutons de mode (from CHARLES) */
#mode-color-btns {
    position: fixed;
    top: 10px;
    right: var(--spacing-sm);
    z-index: 110;
}

#sun,
#moon {
    cursor: pointer;
    width: 25px;
    height: 25px;
    border: none;
    background-color: transparent;
    border-radius: 8px;
    transition: background-color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

#sun:hover,
#moon:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark #sun:hover,
body.dark #moon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Layout principal (from CHARLES) */
.wrap {
    padding-top: 42px;
    min-height: 100vh;
    border-bottom: solid 3px rgb(226,232,240);
}

.LangMode {
    position: fixed;
}

.LangMode > a[role="button"] {
    cursor: pointer;
}

section.back {
    display: none;
}

.article-and-metas {
    position: relative;
    display: flex;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    overflow: hidden;
}

/* Contenu principal (from CHARLES) */
.left-contents {
    flex: 1 1 auto;     
    display: flex;
    justify-content: center; 
    min-width: 100px;
    scrollbar-color: var(--text-muted) var(--text-muted);
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%; 
}

.article-wrap {
    max-width: var(--max-content-width);
    margin: 0 auto;
}

/* Panneau latéral (from CHARLES) */
.right-contents {
    flex: 0 0 auto;
    width: var(--sidebar-width);
    max-width: 100%;
    background-color: #fafaf9;
    border-left: 1px solid #e7e5e4;
    font-family: var(--font-sans);
    box-sizing: border-box;
    height: 100%; /* Prend toute la hauteur du parent */
    overflow-y: auto; /* Scroll indépendant */
    overflow-x: hidden;
    scrollbar-width: thin;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.right-contents * {
    word-wrap: break-word;
    box-sizing: border-box;
}


.right-contents .front,
.right-contents .content-tab,
.right-contents .meta-content-tab {
    width: 100%;
    box-sizing: border-box;
}

body.dark .right-contents {
    background-color: var(--dark-bg-secondary);
    border-left-color: var(--dark-border);
}

/* Titres élégants (from CHARLES) */
.left-contents h1:not(div.boxed-text *) {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    padding-bottom: var(--spacing-lg);
}

body.dark .left-contents h1:not(div.boxed-text *) {
    color: var(--dark-text-primary);
}

.article-wrap ul, .article-wrap ol {
    margin-left: var(--spacing-lg);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

.article-wrap li {
    margin-bottom: var(--spacing-xs);
    padding-left: var(--spacing-xs);
}

section.body, section.front {
    padding-right: 15px;
}

section.body {
    padding-right: 50px;
    line-height: normal;
}

section.front ol, section.front ol {
    padding-left: 25px;
}

/* Onglets (from CHARLES) */
.front > .button-tabs {
    position: sticky;
    top: 0;
    display: flex;
    background-color: #fafaf9;
    border-bottom: 1px solid #e7e5e4;
    z-index: 10;
    height: var(--btn-tabs-height);
    margin-right: -15px;
    width: calc(100% + 15px);
    overflow-x: auto; /* permet le scroll horizontal */
    overflow-y: hidden; /* cache le scroll vertical */
}

.dark .button-tabs {
    background-color: var(--dark-bg-secondary);
    border-bottom-color: var(--dark-border);
}

.tab-btn {
    flex: 1 0 auto;
    padding: var(--spacing-sm);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    background-color: transparent;
    border: none;
    border-right: 1px solid #e7e5e4;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    height: var(--btn-tabs-height);
    min-width: fit-content;
}

.tab-btn[data-key="toc"] {
    flex: 1;
    white-space: nowrap;
}

body.dark .tab-btn {
    color: var(--dark-text-secondary);
    border-right-color: var(--dark-border);
}

.tab-btn:hover {
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

body.dark .tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--dark-text-primary);
}

.focus-meta-tab {
    background-color: var(--primary-color);
    color: white;
}

.focus-meta-tab:hover {
    background-color: var(--primary-hover);
    color: white;
}

.focus-tab {
    background-color: var(--primary-color);
    color: white;
}

.focus-tab:hover {
    background-color: var(--primary-hover);
    color: white;
}

.content-tab {
    padding: var(--spacing-md);
    font-size: 0.9375rem;
}

.content-tab .button-tabs.meta-tabs {
    margin-top: calc(var(--spacing-md) * -1);
    margin-right: calc((var(--spacing-md) + 15px) * -1);
    margin-left: calc(var(--spacing-md) * -1);
    margin-bottom: var(--spacing-lg);
    display: flex;

}

.content-tab .bibliography {
    border: none;
}

/***** section/h *******/
section.body p:not(div.boxed-text *, .caption, .credits, .stage, details *, .front-matter *) {
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-top: var(--spacing-md);
    color: var(--text-primary);
    text-align: justify;
    hyphens: auto;
    word-wrap: break-word;
}

body.dark section.body p:not(div.boxed-text *, .caption, .credits, details *) {
    color: var(--dark-text-primary);
}

.title-sup,
.z39-98 {
    display: inline-block;
    margin-top: 10px;
    font-size: 1.2rem;
    background-color: var(--dark-theme-txt);
    padding-right: 2rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-weight: 450;
}

/*.title-trl {
    font-family: var(--font-serif);
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 10px;
    margin-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    font-style: italic;
}*/

.title-sub {
    font-family: var(--font-serif);
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 10px;
    margin-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

section.body h2:not(div.boxed-text *) {
    font-family: var(--font-serif);
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

section.body h3:not(div.boxed-text *) {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    line-height: 1.4;
}

section.body h4:not(div.boxed-text *) {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

section.body h5 {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
}

section.body h6 {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
}

section.body p.firstPara:not(div.boxed-text *, details *) {
    margin-top: var(--spacing-xl);
}

/***** figure *******/

figure {
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-md);
    background-color: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    min-height: 70px;
}

body.dark figure {
    background-color: var(--dark-bg-secondary);
    border-color: var(--dark-border);
}

figure.fig-formula {
    color: inherit;
    background: transparent;
    margin: 0px 0px;
    min-height: 50px;
    padding-top: 5px;
    padding-bottom: 5px;
    border: none;
}

.img {
    height: 1.3em;
    width: auto;
    vertical-align: bottom;
}

figure img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding-bottom: 0px;
    margin-bottom: 7px;
}

figure .fig-call-window img, 
figure .table-call-window img {
    border-radius: 0px;
    box-shadow: none;
}

body.dark .caption {
    color: var(--dark-text-secondary);
}

.fig-call-window,
.fig-call-window a,
.fig-call-window a:visited,
.table-call-window,
.table-call-window a,
.table-call-window a:visited {
    text-decoration: none;
    align-self: flex-end;
    margin-top: -13px;
    margin-right: -6px;
    margin-bottom: -15px;
}

/* recensions */

.bibl-cr + .bibl-cr {
    margin-top: 15px;
}

.bibl-cr {
    margin-top: 25px;
}

section.review {
    position: relative;
    padding-top: 50px;
}

section.review:not(:first-child)::before {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #454545;
    top: 40px;
}

/* right pane */
div[id='figures'] figure {
    border-top: none;
    background-color: inherit;
    border: none;
    margin-top: -15px;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    padding-right: var(--spacing-md);
    padding-left: var(--spacing-md);
    padding-top: var(--spacing-xl);
}

div[id='figures'] figure + figure {
    border-top: 4px solid #e2e8f0;
    border-radius: 0px;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    padding-right: var(--spacing-md);
    padding-left: var(--spacing-md);
    padding-top: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70px;
}

img {
    width: 100%;
    padding-bottom: 5px;
}

/****** théâtre ******/

.speaker {
    font-weight: bold;
}

.stage {
    font-style: italic;
    color: var(--lighter-txt-light-theme);
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-top: var(--spacing-md);
    text-align: justify;
    hyphens: auto;
    word-wrap: break-word;
}

.dark .stage {
    font-style: italic;
    color: var(--darker-txt-dark-theme);
}

/****** table ******/

table caption {
    font-style: italic;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 1.2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    display: table;
    text-indent: initial;
    line-height: normal;
    font-weight: normal;
    font-size: medium;
    font-style: normal;
    color: -internal-quirk-inherit;
    text-align: start;
    border-spacing: 2px;
    white-space: normal;
    font-variant: normal;
    margin: 0 0;
    margin-bottom: 7px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    background-color: white;
}

table.linguistic {
    display: table;
    margin-top: 1em;
    margin-bottom: 1em;
}

table.lg {
    display: table;
    width: 100%;
    margin-top: 1em;
    margin-bottom: 1em;
    border: none;
}

td[class='num'] {
    width: 40px;
    border: none;
    padding-left: none;
}

td[class='l'] {
    border: none;
    padding-left: none;
}

th,
td {
    padding: var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    padding-left: 2px;
}

body.dark th,
body.dark td {
    border-bottom-color: var(--dark-border);
}

th {
    font-weight: 600;
    background-color: #f8fafc;
    color: var(--text-primary);
}

body.dark th {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text-primary);
}

blockquote table.lg td,
blockquote table.lg th {
    font-size: 1.1rem;
    padding-left: 2px;
}

table.lg td {
    line-height: 120%;
    font-size: 150%;
}

.fig-table label,
.fig-ill label {
    padding: 10px;
    cursor: pointer;
    margin-bottom: 5px;
    line-height: 1.5;
}

.expand {
    color: var(--third-color);
    text-decoration: none;
    margin-right: 0.5em;
    cursor: pointer;
}

span[class='expand empty'] {
    color: var(--third-color);
    text-decoration: none;
    margin-right: 0.5em;
    cursor: pointer;
}

figure .credits,
figure .caption {
    margin-top: 8px;
    margin-right: 5px;
    margin-bottom: 5px;
    margin-left: 8px;
    align-self: flex-start;
    line-height: 1.5;
    color: var(--text-primary);
    text-align: justify;
    hyphens: auto;
    word-wrap: break-word;
}

label {
    margin-bottom: 15px;
}

.caption-right-panel,
.credits-right-panel {
    text-align: left;
    align-self: flex-start;
    line-height: 1.4;
    margin-top: 10px;
    font-size: 0.85rem;
}

.label-right-panel {
    text-align: left;
    align-self: flex-start;
    line-height: 1.4;
    font-weight: bold;
    font-size: 0.85rem;
}

.img-righ-panel {
    margin-bottom: 5px;
    margin-top: 5px;
}

/*counters*/
section.body {
    counter-reset: section;
}

section.body h2:not(div.boxed-text *) {
    counter-reset: subsection;
}
section.body h3:not(div.boxed-text *) {
    counter-reset: subsubsection;
}
section.body h4:not(div.boxed-text *) {
    counter-reset: subsubsubsection;
}

/* descriptions longues */

details.floating-note {
    width: 100%;
    margin-left: 9px;
    margin-top: 12px;
}

details.floating-note .body {
  font-size: smaller;
  line-height: 1.4em;
}

details.floating-note .body ul, details.floating-note .body ol {
    margin-left: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4em;
}

details.floating-note p.firstPara {
    margin-top: 20px;
}
details.floating-note p {
    margin-top: 6px;
}

summary::marker  {
    color: var(--third-color);
    content: "⇱  ";
    font-size: 105%;
}

.floating-note[open] summary::marker {
    content: "⇲  "; 
}

summary span.idno {
    color: var(--third-color);
    font-family: var(--font-sans);
    font-size: 95%;
}

/****** annexe ******/

.appendix, .right-panel-appendix {
    position: relative;
}

section.appendix {
    margin-top: 100px;
}

section.body section.appendix > h1 {
    margin-bottom: var(--spacing-xl);
}

section.appendix::before {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #454545;
    top: -10px;
}

.right-panel-appendix::before {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #454545;
    top: -2px;
}

.auteur-annexe {
    font-size: 85%;
}

section.body frontinclusion h2.sous-titre-annexe {
    margin-top: -10px;
    font-size: 1.5rem;
    line-height: 100%;
    font-weight: normal;
}

bodyInclusion p.firstPara:not(div.boxed-text *) {
    margin-top: 50px;
}

/* biblio right panel + collection de recenion */

.right-contents #refs ul {
    list-style: none;
}

.right-contents #refs li {
    margin-left: 1.5em;
    text-indent: -1.5em;
    margin-bottom: var(--spacing-md);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.right-contents #refs h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    padding-top: 10px;
}

body.dark .right-contents #refs h3 {
    color: var(--dark-text-primary);
}

.right-contents #refs h4 {
    margin-bottom: 10px;
}

.review_bibliography p.bibl {
    margin-left: 1.5em;
    text-indent: -1.5em;
    font-size: 90%;
}

section.review p.bibl-cr {
    margin-bottom: 50px;
    margin-left: 30px;
}

/***** TOC (from CHARLES) *******/

#toc {
    font-size: 0.9375rem;
}

/*#toc li {
    margin-top: var(--spacing-sm);
}*/

#toc a {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

#toc a:hover {
    color: var(--primary-color);
    background-color: rgba(26, 84, 144, 0.08);
}

body.dark #toc a {
    color: var(--dark-text-secondary);
}

body.dark #toc a:hover {
    color: var(--accent-color);
    background-color: rgba(14, 165, 233, 0.1);
}

#toc a.active {
    color: var(--primary-color);
    background-color: rgba(26, 84, 144, 0.12);
    font-weight: 600;
    padding-left: 5px;
    padding-right: 5px;
}

body.dark #toc a.active {
    color: var(--accent-color);
    background-color: rgba(14, 165, 233, 0.15);
}

#toc ol {
    list-style-type: none;
}

#toc .section2 {
    margin-left: 1rem;
}

#toc .section3 {
    margin-left: 2rem;
}

#toc .section4 {
    margin-left: 3rem;
}

#toc .section5 {
    margin-left: 4rem;
}

.toc-floatingText {
    background-color: #ddd;
}

/***** REVIEW *******/
.author-aut,
.authority_affiliation,
.authority_mail {
    text-align: right;
}

/***** INLINE ELEMENTS (from CHARLES) ******/

span[class*="fn-call"], sup {
    font-size: 0.75em;
    vertical-align: super;
    line-height: 0;
    font-weight: 600;
}

sub {
    font-size: .60em;
}

span[class*="fn-call"] {
    color: var(--primary-color);
    cursor: pointer;
    transition: color var(--transition-fast);
}

span[class*="fn-call"]:hover {
    color: var(--primary-hover);
}

body.dark span[class*="fn-call"] {
    color: var(--accent-color);
}

span.bibr-call {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-color);
    transition: all var(--transition-fast);
}

span.bibr-call:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

body.dark span.bibr-call {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/***** FOOTNOTES (from CHARLES) ******/
div[id^="footnotes"] ul,
div[id^="footnotes"] ul {
    list-style-type: none;
}

div[id^="footnotes"] li {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    background-color: #fafaf9;
    border-left: 3px solid transparent;
    border-radius: 8px;
    transition: all var(--transition-base);
    box-sizing: border-box;
}

body.dark div[id^="footnotes"] li {
    background-color: var(--dark-bg-secondary);
}

div[id^="footnotes"] li.focus, #refs .ref.focus {
    border-left-color: var(--primary-color);
    background-color: rgba(26, 84, 144, 0.05);
    border-right: 5px solid var(--third-color);
}

body.dark div[id^="footnotes"] li.focus {
    border-left-color: var(--accent-color);
    background-color: rgba(14, 165, 233, 0.08);
}

div[id^="footnotes"] li .label {
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    display: inline-block;
    margin-right: 10px;
}

body.dark div[id^="footnotes"] .label {
    color: var(--accent-color);
}

div[id^="footnotes"] li .label:hover {
    color: var(--grey-color);
}

div[id^="footnotes"] li .label:before {
    content: '[';
}

div[id^="footnotes"] li .label:after {
    content: '] ';
}

/* je crois que les mixed-citation ne concernait que les réfs biblio du right panel en JATS, si oui, à supprimer (car la structure a changé) */
.mixed-citation {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border-bottom: 1px solid #888;
}

.dark div[id^="footnotes"] li, .dark .mixed-citation {
    border-bottom: 1px solid var(--dark-theme-txt);
}

/*********** INDEX **********/
#index .index-level1 {
    list-style-type: none;
    margin-top: 3%;
    font-weight: bold;
}

#index .index-level2 {
    list-style-type: none;
    margin-top: 1%;
    margin-left: 5%;
    font-weight: normal;
}

#index .index-level3 {
    list-style-type: none;
    margin-top: 1%;
    margin-left: 5%;
    font-weight: normal;
}

.index-anchor {
    color: var(--third-color);
    font-size: 75%;
}

.index-link:first-of-type {
    margin-left: 12px;
}

/* collapse via toggle-button */
.index-level2 {
    display: none;
}

.toggle-button {
    cursor: pointer;
    color: var(--third-color);
}

.expanded .toggle-button::after {
    content: "[-]";
}

.collapsed .toggle-button::after {
    content: "[+]";
}

/******************************************/

body.dark .journal-meta {
    background-color: var(--dark-bg-secondary);
}

.meta-field {
    margin-bottom: var(--spacing-md);
    font-family: var(--font-sans);
}

.meta-field > div:first-child {
    color: var(--grey-color);
    margin-top: 10px;
}

.meta-field:before {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

body.dark .meta-field:before {
    color: var(--dark-text-secondary);
}

.abstract {
    margin-top: 6px;
}

.correction {
    border: 1px solid black;
    margin-top: 6px;
    padding: 3px;
}

.ack {
    font-style: italic;
}

.front-matter, .epigraph {
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 95%;
}

.front-matter:first-of-type {
    margin-top: 50px;
}

.front-matter:last-of-type {
    margin-bottom: 50px;
}

.kwd {
    display: inline-block;
    margin-right: 5px;
}

.kwd:after {
    margin-left: 5px;
    content: "·";
}

.kwd:last-child::after {
    content: none;
}

.underline {
    text-decoration: underline;
}

/********* BOXED TEXT (from CHARLES) **********/
div.boxed-text {
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
    background-color: rgba(26, 84, 144, 0.03);
}

body.dark div.boxed-text {
    border-color: var(--accent-color);
    background-color: rgba(14, 165, 233, 0.05);
}

div.boxed-text h1 {
    font-size: 2.3rem;
    margin-bottom: 10px;
    line-height: normal;
    padding-top: 25px;
}

div.boxed-text h2, frontinclusionencadre .titlePage .title-main {
    font-size: 1.8rem;
    margin-bottom: 20px;
    line-height: normal;
    padding-top: 25px;
}

frontinclusionencadre .titlePage .title-main {
    font-weight: bold;
}

div.boxed-text h3 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    line-height: normal;
    padding-top: 25px;
}

div.boxed-text p {
    font-size: 1.2rem;
    margin-top: 10px;
    line-height: 150%;
    word-wrap: break-word;
}

div.boxed-text * {
    font-size: 1.2rem;
}

/** galleys DL links**/
div.item.galleys {
    position: fixed;
    top: 20px;
    right: 75px;
    display: flex;
    justify-content: right;
    font-size: 0.75rem;
}
div.item.galleys h2 {
    display: none;
}
div.item.galleys ul {
    list-style-type: none;
}

/*********** QUOTE (from CHARLES) *******************/
disp-quote {
    display: block;
    text-align: right;
}

blockquote {
    margin: var(--spacing-lg) 0;
    padding-left: var(--spacing-lg);
    border-left: 4px solid var(--primary-color);
    font-style: italic;
    font-size: 1.0625rem;
    color: var(--text-secondary);
}

body.dark blockquote {
    border-left-color: var(--accent-color);
    color: var(--dark-text-secondary);
}

.epigraph blockquote {
    font-size: 100%;
}

blockquote + blockquote {
    margin-top: 1.7em;
}

.quotation2 {
    border-left: 2px solid var(--grey-color);
    padding-left: 5%;
    margin-left: -5%;
}

/*********** BR *******************/
.lb::after {
    content: "\a";
    white-space: pre;
}

/*************** DRAG-BAR (from CHARLES) ***************************/
ul, ol {
    margin-top: 1ex;
    margin-bottom: 1.5ex;
    line-height: 130%;
}

iframe {
    border: solid 0.5pt;
}

#map {
    height: 400px;
}

#drag-bar {
    flex: 0 0 3px;
    cursor: col-resize;
    background-color: #e2e8f0;
    position: relative;
    z-index: 1000;
    transition: background-color var(--transition-fast);
}


#drag-bar:hover,
#drag-bar:active  {
    background-color: var(--primary-color);
}

body.dark #drag-bar {
    background-color: var(--dark-border);
}

body.dark #drag-bar:hover {
    background-color: var(--accent-color);
}

/* signature et auteur de la section*/

.article-wrap section section p.signature, .article-wrap section section p.author-section-body {
    text-align: right;
}

/* Liens (from CHARLES) */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

body.dark a {
    color: var(--accent-color);
}

/* Scrollbar personnalisée (from CHARLES) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

body.dark ::-webkit-scrollbar-thumb {
    background: var(--dark-border);
}

body.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Styles spécifiques pour Mirador dans le panneau latéral (from CHARLES) */
#mirador-container {
    width: 100%;
    height: calc(100vh - 80px);
    position: relative;
    min-height: 500px;
}

/* Assurer que le conteneur Mirador prend toute la hauteur disponible */
#mirador.content-tab {
    padding: 0;
    height: calc(100vh - 50px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Adapter le thème Mirador au mode sombre */
body.dark #mirador-container {
    background-color: var(--dark-theme-bg);
}

/* S'assurer que Mirador est visible */
#mirador-container > div {
    width: 100% !important;
    height: 100% !important;
}

/* Responsive (from CHARLES) */
@media (max-width: 1200px) {
    .right-contents {
        width: 320px;
    }

    .left-contents {
        max-width: calc(100% - 320px);
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 56px;
    }

    .article-and-metas {
        flex-direction: column;
        display: flex;
        width: 100%;
        overflow: hidden;
    }

    .left-contents,
    .right-contents {
        width: 100%;
        max-width: 100%;
        position: relative;
    }

    .right-contents {
        border-left: none;
        border-top: 1px solid #e2e8f0;
        height: auto;
    }

    body.dark .right-contents {
        border-top-color: var(--dark-border);
    }
}

div.idno {
    margin-left: 7px;
    border-left: 1px solid var(--text-secondary);
    padding-left: 5px;
    margin-top: 2px;
    margin-bottom: 2px;
}

.filter-bar {
  display: none;
}

.LangMode{
    display: none;
}