/**
 * Guides article — Medium typography + MDN-style code (خواندن بی‌نقص)
 */

@font-face {
  font-family: "DevMinds Code";
  src: url("../assets/fonts/jetbrains-mono/JetBrainsMono-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* ─── Design tokens ─── */
html[data-theme="light"] body.guides-reading-page {
  --guides-read-heading: #7a0e8c;
  --guides-read-bg: #ffffff;
  --guides-read-text: #1e293b;
  --guides-read-muted: #64748b;
  --guides-read-border: rgba(15, 23, 42, 0.1);
  --guides-read-surface: #f8fafc;
  --guides-read-link: #1e293b;
  --guides-read-link-hover: #9e12b1;
  --guides-read-progress: rgba(15, 23, 42, 0.08);
  --guides-read-progress-bar: #9e12b1;
  --guides-read-font: "IRANSansWeb", "Tahoma", sans-serif;
  --guides-read-font-mono: "DevMinds Code", "Cascadia Code", Consolas, ui-monospace, monospace;
  --guides-read-body-size: 16px;
  --guides-read-body-lh: 1.65;
  --guides-read-para-gap: 1.5em;
  --guides-rail-title-size: 16px;
  --guides-rail-item-size: 14px;
  --guides-rail-meta-size: 12px;
  --guides-rail-radius: 16px;
  --guides-read-code-size: 1.4rem;
  --guides-read-box-pad-x: 2.5rem;
  --guides-read-box-pad-y: 1.75rem;
  --guides-read-content-max: 720px;
  --guides-read-layout-max: 1280px;
  --guides-read-rail-width: 360px;
  --guides-rail-max-height: min(calc(100vh - 40px), 680px);
  --guides-rail-accent: var(--pillar-accent, #9e12b1);
  --guides-code-border: #e1e4e8;
  --guides-code-header-bg: #f6f8fa;
  --guides-code-bg: #f6f8fa;
  --guides-code-text: #24292f;
  --guides-code-inline-bg: rgba(27, 31, 35, 0.06);
  --guides-rail-bg: #ffffff;
  --guides-rail-bg-gradient: none;
  --guides-rail-hairline: rgba(15, 23, 42, 0.09);
  --guides-rail-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 36px -16px rgba(15, 23, 42, 0.16);
  --guides-rail-link-bg: transparent;
  --guides-rail-link-hover: rgba(15, 23, 42, 0.045);
  --guides-rail-part-bg: rgba(15, 23, 42, 0.06);
  --guides-rail-active-bg: var(--pillar-accent-soft, rgba(158, 18, 177, 0.08));
  --guides-rail-active-border: var(--pillar-accent-glow, rgba(158, 18, 177, 0.22));
  --gt-surface: #ffffff;
  --gt-surface-muted: #f8fafc;
  --gt-border: rgba(15, 23, 42, 0.1);
  --gt-heading: #0f172a;
  --gt-muted: #64748b;
  --gt-emphasis: #7a0e8c;
  --gt-btn-bg: #9e12b1;
  --gt-btn-fg: #ffffff;
  --gt-btn-hover: #7a0e8c;
  --gt-focus-ring: rgba(158, 18, 177, 0.2);
}

html[data-theme="dark"] body.guides-reading-page {
  --guides-rail-accent: #67e8f9;
  --pillar-accent: #67e8f9;
  --pillar-accent-soft: rgba(103, 232, 249, 0.12);
  --pillar-accent-glow: rgba(103, 232, 249, 0.32);
  --guides-rail-bg: #111b2e;
  --guides-rail-bg-gradient: none;
  --guides-rail-hairline: rgba(148, 163, 184, 0.16);
  --guides-rail-shadow: 0 18px 40px -20px rgba(2, 6, 23, 0.7);
  --guides-rail-link-bg: transparent;
  --guides-rail-link-hover: rgba(255, 255, 255, 0.06);
  --guides-rail-part-bg: rgba(255, 255, 255, 0.1);
  --guides-rail-active-bg: rgba(103, 232, 249, 0.12);
  --guides-rail-active-border: rgba(103, 232, 249, 0.32);
  --guides-read-bg: #0b1320;
  --guides-read-text: #e2e8f0;
  --guides-read-muted: #94a3b8;
  --guides-read-border: rgba(148, 163, 184, 0.18);
  --guides-read-surface: #111b2e;
  --guides-read-link: #e2e8f0;
  --guides-read-link-hover: #67e8f9;
  --guides-read-progress: rgba(148, 163, 184, 0.14);
  --guides-read-progress-bar: #67e8f9;
  --guides-read-heading: #67e8f9;
  --guides-read-font: "IRANSansWeb", "Tahoma", sans-serif;
  --guides-read-font-mono: "DevMinds Code", "Cascadia Code", Consolas, ui-monospace, monospace;
  --guides-read-body-size: 16px;
  --guides-read-body-lh: 1.65;
  --guides-read-para-gap: 1.5em;
  --guides-rail-title-size: 16px;
  --guides-rail-item-size: 14px;
  --guides-rail-meta-size: 12px;
  --guides-rail-radius: 16px;
  --guides-read-code-size: 1.4rem;
  --guides-read-box-pad-x: 2.5rem;
  --guides-read-box-pad-y: 1.75rem;
  --guides-read-content-max: 720px;
  --guides-read-layout-max: 1280px;
  --guides-read-rail-width: 360px;
  --guides-rail-max-height: min(calc(100vh - 40px), 680px);
  --guides-code-border: rgba(148, 163, 184, 0.22);
  --guides-code-header-bg: #16213a;
  --guides-code-bg: #0f1a2d;
  --guides-code-text: #e6edf3;
  --guides-code-inline-bg: rgba(240, 246, 252, 0.1);
  --gt-surface: #111b2e;
  --gt-surface-muted: #16213a;
  --gt-border: rgba(148, 163, 184, 0.18);
  --gt-heading: #f1f5f9;
  --gt-muted: #94a3b8;
  --gt-emphasis: #67e8f9;
  --gt-btn-bg: #67e8f9;
  --gt-btn-fg: #06202b;
  --gt-btn-hover: #a5f3fc;
  --gt-focus-ring: rgba(103, 232, 249, 0.2);
}

/* ─── Page shell ─── */
body.guides-reading-page .pillar-page__main,
body.guides-reading-page main.pillar-page__main {
  background: var(--guides-read-bg) !important;
  color: var(--guides-read-text);
  padding-top: 2rem;
  padding-bottom: 5rem;
}

body.guides-reading-page .guides-reading__wrap {
  max-width: var(--guides-read-layout-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 3vw, 2rem);
  box-sizing: border-box;
}

body.guides-reading-page .guides-reading__breadcrumb {
  margin-bottom: 2.5rem;
  font-family: var(--guides-read-font);
  font-size: 1.4rem;
  line-height: 1.5;
}

html[data-theme="dark"] body.guides-reading-page .pillar-breadcrumb__link,
html[data-theme="light"] body.guides-reading-page .pillar-breadcrumb__link {
  color: var(--guides-read-muted);
  text-decoration: none;
}

html[data-theme="dark"] body.guides-reading-page .pillar-breadcrumb__link:hover,
html[data-theme="light"] body.guides-reading-page .pillar-breadcrumb__link:hover {
  color: var(--guides-read-text);
  text-decoration: underline;
}

html[data-theme="dark"] body.guides-reading-page .pillar-breadcrumb__item--current,
html[data-theme="dark"] body.guides-reading-page .pillar-breadcrumb__item--current span,
html[data-theme="light"] body.guides-reading-page .pillar-breadcrumb__item--current,
html[data-theme="light"] body.guides-reading-page .pillar-breadcrumb__item--current span {
  color: var(--pillar-accent);
}

body.guides-reading-page .pillar-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 130;
  height: 3px;
  background: var(--guides-read-progress);
}

body.guides-reading-page .pillar-reading-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--guides-read-progress-bar);
  box-shadow: 0 0 10px color-mix(in srgb, var(--guides-read-progress-bar) 40%, transparent);
  transition: width 0.12s ease-out;
}

/* ─── Reading progress rail ───
 * Lives inside .guides-article-main, so it can never reach the site header or
 * footer. The track is taken out of flow: it adds no height or width to the
 * article, and the sticky rail stops at the end of the article text.
 */
body.guides-reading-page .guides-article-main {
  position: relative;
}

body.guides-reading-page .guides-reading-side-progress-track {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-end: -6rem;
  width: 3.6rem;
  pointer-events: none;
}

body.guides-reading-page .guides-reading-side-progress {
  --guides-side-track-height: min(42vh, 320px);
  position: sticky;
  /* Vertically centred: half of the track plus one stat label and gap (≈5rem). */
  top: calc(50vh - var(--guides-side-track-height) / 2 - 5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

body.guides-reading-page .guides-reading-side-progress__track {
  position: relative;
  width: 4px;
  height: var(--guides-side-track-height);
  border-radius: 999px;
  background: var(--guides-read-border);
}

body.guides-reading-page .guides-reading-side-progress__fill {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 0%;
  border-radius: 999px;
  background: var(--guides-read-progress-bar);
  transition: height 0.12s ease-out;
}

body.guides-reading-page .guides-reading-side-progress__thumb {
  position: absolute;
  left: 50%;
  top: 0%;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: var(--guides-read-progress-bar);
  border: 2px solid var(--guides-read-bg);
  box-sizing: border-box;
  transition: top 0.12s ease-out;
}

body.guides-reading-page .guides-reading-side-progress__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-align: center;
  min-width: 3.2rem;
}

body.guides-reading-page .guides-reading-side-progress__value {
  font-family: var(--guides-read-font);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--guides-read-heading);
  font-variant-numeric: tabular-nums;
}

body.guides-reading-page .guides-reading-side-progress__caption {
  font-family: var(--guides-read-font);
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--guides-read-muted);
  white-space: nowrap;
}

@media (max-width: 1199.98px) {
  body.guides-reading-page .guides-reading-side-progress-track {
    display: none;
  }
}

/* Title reads as the page heading; the accent stays on section headings */
html[data-theme] body.guides-reading-page .pillar-article--immersive .pillar-article__title {
  color: var(--gt-heading) !important;
}

/* Colors typed into an intro were chosen for a light panel; keep the emphasis, stay readable */
html[data-theme="dark"] body.guides-reading-page .pillar-article__intro [style*="color"] {
  color: var(--guides-read-heading) !important;
}

/* Heading underlay from the site theme, in the reading accent */
html[data-theme] body.guides-reading-page .pillar-article__content .Section__Title-Header::after {
  background-color: var(--guides-rail-active-bg) !important;
}

html[data-theme] body.guides-reading-page .pillar-article__content .Section__Title::before {
  background-color: var(--guides-rail-accent) !important;
}

/* ─── Article typography (Medium) ─── */
body.guides-reading-page .pillar-article--immersive {
  font-family: var(--guides-read-font);
  font-size: var(--guides-read-body-size);
  line-height: var(--guides-read-body-lh);
  color: var(--guides-read-text);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.guides-reading-page .pillar-article--immersive .pillar-article__header {
  text-align: start;
  max-width: none;
  margin: 0 0 2.5rem;
  padding: 0;
  border: none;
}

body.guides-reading-page .pillar-article--immersive .pillar-article__title {
  font-family: var(--guides-read-font);
  font-size: clamp(3.6rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--guides-read-text);
  margin: 0 0 1.5rem;
}

body.guides-reading-page .pillar-article--immersive .pillar-article__meta {
  justify-content: flex-start;
  gap: 0.75rem 1.5rem;
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--guides-read-muted);
  font-weight: 400;
}

body.guides-reading-page .pillar-article--immersive .pillar-article__meta-item i {
  color: var(--guides-read-muted);
  font-size: 1.2rem;
}

body.guides-reading-page .pillar-article--immersive .pillar-article__pillar-badge,
html[data-theme] body.guides-reading-page .pillar-article__category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 1.2rem;
  margin-bottom: 1.25rem;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.6;
  text-transform: none;
  color: var(--guides-read-heading);
  text-decoration: none;
  background: var(--guides-rail-active-bg);
  border: 1px solid var(--guides-rail-active-border);
  border-radius: 999px;
  box-shadow: none;
  transition: border-color 0.2s ease;
}

html[data-theme] body.guides-reading-page .pillar-article__category-chip:hover {
  color: var(--guides-read-heading);
  border-color: var(--guides-read-heading);
  text-decoration: none;
}

body.guides-reading-page .pillar-article--immersive .pillar-article__meta {
  font-variant-numeric: normal;
  font-feature-settings: "tnum" 0;
}

body.guides-reading-page .pillar-article--immersive .pillar-article__meta-item {
  font-family: var(--guides-read-font);
}

/* ─── Prose body ─── */
body.guides-reading-page .pillar-article__body {
  max-width: none;
}

body.guides-reading-page .pillar-prose,
body.guides-reading-page .pillar-article__intro {
  font-family: var(--guides-read-font);
  font-size: var(--guides-read-body-size);
  line-height: 3.5rem;
  color: var(--guides-read-text);
  font-weight: 400;
}

body.guides-reading-page .pillar-article--immersive .pillar-article__intro {
  margin-top: 3rem;
  margin-bottom: 2rem;
  padding: 2rem 2.4rem;
  line-height: 4rem;
  background-color: var(--guides-read-surface);
  color: var(--guides-read-text);
  border: 1px solid var(--guides-read-border);
  border-inline-start: 3px solid var(--guides-rail-accent);
  border-radius: 12px;
  box-shadow: none;
}

body.guides-reading-page .pillar-article__content,
body.guides-reading-page .pillar-prose {
  font-size: 16px;
  line-height: 3.5rem;
}

body.guides-reading-page .pillar-article__content {
  padding-bottom: 1.5rem;
}

body.guides-reading-page .pillar-prose p,
body.guides-reading-page .pillar-article__intro p,
body.guides-reading-page .pillar-article__content p {
  font-size: 16px !important;
  line-height: 3.5rem;
}

body.guides-reading-page .pillar-article--immersive .pillar-article__intro p {
  line-height: 4rem;
}

body.guides-reading-page .pillar-prose p,
body.guides-reading-page .pillar-article__intro p,
body.guides-reading-page .pillar-article__content p {
  margin: 0 0 var(--guides-read-para-gap);
  text-align: start !important;
  letter-spacing: 0.01em;
}

body.guides-reading-page .pillar-prose li {
  font-size: 16px;
  line-height: 3.5rem;
  text-align: start !important;
}

body.guides-reading-page .pillar-prose p:last-child,
body.guides-reading-page .pillar-article__intro p:last-child {
  margin-bottom: 0;
}

/* AI history answers — readable prose */
body.guides-reading-page .guides-ai-history-item__answer.pillar-prose {
  font-family: var(--guides-read-font);
  font-size: var(--guides-read-body-size);
  line-height: 3rem;
  color: var(--guides-read-text);
  font-weight: 400;
  width: 100%;
}

body.guides-reading-page .guides-ai-fullscreen__body .guides-ai-history-item__answer.pillar-prose {
  width: 68%;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.guides-reading-page .guides-ai-history-item__answer.pillar-prose p {
  font-size: 16px !important;
  line-height: 3rem;
  color: var(--guides-read-text);
  margin: 0 0 0.85em;
  text-align: start !important;
  letter-spacing: 0.01em;
}

body.guides-reading-page .guides-ai-history-item__answer.pillar-prose p:last-child {
  margin-bottom: 0;
}

body.guides-reading-page .guides-ai-history-item__answer.pillar-prose li {
  font-size: 16px;
  line-height: 3rem;
  color: var(--guides-read-text);
  text-align: start !important;
}

body.guides-reading-page .guides-ai-history-item__answer.pillar-prose ul,
body.guides-reading-page .guides-ai-history-item__answer.pillar-prose ol {
  margin: 0 0 1em;
  padding-inline-start: 1.5em;
}

body.guides-reading-page .guides-ai-history-item__answer.pillar-prose strong {
  color: var(--guides-read-text);
  font-weight: 700;
}

body.guides-reading-page .guides-ai-history-item__answer.pillar-prose :not(pre) > code {
  font-family: var(--guides-read-font-mono);
  font-size: var(--guides-read-code-size);
}

body.guides-reading-page .guides-ai-history-item__answer .guides-ai__list {
  margin: 0 0 1em;
  padding-inline-start: 1.5em;
  list-style: disc;
}

body.guides-reading-page .guides-ai-history-item__answer .guides-ai__list li {
  font-size: 16px;
  line-height: 3rem;
  color: var(--guides-read-text);
  margin-bottom: 0.35em;
}

body.guides-reading-page .guides-ai-history-item__answer .guides-ai__heading {
  margin: 1.25em 0 0.65em;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--pillar-accent, var(--dm-purple, #9e12b1));
}

body.guides-reading-page .guides-ai-history-item__answer .guides-ai__heading:first-child {
  margin-top: 0;
}

body.guides-reading-page .guides-ai-history-item__answer .guides-ai__link,
body.guides-reading-page .guides-ai__answer .guides-ai__link {
  color: var(--guides-read-heading, var(--pillar-accent, #9e12b1));
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}

body.guides-reading-page .guides-ai-history-item__answer .guides-ai__link:hover,
body.guides-reading-page .guides-ai__answer .guides-ai__link:hover {
  opacity: 0.85;
}

html[data-theme="dark"] body.guides-reading-page .guides-ai-history-item__answer .guides-ai__link,
html[data-theme="dark"] body.guides-reading-page .guides-ai__answer .guides-ai__link {
  color: var(--guides-read-heading) !important;
}

body.guides-reading-page .pillar-prose h2 {
  font-family: var(--guides-read-font);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 3.6rem 0 1.2rem;
  color: var(--guides-read-heading, var(--guides-read-text));
  padding-bottom: 10px;
}

body.guides-reading-page .pillar-prose h2::before {
  display: none;
}

body.guides-reading-page .pillar-prose h3 {
  font-family: var(--guides-read-font);
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 2.8rem 0 1rem;
  color: var(--guides-read-heading, var(--guides-read-text));
}

body.guides-reading-page .pillar-prose h4 {
  font-size: 2rem;
  font-weight: 600;
  margin: 2.2rem 0 0.8rem;
  color: var(--guides-read-heading, var(--guides-read-text));
}

html[data-theme="dark"] body.guides-reading-page .pillar-prose h1,
html[data-theme="dark"] body.guides-reading-page .pillar-prose h2,
html[data-theme="dark"] body.guides-reading-page .pillar-prose h3,
html[data-theme="dark"] body.guides-reading-page .pillar-prose h4,
html[data-theme="dark"] body.guides-reading-page .pillar-prose h5,
html[data-theme="dark"] body.guides-reading-page .pillar-prose h6,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content h1,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content h2,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content h3,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content h4,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content h5,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content h6,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content .Blog__Right-Article-Items-Head,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content .Blog__Right-Article-MainTitle,
html[data-theme="dark"] body.guides-reading-page .pillar-article--immersive .pillar-toc__title {
  color: var(--guides-read-heading) !important;
}

html[data-theme="dark"] body.guides-reading-page .pillar-prose .text-Purple,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content .text-Purple,
html[data-theme="dark"] body.guides-reading-page .pillar-prose a.Section__Title-Header,
html[data-theme="dark"] body.guides-reading-page .pillar-prose a.Section__Title,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content a.Section__Title-Header,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content a.Section__Title,
html[data-theme="dark"] body.guides-reading-page .pillar-prose a.Section__Title-Header span,
html[data-theme="dark"] body.guides-reading-page .pillar-prose a.Section__Title span,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content a.Section__Title-Header span,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content a.Section__Title span,
html[data-theme="dark"] body.guides-reading-page .pillar-prose [style*="#9e12b1"],
html[data-theme="dark"] body.guides-reading-page .pillar-prose [style*="9e12b1"],
html[data-theme="dark"] body.guides-reading-page .pillar-prose [style*="158, 18, 177"],
html[data-theme="dark"] body.guides-reading-page .pillar-article__content [style*="#9e12b1"],
html[data-theme="dark"] body.guides-reading-page .pillar-article__content [style*="9e12b1"],
html[data-theme="dark"] body.guides-reading-page .pillar-article__content [style*="158, 18, 177"] {
  color: var(--guides-read-heading) !important;
}

body.guides-reading-page .pillar-prose ul,
body.guides-reading-page .pillar-prose ol {
  margin: 0 0 var(--guides-read-para-gap);
  padding-inline-start: 2rem;
}

body.guides-reading-page .pillar-prose li {
  margin-bottom: 0.65rem;
  line-height: var(--guides-read-body-lh);
}

body.guides-reading-page .pillar-prose li::marker {
  color: var(--guides-read-muted);
}

body.guides-reading-page .pillar-prose strong {
  font-weight: 600;
  color: var(--guides-read-text);
}

body.guides-reading-page .pillar-prose a,
body.guides-reading-page .pillar-article__intro a,
body.guides-reading-page .pillar-article__content a {
  color: inherit;
  text-decoration: none !important;
  text-underline-offset: 0;
}

body.guides-reading-page .pillar-prose a:hover,
body.guides-reading-page .pillar-article__intro a:hover,
body.guides-reading-page .pillar-article__content a:hover {
  color: var(--guides-read-link-hover);
  text-decoration: none !important;
}

html[data-theme="dark"] body.guides-reading-page .pillar-prose a.Section__Title-Header:hover,
html[data-theme="dark"] body.guides-reading-page .pillar-prose a.Section__Title:hover,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content a.Section__Title-Header:hover,
html[data-theme="dark"] body.guides-reading-page .pillar-article__content a.Section__Title:hover {
  color: var(--guides-read-heading) !important;
}

body.guides-reading-page .pillar-prose blockquote {
  margin: var(--guides-read-para-gap) 0;
  padding: 0;
  padding-inline-start: 1.5rem;
  border: none;
  border-inline-start: 3px solid var(--guides-read-border);
  font-size: var(--guides-read-body-size);
  line-height: var(--guides-read-body-lh);
  color: var(--guides-read-muted);
  font-style: normal;
  background: transparent;
}

body.guides-reading-page .pillar-prose hr {
  border: none;
  border-top: 1px solid var(--guides-read-border);
  margin: 3rem 0;
}

body.guides-reading-page .pillar-prose img {
  max-width: 100%;
  height: auto;
  margin: 2.5rem auto;
  display: block;
  border-radius: 2px;
}

/* Code — always LTR / left-aligned */
body.guides-reading-page .guides-code,
body.guides-reading-page .pillar-code-block,
body.guides-reading-page .pillar-prose pre,
body.guides-reading-page .pillar-prose :not(pre) > code {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}

/* Inline code */
body.guides-reading-page .pillar-prose :not(pre) > code {
  font-family: var(--guides-read-font-mono);
  font-size: var(--guides-read-code-size);
  font-weight: 400;
  background: var(--guides-code-inline-bg);
  color: var(--guides-read-text);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--guides-code-border);
  display: inline-block;
  vertical-align: baseline;
}

/* ─── Code blocks (MDN-style) ─── */
body.guides-reading-page .guides-code,
body.guides-reading-page .pillar-code-block {
  margin: 2.5rem 0;
  border: 1px solid var(--guides-code-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--guides-code-bg);
  box-shadow: none;
}

body.guides-reading-page .guides-code__header,
body.guides-reading-page .pillar-code-block__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.65rem var(--guides-read-box-pad-x);
  direction: ltr;
  font-family: var(--guides-read-font);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--guides-read-muted);
  background: var(--guides-code-header-bg);
  border-bottom: 1px solid var(--guides-code-border);
}

body.guides-reading-page .guides-code__lang {
  font-family: var(--guides-read-font-mono);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

body.guides-reading-page .guides-code__copy,
body.guides-reading-page .pillar-code-block__copy {
  font-family: var(--guides-read-font);
  font-size: 1.25rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--guides-code-border);
  background: var(--guides-read-bg);
  color: var(--guides-read-text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

body.guides-reading-page .guides-code__copy:hover,
body.guides-reading-page .pillar-code-block__copy:hover {
  border-color: var(--guides-read-muted);
}

body.guides-reading-page .guides-code__copy.is-copied,
body.guides-reading-page .pillar-code-block__copy.is-copied {
  color: #1a7f37;
  border-color: #1a7f37;
}

html[data-theme="dark"] body.guides-reading-page .guides-code__copy.is-copied,
html[data-theme="dark"] body.guides-reading-page .pillar-code-block__copy.is-copied {
  color: #3fb950;
  border-color: #3fb950;
}

body.guides-reading-page .guides-code pre,
body.guides-reading-page .pillar-code-block pre,
body.guides-reading-page .pillar-prose pre {
  margin: 0 !important;
  padding: 1rem var(--guides-read-box-pad-x) 1.25rem !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.guides-reading-page .guides-code pre code,
body.guides-reading-page .pillar-code-block pre code,
body.guides-reading-page .pillar-prose pre code {
  font-family: var(--guides-read-font-mono) !important;
  font-size: var(--guides-read-code-size) !important;
  line-height: 1.6 !important;
  font-weight: 400 !important;
  color: var(--guides-code-text) !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  white-space: pre;
  word-break: normal;
  tab-size: 2;
  direction: ltr !important;
  text-align: left !important;
  font-variant-ligatures: none;
}

/* Prism syntax — light (GitHub-like) */
html[data-theme="light"] body.guides-reading-page .guides-code .token.comment,
html[data-theme="light"] body.guides-reading-page .guides-code .token.prolog,
html[data-theme="light"] body.guides-reading-page .guides-code .token.doctype,
html[data-theme="light"] body.guides-reading-page .guides-code .token.cdata {
  color: #6a737d;
}

html[data-theme="light"] body.guides-reading-page .guides-code .token.punctuation {
  color: #24292f;
}

html[data-theme="light"] body.guides-reading-page .guides-code .token.property,
html[data-theme="light"] body.guides-reading-page .guides-code .token.tag,
html[data-theme="light"] body.guides-reading-page .guides-code .token.boolean,
html[data-theme="light"] body.guides-reading-page .guides-code .token.number,
html[data-theme="light"] body.guides-reading-page .guides-code .token.constant,
html[data-theme="light"] body.guides-reading-page .guides-code .token.symbol {
  color: #005cc5;
}

html[data-theme="light"] body.guides-reading-page .guides-code .token.selector,
html[data-theme="light"] body.guides-reading-page .guides-code .token.attr-name,
html[data-theme="light"] body.guides-reading-page .guides-code .token.string,
html[data-theme="light"] body.guides-reading-page .guides-code .token.char,
html[data-theme="light"] body.guides-reading-page .guides-code .token.builtin {
  color: #0a3069;
}

html[data-theme="light"] body.guides-reading-page .guides-code .token.operator,
html[data-theme="light"] body.guides-reading-page .guides-code .token.entity,
html[data-theme="light"] body.guides-reading-page .guides-code .token.url {
  color: #24292f;
}

html[data-theme="light"] body.guides-reading-page .guides-code .token.atrule,
html[data-theme="light"] body.guides-reading-page .guides-code .token.attr-value,
html[data-theme="light"] body.guides-reading-page .guides-code .token.keyword {
  color: #cf222e;
}

html[data-theme="light"] body.guides-reading-page .guides-code .token.function,
html[data-theme="light"] body.guides-reading-page .guides-code .token.class-name {
  color: #8250df;
}

/* Prism syntax — dark (MDN-like) */
html[data-theme="dark"] body.guides-reading-page .guides-code .token.comment,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.prolog,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.doctype,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.cdata {
  color: #8b949e;
}

html[data-theme="dark"] body.guides-reading-page .guides-code .token.punctuation {
  color: #e6edf3;
}

html[data-theme="dark"] body.guides-reading-page .guides-code .token.property,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.tag,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.boolean,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.number,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.constant,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.symbol {
  color: #79c0ff;
}

html[data-theme="dark"] body.guides-reading-page .guides-code .token.selector,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.attr-name,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.string,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.char,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.builtin {
  color: #a5d6ff;
}

html[data-theme="dark"] body.guides-reading-page .guides-code .token.atrule,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.attr-value,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.keyword {
  color: #ff7b72;
}

html[data-theme="dark"] body.guides-reading-page .guides-code .token.function,
html[data-theme="dark"] body.guides-reading-page .guides-code .token.class-name {
  color: #d2a8ff;
}

/* VS Code-like syntax colors for every highlighted article language. Prism adds
   .token spans; plain expected-output blocks remain neutral and readable. */
html[data-theme="dark"] body.guides-reading-page .guides-code {
  --syntax-base: #d4d4d4;
  --syntax-keyword: #569cd6;
  --syntax-type: #4ec9b0;
  --syntax-function: #dcdcaa;
  --syntax-string: #ce9178;
  --syntax-number: #b5cea8;
  --syntax-variable: #9cdcfe;
  --syntax-comment: #6a9955;
  --syntax-special: #c586c0;
}
html[data-theme="light"] body.guides-reading-page .guides-code {
  --syntax-base: #1f1f1f;
  --syntax-keyword: #0000ff;
  --syntax-type: #267f99;
  --syntax-function: #795e26;
  --syntax-string: #a31515;
  --syntax-number: #098658;
  --syntax-variable: #001080;
  --syntax-comment: #008000;
  --syntax-special: #af00db;
}
html[data-theme] body.guides-reading-page .guides-code pre code:not(.language-output) {
  color: var(--syntax-base) !important;
}
html[data-theme] body.guides-reading-page .guides-code pre code .token.keyword,
html[data-theme] body.guides-reading-page .guides-code pre code .token.atrule {
  color: var(--syntax-keyword);
}
html[data-theme] body.guides-reading-page .guides-code pre code .token.class-name,
html[data-theme] body.guides-reading-page .guides-code pre code .token.builtin,
html[data-theme] body.guides-reading-page .guides-code pre code .token.tag {
  color: var(--syntax-type);
}
html[data-theme] body.guides-reading-page .guides-code pre code .token.function {
  color: var(--syntax-function);
}
html[data-theme] body.guides-reading-page .guides-code pre code .token.string,
html[data-theme] body.guides-reading-page .guides-code pre code .token.char,
html[data-theme] body.guides-reading-page .guides-code pre code .token.template-string,
html[data-theme] body.guides-reading-page .guides-code pre code .token.interpolation-string,
html[data-theme] body.guides-reading-page .guides-code pre code .token.attr-value {
  color: var(--syntax-string);
}
html[data-theme] body.guides-reading-page .guides-code pre code .token.number,
html[data-theme] body.guides-reading-page .guides-code pre code .token.boolean,
html[data-theme] body.guides-reading-page .guides-code pre code .token.constant {
  color: var(--syntax-number);
}
html[data-theme] body.guides-reading-page .guides-code pre code .token.variable,
html[data-theme] body.guides-reading-page .guides-code pre code .token.property,
html[data-theme] body.guides-reading-page .guides-code pre code .token.attr-name,
html[data-theme] body.guides-reading-page .guides-code pre code .token.selector {
  color: var(--syntax-variable);
}
html[data-theme] body.guides-reading-page .guides-code pre code .token.comment,
html[data-theme] body.guides-reading-page .guides-code pre code .token.prolog,
html[data-theme] body.guides-reading-page .guides-code pre code .token.doctype,
html[data-theme] body.guides-reading-page .guides-code pre code .token.cdata {
  color: var(--syntax-comment);
}
html[data-theme] body.guides-reading-page .guides-code pre code .token.important,
html[data-theme] body.guides-reading-page .guides-code pre code .token.delimiter {
  color: var(--syntax-special);
}
html[data-theme] body.guides-reading-page .guides-code pre code .token.interpolation,
html[data-theme] body.guides-reading-page .guides-code pre code .token.expression,
html[data-theme] body.guides-reading-page .guides-code pre code .token.operator,
html[data-theme] body.guides-reading-page .guides-code pre code .token.punctuation {
  color: var(--syntax-base);
}

/* Boxes — فاصله داخلی از چپ و راست (TOC، کارت‌ها، سری) */
body.guides-reading-page .pillar-article--immersive .pillar-toc {
  background: var(--guides-read-surface);
  border: 1px solid var(--guides-read-border);
  border-radius: 8px;
  padding: var(--guides-read-box-pad-y) var(--guides-read-box-pad-x);
  margin: 2.5rem 0;
}

body.guides-reading-page .pillar-article--immersive .pillar-toc__title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--guides-read-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 1rem;
  padding: 0;
}

body.guides-reading-page .pillar-article--immersive .pillar-toc__list {
  margin: 0;
  padding: 0 0.5rem;
}

body.guides-reading-page .pillar-article--immersive .pillar-toc__link {
  font-size: 1.55rem;
  line-height: 1.55;
  color: var(--guides-read-text);
  padding: 0.4rem 0.25rem;
  text-decoration: none;
}

body.guides-reading-page .pillar-article--immersive .pillar-toc__link:hover {
  text-decoration: underline;
  padding-inline-start: 0;
}

/* Author, series, media */
body.guides-reading-page .pillar-article--immersive .pillar-article__author:not(.pillar-article__author--after-body) {
  max-width: none;
  margin: 2.5rem 0;
  padding: var(--guides-read-box-pad-y) var(--guides-read-box-pad-x);
  background: var(--guides-read-surface);
  border: 1px solid var(--guides-read-border);
  border-radius: 8px;
}

body.guides-reading-page .pillar-article__author-name {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--guides-read-text);
}

body.guides-reading-page .pillar-article__author-role {
  font-size: 1.4rem;
  color: var(--guides-read-muted);
}

body.guides-reading-page .pillar-article__author--after-body {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  margin-top: 48px;
  margin-bottom: 0;
  padding: 28px 32px;
  overflow: hidden;
  background: linear-gradient(
    to left,
    color-mix(in srgb, var(--guides-rail-accent) 7%, var(--guides-rail-bg)),
    var(--guides-rail-bg) 62%
  );
  border: 1px solid var(--guides-rail-hairline);
  border-radius: var(--guides-rail-radius);
  box-shadow: var(--guides-rail-shadow);
}

/* Same accent edge as the intro box */
body.guides-reading-page .pillar-article__author--after-body::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    var(--guides-rail-accent),
    color-mix(in srgb, var(--guides-rail-accent) 35%, transparent)
  );
}

body.guides-reading-page .pillar-article__author--after-body .pillar-article__author-avatar {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--guides-rail-bg);
  box-shadow:
    0 0 0 2px var(--guides-rail-accent),
    0 10px 24px -8px color-mix(in srgb, var(--guides-rail-accent) 55%, transparent);
}

body.guides-reading-page .pillar-article__author--after-body .pillar-article__author-inner {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

/* !important: the dark theme "main a" rule in devminds-theme.css would turn the name blue */
html[data-theme] body.guides-reading-page .pillar-article__author--after-body .pillar-article__author-name {
  display: inline-block;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--gt-heading) !important;
  text-decoration: none !important;
  transition: color 0.15s ease;
}

html[data-theme] body.guides-reading-page .pillar-article__author--after-body a.pillar-article__author-name:hover,
html[data-theme] body.guides-reading-page .pillar-article__author--after-body a.pillar-article__author-name:focus-visible {
  color: var(--guides-rail-accent) !important;
}

body.guides-reading-page .pillar-article__author--after-body .pillar-article__author-bio {
  margin: 8px 0 0;
  width: 100%;
  max-width: 100%;
  font-size: 15px;
  line-height: 1.95;
  color: color-mix(in srgb, var(--guides-read-text) 76%, var(--guides-rail-bg));
}

@media (max-width: 575.98px) {
  body.guides-reading-page .pillar-article__author--after-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-top: 36px;
    padding: 22px 22px 24px;
  }

  body.guides-reading-page .pillar-article__author--after-body .pillar-article__author-avatar {
    width: 72px;
    height: 72px;
  }

  html[data-theme] body.guides-reading-page .pillar-article__author--after-body .pillar-article__author-name {
    font-size: 18px;
  }

  body.guides-reading-page .pillar-article__author--after-body .pillar-article__author-bio {
    font-size: 15px;
  }
}

/* ─── Layout: ردیف بالا (سایدبار + عنوان + ویدیو) | ردیف پایین متن تمام‌عرض ─── */
body.guides-reading-page .guides-article-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2.5rem;
  width: 100%;
  margin-inline: auto;
  padding-top: 2.5rem;
}

body.guides-reading-page .guides-article-layout > .pillar-article--guides-reading {
  width: 100%;
  max-width: none;
}

body.guides-reading-page .guides-article-layout__top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  width: 100%;
}

body.guides-reading-page .guides-article-layout__hero {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

body.guides-reading-page .guides-article-layout__top--with-rail .guides-article-layout__hero {
  max-width: calc(100% - var(--guides-read-rail-width) - 2rem);
}

body.guides-reading-page .guides-article-layout__top .pillar-article__header {
  margin-bottom: 1.5rem;
}

body.guides-reading-page .guides-article-layout__content {
  box-sizing: border-box;
  width: 80%;
  max-width: 100%;
  margin: 0 auto;
}

body.guides-reading-page .guides-article-layout__content .guides-ai {
  max-width: 100%;
}

body.guides-reading-page .guides-article-layout__content .pillar-article__body,
body.guides-reading-page .guides-article-layout__content .pillar-article__intro,
body.guides-reading-page .guides-article-layout__content .pillar-prose,
body.guides-reading-page .guides-article-layout__content .pillar-article__author,
body.guides-reading-page .guides-article-layout__content .pillar-toc,
body.guides-reading-page .guides-article-layout__content .pillar-article__pager,
body.guides-reading-page .guides-article-layout__content .pillar-article__footer {
  max-width: 100%;
}

body.guides-reading-page .guides-series-rail {
  flex: 0 0 var(--guides-read-rail-width);
  width: var(--guides-read-rail-width);
  position: sticky;
  top: 20px;
  align-self: flex-start;
  max-height: var(--guides-rail-max-height);
}

/* Shared sidebar panel: Guides series rail and Blog popular courses */
body.guides-reading-page .guides-series-rail .pillar-series--guides-rail,
body.guides-reading-page .blog-popular-rail {
  border: 1px solid var(--guides-rail-hairline);
  border-radius: var(--guides-rail-radius);
  background: var(--guides-rail-bg);
  color: var(--guides-read-text);
  box-shadow: var(--guides-rail-shadow);
  overflow: hidden;
}

body.guides-reading-page .guides-series-rail .pillar-series--guides-rail {
  display: flex;
  flex-direction: column;
  max-height: var(--guides-rail-max-height);
  height: auto;
  flex: none;
}

body.guides-reading-page .guides-series-rail .pillar-series__head,
body.guides-reading-page .blog-popular-rail__title {
  flex-shrink: 0;
  padding: 18px 20px 15px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--guides-rail-accent) 7%, transparent),
    transparent
  );
  border-bottom: 1px solid var(--guides-rail-hairline);
}

body.guides-reading-page .guides-series-rail .pillar-series__title,
body.guides-reading-page .blog-popular-rail__title {
  display: flex;
  gap: 10px;
  margin: 0;
  font-family: var(--guides-read-font);
  font-size: var(--guides-rail-title-size);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--gt-heading);
}

body.guides-reading-page .guides-series-rail .pillar-series__title::before,
body.guides-reading-page .blog-popular-rail__title::before {
  content: "";
  flex: none;
  align-self: stretch;
  width: 4px;
  min-height: 18px;
  border-radius: 999px;
  background: var(--guides-rail-accent);
}

body.guides-reading-page .guides-series-rail .pillar-series__subtitle {
  margin: 4px 0 0;
  padding-inline-start: 14px;
  font-size: var(--guides-rail-meta-size);
  line-height: 1.6;
  color: var(--guides-read-muted);
}

body.guides-reading-page .guides-series-rail .pillar-series__toggle {
  gap: 10px;
  padding: 15px 20px;
  font-family: var(--guides-read-font);
  font-size: var(--guides-rail-title-size);
  font-weight: 700;
  line-height: 1.6;
  text-align: start;
  color: var(--gt-heading);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--guides-rail-accent) 7%, transparent),
    transparent
  );
  border: 0;
  border-radius: 0;
}

body.guides-reading-page .guides-series-rail .pillar-series__toggle i {
  flex-shrink: 0;
  color: var(--guides-rail-accent);
}

body.guides-reading-page .guides-series-rail .pillar-series__nav {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  scroll-padding-block: 10px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--guides-read-muted) 45%, transparent) transparent;
}

body.guides-reading-page .guides-series-rail .pillar-series__nav::-webkit-scrollbar {
  width: 6px;
}

body.guides-reading-page .guides-series-rail .pillar-series__nav::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--guides-read-muted) 45%, transparent);
  border-radius: 999px;
}

body.guides-reading-page .guides-series-rail .pillar-series__nav::-webkit-scrollbar-track {
  background: transparent;
}

body.guides-reading-page .guides-series-rail .pillar-series__groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.guides-reading-page .guides-series-rail .pillar-series__category {
  margin: 0;
  padding: 0;
}

body.guides-reading-page .guides-series-rail .pillar-series__category + .pillar-series__category {
  padding-top: 12px;
  border-top: 1px solid var(--guides-rail-hairline);
}

body.guides-reading-page .guides-series-rail .pillar-series__category-title {
  margin: 0 0 6px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
}

body.guides-reading-page .guides-series-rail .pillar-series__category-title-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
}

body.guides-reading-page .guides-series-rail .pillar-series__category-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 11px;
  color: var(--guides-rail-accent);
  background: color-mix(in srgb, var(--guides-rail-accent) 13%, transparent);
}

/* !important: the dark theme "main a" rule in devminds-theme.css would turn the link blue */
html[data-theme] body.guides-reading-page .guides-series-rail .pillar-series__category-link,
body.guides-reading-page .guides-series-rail .pillar-series__category-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: var(--guides-read-muted) !important;
}

html[data-theme] body.guides-reading-page .guides-series-rail .pillar-series__category-link {
  text-decoration: none;
  transition: color 0.15s ease;
}

html[data-theme] body.guides-reading-page .guides-series-rail .pillar-series__category-link:hover,
html[data-theme] body.guides-reading-page .guides-series-rail .pillar-series__category-link:focus-visible {
  color: var(--guides-rail-accent) !important;
}

body.guides-reading-page .guides-series-rail .pillar-series__list,
body.guides-reading-page .guides-series-rail .pillar-series__list--nested {
  padding: 0;
  margin: 0;
  list-style: none;
}

body.guides-reading-page .guides-series-rail .pillar-series__list--nested {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

body.guides-reading-page .guides-series-rail .pillar-series__item {
  margin: 0;
}

body.guides-reading-page .guides-series-rail .pillar-series__link {
  position: relative;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--guides-read-text);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.guides-reading-page .guides-series-rail .pillar-series__link:focus-visible {
  outline: 2px solid var(--guides-rail-accent);
  outline-offset: -2px;
}

body.guides-reading-page .guides-series-rail .pillar-series__part {
  width: 24px;
  height: 24px;
  min-width: 24px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
  background: var(--guides-rail-part-bg);
  color: var(--guides-read-muted);
}

body.guides-reading-page .guides-series-rail .pillar-series__label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--guides-rail-item-size);
  line-height: 1.65;
  font-weight: 500;
  color: var(--guides-read-text);
}

body.guides-reading-page .guides-series-rail .pillar-series__label-title {
  display: block;
  font-weight: 500;
  line-height: 1.65;
}

body.guides-reading-page .guides-series-rail .pillar-series__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
}

body.guides-reading-page .guides-series-rail .pillar-series__meta-small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: var(--guides-rail-meta-size);
  line-height: 1.5;
  color: var(--guides-read-muted);
}

body.guides-reading-page .guides-series-rail .pillar-series__meta-small i {
  font-size: 0.9em;
  opacity: 0.8;
}

@media (min-width: 1100px) {
  body.guides-reading-page .guides-series-rail .pillar-series__toggle {
    display: none;
  }
}

/* ویدیو — تمام‌عرض ستون محتوا، بدون کنار سری */
body.guides-reading-page .pillar-article__hero--video-only {
  display: block;
  margin: 0 0 2rem;
}

body.guides-reading-page .pillar-article__hero--video-only .pillar-media {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  overflow: hidden;
}

body.guides-reading-page .pillar-media__embed {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--guides-read-border);
  aspect-ratio: 16 / 9;
  background: #000;
}

body.guides-reading-page .pillar-media__embed iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

body.guides-reading-page .pillar-media__caption {
  margin: 0.75rem 0 0;
  padding: 0;
  font-family: var(--guides-read-font);
  font-size: 1.45rem;
  line-height: 1.5;
  color: var(--guides-read-muted);
  text-align: start;
}

body.guides-reading-page .pillar-media__image {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--guides-read-border);
  background: var(--guides-rail-link-bg, #f5f5f5);
}

/* Blog uploads include portrait screenshots and diagrams; show their full aspect ratio. */
body.guides-reading-page .pillar-article--blog-reading .pillar-media__image {
  width: auto;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

body.guides-reading-page .pillar-article__hero--placeholder .pillar-media {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--guides-read-border);
}

body.guides-reading-page .pillar-media__placeholder {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 12rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(158, 18, 177, 0.12), rgba(102, 126, 234, 0.15));
}

body.guides-reading-page .pillar-media__placeholder-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

body.guides-reading-page .pillar-media__placeholder-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.55) 55%,
    rgba(0, 0, 0, 0.72) 100%
  );
  pointer-events: none;
}

body.guides-reading-page .pillar-media__placeholder-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.5rem;
  text-align: center;
  max-width: 28rem;
}

body.guides-reading-page .pillar-media__placeholder-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(158, 18, 177, 0.15);
  color: var(--pillar-accent, #9e12b1);
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

body.guides-reading-page .pillar-media__placeholder-track {
  font-size: 1.2rem;
  font-weight: 700;
  color: #e8d4f5;
}

body.guides-reading-page .pillar-media__placeholder-title {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.4;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

body.guides-reading-page .pillar-media__placeholder-category {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.88);
}

body.guides-reading-page .pillar-media__placeholder-hint {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.25rem;
}

body.guides-reading-page .pillar-media__placeholder-icon {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* آیتم فعال */
body.guides-reading-page .guides-series-rail .pillar-series__active-glow {
  position: absolute;
  inset-inline-start: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--guides-rail-accent);
  pointer-events: none;
}

html[data-theme] body.guides-reading-page .guides-series-rail .pillar-series__item--active .pillar-series__link,
html[data-theme] body.guides-reading-page .guides-series-rail .pillar-series__link[aria-current="page"] {
  background: var(--guides-rail-active-bg);
  border-color: var(--guides-rail-active-border);
  box-shadow: none;
  color: var(--guides-read-text) !important;
}

html[data-theme] body.guides-reading-page .guides-series-rail .pillar-series__part--reading {
  background: var(--guides-rail-accent);
  color: var(--gt-btn-fg);
  font-size: 11px;
  box-shadow: 0 4px 10px -3px color-mix(in srgb, var(--guides-rail-accent) 60%, transparent);
}

body.guides-reading-page .guides-series-rail .pillar-series__part--reading .fa-book-open {
  font-size: 11px;
}

body.guides-reading-page .guides-series-rail .pillar-series__item--active .pillar-series__label-title,
body.guides-reading-page .guides-series-rail .pillar-series__link[aria-current="page"] .pillar-series__label-title {
  font-weight: 700;
  color: var(--gt-heading);
}

body.guides-reading-page .guides-series-rail .pillar-series__item:not(.pillar-series__item--active) .pillar-series__link:hover {
  background: var(--guides-rail-link-hover);
}

@media (prefers-reduced-motion: reduce) {
  body.guides-reading-page .guides-series-rail .pillar-series__link,
  html[data-theme] body.guides-reading-page .guides-series-rail .pillar-series__category-link,
  html[data-theme] body.guides-reading-page .pillar-article__author--after-body .pillar-article__author-name {
    transition: none;
  }
}

/* موبایل / تبلت: ریل بالای عنوان، متن تمام‌عرض */
@media (max-width: 1099.98px) {
  body.guides-reading-page .guides-reading__wrap {
    max-width: var(--guides-read-layout-max);
  }

  body.guides-reading-page .guides-article-layout {
    gap: 1.75rem;
    padding-top: 1.5rem;
  }

  body.guides-reading-page .guides-article-layout__top {
    flex-direction: column;
    gap: 1.25rem;
  }

  body.guides-reading-page .guides-article-layout__top--with-rail .guides-article-layout__hero {
    max-width: 100%;
  }

  body.guides-reading-page .guides-article-layout__content {
    width: 100%;
  }

  body.guides-reading-page .guides-series-rail {
    position: relative;
    top: auto;
    flex: none;
    width: 100%;
    max-height: none;
  }

  body.guides-reading-page .guides-series-rail .pillar-series--guides-rail {
    display: block;
    max-height: none;
  }

  body.guides-reading-page .guides-series-rail .pillar-series__nav {
    flex: none;
    min-height: 0;
    overflow: visible;
  }

  body.guides-reading-page .guides-series-rail .pillar-series__nav.is-open {
    margin-top: 0;
    border: 0;
    border-top: 1px solid var(--guides-rail-hairline);
    border-radius: 0;
    background: transparent;
    max-height: min(52vh, 420px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.guides-reading-page .guides-series-rail .pillar-series__toggle {
    display: flex;
  }
}

/* Continue + pager + footer */
body.guides-reading-page .pillar-continue-card {
  margin: 3.5rem 0 2rem;
}

body.guides-reading-page .pillar-continue-card__inner {
  background: var(--guides-read-surface);
  border: 1px solid var(--guides-read-border);
  border-radius: 8px;
  padding: var(--guides-read-box-pad-y) var(--guides-read-box-pad-x);
  text-align: start;
}

body.guides-reading-page .pillar-continue-card__eyebrow {
  font-size: 1.35rem;
  color: var(--guides-read-muted);
}

body.guides-reading-page .pillar-continue-card__text {
  font-size: var(--guides-read-body-size);
  line-height: var(--guides-read-body-lh);
  color: var(--guides-read-text);
  margin-bottom: 1.25rem;
}

body.guides-reading-page .pillar-continue-card__btn {
  background: var(--guides-read-text);
  color: var(--guides-read-bg) !important;
  border-radius: 6px;
  font-size: 1.45rem;
  font-weight: 600;
  padding: 0.7rem 1.35rem;
}

body.guides-reading-page .pillar-continue-card__btn:hover {
  opacity: 0.88;
  transform: none;
  box-shadow: none;
}

body.guides-reading-page .pillar-article__pager {
  border-top: 1px solid var(--guides-read-border);
  padding-top: 2rem;
  margin-top: 2.5rem;
  font-family: var(--guides-read-font);
}

body.guides-reading-page .pillar-pager__link {
  color: var(--guides-read-text);
  border: 1px solid var(--guides-read-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  text-decoration: none;
}

body.guides-reading-page .pillar-pager__direction {
  color: var(--guides-read-muted);
  font-size: 1.3rem;
}

body.guides-reading-page .pillar-article__footer {
  border-top: 1px solid var(--guides-read-border);
  margin-top: 3.5rem;
  padding-top: 2rem;
}

body.guides-reading-page .pillar-cluster-nav__card {
  background: var(--guides-read-surface);
  border: 1px solid var(--guides-read-border);
  border-radius: 8px;
}

body.guides-reading-page .pillar-article__share-link {
  color: var(--guides-read-muted);
}

@media (max-width: 767px) {
  body.guides-reading-page .guides-reading__wrap {
    max-width: 100%;
    padding-inline: 1.25rem;
  }

  body.guides-reading-page .pillar-article--immersive .pillar-article__title {
    font-size: 3rem;
  }

  body.guides-reading-page .pillar-prose p,
  body.guides-reading-page .pillar-article__intro p,
  body.guides-reading-page .pillar-article__content p {
    font-size: 16px !important;
  }

  body.guides-reading-page .guides-code pre code,
  body.guides-reading-page .pillar-prose pre code {
    font-size: 1.2rem !important;
  }

  body.guides-reading-page .pillar-article--immersive .pillar-toc {
    padding: 1.5rem 1.75rem;
  }
}
