/* =====================================================================
   Demo theme — article shape DEMO_V2
   «عمود قراءة واحد بلا شريط» / Single reading column, no sidebar.

   The deliberate inverse of DEMO_V1: V1 opens on a full-bleed dark cover
   with the headline reversed out of it and parks a sticky rail beside the
   text. V2 opens on white paper — a narrow measure, black-on-white
   typography, the cover placed AFTER the head as an illustration rather
   than a stage, and nothing at all in the margins. Related reading moves
   to a row under the article instead of a rail beside it.

   Same brand: same Cairo/Inter stack, the same --dm-* palette, the same
   .dm-prose / .dm-tags / .dm-share / .dm-authorcard components. A
   different layout, not a different site.

   SCOPING: every selector below is prefixed .dmv2 (or a .dmv2-* class
   that exists only inside the V2 branch of single-post.blade.php), so
   loading this sheet can never repaint the V1 page. It is pushed onto
   @stack('styles') from that branch only.
   ===================================================================== */

.dmv2 {
    /* The reading measure. ~72 characters of Cairo at 1.12rem. */
    --dmv2-measure: 720px;
}

/* ---------- reading progress -----------------------------------------
   Degrades to nothing: without JS `p` never leaves 0, the bar has width 0
   and the track is transparent — an invisible line, not an empty box. */
.dmv2-progress {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    height: 3px;
    z-index: 65;              /* above the sticky header (60), below modals */
    background: transparent;
    pointer-events: none;
}
.dmv2-progress__bar {
    display: block;
    height: 100%;
    width: 0;
    border-end-end-radius: 3px;
    background: linear-gradient(90deg, var(--dm-primary), var(--dm-accent));
    transition: width .12s linear;
}
[dir="rtl"] .dmv2-progress__bar {
    background: linear-gradient(270deg, var(--dm-primary), var(--dm-accent));
}

/* ---------- the column ---------- */
.dmv2-col {
    max-width: var(--dmv2-measure);
    margin-inline: auto;
    padding-block: 38px 0;
}

/* ---------- head ---------- */
.dmv2-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: .8rem;
    color: var(--dm-muted);
    margin-block-end: 20px;
}
.dmv2-crumb a:hover { color: var(--dm-primary); }
.dmv2-crumb i { font-size: .55rem; color: var(--dm-muted-light); }
.dmv2-crumb span { color: var(--dm-ink-soft); font-weight: 700; }

/* The section name as a typographic kicker — the quiet inverse of V1's
   solid red pill sitting on the dark cover. */
.dmv2-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .4px;
    color: var(--dm-primary);
}
.dmv2-kicker::before {
    content: "";
    width: 26px;
    height: 2px;
    border-radius: 2px;
    background: var(--dm-primary);
    flex-shrink: 0;
}
.dmv2-kicker:hover { color: var(--dm-primary-dark); }

.dmv2-title {
    font-size: clamp(1.85rem, 4.2vw, 2.9rem);
    font-weight: 900;
    line-height: 1.28;
    letter-spacing: -.2px;
    color: var(--dm-ink);
    margin-block: 14px 0;
    text-wrap: balance;
}

.dmv2-standfirst {
    margin-block: 18px 0;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.85;
    color: var(--dm-ink-soft);
}

.dmv2-byline {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-block-start: 24px;
}
.dmv2-byline__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--dm-surface-alt);
}
.dmv2-byline__avatar img { width: 100%; height: 100%; object-fit: cover; }
.dmv2-byline__who { font-size: .95rem; font-weight: 800; color: var(--dm-ink); }
.dmv2-byline__who:hover { color: var(--dm-primary); }
.dmv2-byline__facts { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }

.dmv2-rule {
    border: 0;
    border-block-start: 1px solid var(--dm-border);
    margin-block: 26px 0;
}

/* ---------- cover ----------------------------------------------------
   Emitted only when the post actually carries one. With no cover the head
   flows straight into the body: a text-first shape reads correctly with no
   image, so there is no frame, no plate and no grey box to fill. */
.dmv2-figure { margin: 30px 0 0; }
.dmv2-figure__frame {
    position: relative;
    border-radius: var(--dm-radius);
    overflow: hidden;
    background: var(--dm-surface-alt);
    /* 3:2 — the ratio this site's «article_image» is generated at
       (config/features/sites/demo.php → image_sizes.article_image 900x600),
       so a correctly sized cover is framed, not cropped. */
    aspect-ratio: 3 / 2;
    box-shadow: var(--dm-shadow);
}
.dmv2-figure__frame img,
.dmv2-figure__frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dmv2-figcap {
    margin-block-start: 12px;
    padding-inline-start: 12px;
    border-inline-start: 3px solid var(--dm-border-strong);
    font-size: .82rem;
    line-height: 1.65;
    color: var(--dm-muted);
}

/* On a wide screen the illustration breathes past the measure a little —
   the only element allowed to. Gated at 1000px, where the container still
   leaves 120px of slack on each side of the 720px column. */
@media (min-width: 1000px) {
    .dmv2-figure { margin-inline: -70px; }
}

/* ---------- body ---------- */
.dmv2-prose {
    margin-block-start: 32px;
    font-size: 1.12rem;
    line-height: 2.05;
}
.dmv2-prose > p:first-of-type { font-size: 1.16rem; color: var(--dm-ink); }
.dmv2-prose h2 { font-size: 1.45rem; margin-block: 2.4rem 1rem; letter-spacing: -.1px; }
.dmv2-prose h3 { font-size: 1.2rem; margin-block: 1.9rem .7rem; }
.dmv2-prose img { border-radius: var(--dm-radius-sm); }

/* A centred pull quote instead of V1's side-barred callout. */
.dmv2-prose blockquote {
    margin: 2.2rem 0;
    padding: 22px 0;
    border: 0;
    border-block: 2px solid var(--dm-primary-soft);
    border-radius: 0;
    background: transparent;
    font-size: 1.2rem;
    line-height: 1.85;
    font-weight: 700;
    color: var(--dm-ink);
    text-align: center;
}

/* ---------- foot of the column ---------- */
.dmv2-foot {
    margin-block-start: 38px;
    padding-block-start: 8px;
    border-block-start: 1px solid var(--dm-border);
}
.dmv2-foot .dm-tags { margin-block-start: 22px; }

/* ---------- related row ----------------------------------------------
   Replaces V1's sticky rail. Dropped whole when the component found no
   related posts — no heading is printed over an empty grid. */
.dmv2-more {
    margin-block-start: 48px;
    padding-block: 34px 12px;
    border-block-start: 1px solid var(--dm-border);
}
.dmv2-more__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-block-end: 22px;
}
.dmv2-more__title { font-size: 1.15rem; font-weight: 800; letter-spacing: .2px; }
.dmv2-more__all {
    font-size: .88rem;
    font-weight: 700;
    color: var(--dm-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.dmv2-more__all i { font-size: .7rem; }
.dmv2-more__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }

.dmv2-mcard { display: block; }
.dmv2-mcard__img {
    aspect-ratio: 3 / 2;
    border-radius: var(--dm-radius-sm);
    overflow: hidden;
    background: var(--dm-surface-alt);
}
.dmv2-mcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.dmv2-mcard:hover .dmv2-mcard__img img { transform: scale(1.05); }
.dmv2-mcard__cat {
    display: inline-block;
    margin-block-start: 12px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .3px;
    color: var(--dm-primary);
}
.dmv2-mcard__title { font-size: 1rem; font-weight: 700; line-height: 1.55; margin-block-start: 6px; color: var(--dm-ink); }
.dmv2-mcard:hover .dmv2-mcard__title { color: var(--dm-primary); }
.dmv2-mcard__date { margin-block-start: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
    .dmv2-more__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .dmv2-col { padding-block-start: 26px; }
    .dmv2-standfirst { font-size: 1.05rem; }
    .dmv2-prose { font-size: 1.05rem; line-height: 1.95; }
    .dmv2-prose > p:first-of-type { font-size: 1.08rem; }
    .dmv2-more__grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- print ----------------------------------------------------
   The one shape in this theme that is genuinely a document: strip the
   chrome and let it print as the reading column it already is. */
@media print {
    .dmv2-progress,
    .dmv2-foot .dm-share,
    .dmv2-more { display: none !important; }
    .dmv2-col { max-width: none; padding-block: 0; }
    .dmv2-figure { margin-inline: 0; }
    .dmv2-prose { font-size: 11pt; line-height: 1.7; }
}
