/* ============================================================
   نوشته تکی مقالات — گپیار
   ============================================================ */

body.gpy-single-post {
  background: #f6f8fc;
}

body.gpy-single-post .gpy-site-main {
  padding-top: var(--gpy-header-h, 72px);
}

/* —— هیرو —— */
.gpy-article-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) clamp(2.5rem, 6vw, 4rem);
  background: linear-gradient(165deg, #0e1c30 0%, #152a45 48%, #1a3352 100%);
  color: var(--gpy-cream, #f0f4fa);
}

.gpy-article-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 85% 15%, rgba(255, 107, 44, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(37, 74, 117, 0.45), transparent 50%);
  pointer-events: none;
}

.gpy-article-hero-grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 20%, transparent 95%);
  pointer-events: none;
}

.gpy-article-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.gpy-article-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.gpy-article-cat {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--gpy-cream, #f0f4fa);
  transition: background 0.25s, transform 0.25s;
}

.gpy-article-cat:hover {
  background: rgba(255, 107, 44, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

.gpy-article-hero-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: center;
}

@media (min-width: 900px) {
  .gpy-article-hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
  .gpy-article-hero-grid:not(:has(.gpy-article-featured)) {
    grid-template-columns: 1fr;
  }
}

.gpy-article-featured {
  position: relative;
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gpy-article-featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gpy-article-featured:hover .gpy-article-featured-img {
  transform: scale(1.04);
}

.gpy-article-featured-glow {
  position: absolute;
  inset: auto 10% -20% 10%;
  height: 40%;
  background: radial-gradient(ellipse, rgba(255, 107, 44, 0.45), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.gpy-article-title {
  font-size: clamp(1.65rem, 4.5vw, 2.65rem);
  font-weight: 900;
  line-height: 1.35;
  margin: 0 0 1.35rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.gpy-article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.gpy-article-author {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}

.gpy-article-author:hover strong {
  color: var(--gpy-orange-glow, #ff9a5c);
}

.gpy-article-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 107, 44, 0.55);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.gpy-article-author-text,
.gpy-article-date,
.gpy-article-read {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.3;
}

.gpy-article-author-text em,
.gpy-article-date em,
.gpy-article-read em {
  font-size: 0.68rem;
  font-style: normal;
  opacity: 0.72;
  font-weight: 600;
}

.gpy-article-author-text strong,
.gpy-article-date strong,
.gpy-article-read strong {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
}

.gpy-article-meta-sep {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .gpy-article-meta-sep { display: none; }
  .gpy-article-meta-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ورود انیمیشن */
@keyframes gpy-article-fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gpy-article-anim {
  animation: gpy-article-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gpy-article-anim--delay {
  animation-delay: 0.12s;
}

/* —— بدنه دو ستونه —— */
.gpy-article-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem) clamp(3rem, 6vw, 4rem);
}

.gpy-article-layout {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
}

@media (min-width: 1024px) {
  .gpy-article-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

.gpy-article-main {
  min-width: 0;
  background: #fff;
  border: 1px solid #e8edf4;
  border-radius: 22px;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: 0 12px 40px rgba(14, 28, 48, 0.06);
}

.gpy-article-body-shell {
  position: relative;
}

.gpy-article-body-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gpy-orange-dark, #e05520);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

/* راهنمای داخل المنتور — در فرانت فقط خط نازک */
.gpy-article-zone-marker {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(255, 107, 44, 0.45);
  background: rgba(255, 107, 44, 0.06);
  text-align: center;
}

.gpy-article-zone-marker span {
  display: block;
  font-weight: 900;
  color: var(--gpy-navy, #0e1c30);
  font-size: 0.9rem;
}

.gpy-article-zone-marker p {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--gpy-muted-d, #5b6680);
  line-height: 1.6;
}

body:not(.elementor-editor-active) .gpy-article-zone-marker {
  display: none;
}

/* فهرست مطالب */
.gpy-article-aside {
  min-width: 0;
}

.gpy-article-toc {
  position: sticky;
  top: calc(var(--gpy-header-h, 72px) + 1.25rem);
  background: #fff;
  border: 1px solid #e8edf4;
  border-radius: 20px;
  padding: 1.25rem 1.2rem 1.35rem;
  box-shadow: 0 10px 32px rgba(14, 28, 48, 0.06);
}

.gpy-article-toc-title {
  font-size: 1rem;
  font-weight: 900;
  margin: 0 0 1rem;
  color: var(--gpy-navy, #0e1c30);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gpy-article-toc-title::before {
  content: "";
  width: 5px;
  height: 1.1em;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--gpy-orange, #ff6b2c), var(--gpy-orange-dark, #e05520));
}

.gpy-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.gpy-toc-list li {
  margin: 0;
  padding: 0;
}

.gpy-toc-list a {
  display: block;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.2rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--gpy-muted-d, #5b6680);
  border-inline-start: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.gpy-toc-list a:hover {
  color: var(--gpy-navy, #0e1c30);
  background: #f4f7fb;
}

.gpy-toc-list a.is-active {
  color: var(--gpy-orange-dark, #e05520);
  background: rgba(255, 107, 44, 0.08);
  border-inline-start-color: var(--gpy-orange, #ff6b2c);
}

.gpy-toc-list .gpy-toc-lvl-3 a {
  padding-inline-start: 1.1rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.gpy-article-toc-empty {
  font-size: 0.82rem;
  color: #7a8699;
  margin: 0 0 0.75rem;
}

.gpy-article-toc-cta {
  display: block;
  margin-top: 1rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--gpy-orange, #ff6b2c), var(--gpy-orange-dark, #e05520));
  box-shadow: 0 8px 22px rgba(255, 107, 44, 0.28);
  transition: transform 0.2s, box-shadow 0.2s;
}

.gpy-article-toc-cta:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 107, 44, 0.38);
}

@media (max-width: 1023px) {
  .gpy-article-toc {
    position: relative;
    top: auto;
  }
  .gpy-article-layout {
    display: flex;
    flex-direction: column;
  }
  .gpy-article-aside {
    order: -1;
  }
}

/* محتوای مقاله + المنتور */
.gpy-article-content {
  line-height: 2;
  color: var(--gpy-ink, #1a2233);
}

.gpy-article-content > * + * {
  margin-top: 1.1rem;
}

.gpy-article-content h2,
.gpy-article-content .elementor-heading-title {
  scroll-margin-top: calc(var(--gpy-header-h, 72px) + 1rem);
}

.gpy-article-content h2 {
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  margin-top: 2.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f0f4fa;
}

.gpy-article-content h3 {
  font-size: 1.15rem;
  margin-top: 1.6rem;
}

.gpy-article-content img {
  border-radius: 14px;
}

.gpy-article-content .gpy-article-figure {
  margin: 1.75rem 0 2rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e8edf4;
  background: #f8fafc;
  box-shadow: 0 14px 36px rgba(14, 28, 48, 0.08);
}

.gpy-article-content .gpy-article-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

.gpy-article-content .gpy-article-figure figcaption {
  padding: 0.65rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gpy-muted, #5a6b82);
  text-align: center;
  border-top: 1px solid #eef2f7;
}

.gpy-article-content .gpy-article-lead {
  font-size: 1.05rem;
  line-height: 2.1;
  color: var(--gpy-navy-mid, #152a45);
}

.gpy-article-content .gpy-article-faq {
  margin: 0.75rem 0;
  border: 1px solid #e8edf4;
  border-radius: 12px;
  background: #fafbfd;
  overflow: hidden;
}

.gpy-article-content .gpy-article-faq summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 800;
  color: var(--gpy-navy, #0e1c30);
  list-style: none;
}

.gpy-article-content .gpy-article-faq summary::-webkit-details-marker {
  display: none;
}

.gpy-article-content .gpy-article-faq[open] summary {
  border-bottom: 1px solid #eef2f7;
}

.gpy-article-content .gpy-article-faq p {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
}

.gpy-article-content blockquote {
  border-right: 4px solid var(--gpy-orange, #ff6b2c);
  background: #f6f8fc;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 0 12px 12px 0;
}

/* المنتور داخل ستون مقاله */
.gpy-article-content .elementor {
  max-width: none;
}

.gpy-article-content .elementor-section.elementor-section-stretched {
  margin-inline: calc(-1 * clamp(1.5rem, 4vw, 2.25rem));
  width: calc(100% + 2 * clamp(1.5rem, 4vw, 2.25rem));
  max-width: none;
}

.gpy-article-content .e-con-boxed > .e-con-inner {
  max-width: 100%;
}

.gpy-article-tags {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eef2f7;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.gpy-article-tags-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--gpy-navy, #0e1c30);
}

.gpy-article-tags a {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #f0f4fa;
  color: var(--gpy-navy-mid, #152a45);
}

.gpy-article-nav {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eef2f7;
}

@media (min-width: 640px) {
  .gpy-article-nav {
    grid-template-columns: 1fr 1fr;
  }
}

.gpy-article-nav a {
  display: block;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: #f6f8fc;
  border: 1px solid #e8edf4;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gpy-article-nav a:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(14, 28, 48, 0.08);
}

.gpy-article-nav-label {
  display: block;
  font-size: 0.72rem;
  color: #7a8699;
  margin-bottom: 0.25rem;
}

.gpy-article-nav-title {
  font-weight: 800;
  color: var(--gpy-navy, #0e1c30);
  font-size: 0.92rem;
}

.gpy-article-comments {
  max-width: 860px;
}

@media (prefers-reduced-motion: reduce) {
  .gpy-article-anim,
  .gpy-article-featured-img {
    animation: none;
    transition: none;
  }
}
