/* =========================================================
   EVENT DETAIL — CLEAN & READABLE BUILD
   نسخة موحدة ونظيفة
   - بدون تكرار غير ضروري داخل نفس النطاق
   - الخلفية بنفس سلوك التصميم القديم
   - أحجام خط أوضح للقراءة
   - Responsive للجوال والتابلت والكمبيوتر
   ========================================================= */

.sirah-event-page {
    --ed-wine: #74182d;
    --ed-wine-dark: #4d0d1c;
    --ed-wine-soft: #914457;
    --ed-gold: #c99a48;
    --ed-gold-light: #e9cb87;
    --ed-paper: #fffdf8;
    --ed-paper-2: #faf5ed;
    --ed-line: rgba(114, 53, 47, .13);
    --ed-ink: #4b2928;
    --ed-muted: #816968;
    --ed-shadow: 0 14px 38px rgba(72, 38, 27, .10);
    --ed-radius: 14px;
    width: 100%;
    min-width: 0;
    overflow-x: clip;
    color: var(--ed-ink);
    background: #fff;
    font-size: 12px;
}

.sirah-event-page *,
.sirah-event-page *::before,
.sirah-event-page *::after {
    box-sizing: border-box;
}

.ed-container {
    width: min(calc(100% - 44px), 1220px);
    margin-inline: auto;
}

.ed-view {
    width: 100%;
    min-height: 0;
    margin-inline: auto;
    background: #fff;
}

/* =========================================================
   HERO
   ========================================================= */
.ed-hero {
    position: relative;
    overflow: hidden;
    min-height: 238px;
    color: #fff;
    background:
        radial-gradient(circle at 92% 14%, rgba(224,166,72,.20), transparent 28%),
        radial-gradient(circle at 8% 82%, rgba(132,19,44,.52), transparent 34%),
        linear-gradient(112deg, #4b0818 0%, #73152b 54%, #4b0d18 100%);
}

.ed-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .13;
    background-image:
        radial-gradient(circle at 20% 35%, transparent 0 22px, rgba(238,205,139,.2) 23px 24px, transparent 25px),
        repeating-linear-gradient(45deg, transparent 0 18px, rgba(255,255,255,.035) 19px 20px);
    background-size: 120px 120px, 36px 36px;
}

.ed-hero__ornament {
    position: absolute;
    width: 230px;
    aspect-ratio: 1;
    border: 1px solid rgba(232,199,127,.10);
    border-radius: 50%;
    opacity: .5;
}

.ed-hero__ornament::before,
.ed-hero__ornament::after {
    content: "";
    position: absolute;
    inset: 22px;
    border: 1px solid rgba(232,199,127,.10);
    border-radius: 50%;
    transform: rotate(35deg);
}

.ed-hero__ornament::after {
    inset: 51px;
    border-radius: 28%;
    transform: rotate(45deg);
}

.ed-hero__ornament--right { right: -112px; top: -88px; }
.ed-hero__ornament--left { left: -118px; bottom: -120px; }

.ed-hero__inner {
    position: relative;
    z-index: 2;
    min-height: 238px;
    padding-block: 24px 30px;
    display: grid;
    grid-template-columns: 190px minmax(0,1fr) 190px;
    grid-template-rows: auto 1fr auto;
    align-items: start;
    gap: 8px 18px;
}

/* صف التنقل العلوي: العودة للموسوعة + عرض الكل */
.ed-hero__top-actions {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    direction: rtl;
    pointer-events: none;
}

.ed-return-link,
.ed-view-all-events {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 39px;
    padding: 8px 15px;
    color: #fff9ee !important;
    border: 1px solid rgba(232,199,127,.78);
    border-radius: 10px;
    background: rgba(58,5,17,.34);
    box-shadow: 0 8px 24px rgba(31,0,7,.12);
    backdrop-filter: blur(6px);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none !important;
    white-space: nowrap;
    pointer-events: auto;
    transition: .2s ease;
}

.ed-return-link i,
.ed-view-all-events i {
    color: var(--ed-gold-light);
    font-size: 12px;
    transition: transform .2s ease, color .2s ease;
}

.ed-return-link:hover,
.ed-return-link:focus-visible,
.ed-view-all-events:hover,
.ed-view-all-events:focus-visible {
    color: #fff !important;
    background: rgba(232,199,127,.16);
    border-color: rgba(244,211,142,.96);
    transform: translateY(-1px);
    outline: none;
}

.ed-return-link:hover i,
.ed-return-link:focus-visible i {
    transform: translateX(2px);
}

.ed-view-all-events:hover i,
.ed-view-all-events:focus-visible i {
    transform: translateX(2px);
}


.ed-hero__title-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: center;
    width: min(100%, 930px);
    margin-inline: auto;
    text-align: center;
}

.ed-hero__eyebrow {
    display: inline-block;
    margin-bottom: 5px;
    color: var(--ed-gold-light);
    font-size: 12.5px;
    font-weight: 800;
}

.ed-hero h1 {
    margin: 0;
    color: #fffdf8;
    font-family: "Amiri", "Cairo", serif !important;
    font-size: clamp(34px, 4.4vw, 58px);
    font-weight: 700;
    line-height: 1.16;
    text-shadow: 0 7px 24px rgba(20,0,4,.32);
    text-wrap: balance;
}

.ed-meta-bar {
    grid-column: 2;
    grid-row: 3;
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    max-width: 100%;
    padding: 7px 12px;
    border: 1px solid rgba(229,195,123,.24);
    border-radius: 9px;
    background: rgba(65,4,18,.20);
    backdrop-filter: blur(5px);
}

.ed-meta-bar span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 23px;
    padding-inline: 12px;
    color: rgba(255,255,255,.90);
    border-inline-end: 1px solid rgba(229,195,123,.22);
    font-size: 12px;
    white-space: nowrap;
}

.ed-meta-bar span:last-child { border-inline-end: 0; }
.ed-meta-bar i { color: #e7c276; }
.ed-meta-bar b { color: #fff; font-weight: 800; }




/* =========================================================
   ENCYCLOPEDIA BRAND — مدمجة داخل الهيرو
   ========================================================= */
.ed-hero-brand {
    position: absolute;
    top: clamp(18px, 1.6vw, 24px);
    right: 0;
    z-index: 5;

    /* حجم متدرج بدل مقاسات ثابتة لكل جهاز */
    width: clamp(135px, 13vw, 210px);

    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    opacity: 1;
    pointer-events: none;
}

.ed-hero-brand img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;

    /* ذهبي فاتح عالي التباين فوق الخلفية الخمرية */
    filter:
        brightness(0)
        saturate(100%)
        invert(91%)
        sepia(28%)
        saturate(1070%)
        hue-rotate(342deg)
        brightness(103%)
        contrast(96%)
        drop-shadow(0 3px 8px rgba(0,0,0,.28))
        drop-shadow(0 0 2px rgba(255,244,204,.22));
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */
.ed-content {
    position: relative;
    isolation: isolate;
    padding: 22px 0 30px;
    background: #fff;
}

/* خلفية القسم بنفس فكرة التصميم القديم:
   نقش هندسي خفيف جدًا، بدون تدرج كبير على كامل الشاشة */
.ed-content::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;

    opacity: .018;
    pointer-events: none;

    background:
        linear-gradient(
            30deg,
            transparent 24%,
            rgba(139, 70, 84, .72) 25%,
            rgba(139, 70, 84, .72) 26%,
            transparent 27%,
            transparent 74%,
            rgba(139, 70, 84, .72) 75%,
            rgba(139, 70, 84, .72) 76%,
            transparent 77%
        ),
        linear-gradient(
            150deg,
            transparent 24%,
            rgba(198, 154, 88, .75) 25%,
            rgba(198, 154, 88, .75) 26%,
            transparent 27%,
            transparent 74%,
            rgba(198, 154, 88, .75) 75%,
            rgba(198, 154, 88, .75) 76%,
            transparent 77%
        );

    background-size: 72px 126px;
}

.ed-layout {
    display: grid;
    direction: ltr;
    grid-template-columns: 255px minmax(0, 1fr);
    grid-template-areas: "sidebar main";
    gap: 28px;
    align-items: start;
}

.ed-sidebar { grid-area: sidebar; min-width: 0; direction: rtl; }
.ed-main { grid-area: main; min-width: 0; direction: rtl; }

.ed-event-image {
    position: relative;
    margin: 0 0 13px;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #eee;
    box-shadow: 0 8px 26px rgba(52,29,23,.16);

    /* النسبة الأساسية المناسبة للكمبيوتر والتابلت */
    aspect-ratio: 16 / 7;
}

.ed-event-image > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}


.ed-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 43px;
    margin-bottom: 12px;
    padding: 8px 12px;
    color: #856b60;
    border-bottom: 1px solid rgba(116,24,45,.08);
    font-size: 12px;
}

.ed-breadcrumb a { color: #7b4b3e; text-decoration: none; }
.ed-breadcrumb i { color: #ba8b41; font-size: 12px; }
.ed-breadcrumb strong { color: var(--ed-wine); }

/* =========================================================
   SIDEBAR
   ========================================================= */
.ed-side-card {
    margin-bottom: 16px;
    padding: 10px;
    border: 1px solid rgba(116,24,45,.10);
    border-radius: 10px;
    background: rgba(255,253,248,.98);
    box-shadow: 0 8px 24px rgba(67,38,28,.07);
}

.ed-side-card--actions {
    display: grid;
    gap: 8px;
    padding: 9px;
}

.ed-side-action {
    appearance: none;
    width: 100%;
    display: grid;
    grid-template-columns: 34px minmax(0,1fr);
    gap: 8px;
    padding: 12px 11px 11px;
    color: var(--ed-ink);
    border: 0;
    border-bottom: 1px solid var(--ed-line);
    background: transparent;
    text-align: right;
    cursor: pointer;
}

.ed-side-action:last-child { border-bottom: 0; }

.ed-side-action__icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #a8702e;
    border: 1px solid rgba(201,154,72,.32);
    border-radius: 50%;
    font-size: 14px;
}

.ed-side-action > span:nth-child(2) { min-width: 0; }
.ed-side-action strong {
    display: block;
    margin-bottom: 4px;
    color: #662233;
    font-family: "Amiri", "Cairo", serif;
    font-size: 17px;
}

.ed-side-action small {
    display: block;
    color: #74615d;
    font-size: 12px;
    line-height: 1.7;
}

.ed-side-action em {
    grid-column: 1 / -1;
    min-height: 31px;
    display: grid;
    place-items: center;
    margin-top: 5px;
    color: #fff;
    border-radius: 7px;
    background: linear-gradient(135deg, #7d1731, #621023);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    transition: .2s ease;
}

.ed-side-action:hover em { background: #4f0d1c; transform: translateY(-1px); }

.ed-side-card__title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 5px 10px;
    color: #70263a;
    border-bottom: 1px solid var(--ed-line);
}

.ed-side-card__title i { color: #b6843c; }
.ed-side-card__title h2 {
    margin: 0;
    font-family: "Amiri", "Cairo", serif;
    font-size: 20px;
}

.ed-links-list { display: grid; gap: 2px; padding-top: 7px; }

.ed-link-row {
    appearance: none;
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    padding: 5px 7px;
    color: #4d3633;
    border: 1px solid rgba(116,24,45,.08);
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: .18s ease;
}

.ed-link-row:hover {
    color: var(--ed-wine);
    border-color: rgba(116,24,45,.20);
    background: #fffaf4;
    transform: translateX(-2px);
}

.ed-link-row__label {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.ed-link-row__label i { width: 15px; color: #a87833; text-align: center; }
.ed-link-row b {
    min-width: 25px;
    height: 24px;
    display: grid;
    place-items: center;
    color: #8c6733;
    border: 1px solid rgba(201,154,72,.30);
    border-radius: 6px;
    background: #fffaf1;
    font-size: 12px;
}


/* شريط مسار الحدث */
.ed-breadcrumb__trail {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}


/* =========================================================
   TEXT CARDS — متوازن وواضح
   ========================================================= */

/* الكرت نفسه كان ناقصًا، لذلك العنوان والنص كانا يبدوان
   وكأنهما موضوعان مباشرة على خلفية الصفحة */
.ed-text-card {
    position: relative;
    margin-bottom: 14px;
    padding: 16px 18px 18px;

    border: 1px solid rgba(116, 24, 45, .10);
    border-radius: 12px;

    background:
        linear-gradient(180deg, #ffffff 0%, #fffdfa 100%);

    box-shadow:
        0 6px 18px rgba(71, 41, 31, .045);
}

/* رأس مختصر الحدث / تفاصيل الحدث */
.ed-text-card header {
    display: flex;
    align-items: center;
    gap: 11px;

    margin-bottom: 12px;
    padding-bottom: 10px;

    color: var(--ed-wine);
    border-bottom: 1px solid rgba(183, 125, 48, .16);
}

.ed-text-card header i {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;

    display: grid;
    place-items: center;

    color: #a97027;

    border: 1px solid rgba(183, 125, 48, .28);
    border-radius: 9px;
    background: linear-gradient(180deg, #fffaf1, #fff5e6);

    font-size: 16px;

    box-shadow: 0 3px 9px rgba(87, 48, 28, .045);
}

.ed-text-card h2 {
    margin: 0;

    color: var(--ed-wine);

    font-family: "Amiri", "Cairo", serif;
    font-size: clamp(23px, 2vw, 27px);
    font-weight: 700;
    line-height: 1.35;
}

/* عناوين الأقسام الأخرى مثل أحداث ذات صلة والمكتبة
   أقل بروزًا من عناوين النصوص حتى يبقى التسلسل البصري صحيحًا */
.ed-section-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;

    margin-bottom: 12px;
    padding: 0 4px 10px;

    color: var(--ed-wine);
    border-bottom: 1px solid rgba(183, 125, 48, .15);
}

.ed-section-heading > i {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;

    display: grid;
    place-items: center;

    color: #a97027;

    border: 1px solid rgba(183, 125, 48, .22);
    border-radius: 8px;
    background: #fff8ed;

    font-size: 14px;
}

.ed-section-heading h2 {
    margin: 0;

    color: var(--ed-wine);

    font-family: "Amiri", "Cairo", serif;
    font-size: clamp(22px, 1.8vw, 25px);
    font-weight: 700;
    line-height: 1.35;
}

.ed-rich-text {
    color: #514845;
    font-size: 15px;
    line-height: 2.1;
    text-align: justify;
}

/* =========================================================
   PREV / NEXT
   ========================================================= */
.ed-event-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 1px;
    margin: 12px 0;
    border: 1px solid rgba(116,24,45,.10);
    border-radius: 8px;
    background: rgba(116,24,45,.08);
    overflow: hidden;
}

.ed-event-nav__item {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px;
    color: #6a2738 !important;
    background: #fff;
    text-decoration: none !important;
    transition: .18s ease;
}

.ed-event-nav__item--next { justify-content: flex-end; text-align: left; }
.ed-event-nav__item:hover { background: #fff8ef; }
.ed-event-nav__item i { color: #8b233b; font-size: 15px; }
.ed-event-nav__item span { min-width: 0; }
.ed-event-nav__item small { display: block; color: #9d796d; font-size: 12px; }
.ed-event-nav__item strong {
    display: block;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

/* =========================================================
   INTERACTION CTA — أقرب للتصميم المرجعي
   ========================================================= */
.ed-share-section {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 11px;
    margin: 14px 0 18px;
    padding: 17px 78px 16px;
    overflow: visible;
    color: #fff;
    border: 1px solid rgba(201, 154, 72, .20);
    border-radius: 12px;
    background:
        radial-gradient(circle at 92% 50%, rgba(225, 182, 95, .15), transparent 24%),
        linear-gradient(112deg, #5b0d21 0%, #79172f 58%, #823b22 100%);
    box-shadow: 0 10px 28px rgba(75, 22, 28, .10);
     z-index: 20;
}

.ed-share-section::after {
    content: "✺";
    position: absolute;
    right: 20px;
    top: 50%;
    color: rgba(241, 209, 139, .34);
    font-size: 58px;
    line-height: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

.ed-share-section__copy {
    position: relative;
    z-index: 1;
    text-align: center;
}

.ed-share-section__copy small {
    display: block;
    margin-bottom: 2px;
    color: #e8c878;
    font-size: 12px;
    font-weight: 800;
}

.ed-share-section__copy h2 {
    margin: 0;
    color: #fffdf7;
    font-family: "Amiri", "Cairo", serif;
    font-size: clamp(21px, 2.1vw, 27px);
    font-weight: 700;
    line-height: 1.3;
}

.ed-share-actions {
    position: relative;
    z-index: 3;
    width: min(100%, 520px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0;
}

.ed-share-main,
.ed-quiz-main {
    appearance: none;
    width: 100%;
    min-width: 0;
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 8px 14px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}

.ed-share-main {
    color: #6f1830;
    border: 1px solid rgba(255,255,255,.82);
    background: linear-gradient(180deg, #fffefb, #f8f1e7);
    box-shadow: 0 7px 18px rgba(45, 6, 15, .15);
}

.ed-share-main i {
    width: 27px;
    height: 27px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #6f1830;
    background: #f0d89e;
}

.ed-quiz-main {
    color: #fff;
    border: 1px solid rgba(255, 223, 158, .24);
    background: linear-gradient(135deg, #d59b42, #b9752d);
    box-shadow: 0 7px 18px rgba(76,31,16,.16);
}

.ed-share-main:hover,
.ed-quiz-main:hover {
    transform: translateY(-2px);
    filter: brightness(1.035);
}

.ed-share-menu-wrap {
    position: relative;
      z-index: 50;
}

.ed-share-menu {
    position: absolute;

    /* تفتح فوق زر المشاركة بدل النزول ناحية الفوتر */
    top: auto;
    bottom: calc(100% + 10px);

    left: 0;
    z-index: 1000;

    width: 340px;
    padding: 12px;
    overflow: hidden;

    border: 1px solid rgba(116,24,45,.12);
    border-radius: 14px;

    background: #fffdf9;

    box-shadow: 0 18px 44px rgba(39,20,17,.22);
}

.ed-share-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding: 2px 2px 9px;
    border-bottom: 1px solid rgba(116,24,45,.09);
}

.ed-share-menu__head span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #6f1830;
    font-size: 12px;
    font-weight: 900;
}

.ed-share-menu__head span i {
    color: #bd8337;
}

.ed-share-menu__head small {
    color: #99847b;
    font-size: 12px;
}

.ed-share-social-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
}

.ed-share-social-grid button {
    appearance: none;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 5px;
    border: 1px solid rgba(116,24,45,.08);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: .18s ease;
}

.ed-share-social-grid button:hover {
    transform: translateY(-2px);
    border-color: rgba(183,125,48,.25);
    box-shadow: 0 8px 18px rgba(54,28,23,.08);
}

.ed-share-social-grid button > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    box-shadow: 0 5px 12px rgba(40,20,18,.12);
}

.ed-share-social-grid button em {
    color: #5d4641;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.ed-share-social-grid .is-whatsapp > span { background: #25d366; }
.ed-share-social-grid .is-facebook > span { background: #1877f2; }
.ed-share-social-grid .is-x > span { background: #111; }
.ed-share-social-grid .is-telegram > span { background: #229ed9; }
.ed-share-social-grid .is-linkedin > span { background: #0a66c2; }
.ed-share-social-grid .is-email > span { background: linear-gradient(135deg, #8d213b, #b9772f); }

.ed-share-menu__footer {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(116,24,45,.09);
}

.ed-share-menu__footer button {
    appearance: none;
    min-height: 37px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 10px;
    border: 0;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: .18s ease;
}

.ed-share-copy {
    color: #702137;
    background: #f8eadf;
}

.ed-share-native {
    min-width: 78px;
    color: #fff;
    background: #702137;
}

.ed-share-menu__footer button:hover {
    transform: translateY(-1px);
    filter: brightness(.99);
}

/* =========================================================
   RELATED EVENTS
   ========================================================= */
.ed-related-section,
.ed-library {
    padding: 13px 12px 15px;
    border: 1px solid rgba(116,24,45,.09);
    border-radius: 9px;
    background: #fff;
}

.ed-related-section {
    margin-top: 14px;
}

.ed-library {
    margin-top: 18px;
}

.ed-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 10px;
}

.ed-related-card {
    display: block;
    min-width: 0;
    padding: 5px;
    color: #553b37 !important;
    border: 1px solid rgba(116,24,45,.10);
    border-radius: 7px;
    background: #fffdf9;
    text-decoration: none !important;
    transition: .18s ease;
}

.ed-related-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(69,39,28,.10); }

.ed-related-card__image {
    display: block;
    height: 86px;
    overflow: hidden;
    border-radius: 5px;
    background: #eee;
}

.ed-related-card img { width: 100%; height: 100%; object-fit: cover; }

.ed-related-card__placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #9b6f35;
    background:
        radial-gradient(circle at 50% 45%, rgba(201,154,72,.12), transparent 54%),
        linear-gradient(135deg, #fffaf1, #f5eadc);
    font-size: 30px;
}
.ed-related-card strong {
    display: block;
    min-height: 33px;
    padding: 7px 4px 3px;
    font-size: 12px;
    line-height: 1.6;
}
.ed-related-card small {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 4px 4px;
    color: #9a7e71;
    font-size: 12px;
}
.ed-related-card small i { color: #b58845; }

/* =========================================================
   LIBRARY — ARTICLES THEN VIDEOS THEN AUDIOS
   ========================================================= */
.ed-section-heading--library { padding-bottom: 8px; border-bottom: 1px solid var(--ed-line); }

.ed-library-group + .ed-library-group {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(116,24,45,.08);
}

.ed-library-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.ed-library-group__head h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #752438;
    font-family: "Amiri", "Cairo", serif;
    font-size: 17px;
}

.ed-library-group__head h3 i { color: #ac7b37; font-size: 15px; }
.ed-library-group__head a { color: #9a6e36; font-size: 12px; text-decoration: none; }

.ed-article-list,
.ed-audio-list { display: grid; gap: 6px; }

.ed-article-item,
.ed-audio-item {
    width: 100%;
    min-height: 42px;
    appearance: none;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
    display: grid;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    color: #523936 !important;
    border: 1px solid rgba(116,24,45,.08);
    border-radius: 7px;
    background: #fffdf9;
    text-decoration: none !important;
}

.ed-article-item { grid-template-columns: 28px minmax(0,1fr) 20px; }
.ed-article-item > span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #8a2c3f;
    border-radius: 6px;
    background: #f5e9dc;
    font-size: 12px;
}
.ed-article-item strong { font-size: 12px; }
.ed-article-item > i { color: #a87937; font-size: 12px; }

.ed-video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
}

.ed-video-card {
    position: relative;
    width: 100%;
    min-width: 0;
    padding: 0;
    appearance: none;
    overflow: hidden;
    color: #fff !important;
    border: 0;
    border-radius: 10px;
    background: #301b18;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
    text-decoration: none !important;
}

.ed-video-card img,
.ed-video-card__no-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.ed-video-card img {
    display: block;
    opacity: .78;
    transition: .2s ease;
}

.ed-video-card__no-image {
    display: grid;
    place-items: center;
    color: #7f1730;
    background:
        radial-gradient(circle at center, rgba(201,154,72,.18), transparent 48%),
        #f5eadf;
    font-size: 30px;
}

.ed-video-card:hover img {
    opacity: .58;
    transform: scale(1.025);
}

.ed-video-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 50%;
    background: rgba(36,15,13,.50);
    transform: translate(-50%, -50%);
    font-size: 13px;
}

.ed-video-card strong {
    position: absolute;
    left: 9px;
    right: 9px;
    bottom: 8px;
    overflow: hidden;
    color: #fff;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    text-shadow: 0 2px 7px rgba(0,0,0,.65);
}

/* إذا كان فيديو واحدًا فقط لا يتمدد بعرض القسم كاملًا */
.ed-video-grid:has(.ed-video-card:only-child) {
    grid-template-columns: minmax(280px, 380px);
    justify-content: start;
}

.ed-audio-item { grid-template-columns: 36px minmax(0,1fr) 24px; }
.ed-audio-item__icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    background: linear-gradient(135deg, #8a2b42, #5b1022);
}
.ed-audio-item span:nth-child(2) { min-width: 0; }
.ed-audio-item strong { display: block; font-size: 12px; }
.ed-audio-item small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #8c7670;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ed-audio-item > i { color: #b07d39; font-size: 17px; }

/* =========================================================
   MODAL
   ========================================================= */
.ed-modal[hidden] { display: none !important; }
.ed-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 20px;
}

.ed-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(29,13,15,.66);
    backdrop-filter: blur(4px);
}

.ed-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(82vh, 760px);
    display: grid;
    grid-template-rows: auto minmax(0,1fr);
    overflow: hidden;
    border: 1px solid rgba(210,166,83,.35);
    border-radius: 15px;
    background: #fffdf9;
    box-shadow: 0 28px 70px rgba(22,8,10,.34);
    animation: edModalEnter .22s ease both;
}

@keyframes edModalEnter {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ed-modal__header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    color: #fff;
    background: linear-gradient(130deg, #72172d, #4b0d1b);
}

.ed-modal__heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ed-modal__icon {
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #efd18b;
    border: 1px solid rgba(239,209,139,.28);
    border-radius: 10px;
    background: rgba(255,255,255,.07);
}
.ed-modal__heading small { display: block; color: #ddbd79; font-size: 12px; }
.ed-modal__heading h2 {
    margin: 1px 0 0;
    color: #fff;
    font-family: "Amiri", "Cairo", serif;
    font-size: 25px;
}

.ed-modal__close {
    appearance: none;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #fff;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    cursor: pointer;
}

.ed-modal__body {
    min-height: 120px;
    overflow: auto;
    padding: 18px;
}

.ed-modal-prose {
    color: #514440;
    font-size: 12px;
    line-height: 2.15;
    white-space: normal;
}

.ed-modal-prose--sources { border-right: 3px solid #c79645; padding-right: 14px; }
.ed-modal-list { display: grid; gap: 9px; }
.ed-modal-list-item {
    display: grid;
    grid-template-columns: 39px minmax(0,1fr);
    gap: 10px;
    padding: 11px;
    color: #4e3835 !important;
    border: 1px solid rgba(116,24,45,.09);
    border-radius: 9px;
    background: #fff;
    text-decoration: none !important;
}
.ed-modal-list-item__icon {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    color: #8a2b40;
    border: 1px solid rgba(201,154,72,.20);
    border-radius: 9px;
    background: #f5e9d9;
}
.ed-modal-list-item h3 { margin: 0; color: #6d2437; font-size: 13.5px; }
.ed-modal-list-item strong { display: block; margin-top: 4px; color: #7e5e34; font-size: 12px; }
.ed-modal-list-item small { display: block; margin-top: 3px; color: #a17f70; font-size: 12px; }
.ed-modal-list-item p { margin: 4px 0 0; color: #70605b; font-size: 12px; line-height: 1.9; }

html.ed-modal-open,
body.ed-modal-open { overflow: hidden !important; }


/* =========================================================
   QURAN MODAL — عرض نص الآية فعليًا
   ========================================================= */
.ed-quran-groups {
    display: grid;
    gap: 14px;
}

.ed-quran-group {
    overflow: hidden;
    border: 1px solid rgba(116, 24, 45, .10);
    border-radius: 13px;
    background: #fff;
}

.ed-quran-group__head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border-bottom: 1px solid rgba(116, 24, 45, .08);
    background: linear-gradient(180deg, #fffaf2, #fbf4e9);
}

.ed-quran-group__icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #7b1b32;
    border: 1px solid rgba(201, 154, 72, .24);
    border-radius: 10px;
    background: #f2dfbc;
}

.ed-quran-group__head h3 {
    margin: 0;
    color: #6d2034;
    font-family: "Amiri", "Cairo", serif;
    font-size: 20px;
    line-height: 1.35;
}

.ed-quran-group__head small {
    display: block;
    margin-top: 2px;
    color: #927c72;
    font-size: 12px;
}

.ed-quran-verses {
    display: grid;
    gap: 0;
    padding: 3px 14px;
}

.ed-quran-verse {
    padding: 12px 4px;
    border-bottom: 1px dashed rgba(116, 24, 45, .10);
}

.ed-quran-verse:last-child {
    border-bottom: 0;
}

.ed-quran-verse__text {
    margin: 0;
    color: #3f2d2a;
    font-family: "Amiri", "Traditional Arabic", serif;
    font-size: clamp(20px, 2vw, 25px);
    font-weight: 500;
    line-height: 2.05;
    text-align: right;
}

.ed-quran-ayah-number {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    margin-inline: 5px 2px;
    vertical-align: middle;
    color: #7b1b32;
    border: 1px solid rgba(201, 154, 72, .35);
    border-radius: 50%;
    background: #fff5df;
    font-family: "Cairo", sans-serif;
    font-size: 12px;
    font-weight: 900;
}

.ed-quran-verse__sura {
    display: block;
    margin-top: 3px;
    color: #9a7a57;
    font-size: 12px;
}

.ed-quran-empty {
    padding: 18px;
    color: #8e756d;
    text-align: center;
    font-size: 12px;
}


/* =========================================================
   LIBRARY CONTENT MODAL
   المقالات + الفيديوهات + الصوتيات داخل النافذة المنبثقة
   ========================================================= */
.ed-content-modal {
    display: grid;
    gap: 16px;
}

.ed-content-modal__description {
    margin: 0;
    color: #514440;
    font-size: 14px;
    line-height: 2.1;
    white-space: normal;
}

.ed-content-modal__video,
.ed-content-modal__audio {
    width: 100%;
}

.ed-content-modal__video video,
.ed-content-modal__video iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 12px;
    background: #111;
}

.ed-content-modal__audio audio {
    display: block;
    width: 100%;
}

.ed-content-modal__external {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    color: #fff !important;
    border-radius: 10px;
    background: #7f1730;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 800;
}

/* =========================================================
   TOAST
   ========================================================= */
.ed-toast[hidden] { display: none !important; }

.ed-toast {
    position: fixed;
    z-index: 10080;
    left: 50%;
    bottom: 28px;
    min-width: 190px;
    max-width: min(90vw, 430px);
    padding: 10px 14px;
    color: #fff;
    border-radius: 9px;
    background: #5e1425;
    box-shadow: 0 12px 30px rgba(24,8,11,.22);
    font-size: 12px;
    text-align: center;
    transform: translateX(-50%);
}


/* Zoom Out / الشاشات الواسعة:
   نفس سلوك التصميم القديم — نقيد الهيرو والمحتوى فقط،
   وليس الصفحة كاملة، وتبقى المساحات الخارجية بيضاء. */
@media (min-width: 1600px) {
    .ed-hero,
    .ed-content {
        width: min(100%, 1600px);
        margin-inline: auto;
    }

    .ed-hero {
        border-radius: 0 0 16px 16px;
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1050px) {
    .ed-layout { grid-template-columns: 225px minmax(0,1fr); gap: 20px; }
    .ed-related-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 820px) {
    .ed-container { width: min(calc(100% - 24px), 1220px); }
    .ed-hero__inner {
        min-height: 210px;
        grid-template-columns: 1fr 1fr;
        padding-block: 18px 22px;
    }
    .ed-hero__title-wrap,
    .ed-meta-bar { grid-column: 1 / -1; }

.ed-hero h1 { font-size: clamp(30px, 7vw, 45px); }
    .ed-meta-bar span { padding-inline: 8px; font-size: 12px; }

    .ed-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "sidebar";
        gap: 18px;
    }

    .ed-sidebar {
        position: static;
        top: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 12px;
        max-height: none;
        overflow: visible;
    }

    .ed-side-card { margin: 0; }
    .ed-related-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 991px) {
    .ed-video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ed-video-grid:has(.ed-video-card:only-child) {
        grid-template-columns: minmax(260px, 360px);
    }
}

@media (max-width: 575.98px) {
    .ed-container {
        width: min(calc(100% - 20px), 1220px);
    }

    /* =====================================================
       MOBILE HERO — ترتيب مخصص للجوال
       ===================================================== */
    .ed-hero {
        min-height: 0;
    }

    .ed-hero__inner {
        position: relative;
        display: block;
        min-height: 0;
        padding-block: 14px 18px;
    }

    /* الزران في صف واحد أعلى الهيرو */
    .ed-hero__top-actions {
        top: 13px;
        gap: 8px;
    }

    .ed-return-link,
    .ed-view-all-events {
        min-height: 34px;
        padding: 6px 10px;
        gap: 6px;
        font-size: 12px;
        border-radius: 9px;
    }

    /* كود الشعار محفوظ كما هو حتى لو كان عنصر الشعار مخفيًا من Blade */
    .ed-hero-brand {
        position: absolute;
        top: 15px;
        right: 0;
        z-index: 5;
        width: clamp(116px, 34vw, 135px);
        margin: 0;
    }

    .ed-hero-brand img {
        width: 100%;
        height: auto;
    }

    /* مساحة واضحة بين الصف العلوي والعنوان */
    .ed-hero__title-wrap {
        width: min(100%, 330px);
        margin: 52px auto 0;
        padding-inline: 4px;
        text-align: center;
    }

    .ed-hero__eyebrow {
        margin-bottom: 3px;
        font-size: 12px;
    }

    .ed-hero h1 {
        max-width: 100%;
        margin-inline: auto;
        font-size: clamp(26px, 8.7vw, 34px);
        line-height: 1.28;
        text-wrap: balance;
    }

    /* بيانات التاريخ 2 × 2 بشكل متوازن */
    .ed-meta-bar {
        width: 100%;
        max-width: 340px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin: 13px auto 0;
        padding: 7px;
        border-radius: 11px;
        background: rgba(65,4,18,.24);
    }

    .ed-meta-bar span {
        min-width: 0;
        min-height: 31px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 5px 6px;
        border: 1px solid rgba(229,195,123,.11);
        border-radius: 7px;
        background: rgba(255,255,255,.025);
        font-size: 12px;
        line-height: 1.45;
        white-space: normal;
        text-align: center;
    }

    .ed-meta-bar span:last-child {
        border-inline-end: 1px solid rgba(229,195,123,.11);
    }

    /* بقية الصفحة */
    .ed-content {
        padding-top: 14px;
    }

    .ed-event-image {
        aspect-ratio: 16 / 9;
        border-radius: 10px;
    }

    .ed-breadcrumb {
        min-height: 0;
        padding: 7px 5px;
        font-size: 12px;
    }

    .ed-text-card {
        padding: 14px 13px 15px;
        border-radius: 10px;
    }

    .ed-text-card header {
        gap: 9px;
        margin-bottom: 10px;
        padding-bottom: 9px;
    }

    .ed-text-card header i {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .ed-text-card h2,
    .ed-section-heading h2 {
        font-size:21px;
    }

    .ed-rich-text {
        font-size: 14px;
        line-height: 2.05;
    }

    .ed-event-nav {
        grid-template-columns: 1fr;
    }

    .ed-event-nav__item {
        min-height: 45px;
    }

    .ed-event-nav__item--next {
        text-align: right;
        justify-content: flex-start;
    }

    .ed-share-section {
        padding: 14px 13px 15px;
    }

    .ed-share-section::after {
        right: 10px;
        font-size: 38px;
        opacity: .48;
    }

    .ed-share-actions {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ed-share-main,
    .ed-quiz-main {
        min-width: 0;
        font-size: 12px;
    }

    .ed-share-menu {
        left: 0;
        right: auto;
        width: min(310px, calc(100vw - 34px));
        bottom: calc(100% + 8px);
        top: auto;
    }

    .ed-share-social-grid {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }

    .ed-share-social-grid button {
        min-height: 66px;
    }

    .ed-related-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 7px;
    }

    .ed-related-card__image {
        height: 72px;
    }

    .ed-video-grid,
    .ed-video-grid:has(.ed-video-card:only-child) {
        grid-template-columns: 1fr;
    }

    .ed-sidebar {
        grid-template-columns: 1fr;
    }

    .ed-modal {
        padding: 10px;
    }

    .ed-modal__dialog {
        max-height: 88vh;
        border-radius: 12px;
    }

    .ed-modal__header {
        min-height: 62px;
        padding: 10px 12px;
    }

    .ed-modal__heading h2 {
        font-size: 22px;
    }

    .ed-modal__body {
        padding: 12px;
    }
}

@media (max-width: 390px) {
    .ed-return-link,
    .ed-view-all-events {
        padding-inline: 8px;
        font-size: 12px;
    }

    .ed-hero-brand {
        width: clamp(108px, 32vw, 124px);
    }

    .ed-hero__title-wrap {
        width: min(100%, 315px);
        margin-top: 50px;
    }

    .ed-hero h1 {
        font-size: clamp(25px, 8.5vw, 32px);
    }

    .ed-meta-bar {
        gap: 5px;
        padding: 6px;
    }

    .ed-meta-bar span {
        min-height: 30px;
        padding: 4px 5px;
        font-size: 12px;
    }

    .ed-event-image {
        aspect-ratio: 16 / 9;
    }

    .ed-share-actions {
        grid-template-columns: 1fr;
    }

    .ed-share-section::after {
        display: none;
    }

    .ed-quran-verse__text {
        font-size: 19px;
    }
}


@media (prefers-reduced-motion: reduce) {
    .sirah-event-page *,
    .sirah-event-page *::before,
    .sirah-event-page *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


@media (max-width: 767px) {
    .ed-encyclopedia-brand {
        padding: 8px 12px 1px;
    }

    .ed-encyclopedia-brand__inner {
        width: min(100%, 315px);
        min-height: 54px;
        padding: 6px 14px;
        border-radius: 11px;
    }

    .ed-encyclopedia-brand__inner img {
        max-width: 290px;
        max-height: 47px;
    }
}

/* =========================================================
   STICKY EVENT SIDEBAR — بدون Scroll داخلي
   ========================================================= */
@media (min-width: 821px) {
    .ed-sidebar {
        position: sticky;
        top: 88px;

        align-self: start;

        max-height: none;
        overflow: visible;
    }
}
