/* ═══════════════════════════════════════════════════════════════════════════
   /pages/ + /pages/{slug}/ — "اخبار و مقالات". Page-scoped layer on top of the
   landing theme.

   WHY A SEPARATE FILE AND NOT PART OF index.css
   ---------------------------------------------
   `css/style.min.css` is a GENERATED bundle and the build script that produces
   it is not in this repo yet. Adding these rules to index.css would change a
   source the served bundle is NOT rebuilt from — the page would render
   unstyled with no error anywhere. Linked only on these routes by the
   `[@page->pagecss]` branch in biiq.views.main.v2head.html. Same reason
   about.css, crypto.css and home-prices.css exist; fold all four into index.css
   the day that build script lands.

   Everything here is ADDITIVE. Tokens, .glass, .section*/.divider/.reveal/
   .stagger-child and the .btn-* family come from the bundle and are reused
   as-is. Classes are `.pg-`-prefixed so a future merge cannot collide.

   --pg-accent is set per element by pages.js from a data-pg-accent attribute —
   never by a style="" attribute, because the frontend is CSP-clean. The
   fallback here is what renders if that script never runs, so every rule that
   uses it must look deliberate at the fallback value too.

   RTL: the document is dir="rtl". Directional values are LOGICAL properties
   (inset-inline-*, padding-inline-*, border-inline-*, margin-inline-*).
   ═══════════════════════════════════════════════════════════════════════════ */

:root { --pg-accent: #3d7bff; }

/* ─── SHARED: breadcrumb, category chip, meta row ─── */
.pg-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 26px;
}
.pg-crumb a { color: var(--text-sub); text-decoration: none; transition: color 180ms; }
.pg-crumb a:hover { color: var(--blue2); }
.pg-crumb-sep { opacity: 0.4; }
/* The current page's own title can be long; it must truncate rather than push
   the trail onto a second line on a phone. */
.pg-crumb [aria-current] {
  color: var(--text);
  font-weight: 600;
  max-width: 42ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The article CHIP, META row, GRID and CARD used to be defined here. They moved
   to css/post-card.css on 2026-08-02 so /crypto/{coin}/ could render the same
   card without a second copy of its styles. This route loads both files; see
   the `pagecss` list in biiq.handler.pages.php. */

/* ─── THE COVER SLOT ───
   The three things that can go INSIDE a cover — a real image, a composed
   frame, or the topic icon — live in css/post-cover.css, which /pages/ loads
   alongside this file and the home page loads alongside home-prices.css. Only
   the SLOT is defined here, because the same component sits in three boxes of
   very different shapes and the box is what differs.

   `color` is what the icon inherits; `--pg-accent` is set per card by
   js/pages.js from a data attribute, never a style="" attribute. */
.pg-feat-cover { color: var(--pg-accent); }

/* Size overrides for the big featured slot. They belong here, not in the
   component: 118px is a fact about THIS layout, not about a composed cover. */
.pg-feat-cover .pg-composed-disc { width: 118px; height: 118px; }
.pg-feat-cover .pg-composed-mark { width: 64px;  height: 64px; }
.pg-feat-cover .pg-cover-icon    { width: 66px;  height: 66px; }

/* A real image carries its own dark ground, so the gradient below would only
   muddy it — but that gradient must STAY for the icon and composed variants,
   which have none of their own. Suppressing it only when an image is present
   is exactly what :has() is for. */
.pg-feat-cover:has(.pg-cover-img) { background: #05060a; }
.pg-feat-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 78% 12%, color-mix(in srgb, var(--pg-accent) 34%, transparent), transparent 62%),
    linear-gradient(140deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
}
/* A hairline of the accent along the bottom edge, so a cover still reads as
   belonging to its category once the mark is scrolled past. */
.pg-feat-cover::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pg-accent), transparent);
  opacity: 0.55;
}

/* ─── LIST: hero ─── */
.pg-hero { padding: 60px 0 40px; position: relative; }
.pg-hero::before {
  content: '';
  position: absolute;
  inset-block-start: -140px;
  inset-inline-end: -60px;
  width: 600px; height: 420px;
  background: radial-gradient(circle, rgba(61,123,255,0.15), transparent 66%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}
.pg-hero > .container { position: relative; z-index: 1; }
.pg-h1 {
  font-size: clamp(30px, 4.2vw, 50px);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 16px;
}
/* Same padding/negative-margin pair as .hero-h1 .gradient-text in index.css and
   for the same reason: background-clip paints only inside the element box, so
   glyph ascenders and descenders outside it receive no paint and vanish. */
.pg-h1 .gradient-text {
  background: linear-gradient(90deg, #5C86FF 0%, #9945ff 50%, #00e5c8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-block: 0.16em;
  margin-block: -0.16em;
}
.pg-lead {
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--text-sub);
  max-width: 620px;
  margin: 0;
}

/* ─── LIST: category chips ───
   A horizontal rail on a phone rather than a wrapping block: four chips that
   wrap to three lines push the first article below the fold. */
.pg-filter { padding-bottom: 8px; }
.pg-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-block: 4px 12px;
  scrollbar-width: none;
}
.pg-chips::-webkit-scrollbar { display: none; }
.pg-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms, border-color 180ms, background 180ms;
}
.pg-chip:hover { color: var(--text); border-color: var(--border-h); }
.pg-chip.is-active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--pg-accent) 55%, transparent);
  background: color-mix(in srgb, var(--pg-accent) 14%, transparent);
}
.pg-chip-n {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  padding: 1px 7px;
}
/* An empty category still gets a chip — that is how a visitor learns the
   section HAS the category. It is dimmed, not hidden, and still clickable:
   the destination is a real page with a real empty state. */
.pg-chip.is-empty { opacity: 0.45; }

/* ─── LIST: featured card ─── */
.pg-featured-wrap { padding-top: 12px; }
.pg-featured {
  display: grid;
  grid-template-columns: 1fr;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 260ms, border-color 260ms;
}
.pg-featured:hover { transform: translateY(-3px); border-color: var(--border-h); }
.pg-feat-cover { min-height: 180px; }
.pg-feat-cover .pg-cover-mark { font-size: 56px; }
.pg-feat-body { padding: 28px; }
.pg-feat-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pg-pin {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.pg-feat-title {
  font-size: clamp(21px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.45;
  color: var(--text);
  margin: 0 0 12px;
}
.pg-feat-excerpt {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-sub);
  margin: 0 0 18px;
}


/* ─── LIST: empty state ─── */
.pg-empty {
  border-radius: var(--radius-lg);
  padding: 56px 28px;
  text-align: center;
}
.pg-empty svg { width: 40px; height: 40px; color: var(--text-muted); margin-bottom: 18px; }
.pg-empty-title { font-size: 20px; font-weight: 800; color: var(--text); margin: 0 0 10px; }
.pg-empty-sub   { font-size: 14.5px; color: var(--text-sub); line-height: 1.8; margin: 0 0 22px; }

/* ─── ARTICLE: header ─── */
.pg-art-head { padding: 56px 0 44px; position: relative; }
.pg-art-head::before {
  content: '';
  position: absolute;
  inset-block-start: -160px;
  inset-inline-end: -40px;
  width: 560px; height: 420px;
  background: radial-gradient(circle, color-mix(in srgb, var(--pg-accent) 18%, transparent), transparent 66%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}
.pg-art-head > .container { position: relative; z-index: 1; }
/* The SAME measure and centring as .pg-art-body below, and that is the point:
   with the header right-aligned at its own width and the body centred at 74ch,
   the title started ~370px outboard of the first paragraph and the two read as
   different pages stacked. One column, one edge. */
.pg-art-inner,
.pg-art-head .pg-crumb { max-width: 74ch; margin-inline: auto; }
.pg-art-title {
  font-size: clamp(26px, 3.6vw, 44px);
  font-weight: 900;
  letter-spacing: -0.8px;
  line-height: 1.35;
  color: var(--text);
  margin: 0 0 16px;
}
.pg-art-lead {
  font-size: 17px;
  line-height: 1.95;
  color: var(--text-sub);
  margin: 0 0 20px;
}

/* ─── ARTICLE: body ───
   Measure, not width: a 22-minute article at full container width is unreadable
   on a desktop. ch units track the font, so this stays correct if the type
   scale changes. */
.pg-art-body-wrap { padding: 48px 0 8px; }
.pg-art-body {
  max-width: 74ch;
  /* margin-inline, not margin-left/right — this has to hold in both directions
     if the section is ever served LTR. */
  margin-inline: auto;
}
.pg-art-body .pg-p {
  font-size: 16px;
  line-height: 2.1;
  color: var(--text-sub);
  margin: 0 0 22px;
}
/* Generous space ABOVE a heading and tight below it: a heading belongs to the
   text that follows it, not to the paragraph it interrupts. */
.pg-art-body .pg-h2 {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.5;
  color: var(--text);
  margin: 46px 0 16px;
  padding-inline-start: 14px;
  border-inline-start: 3px solid var(--pg-accent);
}
.pg-art-body .pg-h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--text);
  margin: 32px 0 12px;
}
.pg-art-body > :first-child { margin-top: 0; }

.pg-art-cta {
  max-width: 74ch;
  margin: 52px auto 0;
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.pg-art-cta::before {
  content: '';
  position: absolute;
  inset-block-start: -80px;
  inset-inline-start: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pg-accent), transparent);
  opacity: 0.10;
  pointer-events: none;
}
.pg-art-cta > * { position: relative; }
.pg-art-cta-title { font-size: 19px; font-weight: 800; color: var(--text); margin: 0 0 6px; }
.pg-art-cta-sub   { font-size: 14px; color: var(--text-sub); line-height: 1.8; margin: 0; }

/* ─── RELATED ─── */
.pg-related-more { margin-top: 32px; text-align: center; }

/* ─── RESPONSIVE ─── */
@media (min-width: 576px) {
}
@media (min-width: 768px) {
  .pg-featured    { grid-template-columns: 300px minmax(0, 1fr); }
  .pg-feat-cover  { min-height: 100%; }
  .pg-feat-body   { padding: 34px; }
  .pg-art-cta     { flex-direction: row; align-items: center; justify-content: space-between; gap: 28px; }
  .pg-art-cta .btn { flex: 0 0 auto; }
}
@media (min-width: 992px) {
  .pg-hero      { padding: 80px 0 48px; }
  .pg-art-head  { padding: 72px 0 56px; }
  .pg-featured  { grid-template-columns: 380px minmax(0, 1fr); }
}

/* ─── REDUCED MOTION ───
   The hover lifts are the only motion this page owns; the bundle gates its own.
   Honour the OS setting here too rather than leaving one page moving. */
@media (prefers-reduced-motion: reduce) {
  .pg-card, .pg-featured { transition: border-color 240ms; }
  .pg-card:hover, .pg-featured:hover { transform: none; }
}

/* ─── SOURCE CREDIT ───
   Sits under the article meta on reported pieces. Deliberately quiet but not
   hidden: it is a fact about the article's provenance, so it must survive a
   skim without competing with the headline. */
.pg-source {
  max-width: 74ch;
  margin: 16px 0 0;
  padding: 10px 14px;
  border-inline-start: 2px solid color-mix(in srgb, var(--pg-accent) 55%, transparent);
  border-start-start-radius: 3px;
  border-end-start-radius: 3px;
  background: color-mix(in srgb, var(--pg-accent) 7%, transparent);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
}
.pg-source a { color: var(--pg-accent); font-weight: 700; text-decoration: none; }
.pg-source a:hover { text-decoration: underline; }
