/* ============================================================
   REM.ma — Section Stories
   Direction : luxe (or #D4A853) + innovation
   Le rail defile horizontalement, comme sur les reseaux sociaux.
   ============================================================ */

/* --- Arabe (RTL) ---
   Playfair Display ne contient aucun glyphe arabe : Cairo le remplace
   pour les titres. Les petites capitales (letter-spacing) sont
   illisibles en arabe : on retire l'espacement des lettres. */
html[dir="rtl"] .rem-stories,
html[dir="rtl"] .rem-story-item,
html[dir="rtl"] .rem-stories__btn,
html[dir="rtl"] .rem-story-viewer__caption {
    font-family: 'Noto Kufi Arabic', 'Inter', system-ui, sans-serif;
}

html[dir="rtl"] .rem-stories__title,
html[dir="rtl"] .rem-story-viewer__title {
    font-family: 'Cairo', 'Playfair Display', Georgia, serif;
}

html[dir="rtl"] .rem-stories__label {
    letter-spacing: normal;
}

.rem-stories {
    background: #FAFAFA;
    padding: 64px 0 70px;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    /* Le rail sort du cadre : on borne la section, pas la page. */
    overflow: hidden;
}

.rem-stories__label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: #B08A3E;
    margin: 0;
}

.rem-stories__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -.015em;
    color: #0F172A;
    margin: 8px 0 0;
    line-height: 1.15;
}

.rem-stories__title em {
    color: #B08A3E;
    font-style: italic;
    font-weight: 400;
}

.rem-stories__sub {
    font-size: 15.5px;
    line-height: 1.55;
    color: #64748B;
    max-width: 560px;
    margin: 9px 0 0;
}

.rem-stories__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.rem-stories__all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
    text-decoration: none;
    white-space: nowrap;
    padding-bottom: 4px;
}

.rem-stories__all:hover { color: #B08A3E; }

/* --- le rail --- */
.rem-stories__rail {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 6px 2px 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
}

.rem-stories__rail::-webkit-scrollbar { display: none; }

.rem-stories__rail--wrap {
    flex-wrap: wrap;
    overflow: visible;
    margin-top: 36px;
}

/* --- une story --- */
.rem-story {
    flex: 0 0 116px;
    text-align: center;
    text-decoration: none;
    scroll-snap-align: start;
}

.rem-story__ring {
    display: block;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    padding: 3.5px;
    margin: 0 auto 11px;
    background: linear-gradient(150deg, #F0C97A 0%, #D4A853 40%, #8E6B2C 100%);
    transition: transform .3s;
}

.rem-story:hover .rem-story__ring { transform: translateY(-4px); }

.rem-story__ring--live {
    background: linear-gradient(150deg, #10B981 0%, #059669 45%, #064E3B 100%);
}

.rem-story__inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #FAFAFA;
}

.rem-story__inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rem-story__badge-video {
    position: absolute;
    inset-inline-end: 2px;
    bottom: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #0F172A;
    border: 2px solid #fff;
    display: grid;
    place-items: center;
    color: #F0C97A;
}

.rem-story__live {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 4px 0 5px;
    text-align: center;
    background: linear-gradient(transparent, rgba(11, 18, 32, .85));
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.rem-story__name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0F172A;
    line-height: 1.25;
}

.rem-story__sub {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #64748B;
    margin-top: 2px;
}

/* --- story « publier » --- */
.rem-story--add .rem-story__ring {
    background: none;
    border: 2px dashed rgba(212, 168, 83, .65);
    padding: 0;
}

.rem-story--add .rem-story__inner {
    border: none;
    display: grid;
    place-items: center;
    background: linear-gradient(150deg, rgba(212, 168, 83, .16), rgba(212, 168, 83, .05));
}

.rem-story__plus {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #D4A853;
    color: #0F172A;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 18px -8px rgba(212, 168, 83, .95);
}

.rem-stories__empty {
    font-size: 15px;
    color: #64748B;
    padding: 30px 0;
}

/* ============================================================
   Page « Toutes les stories »
   ============================================================ */
.rem-stories-page {
    background: #FAFAFA;
    min-height: 60vh;
}

.rem-stories-page__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 46px;
    font-weight: 600;
    color: #0F172A;
    margin: 8px 0 0;
}

/* ============================================================
   Lecteur plein ecran
   ============================================================ */
.rem-story-viewer {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(11, 18, 32, .94);
    display: grid;
    place-items: center;
    padding: 20px;
}

.rem-story-viewer__stage {
    width: 100%;
    max-width: 430px;
    display: grid;
    place-items: center;
}

.rem-story-viewer__card {
    position: relative;
    width: 100%;
    max-height: 90vh;
    background: #0B1220;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8);
}

.rem-story-viewer__progress {
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 3px;
    background: rgba(255, 255, 255, .2);
    z-index: 4;
}

.rem-story-viewer__bar {
    display: block;
    height: 100%;
    width: 0;
    background: #F0C97A;
}

.rem-story-viewer__head {
    position: absolute;
    top: 0;
    inset-inline: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 16px 16px 30px;
    background: linear-gradient(rgba(11, 18, 32, .75), transparent);
}

.rem-story-viewer__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 40px;
    background: #1E293B;
}

.rem-story-viewer__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rem-story-viewer__who {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.rem-story-viewer__who strong {
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rem-story-viewer__who small {
    color: rgba(250, 250, 250, .6);
    font-size: 12px;
    margin-top: 2px;
}

.rem-story-viewer__close {
    margin-inline-start: auto;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .12);
    text-decoration: none;
}

.rem-story-viewer__media {
    background: #0B1220;
    display: grid;
    place-items: center;
    min-height: 62vh;
}

.rem-story-viewer__media img,
.rem-story-viewer__media video {
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    display: block;
}

.rem-story-viewer__caption {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 3;
    padding: 34px 18px 20px;
    background: linear-gradient(transparent, rgba(11, 18, 32, .9));
    color: #fff;
}

.rem-story-viewer__caption p {
    font-size: 14.5px;
    line-height: 1.5;
    margin: 0 0 12px;
}

.rem-story-viewer__cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: #D4A853;
    color: #0F172A;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: 999px;
}

@media (max-width: 760px) {
    .rem-stories { padding: 46px 0 52px; }
    .rem-stories__title { font-size: 31px; }
    .rem-stories__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .rem-stories__rail { gap: 16px; }
    .rem-stories-page__title { font-size: 33px; }
    .rem-story-viewer { padding: 0; }
    .rem-story-viewer__card { border-radius: 0; max-height: 100vh; }
}
