/* Boxe Nesle V3 — titres maîtrisés et diaporama automatique.
   Fichier isolé : n'altère pas les pages Disciplines, Contact ou l'admin. */

/* Les cartes gardent une hauteur raisonnable même quand le titre est très long.
   Le titre intégral reste dans le HTML pour la lecture et l'accessibilité. */
.bx-news-item-bottom strong,
.bx-story-related-title strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.23;
}
.bx-news-item-bottom > span,
.bx-story-related-title > span { flex: 0 0 auto; }
.bx-news .bx-news-item-bottom { align-items: flex-start; }

/* Titre de la page d'article : taille adaptée + hauteur max maîtrisée.
   Limite uniquement visuelle, sans troncature en base. */
.bx-story-header h1 {
    font-size: clamp(2.75rem, 7.3vw, 7.1rem);
    line-height: 1.01;
    overflow-wrap: anywhere;
    text-wrap: balance;
}
.bx-story-header h1.bx-story-title-long {
    font-size: clamp(2.45rem, 5.1vw, 5.2rem);
    line-height: 1.06;
}
@supports (-webkit-line-clamp: 3) {
    .bx-story-header h1 {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        overflow: hidden;
    }
}
@media (max-width: 767.98px) {
    .bx-story-header h1 { font-size: clamp(2.65rem, 10vw, 5rem); }
    .bx-story-header h1.bx-story-title-long { font-size: clamp(2.25rem, 8.5vw, 3.7rem); }
}

/* Barre compacte : plus de flèches ; lecture auto + contrôle pause/reprise. */
.bx-story-gallery-controls {
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem clamp(1rem, 3vw, 2rem);
}
.bx-story-gallery-status { display: flex; align-items: baseline; gap: .8rem; }
.bx-story-gallery-small-label {
    font: 700 .68rem/1.4 system-ui, sans-serif;
    letter-spacing: .13em;
    color: #d5b59b;
}
.bx-story-gallery-toggle {
    width: auto !important;
    min-width: 94px;
    min-height: 44px;
    padding: 0 .8rem;
    font: 700 .83rem/1.2 system-ui, sans-serif !important;
    letter-spacing: .01em;
    white-space: nowrap;
}
.bx-story-gallery-toggle span { padding-left: .4rem; }
.bx-story-gallery-toggle[hidden] { display: none !important; }
@media (max-width: 375px) {
    .bx-story-gallery-small-label { font-size: .59rem; letter-spacing: .08em; }
    .bx-story-gallery-status { gap: .4rem; }
}
@media (prefers-reduced-motion: reduce) {
    .bx-story-gallery-track { scroll-behavior: auto !important; }
}

/* Archive : même hauteur de carte par rangée, sans fichier supplémentaire. */
.bx-news-archive .row > [class*="col-"] { display:flex; }
.bx-news-archive .bx-news-archive-item { display:flex; flex-direction:column; width:100%; min-width:0; }

/* Identité des auteurs sur les articles : photo publique uniquement avec accord explicite. */
.bx-story-author{display:inline-flex;align-items:center;gap:.55rem;vertical-align:middle}
.bx-story-author-avatar,.bx-news-card-author-avatar{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;background:#d6a47f;color:#1c1715;font-family:system-ui,sans-serif;font-weight:800;flex-shrink:0}
.bx-story-author-avatar{width:34px;height:34px;font-size:.87rem}
.bx-news-card-author-avatar{width:28px;height:28px;font-size:.72rem}
.bx-story-author-avatar img,.bx-news-card-author-avatar img{display:block;width:100%;height:100%;object-fit:cover}
.bx-news-card-author{display:inline-flex;gap:.55rem;align-items:center;padding:0 1rem 1.15rem;color:#d6b89c;font-size:.78rem;letter-spacing:normal}
.bx-news-archive .bx-news-archive-item>a>.bx-news-card-author{margin-top:0}
@media(max-width:480px){.bx-story-author-avatar{width:30px;height:30px}}


/* Boxe Nesle V3 | Actualités : présentation éditoriale intégrée à la photo.
   Accueil + archive, sans modifier les données ni les avatars.
   Le dégradé garantit une bonne lisibilité quelles que soient les photos. */
.bx-news .bx-news-item,
.bx-news-archive .bx-news-archive-item > a {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 405px;
    padding: clamp(1.1rem, 2.2vw, 1.7rem);
    overflow: hidden;
    color: #f9f4ec;
    background: #211d1b;
    border: 1px solid rgba(220, 172, 135, .28);
    text-decoration: none;
    transition: border-color .26s ease, box-shadow .26s ease;
}
.bx-news-archive .bx-news-archive-item { height: 100%; }
.bx-news .bx-news-item::before,
.bx-news-archive .bx-news-archive-item > a::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to top,
        rgba(11, 10, 10, .98) 0%,
        rgba(11, 10, 10, .88) 20%,
        rgba(11, 10, 10, .68) 40%,
        rgba(11, 10, 10, .2) 68%,
        rgba(11, 10, 10, .04) 100%);
    transition: background .28s ease;
}
.bx-news .bx-news-item > .bx-news-image,
.bx-news-archive .bx-news-archive-item > a > .bx-news-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    margin: 0;
    overflow: hidden;
}
.bx-news .bx-news-image img,
.bx-news-archive .bx-news-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    filter: saturate(.88);
    transition: transform .55s cubic-bezier(.2,.7,.2,1), filter .3s ease;
}
.bx-news .bx-news-item > .bx-news-item-bottom,
.bx-news-archive .bx-news-archive-item > a > .bx-news-item-bottom {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 0 0 auto;
    align-items: end;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    margin: auto 0 0;
    padding: 0;
    gap: .8rem;
    border: 0;
    background: transparent;
}
.bx-news .bx-news-item-bottom strong,
.bx-news-archive .bx-news-item-bottom strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    min-height: 0;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    color: #fff9f0;
    font-size: var(--bx-card-title-size, clamp(1.5rem, 2.45vw, 2.1rem));
    line-height: 1.13;
    text-wrap: balance;
    text-shadow: 0 2px 8px rgba(0,0,0,.54);
}
.bx-news .bx-news-item-bottom > span,
.bx-news-archive .bx-news-item-bottom > span {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    color: #171210;
    background: #d9a77f;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform .25s ease, background .25s ease;
}
.bx-news-archive .bx-news-archive-item > a > .bx-eyebrow {
    position: relative;
    z-index: 2;
    align-self: flex-start;
    max-width: 100%;
    margin: 0 0 .75rem;
    padding: .36rem .6rem;
    color: #f5d6bd;
    background: rgba(15, 13, 12, .78);
    border: 1px solid rgba(230, 178, 131, .43);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1.4;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.bx-news .bx-news-item > .bx-news-card-author,
.bx-news-archive .bx-news-archive-item > a > .bx-news-card-author {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    gap: .65rem;
    width: 100%;
    min-width: 0;
    min-height: 39px;
    padding: .65rem 0 0;
    margin: .8rem 0 0;
    border: 0;
    border-top: 1px solid rgba(252,239,225,.3);
    color: #fff0df;
    background: transparent;
    font-size: .81rem;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: 0;
    text-align: left;
}
.bx-news .bx-news-card-author-avatar,
.bx-news-archive .bx-news-card-author-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid rgba(252,230,213,.7);
    border-radius: 50%;
    overflow: hidden;
    background: #daa77f;
    color: #181311;
    font-size: .76rem;
    font-weight: 800;
}
.bx-news .bx-news-item:is(:hover, :focus-visible),
.bx-news-archive .bx-news-archive-item > a:is(:hover, :focus-visible) {
    color: #fff9f0;
    border-color: #e0ae87;
    box-shadow: 0 12px 35px rgba(0,0,0,.22);
}
.bx-news .bx-news-item:is(:hover,:focus-visible) .bx-news-image img,
.bx-news-archive .bx-news-archive-item > a:is(:hover,:focus-visible) .bx-news-image img {
    transform: scale(1.045);
    filter: saturate(1.02);
}
.bx-news .bx-news-item:is(:hover,:focus-visible) .bx-news-item-bottom > span,
.bx-news-archive .bx-news-archive-item > a:is(:hover,:focus-visible) .bx-news-item-bottom > span {
    transform: translate(2px,-2px);
    background: #f2c19a;
}
.bx-news .bx-news-item:focus-visible,
.bx-news-archive .bx-news-archive-item > a:focus-visible {
    outline: 3px solid #f6c59d;
    outline-offset: 4px;
}
@media (min-width: 768px) and (max-width: 1199.98px) {
    .bx-news .bx-news-item,
    .bx-news-archive .bx-news-archive-item > a { min-height: 420px; }
}
@media (max-width: 575.98px) {
    .bx-news .bx-news-item,
    .bx-news-archive .bx-news-archive-item > a { min-height: 390px; padding: 1.25rem; }
    .bx-news .bx-news-item-bottom strong,
    .bx-news-archive .bx-news-item-bottom strong {
        font-size: var(--bx-card-title-size, clamp(1.45rem, 6vw, 1.88rem));
        line-height: 1.13;
    }
}
@media (max-width: 349.98px) {
    .bx-news .bx-news-item,
    .bx-news-archive .bx-news-archive-item > a { min-height: 405px; padding: 1rem; }
    .bx-news .bx-news-item-bottom strong,
    .bx-news-archive .bx-news-item-bottom strong { font-size: var(--bx-card-title-size, 1.42rem); }
    .bx-news .bx-news-item-bottom > span,
    .bx-news-archive .bx-news-item-bottom > span { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
    .bx-news .bx-news-item,
    .bx-news-archive .bx-news-archive-item > a,
    .bx-news .bx-news-image img,
    .bx-news-archive .bx-news-image img,
    .bx-news .bx-news-item-bottom > span,
    .bx-news-archive .bx-news-item-bottom > span { transition: none !important; }
    .bx-news .bx-news-item:is(:hover,:focus-visible) .bx-news-image img,
    .bx-news-archive .bx-news-archive-item > a:is(:hover,:focus-visible) .bx-news-image img { transform: none; }
}
