/* ═══════════════════════════════════════════════════════════════
   HiBargh — content pages on the "برگه‌ی مشخصات / spec sheet" system.
   Shared by: blog · article · about · contact · landing · 404.
   Ported from the F-t "day book" grammar (blog.css / post-fa).
   Loads AFTER css/spec.css — builds only on its :root tokens.
   No hardcoded colours, no shadow/blur/gradient decor, radius ≤ 2px.
   ═══════════════════════════════════════════════════════════════ */

/* ————— shared document scaffolding ————— */
.doc-main { padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(3rem, 6vw, 5rem); }

/* page-head with a mono counter-note sat on the title baseline */
.doc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 2rem;
}
.doc-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════ BLOG — the day book (مجله) ═══════════════ */
.book-lede { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }

.entry-head,
.entry {
  display: grid;
  grid-template-columns: 6.5rem 60px minmax(0, 1fr) 5rem 1.25rem;
  gap: 1.2rem;
  align-items: center;
}
.entry-head {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding-bottom: 0.55rem;
}
.entry {
  text-decoration: none;
  color: inherit;
  padding-block: 1.05rem;
  border-top: 1px solid var(--line);
  transition: background-color 150ms ease-out;
}
.entry:last-of-type { border-bottom: 1px solid var(--line); }
.entry:hover { background: var(--surface); }

.entry__date,
.entry__mins {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: left;
}
.entry__mins { text-align: end; }

/* ruled image chip — never larger than 60px, sits on white */
.entry__chip {
  inline-size: 60px;
  block-size: 60px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--jacket);
}
.entry__chip img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.entry__chip svg { inline-size: 22px; block-size: 22px; }

.entry__main { min-width: 0; }
.entry__title {
  display: block;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
}
.entry__sum {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}
.entry__arrow {
  color: var(--muted);
  transition: transform 150ms ease-out, color 150ms ease-out;
}
.entry:hover .entry__arrow { transform: translateX(-4px); color: var(--cobalt-text); }

.book-foot {
  margin-top: 1.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.book-foot a { color: var(--cobalt-text); }

/* ruled prev/next pager */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1rem;
  border-top: var(--hair) solid var(--ink);
}
.pager__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  color: var(--cobalt-text);
  text-decoration: none;
  transition: transform 150ms ease-out;
}
.pager__link svg { inline-size: 16px; block-size: 16px; }
.pager__link.is-prev:hover { transform: translateX(4px); }
.pager__link.is-next:hover { transform: translateX(-4px); }
.pager__pos {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pager__gap { flex: 1; }

/* ═══════════════ ARTICLE — the entry page ═══════════════ */
.post-head {
  max-width: 46rem;
  border-top: var(--rule) solid var(--ink);
  padding-top: 1.1rem;
  margin-top: 0.5rem;
}
.pin-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pin-line .pin-cat { color: var(--copper-deep); }
.post-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.3;
  margin-top: 0.7rem;
}
.standfirst {
  margin-top: 0.9rem;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 42rem;
}

/* featured image, framed like a filed print */
.post-plate {
  margin: 1.6rem 0 0;
  max-width: 46rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  background: var(--bg);
}
.post-plate img { width: 100%; height: auto; display: block; border-radius: var(--radius-xs); }

/* the typographic column — element selectors only (stored WP HTML) */
.post-body {
  max-width: 42rem;
  margin-top: 1.6rem;
  font-size: 1rem;
}
.post-body > :first-child { margin-top: 0; }
.post-body p { margin-top: 1.1rem; }
.post-body strong, .post-body b { font-weight: 700; color: var(--ink); }
.post-body a { color: var(--cobalt-text); text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { color: var(--cobalt-hover); }

.post-body h2,
.post-body h3,
.post-body h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.4;
  margin-top: 2.4rem;
  padding-top: 1rem;
  border-top: var(--hair) solid var(--ink);
}
.post-body h2 { font-size: clamp(1.4rem, 2.6vw, 1.7rem); }
.post-body h3 { font-size: 1.25rem; border-top-color: var(--line); }
.post-body h4 { font-size: 1.08rem; border-top-color: var(--line); }

.post-body ul,
.post-body ol { margin-top: 1.05rem; padding-inline-start: 1.4rem; }
.post-body li { margin-top: 0.4rem; }
.post-body ul { list-style: none; padding-inline-start: 0; }
.post-body ul > li { position: relative; padding-inline-start: 1.3rem; }
.post-body ul > li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.72em;
  inline-size: 7px; block-size: 7px;
  border-radius: var(--radius-xs);
  background: var(--cobalt);
}
.post-body ol { list-style: decimal; }
.post-body ol li::marker { font-family: var(--font-mono); color: var(--muted); }

/* stored images: ruled frame, never overflow the column */
.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.6rem 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  background: var(--bg);
}
.post-body figure { margin: 1.6rem 0 0; }
.post-body figure img { margin-top: 0; }
.post-body figcaption {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* margin-note voice for quotes (chalk-tinted, ruled) */
.post-body blockquote {
  margin: 1.6rem 0 0;
  padding: 0.9rem 1.1rem;
  background: var(--chalk);
  border-inline-start: 3px solid var(--copper);
  border-radius: var(--radius-md);
  color: var(--ink);
}
.post-body blockquote p { margin-top: 0.6rem; }
.post-body blockquote p:first-child { margin-top: 0; }

/* mono ruled table — no vertical borders, no zebra */
.post-body table {
  width: 100%;
  margin-top: 1.6rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  display: block;
  overflow-x: auto;
}
.post-body thead th,
.post-body th {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
  text-align: right;
  padding: 0 0.85rem 0.5rem;
  border-bottom: var(--hair) solid var(--ink);
  white-space: nowrap;
}
.post-body td {
  font-size: 0.92rem;
  text-align: right;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line);
}
.post-body pre {
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}
.post-body pre code, .post-body code {
  font-family: var(--font-mono);
  font-size: 0.86rem;
}
.post-body :not(pre) > code {
  padding: 0.1rem 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.post-body hr {
  margin: 1.8rem 0 0;
  border: none;
  border-top: 1px solid var(--line);
}

/* filed line + ruled back row */
.post-end {
  max-width: 42rem;
  margin-top: 2.4rem;
  border-top: var(--rule) solid var(--ink);
  padding-top: 1rem;
}
.filed-line {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.filed-line .pin-cat { color: var(--copper-deep); }
.post-back {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.post-back a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  color: var(--cobalt-text);
  text-decoration: none;
  transition: transform 150ms ease-out;
}
.post-back a svg { inline-size: 16px; block-size: 16px; }
.post-back a.is-back:hover { transform: translateX(4px); }
.post-back .muted-link { color: var(--muted); }
.post-back .muted-link:hover { color: var(--cobalt-text); }

/* related notes as a compact ledger */
.related-wrap { max-width: 46rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); }

/* ═══════════════ ABOUT / CONTACT — counter documents ═══════════════ */
.doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(2rem, 4.5vw, 4rem);
  align-items: start;
}
.doc-aside { position: sticky; top: 5.5rem; display: grid; gap: 1.75rem; }

/* subtitle sat under the page title inside .doc-head (about) — own row */
.page-deck {
  flex: 1 0 100%;
  max-width: 46rem;
  margin-top: 0.3rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.1vw, 1.4rem);
  line-height: 1.65;
  color: var(--ink);
}

/* the counter's standing facts — a dl ledger */
.standing { margin: 0; }
.standing > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.6rem 1.2rem;
  padding-block: 0.8rem;
  border-top: 1px solid var(--line);
}
.standing > div:first-child { border-top: none; }
.standing dt {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--copper-deep);
}
.standing dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.75;
}
.standing dd a { color: var(--ink); text-decoration: none; }
.standing dd a:hover { color: var(--cobalt-text); }
.standing dd .ltr { color: var(--ink); }
.standing dd .sub { display: block; font-size: 0.86rem; }
@media (max-width: 560px) {
  .standing > div { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* a card that heads a document block (about aside), with the one flourish */
.doc-card { padding: 0; }
.doc-card__stripe {
  height: 4px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--amber);
}
.doc-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: var(--hair) solid var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.doc-card__head .rev {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
}
.doc-card__body { padding: 0.4rem 1.25rem 0.9rem; }
.doc-card__link {
  display: block;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: var(--hair) solid var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cobalt-text);
  text-decoration: none;
}
.doc-card__link:hover { color: var(--cobalt-hover); }

/* plain ruled CTA (about) — no glass, no fill */
.doc-cta {
  max-width: 46rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  border-top: var(--hair) solid var(--ink);
  padding-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
}
.doc-cta p { color: var(--muted); margin: 0; max-width: 30rem; }
.doc-cta__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* contact form */
.contact-form { max-width: 34rem; }
.contact-form__head { margin-bottom: 1.25rem; }
.contact-form__head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
}
.contact-form__head p { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ruled prose notices (not toasts) */
.notice {
  margin-bottom: 1.1rem;
  padding: 0.75rem 1rem;
  border: var(--hair) solid var(--ink);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.7;
}
.notice--ok { border-color: var(--earth-green); }
.notice--ok strong { color: var(--earth-green); }
.notice--err { border-color: var(--copper-deep); color: var(--copper-deep); }

/* keep the spam honeypot invisible (belt-and-braces over style.css) */
.honeypot {
  position: absolute !important;
  inset-inline-start: -9999px !important;
  width: 1px !important; height: 1px !important;
  overflow: hidden;
  opacity: 0 !important;
}

/* ═══════════════ LANDING — brand representative document ═══════════════ */
.rep-head {
  display: flex;
  align-items: flex-start;
  gap: clamp(0.9rem, 2.5vw, 1.5rem);
}
.rep-logo {
  flex: none;
  inline-size: 64px; block-size: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: var(--muted);
}
.rep-logo img { inline-size: 100%; block-size: 100%; object-fit: contain; padding: 6%; }
.rep-logo svg, .rep-logo i { inline-size: 26px; block-size: 26px; }
.rep-head__body { min-width: 0; }
.rep-meta {
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.7rem;
}
.rep-meta .sep { color: var(--jacket); }

/* The representative document: prose held at the lede's 46rem measure, with the
   نمایندگی facts card in the rail — otherwise the body hangs off the RTL edge
   and leaves half the page blank. */
.rep-doc {
  /* rail fixed, prose flexes: the card must not be squeezed to one word per
     line on a 1024px laptop */
  grid-template-columns: minmax(0, 1fr) 19rem;
  gap: clamp(1.75rem, 3.5vw, 3.5rem);
  margin-top: clamp(0.25rem, 1.5vw, 1rem);
}
.rep-doc--solo { grid-template-columns: minmax(0, 26rem); }
/* max-width holds the prose on the lede's measure so both share a rag */
.rep-doc .post-plate,
.rep-doc .post-body { max-width: 46rem; margin-top: 0; }
.rep-doc .post-plate + .post-body { margin-top: 1.6rem; }
/* the rail is narrower than the about page's aside — pull the label column in
   so the values stop wrapping after two words */
.rep-doc .standing > div { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.5rem 0.9rem; }

/* lede rag has to land on the prose column's rag, not 46rem of its own */
.rep-lede { max-width: min(46rem, calc(100% - 19rem - clamp(1.75rem, 3.5vw, 3.5rem))); }

@media (max-width: 900px) {
  .rep-doc { grid-template-columns: 1fr; }
  /* the facts land under the lede, before the long read */
  .rep-doc .doc-aside { order: -1; }
  .rep-doc .post-plate,
  .rep-doc .post-body,
  .rep-lede { max-width: 46rem; }
}

/* spec-sheet product grid (uses spec.css .pc-card) — auto-fit with a capped
   track, centred: a short list stays symmetric instead of hanging on the RTL
   edge, and three cards don't balloon to a third of the page each */
.sp-prodGrid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 16rem));
  justify-content: center;
  gap: clamp(0.8rem, 1.8vw, 1.15rem);
}
/* auto-fit counts repetitions off the track's max, so below ~2×16rem it drops
   to a single narrow card — pin it to the shop grid's two-up instead */
@media (max-width: 620px) {
  .sp-prodGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* dark CTA band — cobalt-deep ground, earth stripe on top (the one flourish) */
.cta-band {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  background: var(--cobalt-deep);
  color: var(--on-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cta-band::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--amber);
}
.cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
}
.cta-band h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}
.cta-band p { color: var(--on-dark-muted); margin-top: 0.35rem; max-width: 34rem; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* ═══════════════ 404 — empty ledger page ═══════════════ */
.miss-wrap { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem); }
.mini-search {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  max-width: 26rem;
}
.mini-search input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink);
  padding: 0.55rem 0.75rem;
  border: var(--hair) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: right;
}
.mini-search input::placeholder { color: var(--muted); }
.miss-cats { margin-top: clamp(2rem, 4vw, 3rem); max-width: 40rem; }
.miss-cats__head {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding-bottom: 0.5rem;
}
.miss-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-block: 0.8rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  transition: background-color 150ms ease-out;
}
.miss-row:last-of-type { border-bottom: 1px solid var(--line); }
.miss-row:hover { background: var(--surface); }
.miss-row i, .miss-row svg { inline-size: 18px; block-size: 18px; color: var(--muted); flex: none; }
.miss-row .arrow {
  margin-inline-start: auto;
  color: var(--muted);
  transition: transform 150ms ease-out, color 150ms ease-out;
}
.miss-row:hover .arrow { transform: translateX(-4px); color: var(--cobalt-text); }

/* ————— responsive ————— */
@media (max-width: 900px) {
  .doc-grid { grid-template-columns: 1fr; }
  .doc-aside { position: static; }
}
@media (max-width: 1040px) {
  .entry-head,
  .entry { grid-template-columns: 6rem 56px minmax(0, 1fr) 1.25rem; }
  .entry-head .col-mins,
  .entry__mins { display: none; }
}
@media (max-width: 560px) {
  .entry-head { display: none; }
  .entry { grid-template-columns: 52px minmax(0, 1fr); gap: 0.9rem; }
  .entry__date { grid-column: 1 / -1; direction: rtl; text-align: right; }
  .entry__arrow { display: none; }
  .cta-band__inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .entry:hover .entry__arrow,
  .miss-row:hover .arrow,
  .pager__link:hover,
  .post-back a:hover { transform: none; }
}
