/* =========================================================
   PORTFOLIO DETAIL — portfolio-detail.css
   Matches existing design system vars from style.css
   All pf- namespaced, RTL-ready, mobile-first
   فاز فعلی: فقط لی‌اوت/قرارگیری اولیه‌ی هرو — رنگ‌آمیزی و تایپوگرافی نهایی فازهای بعدیه
   ========================================================= */

/* ── HERO — #pf-detail-hero ──────────────────────────────────
   The cover image is a pre-made marketing banner (a Canva poster
   with its own embedded branding/text). It stays a framed, centered
   graphic — never full-bleed — but the page's breadcrumb/badge/title/
   meta block now overlays the bottom of that frame on a gradient scrim,
   mirroring #bd-hero in blog-detail.css. */
#pf-detail-hero {
  width: 100%;
  padding-top: calc(var(--nav) + 32px);
  background: var(--bg);
}

/* shared width/centering budget for the hero frame (.pf-dh-frame) and
   the full-page screenshot box (.pf-fullpage-wrap) below it — keeping
   both on one variable pair means they can't drift out of sync at a
   breakpoint the way two independently-maintained width rules could. */
:root {
  --pf-poster-w: 90%;
  --pf-poster-maxw: none;
}

@media (min-width: 576px) {
  :root { --pf-poster-maxw: 486px; }
}

@media (min-width: 768px) {
  :root { --pf-poster-w: 96%; --pf-poster-maxw: 1440px; }
}

/* neutralized: #pf-detail-hero itself is the single frame (see rule further
   below) — this wrapper must not add its own box/aspect-ratio, or the banner
   ends up shrunk inside a second, mismatched frame. */
.pf-dh-frame {
  display: contents;
}

.pf-dh-banner {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* bottom-weighted scrim: keeps the overlaid text legible while leaving
   the poster's own branding art in the upper area clearly visible */
.pf-dh-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  height: 55%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(8, 8, 15, .94) 0%,
    rgba(8, 8, 15, .72) 32%,
    rgba(8, 8, 15, .26) 68%,
    transparent 100%
  );
}

.lm .pf-dh-overlay {
  background: linear-gradient(
    to top,
    rgba(10, 10, 26, .9) 0%,
    rgba(10, 10, 26, .65) 32%,
    rgba(10, 10, 26, .2) 68%,
    transparent 100%
  );
}

.pf-dh-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 40px 36px;
  direction: rtl;
  text-align: right;
}

/* breadcrumb */
.pf-dh-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  font-size: .78rem;
  color: rgba(255, 255, 255, .55);
}

.pf-dh-breadcrumb li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pf-dh-breadcrumb li:not(:last-child)::after {
  content: "•";
  margin-inline-start: 6px;
  color: rgba(255, 255, 255, .3);
}

.pf-dh-breadcrumb li:last-child {
  color: rgba(255, 255, 255, .85);
}

.pf-dh-breadcrumb a {
  color: rgba(255, 255, 255, .55);
  text-decoration: none;
  transition: color .2s ease;
}

.pf-dh-breadcrumb a:hover { color: var(--pur); }

/* category badge */
.pf-dh-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 30px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  margin-bottom: 14px;
  color: #fff;
  background: var(--grad);
}

/* عنوان هرو */
#pf-detail-hero .pf-dh-title {
  font-size: clamp(1.6rem, 3.6vw, 2.75rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.02em;
  margin: 0 0 12px;
  max-width: 800px;
  color: #f5f4ff;
  text-wrap: balance;
}

.pf-dh-sub {
  font-size: 1rem;
  line-height: 1.7;
  max-width: 640px;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, .68);
}

/* meta row */
.pf-dh-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.pf-dh-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .8rem;
  color: rgba(255, 255, 255, .55);
  text-decoration: none;
  transition: color .2s ease;
}

.pf-dh-meta-item i {
  color: var(--pur);
  font-size: .74rem;
}

a.pf-dh-meta-item:hover { color: #fff; }
a.pf-dh-meta-item:hover i { color: var(--blu); }

@media (max-width: 991.98px) {
  #pf-detail-hero { padding-top: calc(var(--nav) + 24px); }
  .pf-dh-content { padding: 0 28px 28px; }
}

@media (max-width: 767.98px) {
  #pf-detail-hero { padding-top: calc(var(--nav) + 20px); }
  #pf-detail-hero .pf-dh-title { max-width: 100%; }
  .pf-dh-sub { font-size: .9rem; margin-bottom: 16px; }
  .pf-dh-breadcrumb { font-size: .72rem; margin-bottom: 12px; }
  .pf-dh-meta { gap: 12px; }
}

/* ≤576px: the frame narrows enough that the full text block (breadcrumb +
   badge + title + sub + meta) needs its own taller ratio and a scrim that
   darkens sooner/harder — otherwise the title collides with the poster's
   own upper-area artwork instead of sitting in a clearly darkened zone. */
@media (max-width: 575.98px) {

  .pf-dh-overlay {
    height: 66%;
    background: linear-gradient(
      to top,
      rgba(8, 8, 15, .97) 0%,
      rgba(8, 8, 15, .85) 28%,
      rgba(8, 8, 15, .4) 60%,
      transparent 100%
    );
  }

  .lm .pf-dh-overlay {
    background: linear-gradient(
      to top,
      rgba(10, 10, 26, .95) 0%,
      rgba(10, 10, 26, .8) 28%,
      rgba(10, 10, 26, .35) 60%,
      transparent 100%
    );
  }

  .pf-dh-content { padding: 0 .9rem 20px; }

  #pf-detail-hero .pf-dh-title {
    font-size: 1.28rem; /* explicit, smaller than clamp()'s 1.6rem floor — fits 2 lines at 320-414px */
    line-height: 1.36;
    margin-bottom: 10px;
  }

  .pf-dh-sub { font-size: .82rem; margin-bottom: 14px; }
  .pf-dh-breadcrumb { font-size: .68rem; margin-bottom: 10px; }
  .pf-dh-category-badge { font-size: .66rem; padding: 3px 11px; margin-bottom: 10px; }
  .pf-dh-meta { gap: 10px; }
  .pf-dh-meta-item { font-size: .72rem; }
}

@media (max-width: 424.98px) {
  .pf-dh-sub { font-size: .78rem; margin-bottom: 12px; }
  .pf-dh-breadcrumb { font-size: .66rem; }
  #pf-detail-hero .pf-dh-title { font-size: 1.18rem; }
}

/* ── FULL-PAGE SCREENSHOT BOX ────────────────────────────── */
.pf-fullpage-wrap {
  width: var(--pf-poster-w);
  max-width: var(--pf-poster-maxw);
  margin: 40px auto 0; /* same gap value reused by #pf-device-showcase below — one consistent section gap now that the hero text no longer sits between the banner and this box */
  position: relative;
  z-index: 10;
}

.pf-fullpage-box {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg4);
  box-shadow: 0 8px 40px rgba(0, 0, 0, .45);
}


.pf-browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg3, #1a1a2e);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.pf-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  flex-shrink: 0;
}

.pf-url {
  font-size: .72rem;
  color: rgba(255, 255, 255, .4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
}

.pf-fullpage-scroll {
  overflow-y: auto;
  aspect-ratio: 4 / 3; /* taller viewport frame; browser bar sits above this so total box height is aspect-ratio + bar height */
}

.pf-fullpage-scroll img {
  display: block;
  width: 100%;
  height: auto;
}

.pf-fullpage-empty {
  padding: 60px 20px;
  text-align: center;
  color: rgba(255, 255, 255, .3);
  font-size: .85rem;
}

/* ── DEVICE SHOWCASE HEADER (tabs + arrow pair, one row) ────── */
#pf-device-showcase {
  margin-top: 40px; /* same gap value used for .pf-fullpage-wrap after the hero */
  background: var(--bg3);
}

#pf-challenge {
  background: var(--bg2);
}

#pf-modules {
  background: var(--bg2);
}

#pf-quickfacts {
  background: var(--bg3);
}

#pf-related {
  background: var(--bg2);
}

#pf-results {
  background: var(--bg3);
}

#pf-project-context {
  background: var(--bg2);
}

.pf-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.pf-context-grid > div {
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--bd);
  border-radius: 16px;
  background: var(--sf);
}

.pf-context-grid dt {
  margin-bottom: .4rem;
  color: var(--tx3);
  font-size: .72rem;
  font-weight: 600;
}

.pf-context-grid dd {
  margin: 0;
  color: var(--tx);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.7;
}

.pf-context-grid .pf-context-grid__wide {
  grid-column: span 2;
}

.pf-results-grid,
.pf-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.pf-result-card,
.pf-related-card {
  overflow: hidden;
  border: 1px solid var(--bd);
  border-radius: 18px;
  background: var(--sf);
}

.pf-result-card {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: 1.5rem;
  text-align: center;
}

.pf-result-card strong {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1;
  color: var(--pur);
}

.pf-result-card span,
.pf-related-card__body p {
  color: var(--tx3);
}

.pf-related-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.pf-related-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.pf-related-card:hover .pf-related-card__media img {
  transform: scale(1.035);
}

.pf-related-card__body {
  padding: 1.15rem 1.25rem 1.35rem;
}

.pf-related-card__body > span {
  color: var(--pur);
  font-size: .72rem;
  font-weight: 700;
}

.pf-related-card__body h3 {
  margin: .45rem 0 .55rem;
  font-size: 1.05rem;
}

.pf-related-card__body h3 a {
  color: var(--tx);
  text-decoration: none;
}

.pf-related-card__body p {
  margin: 0;
  font-size: .8rem;
  line-height: 1.8;
}

@media (max-width: 991.98px) {
  .pf-context-grid,
  .pf-results-grid,
  .pf-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
  .pf-context-grid,
  .pf-results-grid,
  .pf-related-grid { grid-template-columns: 1fr; }
  .pf-context-grid .pf-context-grid__wide { grid-column: auto; }
}

#pf-device-showcase .container {
  position: relative;
  padding-top: 1.5rem;
}

.pf-device-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  margin-top: 0;
  padding-inline-end: 108px; /* reserves room for the arrow pair */
  margin-bottom: 2rem;
}

.pf-device-tab {
  padding: 8px 20px;
  border-radius: 100px;
  border: 1px solid var(--bd);
  background: transparent;
  color: var(--tx2);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.pf-device-tab.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}
/* ── DEVICE CAROUSEL ──────────────────────────────────────── */
.pf-device-carousel {
  position: relative;
  margin-top: 24px;          /* فاصله از تب‌ها */
  padding-block: 32px 56px;  /* فضای آزاد بالا و پایین خود Carousel */
}

.pf-device-track {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 8px 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: center;
  justify-content: safe center;
}

.pf-device-track::-webkit-scrollbar {
  display: none;
}

/* ── DEVICE SLIDES (card) ─────────────────────────────────── */
.pf-device-slide {
  flex-shrink: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  width: min(300px, 82vw);
  border-radius: 18px;
  overflow: hidden;
  background: var(--sf);
  border: 1px solid var(--bd);
  position: relative;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}

.pf-device-slide:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 50px rgba(0,0,0,.25);
  border-color: rgba(139,92,246,.3);
}

.pf-device-slide img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.pf-device-slide.pf-hidden {
  display: none;
}

.pf-device-caption {
  display: block;
  padding: 10px 14px 12px;
  font-size: .78rem;
  color: var(--tx3);
  background: var(--bg2);
  border-top: 1px solid var(--bd);
}

.pf-device-slide-empty {
  padding: 40px 20px;
  color: var(--tx3);
  font-size: .85rem;
  text-align: center;
}

/* ── CAROUSEL ARROWS ──────────────────────────────────────── */
.pf-device-arrow {
  position: absolute;
  top: 0;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sf);
  border: 1px solid var(--bd);
  color: var(--tx);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, opacity .2s;
}

.pf-device-arrow-prev {
  inset-inline-end: 0;
}

.pf-device-arrow-next {
  inset-inline-end: 48px;
}

.pf-device-arrow-prev i,
.pf-device-arrow-next i {
  transform: scaleX(-1);
}

.pf-device-arrow:hover {
  background: var(--bg3);
  border-color: rgba(139,92,246,.35);
  color: var(--pur);
}

.pf-device-arrow[disabled] {
  opacity: .3;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 768px) {
  .pf-device-arrow {
    display: none;
  }

  .pf-device-tabs {
    justify-content: center;
    padding-inline-end: 0;
  }

  .pf-device-track {
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .pf-device-slide {
    width: 78vw;
  }
}


/* ── LIGHTBOX ─────────────────────────────────────────────── */
.pf-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.pf-lightbox.active {
  display: flex;
}

.pf-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(4px);
}

.pf-lightbox-content {
  position: relative;
  z-index: 1;
  max-height: 90vh;
  max-width: 92vw;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pf-lightbox-close {
  position: absolute;
  top: -44px;
  inset-inline-end: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sf);
  border: 1px solid var(--bd);
  color: var(--tx);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.pf-lightbox-frame {
  background: var(--sf);
  border: 1px solid var(--bd);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.pf-lightbox-screen {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.pf-lightbox-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain; /* full, uncropped screenshot — unlike the grid thumbnails */
}

.pf-lightbox-browserbar,
.pf-lightbox-notch {
  display: none;
}

/* ── LIGHTBOX FRAME VARIANTS ──────────────────────────────── */
.pf-frame-desktop {
  width: min(900px, 90vw);
  aspect-ratio: 16 / 10;
  border-radius: 12px;
}

.pf-frame-desktop .pf-lightbox-browserbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--bd);
}

.pf-frame-desktop .pf-lightbox-screen {
  height: calc(100% - 40px);
}

.pf-frame-desktop .pf-lightbox-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top;
}

.pf-frame-tablet {
  width: min(560px, 88vw);
  aspect-ratio: 4 / 3;
  border-radius: 16px;
}

.pf-frame-tablet .pf-lightbox-browserbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--bd);
}

.pf-frame-tablet .pf-lightbox-browserbar .pf-url {
  font-size: .68rem;
}

.pf-frame-tablet .pf-lightbox-screen {
  height: calc(100% - 34px);
}

.pf-frame-tablet .pf-lightbox-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top;
}

.pf-frame-mobile {
  width: min(280px, 70vw);
  aspect-ratio: 9 / 19;
  border-radius: 36px;
  padding: 10px;
  background: #111;
  position: relative;
}

.pf-frame-mobile .pf-lightbox-screen {
  position: relative;
  width: 100%;
  height: calc(100% - 24px);
  margin-top: 14px;
  overflow-y: auto;
  border-radius: 26px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.pf-frame-mobile .pf-lightbox-notch {
  display: block;
  position: absolute;
  top: 10px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 18px;
  border-radius: 10px;
  background: #000;
  z-index: 1;
}

.pf-frame-mobile .pf-lightbox-img {
  width: 100%;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  object-position: top;
}

@media (max-width: 600px) {
  .pf-frame-desktop { width: 94vw; }
  .pf-lightbox-close { top: -40px; }
}


#pf-detail-hero {
  position: relative;
  width: min(95%, 1500px);
  margin-inline: auto;
  margin-top: calc(var(--nav) + 28px);
  margin-bottom: 56px;               /* فاصله تا باکس اسکرول — دیگه گپ اضافه‌ی قبلی لازم نیست */
  aspect-ratio: 21 / 10;             /* کمی بلندتر از قبل تا متن پایین جا بگیره */
  border-radius: 18px;
  overflow: hidden;                  /* گرادینت و متن به گوشه‌های گرد احترام می‌ذارن */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;         /* محتوا می‌چسبه ته قاب — همون الگوی bd-hero */
  background: var(--bg2);            /* fallback وقتی عکس لود نشده */
}
 
/* ── بنر: لایه‌ی زیرین، کل قاب رو پر می‌کنه ── */
.pf-dh-banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  /* بدون filter تیره‌کننده — پوسترِ برند باید بالای قاب واضح بمونه؛
     خوانایی متن فقط با گرادینت پایین تأمین می‌شه */
}
 

 
/* ── بلوک متن: روی همه‌چیز، ته قاب ── */
.pf-dh-content {
  position: relative;
  z-index: 2;
  padding: 32px 36px 36px;   /* padding داخلی نسبت به لبه‌های قاب، نه ویوپورت */
}
 
/* روی گرادینت تیره، متن‌ها همیشه روشن — حتی در لایت‌مود */
#pf-detail-hero .pf-dh-title {
  color: #f0f0ff;
  margin-bottom: 12px;
}
#pf-detail-hero .pf-dh-sub {
  color: rgba(255, 255, 255, .6);
}
#pf-detail-hero .pf-dh-breadcrumb a { color: rgba(255, 255, 255, .55); }
#pf-detail-hero .pf-dh-breadcrumb a:hover { color: var(--pur); }
#pf-detail-hero .pf-dh-breadcrumb li:last-child { color: rgba(255, 255, 255, .85); }
#pf-detail-hero .pf-dh-meta-item { color: rgba(255, 255, 255, .65); }
 
/* ── ریسپانسیو ── */
@media (max-width: 992px) {
  #pf-detail-hero { aspect-ratio: 16 / 10; }
  .pf-dh-content { padding: 24px 26px 28px; }
}
 
@media (max-width: 768px) {
  #pf-detail-hero {
    aspect-ratio: 4 / 3;
    margin-top: calc(var(--nav) + 20px);
    margin-bottom: 40px;
    border-radius: 14px;
  }
  .pf-dh-content { padding: 20px 20px 22px; }
}
 
@media (max-width: 576px) {
  #pf-detail-hero {
    width: calc(100% - 24px);     /* حاشیه از لبه‌ها در موبایل حفظ می‌شه */
    aspect-ratio: 3 / 4;          /* قاب بلندتر: هم برش عکس کمتر، هم متن جا می‌شه */
    margin-bottom: 32px;
  }
  .pf-dh-banner { object-position: 22% center; } /* آیکون‌ها + SHOPX هر دو در کادر بمونن */
  /* .pf-dh-overlay {
    /* background: linear-gradient(
      180deg,
      rgba(8, 8, 15, 0)   0%,
      rgba(8, 8, 15, 0)   30%,
      rgba(8, 8, 15, .68) 60%,
      rgba(8, 8, 15, .97) 100%
    ); */
  } */
  .pf-dh-content { padding: 16px 16px 18px; }


 
/* ══════════════════════════════════════════════════════════
   PF DETAIL HERO — framed poster + text overlaid at bottom
   جایگزین کامل قوانین قبلی #pf-detail-hero و بچه‌هاش بشه.
   (قوانین قدیمی .pf-dh-banner / .pf-dh-overlay / .pf-dh-content
    و مدیا کوئری‌های مربوطه رو حذف کن و این بلاک رو بذار)
   ══════════════════════════════════════════════════════════ */

/* ── قاب اصلی: خود سکشن هم قابه هم مرجع پوزیشن ── */
#pf-detail-hero {
  position: relative;
  width: min(95%, 1500px);
  margin-inline: auto;
  margin-top: calc(var(--nav) + 28px);
  margin-bottom: 56px;               /* فاصله تا باکس اسکرول — دیگه گپ اضافه‌ی قبلی لازم نیست */
  aspect-ratio: 21 / 10;             /* کمی بلندتر از قبل تا متن پایین جا بگیره */
  border-radius: 18px;
  overflow: hidden;                  /* گرادینت و متن به گوشه‌های گرد احترام می‌ذارن */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;         /* محتوا می‌چسبه ته قاب — همون الگوی bd-hero */
  background: var(--bg2);            /* fallback وقتی عکس لود نشده */
}

/* ── بنر: لایه‌ی زیرین، کل قاب رو پر می‌کنه ── */
.pf-dh-banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  /* بدون filter تیره‌کننده — پوسترِ برند باید بالای قاب واضح بمونه؛
     خوانایی متن فقط با گرادینت پایین تأمین می‌شه */
}

.lm .pf-dh-overlay {
  background: linear-gradient(
    180deg,
    rgba(10, 10, 26, 0)   0%,
    rgba(10, 10, 26, 0)   38%,
    rgba(10, 10, 26, .58) 68%,
    rgba(10, 10, 26, .95) 100%
  );
} */

/* .pf-dh-overlay{
    background:rgba(0,0,0,.4);
} */
/* ── بلوک متن: روی همه‌چیز، ته قاب ── */
.pf-dh-content {
  position: relative;
  z-index: 2;
  padding: 32px 36px 36px;   /* padding داخلی نسبت به لبه‌های قاب، نه ویوپورت */
}

/* روی گرادینت تیره، متن‌ها همیشه روشن — حتی در لایت‌مود */
#pf-detail-hero .pf-dh-title {
  color: #f0f0ff;
  margin-bottom: 12px;
}

#pf-detail-hero .pf-dh-breadcrumb a { color: rgba(255, 255, 255, .55); }
#pf-detail-hero .pf-dh-breadcrumb a:hover { color: var(--pur); }
#pf-detail-hero .pf-dh-breadcrumb li:last-child { color: rgba(255, 255, 255, .85); }
#pf-detail-hero .pf-dh-meta-item { color: rgba(255, 255, 255, .65); }

/* ── ریسپانسیو ── */
@media (max-width: 992px) {
  #pf-detail-hero { aspect-ratio: 16 / 10; }
  .pf-dh-content { padding: 24px 26px 28px; }
}

@media (max-width: 768px) {
  #pf-detail-hero {
    aspect-ratio: 4 / 3;
    margin-top: calc(var(--nav) + 20px);
    margin-bottom: 40px;
    border-radius: 14px;
  }
  .pf-dh-content { padding: 20px 20px 22px; }
}

@media (max-width: 576px) {
  #pf-detail-hero {
    width: calc(100% - 24px);     /* حاشیه از لبه‌ها در موبایل حفظ می‌شه */
    aspect-ratio: 3 / 4;          /* قاب بلندتر: هم برش عکس کمتر، هم متن جا می‌شه */
    margin-bottom: 32px;
  }
  .pf-dh-banner { object-position: 22% center; } /* آیکون‌ها + SHOPX هر دو در کادر بمونن */
  .pf-dh-overlay {
    background: linear-gradient(
      180deg,
      rgba(8, 8, 15, 0)   0%,
      rgba(8, 8, 15, 0)   30%,
      rgba(8, 8, 15, .68) 60%,
      rgba(8, 8, 15, .97) 100%
    );
  }
  .pf-dh-content { padding: 16px 16px 18px; }
}
.pf-dh-frame{
    position:relative;
    width:100%;
    height:100%;
    overflow:hidden;
}

/* ── PROJECT NARRATIVE ──────────────────────────────────── */

.pf-narrative-section {
  padding-block: clamp(56px, 7vw, 96px);
  direction: rtl;
  text-align: right;
}

/*
  رنگ خط جداکننده مستقیماً از تم اصلی پروژه گرفته می‌شود:
  در نایت‌مد روشن و در لایت‌مد تیره خواهد بود.
*/
.pf-narrative-section + .pf-narrative-section {
  border-top: 1px solid var(--bd);
}


/* ── OVERVIEW: TEXT ONLY ────────────────────────────────── */

.pf-overview-section {
  padding-top: clamp(64px, 8vw, 110px);
}

.pf-overview-content {
  width: min(100%, 900px);
  margin-inline: auto;
  direction: rtl;
  text-align: right;
  font-size: clamp(1rem, 1.2vw, 1.125rem);
}

.pf-overview-text {
  margin-top: 22px;
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 2;
  color: var(--tx);
  direction: rtl;
  text-align: right;
}

.pf-overview-text > *:last-child {
  margin-bottom: 0;
}


/* ── CHALLENGE & SOLUTION ───────────────────────────────── */

.pf-narrative-content {
  width: min(100%, 600px);
  direction: rtl;
  text-align: right;
}

.pf-narrative-text {
  margin-top: 22px;
  font-size: clamp(1rem, 1.1vw, 1.075rem);
  line-height: 2;
  color: var(--tx);
  direction: rtl;
  text-align: right;
}

.pf-narrative-text > *:last-child {
  margin-bottom: 0;
}


/* ── SECTION LABELS ─────────────────────────────────────── */

.pf-narrative-section .slbl {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  direction: rtl;
  text-align: right;
}


/* ── TINYMCE / RICH-TEXT CONTENT ────────────────────────── */

/*
  متن از TinyMCE و با |safe وارد صفحه می‌شود؛ بنابراین ممکن است
  روی بعضی عناصر رنگ inline ثبت شده باشد. !important آن را خنثی
  می‌کند تا رنگ متن همیشه از تم اصلی پروژه گرفته شود.
*/
.pf-overview-text *,
.pf-narrative-text * {
  direction: rtl;
  text-align: right;
  color: var(--tx) !important;
}

.pf-overview-text p,
.pf-narrative-text p {
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: inherit;
}

.pf-overview-text ul,
.pf-overview-text ol,
.pf-narrative-text ul,
.pf-narrative-text ol {
  margin-bottom: 1rem;
  padding-right: 1.4rem;
  padding-left: 0;
}

.pf-overview-text li,
.pf-narrative-text li {
  margin-bottom: 0.45rem;
}


/* ── LINKS INSIDE TEXT ──────────────────────────────────── */

.pf-overview-text a,
.pf-narrative-text a {
  color: var(--pur) !important;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity 0.2s ease;
}

.pf-overview-text a:hover,
.pf-narrative-text a:hover {
  opacity: 0.8;
}


/* ── IMAGE WRAPPER ──────────────────────────────────────── */

.pf-narrative-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/*
  تصویر از اندازه ستون بزرگ‌تر نمی‌شود.
  object-fit: contain از برش یا کشیدگی تصویر جلوگیری می‌کند.
*/
.pf-narrative-img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 560px;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
}


/* ── RESPONSIVE ─────────────────────────────────────────── */

@media (min-width: 992px) {
  #pf-challenge .pf-narrative-content {
    margin-inline-start: auto;
  }

  #pf-solution .pf-narrative-content {
    margin-inline-end: auto;
  }
}

@media (max-width: 991.98px) {
  .pf-narrative-section {
    padding-block: 52px;
  }

  .pf-narrative-content {
    width: 100%;
  }

  .pf-narrative-img {
    max-height: 420px;
  }
}

@media (max-width: 575.98px) {
  .pf-narrative-section {
    padding-block: 42px;
  }

  .pf-overview-text,
  .pf-narrative-text {
    margin-top: 16px;
    line-height: 1.9;
  }

  .pf-narrative-img {
    max-height: 340px;
    border-radius: 14px;
  }
}

.pf-narrative-media {
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 22px;
  transition:
    border-color 0.35s ease,
    background-color 0.35s ease,
    box-shadow 0.35s ease;
}

.pf-narrative-img {
  transition: transform 0.45s cubic-bezier(.22, .8, .32, 1);
}

.pf-narrative-media:hover {
  border-color: rgba(139, 92, 246, 0.22);
  background: rgba(139, 92, 246, 0.025);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
}

.pf-narrative-media:hover .pf-narrative-img {
  transform: scale(1.015);
}

.pf-narrative-section {
  position: relative;
}

.pf-narrative-section + .pf-narrative-section {
  border-top: 0;
}

.pf-narrative-section + .pf-narrative-section::before {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  width: min(88%, 1120px);
  height: 1px;
  transform: translateX(50%);
  background: linear-gradient(
    90deg,
    transparent,
    var(--bd2),
    rgba(139, 92, 246, 0.32),
    var(--bd2),
    transparent
  );
}

.pf-narrative-media::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.12),
    transparent 68%
  );
  filter: blur(32px);
  opacity: 0.65;
  pointer-events: none;
}

.pf-narrative-media {
  position: relative;
  isolation: isolate;
}
/* ── PORTFOLIO SECTION DIVIDER ──────────────────────────── */

.pf-section-divider {
  position: relative;
}

.pf-section-divider::before {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  width: min(88%, 1120px);
  height: 1px;
  transform: translateX(50%);
  background: linear-gradient(
    90deg,
    transparent,
    var(--bd2),
    rgba(139, 92, 246, 0.32),
    var(--bd2),
    transparent
  );
  pointer-events: none;
}


/* ── PORTFOLIO SECTION DIVIDER ──────────────────────────── */

.pf-section-divider {
  position: relative;
  border-top: 0;
  padding-block: 32px 56px;
}

.pf-section-divider::before {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  z-index: 2;
  width: min(88%, 1120px);
  height: 1px;
  transform: translateX(50%);
  background: linear-gradient(
    90deg,
    transparent,
    var(--bd2),
    rgba(139, 92, 246, 0.32),
    var(--bd2),
    transparent
  );
  pointer-events: none;
}

/* ── PORTFOLIO CONTENT SECTIONS ─────────────────────────── */

.pf-content-section {
  position: relative;
  padding-block: clamp(56px, 7vw, 90px);
  direction: rtl;
  text-align: right;
}

.pf-section-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 28px;
}


/* ── SHARED CARD STYLE ──────────────────────────────────── */

.pf-module-card,
.pf-fact-card,
.pf-related-card {
  position: relative;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(
      145deg,
      rgba(139, 92, 246, 0.035),
      transparent 42%
    ),
    var(--sf);
  border: 1px solid var(--bd);
  border-radius: 18px;
  transition:
    transform 0.35s cubic-bezier(.22, .8, .32, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.pf-module-card::before,
.pf-fact-card::before,
.pf-related-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 24px;
  left: 24px;
  height: 1px;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.75),
    transparent
  );
  transition: opacity 0.35s ease;
}

.pf-module-card:hover,
.pf-fact-card:hover,
.pf-related-card:hover {
  transform: translateY(-5px);
  border-color: rgba(139, 92, 246, 0.28);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.2);
}

.pf-module-card:hover::before,
.pf-fact-card:hover::before,
.pf-related-card:hover::before {
  opacity: 1;
}


/* ── MODULE CAROUSEL ────────────────────────────────────── */

.pf-modules-carousel {
  width: 100%;
  overflow: hidden;
}

.pf-modules-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 20px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.35) transparent;
}

.pf-modules-track::-webkit-scrollbar {
  height: 5px;
}

.pf-modules-track::-webkit-scrollbar-track {
  background: transparent;
}

.pf-modules-track::-webkit-scrollbar-thumb {
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.35);
}

.pf-module-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 26px;
  scroll-snap-align: start;
}

.pf-module-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.pf-module-icon,
.pf-fact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.11);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 13px;
  font-size: 1.05rem;
}

.pf-module-index {
  direction: ltr;
  color: var(--tx3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.pf-module-title {
  margin: 0 0 12px;
  color: var(--tx);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.6;
}

.pf-module-desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--tx2);
  font-size: 0.9rem;
  line-height: 1.9;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}


/* ── QUICK FACT CARDS ───────────────────────────────────── */

#pf-quickfacts {
  padding-top: 3rem;
}

#pf-quickfacts .row > [class*="col-"] {
  display: flex;
}

.pf-fact-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 280px;
  padding: 28px;
}

.pf-fact-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.pf-fact-eyebrow {
  display: block;
  margin-bottom: 4px;
  direction: ltr;
  color: var(--tx3);
  font-size: 0.80rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
}

.pf-fact-title {
  margin: 0;
  color: var(--tx);
  font-size: 1rem;
  font-weight: 700;
}


/* ── TECHNOLOGY BADGES ──────────────────────────────────── */

.pf-techwrap {
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 9px;
}

.pf-tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  color: var(--tx2);
  background: var(--bg3);
  border: 1px solid var(--bd);
  border-radius: 9px;
  font-size: 0.80rem;
  font-weight: 500;
  line-height: 1;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.pf-tech-badge:hover {
  color: var(--tx);
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.28);
}


/* ── HIGHLIGHT LIST ─────────────────────────────────────── */

.pf-highlight-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pf-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--tx2);
  font-size: 0.88rem;
  line-height: 1.7;
}

.pf-highlight-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  border-radius: 50%;
  font-size: 0.66rem;
}


/* ── STAT CARD ──────────────────────────────────────────── */

.pf-stat-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.pf-fact-num {
  display: block;
  direction: ltr;
  margin-bottom: 8px;
  color: var(--tx);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1;
  text-align: right;
}

.pf-stat-label {
  color: var(--tx2);
  font-size: 0.93rem;
  line-height: 1.7;
}


/* ── RELATED PROJECT CARDS ──────────────────────────────── */

#pf-related .row > [class*="col-"] {
  display: flex;
}

.pf-related-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.pf-related-link:hover {
  color: inherit;
}

.pf-related-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 390px;
}

.pf-related-media {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg3);
  border-bottom: 1px solid var(--bd);
}

.pf-related-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(.22, .8, .32, 1);
}

.pf-related-card:hover .pf-related-media img {
  transform: scale(1.035);
}

.pf-related-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--tx3);
  font-size: 2rem;
}

.pf-related-category {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 6px 10px;
  color: #fff;
  background: rgba(8, 8, 15, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  font-size: 0.7rem;
  font-weight: 600;
}

.pf-related-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px;
}

.pf-related-title {
  margin: 0 0 10px;
  color: var(--tx);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.6;
}

.pf-related-desc {
  display: -webkit-box;
  margin: 0 0 20px;
  overflow: hidden;
  color: var(--tx2);
  font-size: 0.84rem;
  line-height: 1.8;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.pf-related-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  color: #a78bfa;
  font-size: 0.78rem;
  font-weight: 600;
  transition: gap 0.2s ease;
}

.pf-related-card:hover .pf-related-action {
  gap: 11px;
}


/* ── EMPTY STATES ───────────────────────────────────────── */

.pf-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  padding: 24px;
  color: var(--tx3);
  background: var(--sf);
  border: 1px dashed var(--bd2);
  border-radius: 16px;
  text-align: center;
}

.pf-empty-text {
  margin: 0;
  color: var(--tx3);
  font-size: 0.84rem;
  line-height: 1.7;
}


/* ── RESPONSIVE ─────────────────────────────────────────── */

@media (min-width: 1200px) {
  .pf-modules-track {
    grid-auto-columns: calc((100% - 40px) / 3);
  }
}

@media (max-width: 991.98px) {
  .pf-content-section {
    padding-block: 56px;
  }

  #pf-quickfacts {
    padding-top: 0;
  }

  .pf-fact-card {
    min-height: 260px;
  }
}

@media (max-width: 575.98px) {
  .pf-content-section {
    padding-block: 44px;
  }

  .pf-modules-track {
    grid-auto-columns: minmax(82vw, 1fr);
  }

  .pf-module-card,
  .pf-fact-card {
    min-height: auto;
    padding: 22px;
  }

  .pf-related-card {
    min-height: 360px;
  }
}


/* ── ACCESSIBILITY: REDUCED MOTION ──────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .pf-module-card,
  .pf-fact-card,
  .pf-related-card,
  .pf-related-media img {
    transition: none;
  }

  .pf-module-card:hover,
  .pf-fact-card:hover,
  .pf-related-card:hover {
    transform: none;
  }
}

/* ── SECTION HEADING ────────────────────────────────────── */

.pf-section-heading {
  width: min(100%, 700px);
  margin-bottom: 32px;
  direction: rtl;
  text-align: right;
}

.pf-section-title {
  margin: 2px 0 12px;
  color: var(--tx);
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 750;
  line-height: 1.5;
}

.pf-section-description {
  margin: 0;
  color: var(--tx2);
  font-size: 0.94rem;
  line-height: 1.9;
}


/* ── MODULE CAROUSEL ────────────────────────────────────── */

.pf-modules-carousel {
  position: relative;
  width: 100%;
  padding-inline: 54px;
  padding-block: 32px 56px;
}

.pf-modules-track {
  display: flex;
  align-items: stretch;
  gap: 20px;
  overflow-x: auto;
  padding: 6px 4px 20px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

.pf-modules-track::-webkit-scrollbar {
  display: none;
}

.pf-module-card {
  flex: 0 0 calc((100% - 40px) / 3);
  min-width: 0;
  min-height: 260px;
  scroll-snap-align: start;
}


/* ── CAROUSEL ARROWS ────────────────────────────────────── */

.pf-module-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--tx);
  background: var(--sf);
  border: 1px solid var(--bd2);
  border-radius: 50%;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.pf-module-arrow:hover {
  color: #fff;
  background: var(--pur);
  border-color: var(--pur);
  transform: translateY(-50%) scale(1.05);
}

.pf-module-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.pf-module-arrow-prev {
  right: 0;
}

.pf-module-arrow-next {
  left: 0;
}


/* ── RESPONSIVE CAROUSEL ────────────────────────────────── */

@media (max-width: 991.98px) {
  .pf-module-card {
    flex-basis: calc((100% - 20px) / 2);
  }
}

@media (max-width: 575.98px) {
  .pf-modules-carousel {
    padding-inline: 0;
  }

  .pf-module-card {
    flex-basis: 86%;
  }

  .pf-module-arrow {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════
   SHARED SECTION LAYOUT
════════════════════════════════════════════════════════ */

.pf-content-section {
  position: relative;
  padding-block: clamp(72px, 8vw, 112px);
  overflow: hidden;
}

.pf-section-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}


/* ── Shared section heading ───────────────────────────── */

.pf-section-heading {
  width: min(100%, 760px);
  margin-inline: auto;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.pf-section-heading--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}


/* Small purple label */

.pf-section-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;

  color: #8b5cf6;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.pf-section-label-line {
  display: block;
  width: 24px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(124, 92, 255, 0.9)
  );
}

.pf-section-label-line:last-child {
  transform: scaleX(-1);
}


/* Main section title */

.pf-section-title {
  max-width: 720px;
  margin: 0;

  color: #f8f7ff;
  font-size: clamp(1.75rem, 3vw, 2.65rem);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.025em;
}

.pf-title-accent {
  color: #7c5cff;
}


/* Description */

.pf-section-description {
  max-width: 650px;
  margin: 16px auto 0;

  color: rgba(224, 221, 241, 0.68);
  font-size: clamp(0.88rem, 1.2vw, 1rem);
  font-weight: 400;
  line-height: 2;
}


/* ═══════════════════════════════════════════════════════
   QUICK FACTS
════════════════════════════════════════════════════════ */

.pf-quickfacts-section {
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(104, 72, 255, 0.07),
      transparent 38%
    ),
    #11101f;
}

.pf-quickfacts-section .pf-fact-card {
  height: 100%;
  min-height: 220px;
}


/* ═══════════════════════════════════════════════════════
   MODULES SECTION
════════════════════════════════════════════════════════ */

.pf-modules-section {
  background:
    radial-gradient(
      circle at 50% 10%,
      rgba(87, 62, 218, 0.055),
      transparent 42%
    ),
    #0c0b17;
}

.pf-modules-carousel {
  margin-top: 0;
}


/* ═══════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════ */

@media (max-width: 767.98px) {
  .pf-content-section {
    padding-block: 64px;
  }

  .pf-section-heading {
    margin-bottom: 36px;
  }

  .pf-section-title {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .pf-section-description {
    max-width: 92%;
    font-size: 0.88rem;
    line-height: 1.9;
  }

  .pf-section-label-line {
    width: 18px;
  }
}


/* ═══════════════════════════════════════════════════════
   PORTFOLIO NARRATIVE SECTIONS
════════════════════════════════════════════════════════ */

.pf-narrative .slbl {
  margin-bottom: 14px;

  font-size: clamp(0.78rem, 0.9vw, 0.9rem);
  font-weight: 700;
  line-height: 1.6;
}

.pf-narrative-title {
  margin: 0 0 20px;

  color: #f8f7ff;
  font-size: clamp(1.85rem, 3vw, 2.7rem);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.025em;
}

.pf-narrative-text,
.pf-narrative-description {
  max-width: 680px;
  margin: 0;

  color: rgba(225, 222, 241, 0.76);
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
  font-weight: 400;
  line-height: 2.15;
}


/* اگر متن مستقیماً داخل ستون قرار گرفته است */

.pf-narrative-content > p {
  max-width: 680px;

  color: rgba(225, 222, 241, 0.76);
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
  line-height: 2.15;
}


/* فاصله بهتر میان متن و تصویر */

.pf-narrative .row {
  --bs-gutter-x: clamp(40px, 7vw, 96px);
  --bs-gutter-y: 40px;
}


/* عرض مناسب‌تر ستون محتوا */

.pf-narrative-content {
  max-width: 700px;
}


/* Responsive */

@media (max-width: 991.98px) {
  .pf-narrative-title {
    font-size: clamp(1.65rem, 5vw, 2.2rem);
  }

  .pf-narrative-text,
  .pf-narrative-description,
  .pf-narrative-content > p {
    font-size: 0.98rem;
    line-height: 2;
  }
}

@media (max-width: 575.98px) {
  .pf-narrative-title {
    margin-bottom: 16px;
    font-size: 1.55rem;
    line-height: 1.55;
  }

  .pf-narrative-text,
  .pf-narrative-description,
  .pf-narrative-content > p {
    font-size: 0.93rem;
    line-height: 1.95;
  }
}



/* ═══════════════════════════════════════════════════════
   PORTFOLIO NARRATIVE — THEME VARIABLES
   Default: Dark mode
════════════════════════════════════════════════════════ */

:root {
  --pf-narrative-bg: var(--bg2);
  --pf-narrative-bg-alt: var(--bg);
  --pf-narrative-title: var(--tx);

  /* روشن‌تر از tx2 برای خوانایی بهتر در دارک‌مود */
  --pf-narrative-text: #c4c4dc;

  --pf-narrative-label: #9b74ff;
  --pf-narrative-border: rgba(255, 255, 255, 0.055);
  --pf-narrative-glow: rgba(139, 92, 246, 0.075);
}


/* Light mode در ساختار اصلی قالب */

.lm {
  --pf-narrative-bg: #f2f2ff;
  --pf-narrative-bg-alt: #fafafe;
  --pf-narrative-title: #151526;

  /* متن تیره و کاملاً خوانا روی پس‌زمینه روشن */
  --pf-narrative-text: #4c4c68;

  --pf-narrative-label: #7047ed;
  --pf-narrative-border: rgba(99, 71, 246, 0.11);
  --pf-narrative-glow: rgba(112, 71, 237, 0.07);
}


/* ═══════════════════════════════════════════════════════
   NARRATIVE SECTION
════════════════════════════════════════════════════════ */

.pf-narrative {
  position: relative;
  padding-block: clamp(88px, 9vw, 132px);

  background:
    radial-gradient(
      circle at 50% 40%,
      var(--pf-narrative-glow),
      transparent 46%
    ),
    var(--pf-narrative-bg);

  border-top: 1px solid var(--pf-narrative-border);
  overflow: hidden;

  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
}


/* برای ایجاد حالت زیگزاگی و تفکیک سکشن‌ها */

.pf-narrative:nth-of-type(even) {
  background:
    radial-gradient(
      circle at 50% 40%,
      var(--pf-narrative-glow),
      transparent 46%
    ),
    var(--pf-narrative-bg-alt);
}


/* Bootstrap row */

.pf-narrative .row {
  --bs-gutter-x: clamp(48px, 8vw, 112px);
  --bs-gutter-y: 52px;

  align-items: center;
}


/* ═══════════════════════════════════════════════════════
   CONTENT
════════════════════════════════════════════════════════ */

.pf-narrative-content {
  position: relative;
  z-index: 2;

  width: 100%;
  max-width: 660px;
}


/* لیبل کوچک بالای محتوا */

.pf-narrative .slbl {
  display: inline-flex;
  align-items: center;
  gap: 9px;

  margin-bottom: 16px;

  color: var(--pf-narrative-label);
  font-size: clamp(0.8rem, 0.9vw, 0.9rem);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.025em;
  text-transform: none;

  opacity: 1;
}

.pf-narrative .slbl::before {
  flex: 0 0 auto;

  width: 28px;
  height: 2px;

  background: var(--grad);
  border-radius: 999px;
}


/* عنوان اصلی Narrative */

.pf-narrative-title {
  max-width: 620px;
  margin: 0 0 20px;

  color: var(--pf-narrative-title);
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.025em;

  opacity: 1;
  transition: color 0.3s ease;
}


/* متن توضیحات */

.pf-narrative-text,
.pf-narrative-description,
.pf-narrative-content > p {
  max-width: 640px;
  margin: 0;

  color: var(--pf-narrative-text);
  font-size: clamp(1rem, 1.18vw, 1.1rem);
  font-weight: 400;
  line-height: 2.15;
  letter-spacing: 0;

  /* جلوگیری از مشکل فعلی ناخوانایی */
  opacity: 1;

  transition: color 0.3s ease;
}


/* فاصله میان چند پاراگراف */

.pf-narrative-content > p + p,
.pf-narrative-text + .pf-narrative-text {
  margin-top: 14px;
}


/* لینک‌های احتمالی داخل متن */

.pf-narrative-content p a {
  color: var(--pur);
  font-weight: 600;
  text-decoration: none;
}

.pf-narrative-content p a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}


/* جلوگیری از کم‌رنگ شدن تگ‌های داخلی متن Rich Text */

.pf-narrative-content p span,
.pf-narrative-content p strong,
.pf-narrative-content p em {
  color: inherit;
}

.pf-narrative-content strong {
  color: var(--pf-narrative-title);
  font-weight: 700;
}


/* ═══════════════════════════════════════════════════════
   NARRATIVE MEDIA
════════════════════════════════════════════════════════ */

.pf-narrative-media {
  position: relative;
  z-index: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 430px;
}

.pf-narrative-media img {
  display: block;

  width: 100%;
  max-width: 620px;
  max-height: 500px;
  object-fit: contain;

  border-radius: 18px;
}


/* اگر تصویر موبایل است، بیش از حد کشیده نشود */

.pf-narrative-media img.pf-mobile-image {
  width: auto;
  max-width: min(280px, 80%);
  max-height: 500px;
}


/* ═══════════════════════════════════════════════════════
   LIGHT MODE REFINEMENTS
════════════════════════════════════════════════════════ */

.lm .pf-narrative {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.lm .pf-narrative-media img {
  filter:
    drop-shadow(0 22px 32px rgba(46, 36, 96, 0.10))
    drop-shadow(0 6px 12px rgba(46, 36, 96, 0.06));
}


/* ═══════════════════════════════════════════════════════
   DARK MODE REFINEMENTS
════════════════════════════════════════════════════════ */

body:not(.lm) .pf-narrative-media img {
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.26));
}


/* ═══════════════════════════════════════════════════════
   TABLET
════════════════════════════════════════════════════════ */

@media (max-width: 991.98px) {
  .pf-narrative {
    padding-block: 80px;
  }

  .pf-narrative .row {
    --bs-gutter-y: 46px;
  }

  .pf-narrative-content {
    max-width: 720px;
    margin-inline: auto;
  }

  .pf-narrative-title {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
  }

  .pf-narrative-text,
  .pf-narrative-description,
  .pf-narrative-content > p {
    max-width: 680px;
    font-size: 1.8rem;
    line-height: 2.05;
  }

  .pf-narrative-media {
    min-height: auto;
  }
}


/* ═══════════════════════════════════════════════════════
   MOBILE
════════════════════════════════════════════════════════ */

@media (max-width: 575.98px) {
  .pf-narrative {
    padding-block: 64px;
  }

  .pf-narrative .row {
    --bs-gutter-y: 36px;
  }

  .pf-narrative .slbl {
    margin-bottom: 12px;
    font-size: 0.78rem;
  }

  .pf-narrative .slbl::before {
    width: 21px;
  }

  .pf-narrative-title {
    margin-bottom: 16px;
    font-size: 1.80rem;
    line-height: 1.8;
  }

  .pf-narrative-text,
  .pf-narrative-description,
  .pf-narrative-content > p {
    font-size: 0.96rem;
    line-height: 2;
  }

  .pf-narrative-media img {
    max-height: 380px;
    border-radius: 14px;
  }
}
