/* ==========================================================================
   MZF Store — Single post (premium editorial layout)
   ========================================================================== */

/* ---------- Reading progress ---------- */
.mzf-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: transparent;
  z-index: 999;
  pointer-events: none;
}
.mzf-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), #e84150);
  transition: width .1s linear;
}

/* ---------- Hero ---------- */
.mzf-hero {
  position: relative;
  padding: 56px 0 40px;
  background: linear-gradient(180deg, var(--surface), #fff);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.mzf-hero--image { min-height: 420px; display: flex; align-items: flex-end; border-bottom: 0; }
.mzf-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  filter: saturate(1.05);
}
.mzf-hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(10, 12, 16, .92) 0%, rgba(10, 12, 16, .72) 45%, rgba(10, 12, 16, .35) 100%);
}
.mzf-hero__inner { position: relative; z-index: 1; }
.mzf-hero--image .mzf-hero__inner { padding-block: 40px; }

/* Breadcrumbs */
.mzf-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--ink-muted);
  margin-bottom: 18px;
}
.mzf-crumbs a { color: inherit; text-decoration: none; }
.mzf-crumbs a:hover { color: var(--brand); }
.mzf-crumbs span { opacity: .45; }
.mzf-hero--image .mzf-crumbs { color: rgba(255, 255, 255, .75); }
.mzf-hero--image .mzf-crumbs a:hover { color: #fff; }

/* Category chips */
.mzf-hero__cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.mzf-chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-brand);
  transition: transform .18s ease, filter .18s ease;
}
.mzf-chip:hover { transform: translateY(-1px); filter: brightness(1.08); color: #fff; }

.mzf-hero__title {
  margin: 0;
  font-size: clamp(1.7rem, 4.2vw, 2.85rem);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.01em;
  max-width: 22ch;
  color: var(--ink);
}
.mzf-hero--image .mzf-hero__title { color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); max-width: 26ch; }

.mzf-hero__lead {
  margin: 16px 0 0;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink-muted);
  max-width: 62ch;
}
.mzf-hero--image .mzf-hero__lead { color: rgba(255, 255, 255, .88); }

/* Hero meta row */
.mzf-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin-top: 26px;
  font-size: .9rem;
  color: var(--ink-muted);
}
.mzf-hero--image .mzf-hero__meta { color: rgba(255, 255, 255, .85); }
.mzf-hero__author { display: flex; align-items: center; gap: 10px; }
.mzf-hero__author span { display: flex; flex-direction: column; line-height: 1.45; }
.mzf-hero__author strong { font-weight: 700; color: var(--ink); }
.mzf-hero--image .mzf-hero__author strong { color: #fff; }
.mzf-hero__avatar { border-radius: 50%; border: 2px solid rgba(255, 255, 255, .6); }
.mzf-hero__read { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Article shell: share rail + body ---------- */
.mzf-article__wrap {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-block: 44px 8px;
  /* Cap the whole shell (rail + body) and centre it, so the body can fill its
     column. Capping the body itself left a dead gap on the inline-end side. */
  max-width: 1040px;
  margin-inline: auto;
}
.mzf-article__body { min-width: 0; }

/* Sticky share rail */
.mzf-share {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.mzf-share__label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.mzf-share__btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink-muted);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.mzf-share__btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
}
.mzf-share__copy.is-copied {
  background: #12a150;
  border-color: #12a150;
  color: #fff;
}

/* ---------- Prose ---------- */
.mzf-prose { font-size: 1.06rem; line-height: 1.95; color: var(--ink); }
.mzf-prose > * + * { margin-top: 1.35em; }
/* NO drop cap in Persian/Arabic script: ::first-letter forces the first glyph
   into its own box, which breaks the cursive joining ("بی" renders as "ب ی").
   A styled lead paragraph gives the same editorial emphasis, safely. */
.mzf-prose > p:first-of-type {
  font-size: 1.16em;
  line-height: 1.9;
  color: var(--ink);
  font-weight: 500;
  padding-inline-start: 16px;
  border-inline-start: 4px solid var(--brand);
}
.mzf-prose h2,
.mzf-prose h3,
.mzf-prose h4 {
  position: relative;
  margin-top: 2.1em;
  margin-bottom: .55em;
  font-weight: 800;
  line-height: 1.4;
  padding-inline-start: 16px;
  scroll-margin-top: 90px;
}
.mzf-prose h2 { font-size: 1.55rem; }
.mzf-prose h3 { font-size: 1.28rem; }
.mzf-prose h4 { font-size: 1.1rem; }
.mzf-prose h2::before,
.mzf-prose h3::before,
.mzf-prose h4::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .22em;
  width: 5px;
  height: .82em;
  border-radius: var(--r-pill);
  background: var(--brand);
}
.mzf-prose a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.mzf-prose a:hover { text-decoration-thickness: 3px; }
.mzf-prose img,
.mzf-prose iframe,
.mzf-prose video {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  display: block;
  margin-block: 1.6em;
}
.mzf-prose figure { margin: 1.8em 0; }
.mzf-prose figcaption {
  margin-top: 10px;
  font-size: .87rem;
  color: var(--ink-muted);
  text-align: center;
}
.mzf-prose ul,
.mzf-prose ol { padding-inline-start: 1.4em; }
.mzf-prose li { margin-top: .55em; }
.mzf-prose ul > li::marker { color: var(--brand); }
.mzf-prose ol > li::marker { color: var(--brand); font-weight: 700; }
.mzf-prose blockquote {
  margin: 2em 0;
  padding: 22px 24px;
  background: var(--brand-050);
  border-inline-start: 5px solid var(--brand);
  border-radius: var(--r-lg);
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.8;
}
.mzf-prose blockquote p:last-child { margin-bottom: 0; }
.mzf-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 1.8em;
  font-size: .96rem;
  overflow: hidden;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.mzf-prose th,
.mzf-prose td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: start; }
.mzf-prose thead th { background: var(--brand); color: #fff; font-weight: 700; }
.mzf-prose tbody tr:nth-child(even) { background: var(--surface); }
.mzf-prose code {
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .92em;
}
.mzf-prose pre {
  background: #0f1115;
  color: #e6e6e6;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}
.mzf-prose pre code { background: transparent; padding: 0; color: inherit; }
.mzf-prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.4em; }
.mzf-prose__pages { margin-top: 2em; font-weight: 600; }

/* ---------- Tags ---------- */
.mzf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.mzf-tag {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .18s ease;
}
.mzf-tag:hover { background: var(--brand-050); border-color: var(--brand); color: var(--brand); }

/* ---------- Author box ---------- */
.mzf-authorbox {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-top: 36px;
  padding: 24px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--brand-050), #fff);
  border: 1px solid var(--line);
}
.mzf-authorbox__avatar { border-radius: 50%; flex-shrink: 0; }
.mzf-authorbox__text { display: flex; flex-direction: column; gap: 4px; }
.mzf-authorbox__kicker {
  font-size: .74rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: .05em;
}
.mzf-authorbox__name { font-size: 1.08rem; font-weight: 800; }
.mzf-authorbox__bio { margin: 4px 0 0; color: var(--ink-muted); font-size: .94rem; line-height: 1.75; }

/* ---------- Prev / next ---------- */
.mzf-postnav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 36px;
}
.mzf-postnav__item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  text-decoration: none;
  transition: all .2s ease;
}
.mzf-postnav__item:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.mzf-postnav__dir { font-size: .78rem; font-weight: 700; color: var(--brand); }
.mzf-postnav__title {
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Related grid ---------- */
.mzf-related {
  margin-top: 56px;
  padding-block: 44px 56px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.mzf-related__grid {
  display: grid;
  /* Exactly three cards per row on desktop — auto-fit was spilling to 4. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

/* Mobile: single column for related posts */
@media (max-width: 768px) {
  .mzf-related__grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
/* Grid variant of the blog card: fills its cell instead of fixed slider width */
.mzf-blog-card--grid { width: auto; height: 100%; }
.mzf-blog-card--grid .mzf-blog-card__thumb { height: 190px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .mzf-article__wrap { grid-template-columns: 1fr; gap: 0; }
  .mzf-share {
    position: static;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
  }
  .mzf-share__label { margin: 0 4px 0 0; align-self: center; }
  .mzf-article__body { max-width: none; }
}
@media (max-width: 600px) {
  .mzf-hero { padding: 34px 0 26px; }
  .mzf-hero--image { min-height: 320px; }
  .mzf-hero__title { font-size: 1.45rem; max-width: none; }
  .mzf-hero__lead { font-size: .98rem; }
  .mzf-prose { font-size: 1rem; line-height: 1.85; }
  .mzf-prose > p:first-of-type { font-size: 1.08em; padding-inline-start: 12px; }
  .mzf-authorbox { flex-direction: column; }
  .mzf-related { padding-block: 32px 40px; }
}
