/**
 * article-components.css — مكتبة مركّبات القصة (Featured Story Components)
 * نسخة sitemanagingV6Client (المرجع) — تُزامَن مع backoffice/assets/css/article-components.css لعرض WYSIWYG داخل canvas المحرّر.
 *
 * مبادئ:
 * - كل مركّب مكتفٍ ذاتياً ومُنطّق على [data-component="..."] (لا اعتماد على Bootstrap) ليتطابق العرض في المحرّر والموقع.
 * - RTL أولاً (الموقع عربي)، مع خصائص منطقية (margin-inline / padding-inline).
 * - دعم prefers-reduced-motion و:focus-visible وبدائل نصية (sr-only).
 * - النسخ عبر data-v على كل مركّب (عقد دائم) — الأنماط تدعم النسخة 1 وما بعدها دون كسر.
 */

/* ─── توكنز المركّبات (قابلة للتجاوز من الثيم) ─── */
[data-component] {
    --ac-accent: var(--color-primary, #7a9b22);
    --ac-accent-contrast: #ffffff;
    --ac-text: #1f2329;
    --ac-muted: #6c757d;
    --ac-border: #e3e6ea;
    --ac-surface: #ffffff;
    --ac-surface-alt: #f6f7f4;
    --ac-radius: 14px;
    --ac-radius-sm: 8px;
    --ac-gap: 1rem;
    --ac-gap-lg: 1.5rem;
    --ac-shadow: 0 6px 24px rgba(20, 24, 31, 0.08);
    box-sizing: border-box;
}

[data-component] *,
[data-component] *::before,
[data-component] *::after {
    box-sizing: border-box;
}

[data-component] {
    margin-block: var(--ac-gap-lg);
    color: var(--ac-text);
}

/* أداة بديل نصي للقارئات الشاشية */
[data-component] .ac-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

[data-component] :focus-visible {
    outline: 2px solid var(--ac-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ════════════ 1) Hero — رأس القصة ════════════ */
[data-component="story-hero"] {
    display: grid;
    gap: var(--ac-gap);
    padding: 0;
}

[data-component="story-hero"] .story-hero__eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ac-accent);
    text-transform: uppercase;
    margin: 0;
}

[data-component="story-hero"] .story-hero__title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.2;
    font-weight: 800;
    margin: 0;
    color: var(--ac-text);
}

[data-component="story-hero"] .story-hero__byline {
    font-size: 0.95rem;
    color: var(--ac-muted);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

[data-component="story-hero"] .story-hero__byline time {
    color: var(--ac-muted);
}

[data-component="story-hero"] .story-hero__media {
    margin: 0;
}

[data-component="story-hero"] .story-hero__media img {
    width: 100%;
    height: auto;
    border-radius: var(--ac-radius);
    display: block;
}

[data-component="story-hero"] .story-hero__media figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--ac-muted);
    text-align: center;
}

/* ════════════ 2) Narrative — سرد + drop-cap + ملاحظة ميدانية ════════════ */
[data-component="story-narrative"] {
    font-size: 1.08rem;
    line-height: 1.9;
}

[data-component="story-narrative"] p {
    margin-block: 0 1rem;
}

[data-component="story-narrative"] .story-narrative__lead .dropcap,
[data-component="story-narrative"] .dropcap {
    float: inline-start;
    font-size: 3.2rem;
    line-height: 0.8;
    font-weight: 800;
    color: var(--ac-accent);
    padding-inline-end: 0.5rem;
    padding-block-start: 0.35rem;
}

[data-component="field-note"],
[data-component="story-narrative"] .field-note {
    margin-block: var(--ac-gap);
    padding: 1rem 1.1rem;
    background: var(--ac-surface-alt);
    border-inline-start: 4px solid var(--ac-accent);
    border-radius: var(--ac-radius-sm);
    font-size: 0.98rem;
}

[data-component="field-note"] > *:first-child,
[data-component="story-narrative"] .field-note > *:first-child { margin-block-start: 0; }
[data-component="field-note"] > *:last-child,
[data-component="story-narrative"] .field-note > *:last-child { margin-block-end: 0; }

/* ════════════ 3) Pull-quote — اقتباس بارز ════════════ */
[data-component="pull-quote"] {
    margin-inline: 0;
    padding: 1.25rem 1.5rem;
    border-block: 2px solid var(--ac-border);
    text-align: center;
}

[data-component="pull-quote"] blockquote {
    margin: 0;
    border: 0;
    padding: 0;
}

[data-component="pull-quote"] blockquote p {
    font-size: clamp(1.3rem, 2.5vw, 1.9rem);
    line-height: 1.5;
    font-weight: 700;
    color: var(--ac-text);
    margin: 0;
}

[data-component="pull-quote"] blockquote p::before { content: "« "; color: var(--ac-accent); }
[data-component="pull-quote"] blockquote p::after { content: " »"; color: var(--ac-accent); }

[data-component="pull-quote"] figcaption {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: var(--ac-muted);
    font-weight: 600;
}

/* ════════════ 4) Gallery — معرض صور (scroll-snap) ════════════ */
[data-component="story-gallery"] {
    display: grid;
    gap: 0.75rem;
}

[data-component="story-gallery"] .story-gallery__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(80%, 420px);
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-block-end: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

[data-component="story-gallery"] figure {
    margin: 0;
    scroll-snap-align: start;
}

[data-component="story-gallery"] img {
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--ac-radius-sm);
    display: block;
}

[data-component="story-gallery"] figcaption {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--ac-muted);
}

/* بديل: شبكة عند عدم وجود track */
[data-component="story-gallery"]:not(:has(.story-gallery__track)) {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ════════════ 5) Video — قائمة فيديو (تضمين iframe) ════════════ */
[data-component="story-video"] {
    display: grid;
    gap: var(--ac-gap);
}

[data-component="story-video"] .story-video__item {
    margin: 0;
}

[data-component="story-video"] .story-video__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--ac-radius-sm);
    overflow: hidden;
}

[data-component="story-video"] .story-video__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

[data-component="story-video"] figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--ac-muted);
}

/* ════════════ 6) Podcast — مشغّل بودكاست ════════════ */
[data-component="story-podcast"] {
    display: flex;
    gap: var(--ac-gap);
    align-items: center;
    padding: 1rem;
    background: var(--ac-surface-alt);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    flex-wrap: wrap;
}

[data-component="story-podcast"] .story-podcast__art {
    width: 96px;
    height: 96px;
    border-radius: var(--ac-radius-sm);
    object-fit: cover;
    flex: 0 0 auto;
}

[data-component="story-podcast"] .story-podcast__body {
    flex: 1 1 240px;
    min-width: 0;
    display: grid;
    gap: 0.5rem;
}

[data-component="story-podcast"] .story-podcast__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

[data-component="story-podcast"] .story-podcast__meta {
    font-size: 0.85rem;
    color: var(--ac-muted);
    margin: 0;
}

[data-component="story-podcast"] audio {
    width: 100%;
}

/* ════════════ 7) Shop the Story — بطاقات منتج ════════════ */
[data-component="shop-the-story"] {
    display: grid;
    gap: var(--ac-gap);
}

[data-component="shop-the-story"] .shop-the-story__title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
}

[data-component="shop-the-story"] .shop-the-story__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--ac-gap);
}

[data-component="shop-the-story"] .shop-card {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    text-decoration: none;
    color: inherit;
}

[data-component="shop-the-story"] .shop-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--ac-radius-sm);
}

[data-component="shop-the-story"] .shop-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

[data-component="shop-the-story"] .shop-card__price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ac-accent);
    margin: 0;
}

/* ════════════ 8) Related Reads + شريط مشاركة ════════════ */
[data-component="related-reads"] {
    display: grid;
    gap: var(--ac-gap);
    padding: var(--ac-gap);
    background: var(--ac-surface-alt);
    border-radius: var(--ac-radius);
}

[data-component="related-reads"] .related-reads__title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
}

[data-component="related-reads"] ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

[data-component="related-reads"] li a {
    color: var(--ac-text);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

[data-component="related-reads"] li a:hover { color: var(--ac-accent); }

[data-component="share-bar"] {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

[data-component="share-bar"] .share-bar__label {
    font-weight: 700;
    margin-inline-end: 0.25rem;
}

[data-component="share-bar"] a,
[data-component="share-bar"] button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--ac-border);
    background: var(--ac-surface);
    color: var(--ac-text);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

[data-component="share-bar"] a:hover,
[data-component="share-bar"] button:hover {
    border-color: var(--ac-accent);
    color: var(--ac-accent);
}

/* ════════════ 9) By The Numbers — أرقام ════════════ */
[data-component="by-the-numbers"] {
    display: grid;
    gap: var(--ac-gap);
}

[data-component="by-the-numbers"] .by-the-numbers__title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
}

[data-component="by-the-numbers"] .by-the-numbers__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--ac-gap);
}

[data-component="by-the-numbers"] .stat {
    text-align: center;
    padding: 1rem;
    background: var(--ac-surface-alt);
    border-radius: var(--ac-radius);
}

[data-component="by-the-numbers"] .stat__value {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: var(--ac-accent);
    line-height: 1;
    margin: 0;
}

[data-component="by-the-numbers"] .stat__label {
    font-size: 0.9rem;
    color: var(--ac-muted);
    margin: 0.35rem 0 0;
}

/* ════════════ تفاعلي 1) Before/After ════════════ */
[data-component="before-after"] .before-after__stage {
    --ba-pos: 50%;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--ac-radius);
    background: var(--ac-surface-alt);
}

[data-component="before-after"] .before-after__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

[data-component="before-after"] .before-after__img--after {
    clip-path: inset(0 0 0 var(--ba-pos));
}

[data-component="before-after"] .before-after__range {
    position: absolute;
    inset-block-end: 12px;
    inset-inline: 12px;
    width: calc(100% - 24px);
    z-index: 3;
    cursor: ew-resize;
}

[data-component="before-after"] .before-after__labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--ac-muted);
    font-weight: 600;
}

/* بديل بلا JS: تظهر الصورتان فوق بعض دون قصّ */
[data-component="before-after"]:not(.is-enhanced) .before-after__img--after { clip-path: none; opacity: 0.5; }

/* ════════════ تفاعلي 2) Hotspots ════════════ */
[data-component="hotspots"] .hotspots__stage {
    position: relative;
    margin: 0;
}

[data-component="hotspots"] .hotspots__stage > img {
    width: 100%;
    height: auto;
    border-radius: var(--ac-radius);
    display: block;
}

[data-component="hotspots"] .hotspots__dot {
    position: absolute;
    transform: translate(50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid var(--ac-accent-contrast);
    background: var(--ac-accent);
    color: var(--ac-accent-contrast);
    cursor: pointer;
    box-shadow: var(--ac-shadow);
    padding: 0;
    z-index: 2;
}

[data-component="hotspots"] .hotspots__dot::before {
    content: "+";
    font-size: 1.1rem;
    line-height: 1;
}

[data-component="hotspots"] .hotspots__pop {
    position: absolute;
    z-index: 4;
    max-width: 260px;
    padding: 0.75rem 0.9rem;
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    box-shadow: var(--ac-shadow);
    font-size: 0.9rem;
    inset-block-start: 50%;
    inset-inline-start: 50%;
}

[data-component="hotspots"] .hotspots__pop > *:first-child { margin-block-start: 0; }
[data-component="hotspots"] .hotspots__pop > *:last-child { margin-block-end: 0; }

/* ════════════ تفاعلي 3) Stats Tabs ════════════ */
[data-component="stats-tabs"] .stats-tabs__tablist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-block-end: 2px solid var(--ac-border);
    margin-block-end: var(--ac-gap);
}

[data-component="stats-tabs"] [role="tab"] {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ac-muted);
    cursor: pointer;
    border-block-end: 2px solid transparent;
    margin-block-end: -2px;
}

[data-component="stats-tabs"] [role="tab"][aria-selected="true"] {
    color: var(--ac-accent);
    border-block-end-color: var(--ac-accent);
}

[data-component="stats-tabs"] [role="tabpanel"][hidden] { display: none; }

/* ════════════ تفاعلي 4) Carousel ════════════ */
[data-component="story-carousel"] .story-carousel__viewport { overflow: hidden; }

[data-component="story-carousel"] .story-carousel__track {
    display: flex;
    gap: var(--ac-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem;
    scroll-behavior: smooth;
}

[data-component="story-carousel"] .story-carousel__slide {
    flex: 0 0 min(85%, 480px);
    scroll-snap-align: center;
}

[data-component="story-carousel"] .story-carousel__slide figure { margin: 0; }

[data-component="story-carousel"] .story-carousel__slide img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--ac-radius-sm);
    display: block;
}

[data-component="story-carousel"] .story-carousel__slide figcaption {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--ac-muted);
}

[data-component="story-carousel"] .story-carousel__controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

[data-component="story-carousel"] .story-carousel__btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--ac-border);
    background: var(--ac-surface);
    color: var(--ac-text);
    font-size: 1.2rem;
    cursor: pointer;
}

[data-component="story-carousel"] .story-carousel__btn:disabled { opacity: 0.4; cursor: default; }
[data-component="story-carousel"] .story-carousel__btn:hover:not(:disabled) { border-color: var(--ac-accent); color: var(--ac-accent); }

@media (prefers-reduced-motion: reduce) {
    [data-component="story-carousel"] .story-carousel__track { scroll-behavior: auto; }
}

/* ════════════ تفاعلي 5) Audio Story ════════════ */
[data-component="audio-story"] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--ac-surface-alt);
    border: 1px solid var(--ac-border);
    border-radius: 999px;
}

[data-component="audio-story"] .audio-story__play {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--ac-accent);
    color: var(--ac-accent-contrast);
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}

[data-component="audio-story"] .audio-story__seek {
    flex: 1 1 140px;
    min-width: 100px;
}

[data-component="audio-story"] .audio-story__time {
    font-size: 0.85rem;
    color: var(--ac-muted);
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

[data-component="audio-story"] .audio-story__speed {
    border: 1px solid var(--ac-border);
    background: var(--ac-surface);
    border-radius: 999px;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
    flex: 0 0 auto;
}

[data-component="audio-story"] .audio-story__audio { display: none; }

/* ════════════ متقدّم 1) Data Chart — رسم بياني ════════════ */
[data-component="data-chart"] .data-chart__canvas-wrap {
    position: relative;
    inline-size: 100%;
    block-size: 340px;
    margin-block: var(--ac-gap);
}

[data-component="data-chart"] .data-chart__toggle {
    appearance: none;
    border: 1px solid var(--ac-border);
    background: var(--ac-surface);
    color: var(--ac-text);
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    margin-block-end: 0.5rem;
}

[data-component="data-chart"] .data-chart__toggle:hover { border-color: var(--ac-accent); color: var(--ac-accent); }

[data-component="data-chart"] table {
    inline-size: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

[data-component="data-chart"] caption { caption-side: top; font-weight: 700; margin-block-end: 0.4rem; text-align: start; }
[data-component="data-chart"] th,
[data-component="data-chart"] td { border: 1px solid var(--ac-border); padding: 0.4rem 0.6rem; text-align: start; }
[data-component="data-chart"] thead th { background: var(--ac-surface-alt); }

/* عند التحسين: الجدول مخفي بصرياً (يبقى لقارئ الشاشة)، إلا عند طلب إظهاره */
[data-component="data-chart"].is-enhanced table {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

[data-component="data-chart"].is-enhanced.data-chart--table-visible table {
    position: static;
    inline-size: 100%;
    block-size: auto;
    padding: revert;
    margin: revert;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ════════════ متقدّم 2) Story Map — خريطة ════════════ */
[data-component="story-map"] .story-map__stage {
    position: relative;
    margin: 0;
}

[data-component="story-map"] .story-map__stage > img {
    inline-size: 100%;
    block-size: auto;
    border-radius: var(--ac-radius);
    display: block;
}

[data-component="story-map"] .story-map__marker {
    position: absolute;
    transform: translate(50%, -50%);
    min-inline-size: 26px;
    block-size: 26px;
    padding-inline: 6px;
    border-radius: 999px;
    border: 2px solid var(--ac-accent-contrast);
    background: var(--ac-accent);
    color: var(--ac-accent-contrast);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--ac-shadow);
    z-index: 2;
}

[data-component="story-map"] .story-map__marker.is-active { outline: 3px solid var(--ac-accent); outline-offset: 2px; }

[data-component="story-map"] .story-map__list {
    list-style: none;
    margin: var(--ac-gap) 0 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

[data-component="story-map"] .story-map__item {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    background: var(--ac-surface);
}

[data-component="story-map"] .story-map__item.is-active { border-color: var(--ac-accent); background: var(--ac-surface-alt); }

/* ════════════ متقدّم 3) Audio waveform ════════════ */
[data-component="audio-story"] .audio-story__wave {
    display: flex;
    align-items: center;
    gap: 2px;
    block-size: 28px;
    flex: 1 1 120px;
    min-inline-size: 80px;
}

[data-component="audio-story"] .audio-story__wave span {
    flex: 1 1 auto;
    background: var(--ac-accent);
    opacity: 0.55;
    border-radius: 2px;
    block-size: 30%;
}

[data-component="audio-story"].is-playing .audio-story__wave span {
    animation: acWave 1s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 0.04s);
}

@keyframes acWave {
    0%, 100% { block-size: 25%; opacity: 0.45; }
    50% { block-size: 90%; opacity: 0.9; }
}

/* ════════════ متقدّم 4) Story Poll — تصويت ════════════ */
[data-component="story-poll"] {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 1.1rem 1.25rem;
    background: var(--ac-surface-alt);
}

[data-component="story-poll"] fieldset { border: 0; margin: 0; padding: 0; }
[data-component="story-poll"] legend { font-weight: 700; font-size: 1.1rem; margin-block-end: 0.75rem; padding: 0; }

[data-component="story-poll"] .story-poll__option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    background: var(--ac-surface);
    margin-block-end: 0.5rem;
    cursor: pointer;
}

[data-component="story-poll"] .story-poll__option:hover { border-color: var(--ac-accent); }
[data-component="story-poll"] .story-poll__option input { inline-size: 1.1rem; block-size: 1.1rem; }

[data-component="story-poll"] .story-poll__submit {
    margin-block-start: 0.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--ac-accent);
    color: var(--ac-accent-contrast);
    font-weight: 700;
    padding: 0.55rem 1.4rem;
    cursor: pointer;
}

[data-component="story-poll"] .story-poll__submit:disabled { opacity: 0.6; cursor: default; }

[data-component="story-poll"] .story-poll__bar {
    display: grid;
    grid-template-columns: minmax(80px, 30%) 1fr auto;
    align-items: center;
    gap: 0.6rem;
    margin-block-end: 0.55rem;
    font-size: 0.9rem;
}

[data-component="story-poll"] .story-poll__bar-track {
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: 999px;
    block-size: 12px;
    overflow: hidden;
}

[data-component="story-poll"] .story-poll__bar-fill {
    display: block;
    block-size: 100%;
    background: var(--ac-accent);
    border-radius: 999px;
    transition: inline-size 0.4s ease;
}

[data-component="story-poll"] .story-poll__bar-pct { font-variant-numeric: tabular-nums; color: var(--ac-muted); }
[data-component="story-poll"] .story-poll__total { margin-block-start: 0.6rem; font-weight: 600; }

/* ════════════ متقدّم 5) شريط تقدّم القراءة ════════════ */
.article-reading-progress {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    block-size: 4px;
    background: transparent;
    z-index: 1080;
    pointer-events: none;
}

.article-reading-progress__fill {
    block-size: 100%;
    inline-size: 0;
    background: var(--ac-accent, #4f46e5);
}

@media (prefers-reduced-motion: reduce) {
    [data-component="audio-story"].is-playing .audio-story__wave span { animation: none; block-size: 55%; }
    [data-component="story-poll"] .story-poll__bar-fill { transition: none; }
}

/* ─── استجابة ─── */
@media (max-width: 640px) {
    [data-component="story-podcast"] {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    [data-component="story-podcast"] .story-podcast__art {
        margin-inline: auto;
    }
}

/* ─── حركة مخفّضة ─── */
@media (prefers-reduced-motion: reduce) {
    [data-component] * {
        scroll-behavior: auto !important;
    }
}

/* ─── طبقات عنوان المقال (حقول Article_Title / SubTitle / Summary) ─── */
.article-deck {
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    line-height: 1.6;
    color: var(--bs-secondary-color, #6c757d);
    max-width: 42rem;
    margin-inline: auto;
}

.article-lead {
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--bs-body-color, #212529);
}

.article-card-deck {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--bs-secondary-color, #6c757d);
}
