/* ============================================================
   JP News (جهينة نيوز) — finaldesign «الشبكة» — article.css
   The single-article template (2026-09-28) and its opinion modifier
   (.article-opinion — same components, one class). Loaded after
   interior.css on article.html and article-opinion.html only.
   Owns: reading progress · article head (kicker, h1, standfirst,
   meta row) · hero figure · long-form body typography (keyword
   links, subheads, pull quote, inline figure, lists, blockquote) ·
   comments · author block · disclaimer · text-size steps · print.
   ============================================================ */

/* ------------------------------------------------------------
   READING PROGRESS — a real <progress>, so animating it takes ONE
   attribute (value) and no style. Pure design (2026-09-29): the
   templates ship it at 0; the development team drives it. Sticky
   just under the header;
   the track is transparent, so only the read part shows. Fills
   from the inline start because the element inherits direction.
   ------------------------------------------------------------ */
.reading-progress {
    position: sticky;
    inset-block-start: calc(var(--header-height) + 1px);
    z-index: calc(var(--z-sticky) - 1);
    display: block;
    inline-size: 100%;
    block-size: 4px;
    margin-block-end: -4px;          /* takes no room in the flow */
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--cat, var(--color-accent));
    pointer-events: none;
}

.reading-progress::-webkit-progress-bar {
    background: transparent;
}

.reading-progress::-webkit-progress-value {
    background-color: var(--cat, var(--color-accent));
    transition: inline-size var(--transition-fast);
}

.reading-progress::-moz-progress-bar {
    background-color: var(--cat, var(--color-accent));
}

@media (prefers-reduced-motion: reduce) {
    .reading-progress::-webkit-progress-value {
        transition: none;
    }
}

/* ------------------------------------------------------------
   PAGE WIDTH — an article is read, so the two columns are held to
   1160px and centred: main 804px at 1440 (the 750px measure inside),
   rail 324. Below 1200 the grid is the container.
   ------------------------------------------------------------ */
@media (min-width: 1200px) {
    .article-page .page-grid,
    .article-page .breadcrumb {
        max-inline-size: 1160px;
        margin-inline: auto;
    }
}

/* ------------------------------------------------------------
   ARTICLE HEAD
   ------------------------------------------------------------ */
.article {
    --article-measure: 750px;     /* head, hero, body and foot share one reading width */
}

.article-head,
.article-hero,
.article-foot {
    max-inline-size: var(--article-measure);
}

.article-head {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-block-end: var(--space-md);
}

.article-kicker {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    align-self: flex-start;
    min-block-size: 32px;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: var(--fs-label);
    color: var(--cat, var(--color-text));
}

.article-kicker:hover,
.article-kicker:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.article-title {
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: clamp(26px, 2.8vw, 36px);
    line-height: 1.3;
}

.article-standfirst {
    font-size: var(--fs-lg);
    font-weight: 500;
    line-height: 1.7;
    color: var(--color-text);
    padding-inline-start: var(--space-md);
    border-inline-start: 4px solid var(--cat, var(--color-accent));
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs) var(--space-md);
    font-size: var(--fs-meta);
    color: var(--color-text-muted);
}

.article-meta > * {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.article-source {
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--color-text);
}

.article-meta .icon-sm {
    inline-size: 14px;
    block-size: 14px;
}

.article-meta time {
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   FIGURES — hero and inline. The media box declares its ratio, so
   the image never moves the text (zero CLS).
   ------------------------------------------------------------ */
.article-hero {
    margin-block: var(--space-md) var(--space-lg);
}

.article-figure {
    margin-block: 1.5em;
}


.article-figure + * + * {
    clear: both;
}

.article-figure + p + figure {
    clear: both;
}

/* .article-figure--left,
.article-figure--right {
    inline-size: min(42%, 320px);
    margin-block: 0.35em 1em;
}

.article-figure--left {
    float: left;
    margin-inline: 0 1.25em;
}

.article-figure--right {
    float: right;
    margin-inline: 1.25em 0;
} */

/* One caption per image, no separate credit line (client, 2026-09-29) */
.figure-caption {
    padding-block: var(--space-sm);
    border-block-end: 1px solid var(--color-border);
    font-size: var(--fs-meta);
    line-height: 1.6;
    color: var(--color-text-muted);
}

.article-media-section {
    margin-block: 1.75em;
}

.article-media-section .article-subhead {
    margin-block-start: 0;
}

.article-video {
    margin: 0;
}

.article-video-frame {
    inline-size: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #111;
    border-radius: var(--radius-card);
}

.article-video-frame iframe {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    border: 0;
}

.article-document-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-inline-start: 4px solid var(--cat, var(--color-accent));
    border-radius: var(--radius-card);
    background-color: var(--color-bg-alt);
}

.article-document-type {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    inline-size: 48px;
    block-size: 56px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background-color: var(--color-bg);
    color: var(--cat, var(--color-accent));
    font-size: var(--fs-meta);
    font-weight: 800;
    line-height: 1;
}

.article-document-info {
    min-inline-size: 0;
    flex: 1 1 auto;
}

.article-document-info h3 {
    font-family: var(--font-primary);
    font-size: var(--fs-md);
    font-weight: 700;
    line-height: 1.5;
}

.article-document-info p {
    margin-block-start: var(--space-xs);
    color: var(--color-text-muted);
    font-size: var(--fs-meta);
    line-height: 1.5;
}

.article-document-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.article-body a.article-document-link:not(.keyword-link):not(.thumb-link) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: 40px;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--cat, var(--color-accent));
    border-radius: var(--radius-card);
    background-color: var(--cat, var(--color-accent));
    color: var(--color-on-accent, #fff);
    font-size: var(--fs-meta);
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.article-body a.article-document-download:not(.keyword-link):not(.thumb-link) {
    background-color: transparent;
    color: var(--cat, var(--color-text));
}

.article-body a.article-document-link:not(.keyword-link):not(.thumb-link):hover,
.article-body a.article-document-link:not(.keyword-link):not(.thumb-link):focus-visible {
    filter: brightness(0.92);
    text-decoration: none;
}

@media (max-width: 600px) {
    .article-document-card {
        flex-wrap: wrap;
    }

    .article-document-info {
        flex-basis: calc(100% - 64px);
    }

    .article-document-actions {
        flex-basis: 100%;
    }

    .article-document-link {
        flex: 1 1 auto;
    }
}

/* ------------------------------------------------------------
   BODY — long-form Arabic: 18px on a 760px measure, 1.9 leading,
   a clear paragraph beat. --article-fs is the one size of the
   reading column (the opinion page's «أ− / أ+» design buttons would
   step it; that behaviour is the development team's).
   ------------------------------------------------------------ */
.article-body {
    --article-fs: var(--fs-lg);
    max-inline-size: var(--article-measure);
    font-size: var(--article-fs);
    line-height: 1.9;
}

.article-body > p {
    margin-block-end: 1.25em;
}

.article-body > p:last-child {
    margin-block-end: 0;
}

/* Inline keyword links — a topic, not a citation: the category
   colour runs under the words, the text stays ink until hover */
.keyword-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--cat, var(--color-accent));
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.keyword-link:hover,
.keyword-link:focus-visible {
    color: var(--cat, var(--color-text));
    background-color: var(--color-bg-alt);
}

/* Ordinary links inside the body (sources, documents) */
.article-body a:not(.keyword-link):not(.thumb-link) {
    color: var(--cat, var(--color-text));
    text-decoration: underline;
    text-underline-offset: 4px;
}

.article-subhead {
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: var(--fs-card-lg);
    line-height: 1.4;
    margin-block: 1.6em 0.6em;
}

/* The short category rule over each subhead belongs to the opinion
   template only; the news article's subheads carry none (client,
   2026-09-29 — the opinion page keeps it until told otherwise) */
.article-opinion .article-subhead::before {
    content: '';
    display: block;
    inline-size: 32px;
    block-size: 3px;
    margin-block-end: var(--space-sm);
    background-color: var(--cat, var(--color-accent));
    border-radius: var(--radius-bar, 0);
}

/* Pull quote — an excerpt of the piece, set apart on the panel ground */
.pull-quote {
    margin-block: 1.5em;
    padding: var(--space-md) var(--space-lg);
    background-color: var(--color-bg-alt);
    border-inline-start: 4px solid var(--cat, var(--color-accent));
    border-radius: var(--radius-card);
}

.pull-quote p {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: var(--fs-xl);
    line-height: 1.55;
}

.pull-quote::before {
    content: '';
    display: block;
    inline-size: 40px;
    block-size: 4px;
    margin-block-end: var(--space-sm);
    background-color: var(--cat, var(--color-accent));
    border-radius: var(--radius-bar, 0);
}

/* Lists in the body — real bullets, category-coloured markers */
ul.article-list {                    /* ul + class beats the reset's ul[class] on specificity */
    margin-block-end: 1.25em;
    padding-inline-start: 1.4em;
    list-style: disc;
}

.article-list li {
    padding-inline-start: 0.2em;
}

.article-list li + li {
    margin-block-start: 0.4em;
}

.article-list li::marker {
    color: var(--cat, var(--color-accent));
}

/* Blockquote — a quoted statement with its attribution */
.article-quote {
    margin-block: 1.5em;
    padding-inline-start: var(--space-md);
    border-inline-start: 3px solid var(--color-rule-strong);
}

.article-quote p {
    font-size: var(--article-fs);
    margin-block-end: var(--space-sm);
}

/* The news article's quotation has no attribution line (client,
   2026-09-29), so its text is the last child */
.article-quote p:last-child {
    margin-block-end: 0;
}

.quote-attrib {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-text-muted);
}

.quote-attrib::before {
    content: '— ';
}

/* ------------------------------------------------------------
   ARTICLE FOOT — tags · compact share · pager
   ------------------------------------------------------------ */
.article-foot {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-block-start: var(--space-lg);
}

/* AD-07 closes the article, above the comments (client, 2026-09-29):
   centred on the reading measure, the same air above and below */
.article > .ad-column-banner {
    max-inline-size: var(--article-measure);
    margin-block-start: var(--space-lg);
}

.article > .ad-column-banner + .article-comments {
    margin-block-start: var(--space-lg);
}

/* ------------------------------------------------------------
   COMMENTS — after the article foot (client, 2026-09-29), on the
   same reading measure. A strong rule opens the section; the
   composer is the shared .form-panel (interior.css «FORMS»); the
   thread runs newest first and flat — no replies, no report button
   (client, 2026-09-29). Comment text is plain — no links (the form
   refuses them).
   ------------------------------------------------------------ */
.article-comments {
    max-inline-size: var(--article-measure);
    margin-block-start: var(--space-xl);
    padding-block-start: var(--space-lg);
    border-block-start: 3px solid var(--color-rule-strong);
}

.comments-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs) var(--space-md);
    margin-block-end: var(--space-md);
}

.comments-head .section-label {
    margin-block-end: 0;
}

.comments-count {
    font-size: var(--fs-meta);
    color: var(--color-text-muted);
}

/* Thread */
.comment-list {
    margin-block-start: var(--space-md);
}

.comment-item + .comment-item {
    border-block-start: 1px solid var(--color-border);
}

.comment {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: var(--space-md);
    padding-block: var(--space-md);
}

.comment-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 40px;
    block-size: 40px;
    border-radius: var(--radius-chip);
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: var(--fs-md);
    line-height: 1;
}

.comment-main {
    min-inline-size: 0;
}

.comment-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-xs) var(--space-sm);
}

.comment-author {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: var(--fs-md);
}

.comment-time {
    font-size: var(--fs-meta);
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.comment-text {
    margin-block-start: var(--space-xs);
    font-size: var(--fs-md);
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.article-comments .load-more-wrap {
    padding-block: var(--space-md) 0;
}

/* ------------------------------------------------------------
   OPINION MODIFIER — the author is the visual anchor: a large
   portrait block replaces the hero, an «مقال رأي» chip sits on the
   kicker line, and a disclaimer closes the body. Nothing else
   changes, so both variants share this stylesheet.
   ------------------------------------------------------------ */
.opinion-label {
    display: inline-flex;
    align-items: center;
    min-block-size: 24px;
    padding-inline: 10px;
    border-radius: var(--radius-chip);
    background-color: var(--cat, var(--color-primary));
    color: var(--color-on-cat);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: var(--fs-xs);
    line-height: 1;
}

.author-block {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-md);
    background-color: var(--color-bg-alt);
    border-inline-start: 4px solid var(--cat, var(--color-accent));
    border-radius: var(--radius-card);
}

.author-portrait {
    inline-size: 96px;
    block-size: 96px;
    border-radius: 50%;
    object-fit: cover;
}

.author-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-inline-size: 0;
}

.author-name {
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: var(--fs-xl);
    line-height: 1.3;
}

.author-column {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: var(--fs-meta);
    color: var(--cat, var(--color-text));
}

.author-bio {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}

.author-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    align-self: flex-start;
    min-block-size: 44px;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: var(--fs-sm);
    color: var(--cat, var(--color-text));
}

.author-link:hover,
.author-link:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.author-link .icon-sm {
    transform: rotate(90deg);
}

.opinion-disclaimer {
    margin-block-start: var(--space-lg);
    padding-block-start: var(--space-md);
    border-block-start: 1px solid var(--color-border);
    font-size: var(--fs-meta);
    color: var(--color-text-muted);
}

.print-only {
    display: none;
}

@media (max-width: 575px) {
    .article-figure--left,
    .article-figure--right {
        float: none;
        inline-size: 100%;
        margin: 1.5em 0;
    }

    .author-block {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .author-portrait {
        inline-size: 72px;
        block-size: 72px;
    }

    .pull-quote {
        padding: var(--space-md);
    }

    .pull-quote p {
        font-size: var(--fs-lg);
    }
}

/* ------------------------------------------------------------
   PRINT — chrome, ads, share, rail and pager go; headline, meta,
   hero, body, captions and the URL stay. Black on white, one column.
   ------------------------------------------------------------ */
@media print {
    .ad-slot,
    .site-header,
    .drawer,
    .drawer-backdrop,
    .latest-wire,
    .breadcrumb,
    .share-bar,
    .page-rail,
    .article-pager,
    .article-related,
    .article-more,
    .site-footer,
    .breaking-ribbon,
    .reading-progress,
    .skip-link,
    .author-link,
    .article-comments {
        display: none !important;
    }

    /* Black on white without a hex literal: the system colours resolve
       against a forced light scheme, and every palette block is named so
       the reader's dark override cannot win on specificity */
    :root,
    :root[data-theme="dark"],
    :root[data-theme="light"] {
        color-scheme: light;
        --color-text: CanvasText;
        --color-text-muted: GrayText;
        --color-bg: Canvas;
        --color-bg-alt: Canvas;
        --color-border: GrayText;
    }

    body {
        color: CanvasText;
        background: Canvas;
    }

    .page-grid {
        display: block;
    }

    .article-body {
        max-inline-size: none;
        font-size: 12pt;
        line-height: 1.7;
    }

    .article-title {
        font-size: 22pt;
    }

    .keyword-link {
        color: inherit;
        text-decoration: none;
    }

    .print-only {
        display: block;
        margin-block-start: 12pt;
        font-size: 9pt;
        color: CanvasText;
        direction: ltr;
        text-align: start;
    }

    .figure-caption,
    .article-meta {
        color: CanvasText;
    }
}
