/* theme/actualites-bourse.css — la page /des-actualites (copie de l’aperçu _apercus/flux/04-le-hub/bourse.css, intégrée le 30 octobre 2026 ;
   l’aperçu reste le banc d’essai). */
/* ==========================================================================
   La bourse (bourse.js) : la moitié droite de la bande du haut, la fiche
   d'une valeur dans la lecture, la liste du sommaire.

   La grammaire du hub : Söhne pour les noms, Signifier pour les cours
   (chiffres tabulaires), des filets, le noir. La baisse prend le rouge du
   hub, la hausse reste à l'encre ; le signe dit le reste.
   ========================================================================== */

/* --- Dans la bande ---------------------------------------------------------- */
.bourse {
    position: relative; min-width: 0;
    display: flex; flex-direction: column; justify-content: center; gap: 3px;
    padding: 7px 0 8px;
    background: var(--papier); color: var(--texte);
    border-top: 3px solid var(--encre);
}
.bande.a-alertes .bourse { border-left: 1px solid var(--filet); }
.bourse-tete {
    display: flex; align-items: center; gap: 14px; height: 19px; margin: 0; padding: 0 18px;
    font-size: 12px; line-height: 15px; white-space: nowrap;
}
.bourse-nom {
    padding: 0; background: none; border: 0; cursor: pointer;
    font: inherit; font-weight: 500; color: var(--encre);
}
.bourse-nom:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
/* « différé d’environ 15 min · Yahoo Finance » : au survol, au focus (et toujours au téléphone). */
.bourse-source {
    min-width: 0; overflow: hidden; text-overflow: ellipsis;
    color: var(--attenue); font-variant-numeric: tabular-nums;
    opacity: 0; transition: opacity .2s ease;
}
.bourse:hover .bourse-source, .bourse:focus-within .bourse-source { opacity: 1; }

.bourse-fenetre {
    position: relative; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 36px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 36px), transparent 100%);
}
.bourse-train { display: flex; width: max-content; }
.bourse.est-defile .bourse-train { will-change: transform; }
.bourse-piste { display: flex; list-style: none; margin: 0; padding: 0; }
.bourse-piste > li { flex: none; display: flex; }

/* Une valeur : le rond (plein : ouverte), le nom, la petite courbe, le cours, la variation. */
.valeur {
    display: inline-flex; align-items: baseline; gap: 7px;
    height: 22px; padding: 0 17px 0 18px; margin: 0;
    background: none; border: 0; border-right: 1px solid var(--filet); border-radius: 0;
    cursor: pointer; color: var(--texte); white-space: nowrap; text-align: left;
    font: inherit;
}
.v-etat {
    flex: none; align-self: center; width: 7px; height: 7px; margin-right: 1px;
    border: 1px solid var(--attenue); border-radius: 50%;
}
.valeur.est-ouverte .v-etat { background: var(--encre); border-color: var(--encre); }
.v-nom { font-size: 12.5px; font-weight: 500; color: var(--encre); }
.v-place { font-weight: 400; color: var(--attenue); }
.v-courbe {
    flex: none; align-self: center; width: 44px; height: 16px; overflow: visible;
    fill: none; stroke: none;
}
.v-courbe polyline { fill: none; stroke: var(--encre); stroke-width: 1.25; stroke-linejoin: round; stroke-linecap: round; }
.valeur.est-baisse .v-courbe polyline { stroke: var(--rouge); }
.v-veille { stroke: var(--attenue); stroke-width: 1; stroke-dasharray: 1.5 2; opacity: .75; }
.v-cours {
    font: 400 17px/22px var(--serif); letter-spacing: -0.01em; color: var(--encre);
    font-variant-numeric: tabular-nums lining-nums;
}
.v-unite { font: 400 12px/1 var(--sans); color: var(--attenue); }
.v-var { font-size: 12.5px; color: var(--texte); font-variant-numeric: tabular-nums; }
.valeur.est-baisse .v-var { color: var(--rouge); }
.valeur.est-stable .v-var { color: var(--attenue); }
.valeur:hover .v-nom { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--efface); }
.valeur:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 3px; }

/* La piste qu'on fait glisser (moins de mouvement, téléphone) : rien ne défile tout seul. */
.bourse.est-piste .bourse-fenetre {
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; cursor: grab;
}
.bourse.est-piste .bourse-fenetre::-webkit-scrollbar { display: none; }
.bourse.est-tiree .bourse-fenetre { cursor: grabbing; }
.bourse.est-tiree .valeur { pointer-events: none; }

/* --- La fiche d'une valeur, dans la lecture ------------------------------------- */
.bo-surtitre { align-items: center; }
.bo-etat {
    flex: none; width: 8px; height: 8px; border: 1px solid var(--attenue); border-radius: 50%;
}
.bo-etat.est-ouverte { background: var(--encre); border-color: var(--encre); }
.bo-chiffres { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 26px; margin: 20px 0 0; }
.bo-cours { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.bo-cours-n {
    font: 300 clamp(46px, 9.5cqi, 66px)/1 var(--serif); letter-spacing: -0.035em; color: var(--encre);
    font-variant-numeric: tabular-nums lining-nums;
}
.bo-unite { font-size: 13px; color: var(--attenue); }
.bo-var { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.bo-var-pc { font: 400 24px/1 var(--serif); letter-spacing: -0.01em; color: var(--encre); font-variant-numeric: tabular-nums lining-nums; }
.est-baisse .bo-var-pc { color: var(--rouge); }
.est-stable .bo-var-pc { color: var(--attenue); }
.bo-var-abs { font-size: 13px; color: var(--attenue); font-variant-numeric: tabular-nums; }

.bo-figure { margin: 30px 0 0; }
.bo-cadre {
    position: relative; height: clamp(170px, 36cqi, 250px);
    border-bottom: 1.5px solid var(--filet-fort);
}
.bo-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: none; }
.bo-heure { stroke: var(--filet); stroke-width: 1; }
.bo-veille { stroke: var(--attenue); stroke-width: 1; stroke-dasharray: 2 3; }
.bo-ligne { fill: none; stroke: var(--encre); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.est-baisse .bo-ligne { stroke: var(--rouge); }
.bo-aire { fill: var(--encre); opacity: .045; stroke: none; }
.est-baisse .bo-aire { fill: var(--rouge); opacity: .065; }
.bo-point {
    position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
    border-radius: 50%; background: var(--encre); box-shadow: 0 0 0 3px var(--papier);
}
.est-baisse .bo-point { background: var(--rouge); }
.bo-veille-lib {
    position: absolute; left: 0; transform: translateY(-100%); padding: 0 6px 3px 0;
    font-size: 11.5px; line-height: 1.2; color: var(--attenue); white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.bo-veille-lib.est-droite { left: auto; right: 0; padding: 0 0 3px 6px; }
.bo-veille-lib.est-dessous { transform: translateY(4px); }
.bo-axe { position: relative; height: 18px; margin-top: 6px; font-size: 11.5px; line-height: 18px; color: var(--attenue); font-variant-numeric: tabular-nums; }
.bo-axe span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.bo-axe .bo-axe-bord { transform: none; }
.bo-axe .bo-axe-fin { transform: translateX(-100%); }
.bo-figure figcaption { margin: 10px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--attenue); }

.bo-faits {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 20px;
    margin: 30px 0 0; padding-top: 12px; border-top: 1px solid var(--filet);
}
.bo-faits div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; min-width: 0; }
.bo-faits dt { font-size: 12.5px; color: var(--attenue); }
.bo-faits dd { margin: 0; font: 400 19px/1.2 var(--serif); color: var(--encre); font-variant-numeric: tabular-nums lining-nums; }
@container lecture (max-width: 540px) {
    .bo-faits { grid-template-columns: 1fr 1fr; }
}

/* --- La liste de toutes les valeurs (le sommaire, la fiche) ------------------------ */
.bo-liste { list-style: none; margin: 0; padding: 0; }
.bo-liste li + li .valeur-ligne { border-top: 1px solid var(--filet); }
.valeur.valeur-ligne {
    position: relative; display: grid; grid-template-columns: 8px minmax(0, 1fr) 64px 7.4em 4.9em;
    align-items: center; column-gap: 12px;
    width: 100%; height: auto; padding: 9px 0; border-right: 0;
}
.valeur-ligne .v-etat { margin: 0; }
.valeur-ligne .v-nom { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; line-height: 1.3; }
.valeur-ligne .v-nom, .valeur-ligne .v-place { overflow: hidden; text-overflow: ellipsis; }
.valeur-ligne .v-place { font-size: 12px; }
.valeur-ligne .v-courbe { width: 64px; height: 22px; }
.valeur-ligne .v-cours { justify-self: end; font-size: 18px; }
.valeur-ligne .v-var { justify-self: end; font-size: 13px; }
.valeur-ligne:focus-visible { outline-offset: 2px; }
.valeur-ligne[aria-current="true"]::before {
    content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 2px; background: var(--encre);
}
.valeur-ligne[aria-current="true"] .v-nom { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@container lecture (max-width: 440px) {
    .valeur.valeur-ligne { grid-template-columns: 8px minmax(0, 1fr) 44px 6.9em 4.6em; column-gap: 9px; }
    .valeur-ligne .v-courbe { width: 44px; height: 18px; }
    .valeur-ligne .v-cours { font-size: 16.5px; }
    .valeur-ligne[aria-current="true"]::before { left: -11px; }
}

/* --- Le téléphone : la bourse sous les actualités, une piste qu'on fait glisser --- */
@media (max-width: 959px) {
    .bourse { padding: 10px 0 11px; gap: 5px; border-top: 0; }
    .bande.a-alertes .bourse { border-left: 0; border-top: 1px solid var(--filet); }
    .bande:not(.a-alertes) .bourse { border-top: 3px solid var(--encre); }
    .bourse-tete { padding: 0 16px; font-size: 12.5px; }
    .bourse-source { opacity: 1; }
    .bourse-releve { display: none; }
    .bourse-fenetre { -webkit-mask-image: none; mask-image: none; scroll-padding: 0 16px; }
    .bourse-piste > li:first-child .valeur { padding-left: 16px; }
    .valeur { height: 26px; }
    .v-nom { font-size: 13px; }
    .v-cours { font-size: 18px; line-height: 26px; }
    .v-var { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .bourse-source { transition: none; }
}

#lecture .so-bourse { scroll-margin-top: 62px; }
