423 lines
8.4 KiB
CSS
423 lines
8.4 KiB
CSS
:root {
|
||
color-scheme: light dark;
|
||
|
||
--page-gap: 12px;
|
||
|
||
/* valeurs mises à jour par JS */
|
||
--sticky-header-h: 108px;
|
||
--followbar-h: 0px;
|
||
--sticky-offset-px: 120;
|
||
|
||
/* offset réel pour scroll-margin-top (header + bandeau) */
|
||
--sticky-offset: calc(var(--sticky-header-h) + var(--followbar-h));
|
||
|
||
/* bandeau aligné sur le reading */
|
||
--reading-left: 0px;
|
||
--reading-width: 100%;
|
||
|
||
/* tailles exactes du reading (injectées par JS) */
|
||
--rf-h1-size: 2rem;
|
||
--rf-h1-lh: 1.2;
|
||
--rf-h1-fw: 800;
|
||
|
||
--rf-h2-size: 1.5rem;
|
||
--rf-h2-lh: 1.25;
|
||
--rf-h2-fw: 700;
|
||
|
||
--rf-h3-size: 1.25rem;
|
||
--rf-h3-lh: 1.25;
|
||
--rf-h3-fw: 650;
|
||
}
|
||
|
||
body {
|
||
margin: 0;
|
||
font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
|
||
line-height: 1.6;
|
||
}
|
||
|
||
a { text-decoration: none; }
|
||
a:hover { text-decoration: underline; }
|
||
|
||
/* Header sticky */
|
||
header{
|
||
position: sticky;
|
||
top: 0;
|
||
z-index: 50;
|
||
|
||
background: rgba(255,255,255,.92);
|
||
backdrop-filter: blur(10px);
|
||
-webkit-backdrop-filter: blur(10px);
|
||
|
||
border-bottom: 1px solid rgba(127,127,127,0.35);
|
||
padding: 12px 16px;
|
||
}
|
||
@media (prefers-color-scheme: dark){
|
||
header{ background: rgba(0,0,0,.72); }
|
||
}
|
||
|
||
.site-nav { font-size: 14px; opacity: 0.9; }
|
||
main { padding: 0; }
|
||
|
||
.reading {
|
||
max-width: 78ch;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
.reading h1 {
|
||
line-height: 1.2;
|
||
margin: 0 0 10px;
|
||
}
|
||
|
||
.reading p { margin: 0 0 12px; }
|
||
|
||
.edition-bar {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 10px 16px;
|
||
align-items: center;
|
||
margin-top: 10px;
|
||
padding-top: 10px;
|
||
border-top: 1px dashed rgba(127,127,127,0.35);
|
||
font-size: 14px;
|
||
}
|
||
/* Edition-bar: cacher des badges (non destructif) */
|
||
.edition-bar [data-badge="edition"],
|
||
.edition-bar [data-badge="status"],
|
||
.edition-bar [data-badge="version"]{
|
||
display: none;
|
||
}
|
||
|
||
.badge {
|
||
padding: 2px 8px;
|
||
border: 1px solid rgba(127,127,127,0.45);
|
||
border-radius: 999px;
|
||
}
|
||
|
||
.resume-btn{
|
||
font-size: 15px;
|
||
font-weight: 800;
|
||
border: 1px solid rgba(127,127,127,0.55);
|
||
border-radius: 999px;
|
||
padding: 5px 12px;
|
||
}
|
||
|
||
/* Jump by paragraph id */
|
||
.jump-form{
|
||
display: inline-flex;
|
||
gap: 6px;
|
||
align-items: center;
|
||
}
|
||
.jump-input{
|
||
border: 1px solid rgba(127,127,127,0.55);
|
||
background: transparent;
|
||
padding: 4px 10px;
|
||
border-radius: 999px;
|
||
font-size: 13px;
|
||
width: 320px;
|
||
}
|
||
.jump-input.is-error{
|
||
outline: 2px solid rgba(127,127,127,0.55);
|
||
outline-offset: 2px;
|
||
}
|
||
.jump-btn{
|
||
border: 1px solid rgba(127,127,127,0.55);
|
||
background: transparent;
|
||
padding: 4px 10px;
|
||
border-radius: 999px;
|
||
cursor: pointer;
|
||
font-size: 13px;
|
||
}
|
||
|
||
/* Toggle niveaux (legacy, non bloquant) */
|
||
.level-toggle { display: inline-flex; gap: 6px; }
|
||
.lvl-btn {
|
||
border: 1px solid rgba(127,127,127,0.55);
|
||
background: transparent;
|
||
padding: 4px 10px;
|
||
border-radius: 999px;
|
||
cursor: pointer;
|
||
font-size: 13px;
|
||
}
|
||
.lvl-btn[aria-pressed="true"] {
|
||
border-color: rgba(127,127,127,0.9);
|
||
font-weight: 650;
|
||
}
|
||
|
||
/* Règles niveaux */
|
||
body[data-reading-level="1"] .level-2,
|
||
body[data-reading-level="1"] .level-3,
|
||
body[data-reading-level="1"] .level-4 { display: none; }
|
||
|
||
body[data-reading-level="2"] .level-3,
|
||
body[data-reading-level="2"] .level-4 { display: none; }
|
||
|
||
body[data-reading-level="3"] .level-2,
|
||
body[data-reading-level="3"] .level-4 { display: none; }
|
||
|
||
body[data-reading-level="4"] .level-2,
|
||
body[data-reading-level="4"] .level-3 { display: none; }
|
||
|
||
/* ==========================
|
||
Scroll offset (anchors / headings / paras)
|
||
========================== */
|
||
|
||
.reading p[id]{
|
||
position: relative;
|
||
padding-right: 14rem;
|
||
scroll-margin-top: var(--sticky-offset);
|
||
}
|
||
|
||
/* Anchres + titres */
|
||
.para-alias,
|
||
.details-anchor{
|
||
display: block;
|
||
height: 0;
|
||
scroll-margin-top: var(--sticky-offset);
|
||
}
|
||
|
||
.reading h1,
|
||
.reading h2[id],
|
||
.reading h3[id]{
|
||
scroll-margin-top: var(--sticky-offset);
|
||
}
|
||
|
||
.para-tools{
|
||
position: absolute;
|
||
right: 0;
|
||
top: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: flex-end;
|
||
gap: 8px;
|
||
opacity: 0;
|
||
transition: opacity 120ms ease-in-out;
|
||
}
|
||
|
||
.para-tools-row{
|
||
display: inline-flex;
|
||
gap: 6px;
|
||
flex-wrap: wrap;
|
||
justify-content: flex-end;
|
||
}
|
||
|
||
.reading p[id]:hover .para-tools,
|
||
.reading p[id]:focus-within .para-tools { opacity: 1; }
|
||
|
||
.para-anchor,
|
||
.para-propose,
|
||
.para-cite{
|
||
font-size: 12px;
|
||
border: 1px solid rgba(127,127,127,0.45);
|
||
border-radius: 999px;
|
||
padding: 2px 8px;
|
||
background: transparent;
|
||
}
|
||
.para-cite{ cursor: pointer; }
|
||
|
||
.para-bookmark{
|
||
font-size: 13px;
|
||
border: 1px solid rgba(127,127,127,0.65);
|
||
border-radius: 999px;
|
||
padding: 4px 12px;
|
||
background: transparent;
|
||
cursor: pointer;
|
||
}
|
||
.para-bookmark:hover{ text-decoration: underline; }
|
||
|
||
/* Highlight (jump / resume / arrivée hash) */
|
||
.para-highlight{
|
||
background: rgba(127,127,127,0.10);
|
||
border-radius: 10px;
|
||
box-shadow: 0 0 0 2px rgba(127,127,127,0.35);
|
||
transition: box-shadow 160ms ease;
|
||
}
|
||
|
||
.build-stamp {
|
||
margin-top: 28px;
|
||
padding-top: 14px;
|
||
border-top: 1px solid rgba(127,127,127,0.25);
|
||
opacity: 0.85;
|
||
}
|
||
|
||
/* Accordéon */
|
||
.details-section {
|
||
border: 1px solid rgba(127,127,127,.25);
|
||
border-radius: 16px;
|
||
padding: 10px 12px;
|
||
margin: 14px 0;
|
||
position: relative;
|
||
}
|
||
|
||
/* ✅ Handle minimal pour sections fermées : pas de titre visible, mais ouvrable */
|
||
.details-summary{
|
||
list-style: none;
|
||
cursor: pointer;
|
||
user-select: none;
|
||
|
||
border: 1px dashed rgba(127,127,127,.25);
|
||
border-radius: 999px;
|
||
padding: 6px 10px;
|
||
margin: 10px 0;
|
||
|
||
background: rgba(127,127,127,0.06);
|
||
position: relative;
|
||
|
||
/* cache le texte réel (souvent le titre), sans casser l’accessibilité */
|
||
color: transparent;
|
||
}
|
||
.details-summary::-webkit-details-marker { display: none; }
|
||
|
||
.details-summary::before{
|
||
content: "▸ Ouvrir la section";
|
||
color: rgba(127,127,127,0.85);
|
||
font-size: 12px;
|
||
font-weight: 850;
|
||
}
|
||
@media (prefers-color-scheme: dark){
|
||
.details-summary::before{ color: rgba(220,220,220,0.82); }
|
||
}
|
||
|
||
details[open] > .details-summary{
|
||
/* une fois ouvert, on le rend “SR-only” pour éviter le doublon visuel */
|
||
position: absolute;
|
||
width: 1px;
|
||
height: 1px;
|
||
padding: 0;
|
||
margin: -1px;
|
||
overflow: hidden;
|
||
clip: rect(0, 0, 0, 0);
|
||
white-space: nowrap;
|
||
border: 0;
|
||
}
|
||
|
||
.details-body { margin-top: 10px; }
|
||
|
||
/* Smooth scroll */
|
||
html{ scroll-behavior: smooth; }
|
||
@media (prefers-reduced-motion: reduce){
|
||
html{ scroll-behavior: auto; }
|
||
}
|
||
|
||
/* ==========================
|
||
Reading-follow (H1/H2/H3 only)
|
||
========================== */
|
||
|
||
.reading-follow{
|
||
position: fixed;
|
||
|
||
left: var(--reading-left);
|
||
width: var(--reading-width);
|
||
right: auto;
|
||
|
||
top: var(--sticky-header-h);
|
||
|
||
z-index: 60;
|
||
pointer-events: none;
|
||
|
||
opacity: 0;
|
||
transform: translateY(-6px);
|
||
transition: opacity 160ms ease, transform 160ms ease;
|
||
}
|
||
|
||
.reading-follow.is-on{
|
||
opacity: 1;
|
||
transform: translateY(0);
|
||
}
|
||
|
||
.reading-follow__inner{
|
||
pointer-events: auto;
|
||
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
|
||
padding: 8px 12px;
|
||
padding-right: 84px;
|
||
|
||
border: 1px solid rgba(127,127,127,.20);
|
||
border-top: 0;
|
||
border-radius: 0 0 14px 14px;
|
||
|
||
background: rgba(255,255,255,.86);
|
||
backdrop-filter: blur(10px);
|
||
-webkit-backdrop-filter: blur(10px);
|
||
|
||
box-shadow: 0 10px 22px rgba(0,0,0,.06);
|
||
|
||
position: relative;
|
||
}
|
||
|
||
@media (prefers-color-scheme: dark){
|
||
.reading-follow__inner{
|
||
background: rgba(0,0,0,.58);
|
||
box-shadow: 0 10px 22px rgba(0,0,0,.18);
|
||
}
|
||
}
|
||
|
||
.rf-line{
|
||
width: 100%;
|
||
text-align: left;
|
||
border: 0;
|
||
background: transparent;
|
||
padding: 0;
|
||
cursor: pointer;
|
||
margin: 0;
|
||
}
|
||
.rf-line[hidden]{ display: none !important; }
|
||
|
||
.rf-h1{
|
||
font-size: var(--rf-h1-size);
|
||
line-height: var(--rf-h1-lh);
|
||
font-weight: var(--rf-h1-fw);
|
||
}
|
||
.rf-h2{
|
||
font-size: var(--rf-h2-size);
|
||
line-height: var(--rf-h2-lh);
|
||
font-weight: var(--rf-h2-fw);
|
||
opacity: .96;
|
||
}
|
||
.rf-h3{
|
||
font-size: var(--rf-h3-size);
|
||
line-height: var(--rf-h3-lh);
|
||
font-weight: var(--rf-h3-fw);
|
||
opacity: .92;
|
||
}
|
||
.rf-line:hover{ text-decoration: underline; }
|
||
|
||
/* Actions */
|
||
.rf-actions{
|
||
position: absolute;
|
||
right: 10px;
|
||
bottom: 8px;
|
||
display: inline-flex;
|
||
gap: 6px;
|
||
}
|
||
|
||
.rf-btn{
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
width: 34px;
|
||
height: 30px;
|
||
border-radius: 10px;
|
||
border: 1px solid rgba(127,127,127,0.35);
|
||
background: rgba(127,127,127,0.10);
|
||
cursor: pointer;
|
||
transition: background 120ms ease, transform 120ms ease;
|
||
}
|
||
|
||
.rf-btn:hover{
|
||
background: rgba(127,127,127,0.16);
|
||
transform: translateY(-1px);
|
||
}
|
||
|
||
/* ==========================
|
||
PATCH CRUCIAL : éviter les “rectangles vides”
|
||
(details fermés + summary handle minimal)
|
||
========================== */
|
||
|
||
.reading details.details-section:not([open]){
|
||
border: 0;
|
||
padding: 0;
|
||
background: transparent;
|
||
}
|