/* =====================================================================
   Lecture d'une histoire — mise en page éditoriale
   ===================================================================== */

.story-page {
    --story-ink: #07111f;
    --story-text: #2b3442;
    --story-muted: #5d6570;
    --story-line: #e2ded6;
    --story-gold: #bd7e18;
    --story-gold-dark: #8a5a0a;
    --story-gold-soft: #f7f0df;
    --story-serif: 'Poppins', 'Source Sans Pro', Arial, sans-serif;

    background: #f6f7fa;
    color: var(--story-ink);
}

/* Barre de progression de lecture */
.story-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    height: 3px;
    background: transparent;
    pointer-events: none;
}

.story-progress span {
    display: block;
    height: 100%;
    background: #bd7e18;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .1s linear;
}

/* ---------------------------------------------------------------------
   En-tête
   --------------------------------------------------------------------- */
.story-hero {
    padding: 28px 0 8px;
}

.story-hero__inner {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}

.story-kicker {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 14px;
    margin: 0 0 18px;
    font-size: .74rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.story-kicker__label {
    color: var(--story-gold);
    font-weight: 700;
}

.story-kicker__period {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 22px;
    border: 1px solid var(--story-line);
    border-radius: 999px;
    background: #fff;
    color: var(--story-ink);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
}

@media (max-width: 767px) {
    .story-kicker__period {
        padding: 7px 16px;
        font-size: .98rem;
    }
}

.story-kicker__period i {
    color: var(--story-gold);
}

.story-title {
    margin: 0;
    color: var(--story-ink);
    font-family: var(--story-serif);
    font-size: clamp(2rem, 4.2vw, 3.3rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.01em;
}

.story-standfirst {
    max-width: 720px;
    margin: 20px auto 0;
    color: var(--story-muted);
    font-family: var(--story-serif);
    font-size: 1.15rem;
    font-style: italic;
    line-height: 1.6;
}

.story-byline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 0;
    margin-top: 22px;
    color: var(--story-muted);
    font-size: .85rem;
}

.story-byline > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
}

.story-byline > span + span {
    border-left: 1px solid var(--story-line);
}

.story-byline i {
    color: var(--story-gold);
}

.story-byline__authors {
    color: var(--story-ink);
}

.story-byline a {
    color: var(--story-ink);
    text-decoration: underline;
    text-decoration-color: rgba(189, 126, 24, .5);
    text-underline-offset: 3px;
}

/* ---------------------------------------------------------------------
   Visuel principal
   --------------------------------------------------------------------- */
.story-figure {
    max-width: 1080px;
    margin: 28px auto 0;
}

.story-figure img {
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(7, 17, 31, .12);
}

.story-figure figcaption {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 16px;
    margin-top: 10px;
    padding: 0 2px;
    color: var(--story-muted);
    font-size: .82rem;
    line-height: 1.45;
}

.story-figure__credit {
    font-style: italic;
}

/* ---------------------------------------------------------------------
   Texte + colonne latérale
   --------------------------------------------------------------------- */
.story-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 48px;
    max-width: 1080px;
    margin: 40px auto 0;
    padding-bottom: 56px;
}

.story-main {
    min-width: 0;
}

.story-body {
    max-width: 700px;
    color: var(--story-text);
    font-family: var(--story-serif);
    font-size: 1.14rem;
    line-height: 1.85;
    overflow-wrap: break-word;
}

.story-body > *:first-child {
    margin-top: 0;
}

.story-body p {
    margin: 0 0 1.4em;
}

.story-body h2,
.story-body h3,
.story-body h4 {
    margin: 1.8em 0 .6em;
    color: var(--story-ink);
    font-family: var(--story-serif);
    font-weight: 700;
    line-height: 1.25;
}

.story-body h2 {
    font-size: 1.6rem;
}

.story-body h3 {
    font-size: 1.32rem;
}

.story-body h4 {
    font-size: 1.12rem;
}

.story-body a {
    color: var(--story-gold-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.story-body img {
    max-width: 100%;
    height: auto;
    margin: 1.2em 0;
    border-radius: 8px;
}

.story-body blockquote {
    margin: 1.8em 0;
    padding: 4px 0 4px 22px;
    border-left: 3px solid var(--story-gold);
    color: var(--story-ink);
    font-size: 1.22rem;
    font-style: italic;
}

.story-body ul,
.story-body ol {
    margin: 0 0 1.4em;
    padding-left: 1.4em;
}

.story-body li {
    margin-bottom: .4em;
}

.story-body table {
    width: 100%;
    margin: 1.4em 0;
    border-collapse: collapse;
    font-family: system-ui, sans-serif;
    font-size: .92rem;
}

.story-body th,
.story-body td {
    padding: 8px 10px;
    border: 1px solid var(--story-line);
}

/* Sources */
.story-sources {
    max-width: 700px;
    margin-top: 40px;
    padding: 22px 24px;
    border: 1px solid var(--story-line);
    border-left: 3px solid var(--story-gold);
    border-radius: 8px;
    background: #fff;
}

.story-sources h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    color: var(--story-ink);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.story-sources h2 i {
    color: var(--story-gold);
}

.story-sources__content {
    color: var(--story-muted);
    font-size: .9rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.story-sources__content p:last-child,
.story-sources__content ul:last-child {
    margin-bottom: 0;
}

.story-sources__content a {
    color: var(--story-gold-dark);
}

/* Crédits */
.story-credits {
    max-width: 700px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 20px;
    margin-top: 28px;
    color: var(--story-muted);
    font-size: .85rem;
}

.story-credits p {
    margin: 0;
}

.story-credits__label {
    margin-right: 4px;
}

.story-credits a {
    color: var(--story-ink);
}

/* Contributions */
.story-contribute,
.biographies-collections.story-contribute {
    max-width: 700px;
    margin-top: 28px;
    padding: 0;
    border-top: 0;
    background: transparent;
}

/* À propos */
.story-about {
    max-width: 700px;
    margin-top: 28px;
    padding: 22px 24px;
    border-radius: 8px;
    background: var(--story-gold-soft);
    color: var(--story-text);
    font-size: .9rem;
    line-height: 1.65;
}

.story-about h2 {
    margin: 0 0 8px;
    color: var(--story-ink);
    font-family: var(--story-serif);
    font-size: 1.1rem;
    font-weight: 700;
}

.story-about p:last-child {
    margin-bottom: 0;
}

/* Colonne latérale */
.story-aside__sticky {
    position: sticky;
    top: 130px;
    display: grid;
    gap: 18px;
}

.story-panel {
    padding: 20px;
    border: 1px solid var(--story-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(7, 17, 31, .04);
}

.story-panel__title {
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--story-line);
    color: var(--story-ink);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.story-facts {
    display: grid;
    gap: 12px;
    margin: 0;
}

.story-facts dt {
    margin-bottom: 2px;
    color: var(--story-muted);
    font-size: .72rem;
    font-weight: 400;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.story-facts dd {
    margin: 0;
    color: var(--story-ink);
    font-size: .92rem;
}

.story-facts a {
    color: var(--story-gold-dark);
    text-decoration: none;
}

.story-facts a:hover,
.story-facts a:focus {
    text-decoration: underline;
}

.story-share {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.story-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--story-line);
    border-radius: 50%;
    background: #fff;
    color: var(--story-ink);
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.story-share__btn:hover,
.story-share__btn:focus {
    border-color: var(--story-ink);
    background: var(--story-ink);
    color: #fff;
}

.story-share__btn.is-whatsapp:hover,
.story-share__btn.is-whatsapp:focus { background: #25d366; border-color: #25d366; }
.story-share__btn.is-facebook:hover,
.story-share__btn.is-facebook:focus { background: #1877f2; border-color: #1877f2; }
.story-share__btn.is-linkedin:hover,
.story-share__btn.is-linkedin:focus { background: #0a66c2; border-color: #0a66c2; }

.story-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--story-gold);
    border-radius: 6px;
    color: var(--story-gold-dark);
    font-size: .82rem;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}

.story-pdf:hover,
.story-pdf:focus {
    background: var(--story-gold);
    color: #fff;
}

.story-popular {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.story-popular a {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    color: var(--story-ink);
    text-decoration: none;
}

.story-popular img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
}

.story-popular strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: .85rem;
    font-weight: 400;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.story-popular small {
    display: block;
    margin-top: 2px;
    color: var(--story-muted);
    font-size: .72rem;
}

.story-popular a:hover strong,
.story-popular a:focus strong {
    color: var(--story-gold-dark);
}

.story-panel__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: var(--story-ink);
    font-size: 11px;
    text-decoration: none;
    text-transform: uppercase;
}

.story-panel__more:hover,
.story-panel__more:focus {
    color: var(--story-gold-dark);
}

/* ---------------------------------------------------------------------
   À découvrir aussi
   --------------------------------------------------------------------- */
.story-related {
    padding: 56px 0 60px;
    background: #fff;
}

.story-related__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    text-align: center;
}

.story-related__kicker {
    color: var(--story-gold);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.story-related__head h2 {
    margin: 6px 0 0;
    color: var(--story-ink);
    font-family: var(--story-serif);
    font-size: 1.3rem;
    font-weight: 700;
}

.story-related__rule {
    display: block;
    width: 48px;
    height: 2px;
    margin-top: 14px;
    background: var(--story-gold);
}

.story-related-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--story-line);
    border-radius: 10px;
    background: #fff;
    transition: transform .2s ease, box-shadow .2s ease;
}

.story-related-card:hover,
.story-related-card:focus-within {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(7, 17, 31, .1);
}

.story-related-card__media {
    position: relative;
    display: block;
    overflow: hidden;
}

.story-related-card__media img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform .4s ease;
}

.story-related-card:hover .story-related-card__media img {
    transform: scale(1.04);
}

.story-related-card__date {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(7, 17, 31, .82);
    color: #fff;
    font-size: .72rem;
    letter-spacing: .04em;
}

.story-related-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 16px 18px 18px;
}

.story-related-card__type {
    margin-bottom: 6px;
    color: var(--story-gold-dark);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.story-related-card h3 {
    display: -webkit-box;
    margin: 0 0 8px;
    overflow: hidden;
    font-family: var(--story-serif);
    font-size: 1.06rem;
    font-weight: 400;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.story-related-card h3 a {
    color: var(--story-ink);
    text-decoration: none;
}

/* Toute la carte est cliquable via le lien du titre. */
.story-related-card h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.story-related-card h3 a:focus {
    outline: none;
}

.story-related-card:focus-within {
    outline: 3px solid var(--story-gold);
    outline-offset: 2px;
}

.story-related-card p {
    display: -webkit-box;
    margin: 0 0 12px;
    overflow: hidden;
    color: var(--story-muted);
    font-size: .86rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.story-related-card__more {
    margin-top: auto;
    color: var(--story-ink);
    font-size: 11px;
    text-transform: uppercase;
}

.story-related-card:hover .story-related-card__more {
    color: var(--story-gold-dark);
}

.story-related__carousel .owl-stage {
    display: flex;
}

.story-related__carousel .owl-item {
    display: flex;
    padding: 4px 0 8px;
}

.story-related__carousel.owl-theme .owl-dots {
    margin-top: 18px;
}

.story-related__carousel.owl-theme .owl-dots .owl-dot span {
    width: 8px;
    height: 8px;
    margin: 4px;
    background: #d6d9de;
}

.story-related__carousel.owl-theme .owl-dots .owl-dot.active span,
.story-related__carousel.owl-theme .owl-dots .owl-dot:hover span {
    background: var(--story-gold);
}

.story-related__actions {
    margin-top: 22px;
    text-align: center;
}

.story-related__actions a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--story-ink);
    font-size: 11px;
    text-decoration: none;
    text-transform: uppercase;
}

.story-related__actions a:hover,
.story-related__actions a:focus {
    color: var(--story-gold-dark);
}

/* Toast « lien copié » */
.histoire-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-radius: 8px;
    background: #07111f;
    color: #fff;
    font-size: .88rem;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}

.histoire-toast.show {
    opacity: 1;
    transform: none;
}

.histoire-toast i {
    color: #cfa15c;
}

/* Liens sans gras */
.story-page a {
    font-weight: 400;
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 991px) {
    .story-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .story-body,
    .story-sources,
    .story-credits,
    .story-contribute,
    .story-about {
        max-width: none;
    }

    .story-aside__sticky {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .story-hero {
        padding-top: 16px;
    }

    .story-standfirst {
        font-size: 1.02rem;
    }

    .story-byline > span {
        padding: 0 10px;
    }

    .story-figure img {
        border-radius: 6px;
    }

    .story-body {
        font-size: 1.05rem;
        line-height: 1.75;
    }

    .story-aside__sticky {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-progress span,
    .story-related-card,
    .histoire-toast {
        transition: none;
    }
}

@media print {
    .story-progress,
    .story-aside,
    .story-contribute,
    .story-related,
    .histoire-toast {
        display: none !important;
    }

    .story-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}
