/* ==========================================================================
   Kalhor — Static pages & article reading layout
   Font: IRANSans (same as homepage). Scoped: .site-page / .site-article
   ========================================================================== */

.site-page,
.site-article,
.site-page *,
.site-article *,
.site-page .card-content,
.site-article .card-content,
.site-page .article-content,
.site-article .article-content,
.site-page .article-content *,
.site-article .article-content *,
.site-page .card-content *[style*="font-family"],
.site-article .card-content *[style*="font-family"],
.site-page .article-content *[style*="font-family"],
.site-article .article-content *[style*="font-family"] {
  font-family: IRANSans, Tahoma, "Segoe UI", sans-serif !important;
}

.site-page,
.site-article {
  --cp-navy: #1b2a4a;
  --cp-teal: #09838e;
  --cp-teal-soft: #0a9aa6;
  --cp-ink: #243044;
  --cp-muted: #6b7280;
  --cp-bg: #f5f7fa;
  --cp-surface: #ffffff;
  --cp-border: rgba(27, 42, 74, 0.1);
  --cp-shadow: 0 10px 28px rgba(27, 42, 74, 0.08);
  --cp-radius: 16px;
  color: var(--cp-ink);
  background: var(--cp-bg);
  direction: rtl;
  text-align: right;
}

/* ---------- Shared hero ---------- */
.site-page__hero,
.site-article__hero {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background-color: var(--cp-navy);
  background-size: cover;
  background-position: center;
}

.site-page__hero::before,
.site-article__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(9, 131, 142, 0.72) 0%, rgba(27, 42, 74, 0.88) 100%);
  z-index: 1;
}

.site-page__hero-inner,
.site-article__hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 3.25rem 0 2.25rem;
}

.site-page__eyebrow,
.site-article__eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.88;
}

.site-page__title,
.site-article__title {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.45;
  color: #fff;
}

.site-article__title a {
  color: inherit;
  text-decoration: none;
}

.site-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  opacity: 0.92;
}

.site-article__meta a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-article__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none !important;
}

/* ---------- Shell / grid ---------- */
.site-page__shell,
.site-article__shell {
  padding: 1.75rem 0 3.5rem;
}

.site-article__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 991.98px) {
  .site-article__grid {
    grid-template-columns: 1fr;
  }
}

.site-page__panel,
.site-article__panel {
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow);
  padding: 1.5rem 1.35rem 1.75rem;
}

@media (min-width: 768px) {
  .site-page__panel,
  .site-article__panel {
    padding: 1.85rem 2rem 2.1rem;
  }
}

/* ---------- Reading body ---------- */
.site-page__body,
.site-article__body,
.article-content {
  max-width: 46rem;
  margin-inline: auto;
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--cp-ink);
}

.site-page__body h1,
.site-page__body h2,
.site-page__body h3,
.site-page__body h4,
.site-article__body h1,
.site-article__body h2,
.site-article__body h3,
.site-article__body h4,
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  color: var(--cp-navy);
  font-weight: 700;
  line-height: 1.45;
  margin-top: 1.6rem;
  margin-bottom: 0.75rem;
}

.site-page__body p,
.site-article__body p,
.article-content p {
  margin-bottom: 1rem;
}

.site-page__body img,
.site-article__body img,
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.site-page__body a,
.site-article__body a,
.article-content a {
  color: var(--cp-teal);
}

.site-page__media {
  margin-top: 1.5rem;
}

.site-page__media video {
  width: 100%;
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow);
  background: #000;
}

/* ---------- Share / tags ---------- */
.site-article__share {
  margin: 1.5rem 0 0.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--cp-border);
}

.site-article__tags {
  margin-top: 1.25rem;
}

.site-article__tags-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cp-navy);
}

.site-article__tag {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.4rem 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(9, 131, 142, 0.1);
  color: var(--cp-teal) !important;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none !important;
}

.site-article__tag:hover {
  background: rgba(9, 131, 142, 0.18);
}

/* ---------- Must-read cards ---------- */
.site-article .must-read-card {
  margin: 1.35rem 0;
  border: 1px solid rgba(9, 131, 142, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(9, 131, 142, 0.08), rgba(27, 42, 74, 0.04));
  box-shadow: none;
}

.site-article .must-read-label {
  font-size: 0.92rem;
  color: var(--cp-ink);
}

.site-article .must-read-title {
  color: var(--cp-teal);
  font-weight: 700;
}

/* ---------- Related grid ---------- */
.site-article__related {
  margin-top: 1.5rem;
}

.site-article__section-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cp-navy);
}

.site-article__related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (max-width: 575.98px) {
  .site-article__related-grid {
    grid-template-columns: 1fr;
  }
}

.site-article__related-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--cp-border);
  border-radius: 14px;
  background: #fff;
  text-decoration: none !important;
  color: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.site-article__related-card:hover {
  box-shadow: var(--cp-shadow);
  transform: translateY(-2px);
}

.site-article__related-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.site-article__related-card-body {
  padding: 0.85rem 0.9rem 1rem;
}

.site-article__related-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--cp-navy);
}

.site-article__related-card p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--cp-muted);
}

/* ---------- Comments ---------- */
.site-article__comments,
.site-article__comment-form {
  margin-top: 1.5rem;
}

.site-article__comment-form {
  scroll-margin-top: 6rem;
}

.site-article__comment-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cp-navy);
}

.site-article__comment-form .form-control {
  border-radius: 10px;
  border-color: var(--cp-border);
}

.site-article__comment {
  display: flex;
  gap: 0.75rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--cp-border);
}

.site-article__comment:last-child {
  border-bottom: 0;
}

.site-article__comment-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 44px;
}

.site-article__comment-name {
  font-weight: 700;
  color: var(--cp-navy);
  font-size: 0.9rem;
}

.site-article__comment-date {
  font-size: 0.75rem;
  color: var(--cp-muted);
}

.site-article__comment-text {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  line-height: 1.7;
}

.site-article__comment--reply {
  margin-right: 2rem;
}

/* ---------- Related article popup (slide from left) ---------- */
.article-related-popup {
  --ap-navy: #1b2a4a;
  --ap-teal: #0a6f78;
  --ap-cream: #f7f9fc;
  --ap-muted: #5b6b7c;
  position: fixed;
  left: 20px;
  bottom: 28px;
  z-index: 1080;
  width: min(440px, calc(100vw - 28px));
  background: #fff;
  border: 1px solid rgba(27, 42, 74, 0.08);
  border-radius: 18px;
  box-shadow:
    0 22px 48px rgba(16, 28, 48, 0.16),
    0 2px 8px rgba(16, 28, 48, 0.06);
  transform: translateX(calc(-100% - 28px));
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  overflow: hidden;
  font-family: IRANSans, Tahoma, sans-serif;
}

.article-related-popup::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--ap-teal) 0%, var(--ap-navy) 100%);
}

.article-related-popup.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.article-related-popup__close {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ap-navy);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 28, 48, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.article-related-popup__close:hover {
  background: #fff;
  transform: scale(1.05);
}

.article-related-popup__link {
  display: grid;
  grid-template-columns: 132px 1fr;
  text-decoration: none;
  color: inherit;
  min-height: 148px;
}

.article-related-popup--no-image .article-related-popup__link {
  grid-template-columns: 108px 1fr;
}

.article-related-popup__media {
  position: relative;
  overflow: hidden;
  background: var(--ap-cream);
}

.article-related-popup__media img,
.article-related-popup__media-fallback {
  width: 100%;
  height: 100%;
  min-height: 148px;
  object-fit: cover;
  display: block;
}

.article-related-popup__media-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0a6f78 0%, #1b2a4a 100%);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.article-related-popup__body {
  padding: 16px 18px 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
}

.article-related-popup__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  color: var(--ap-teal);
  font-weight: 700;
}

.article-related-popup__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ap-navy);
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-related-popup__excerpt {
  margin: 0.25rem 0 0.55rem;
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--ap-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-related-popup__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  margin-top: 0.15rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(10, 111, 120, 0.1);
  color: var(--ap-teal);
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.article-related-popup__cta em,
.article-related-popup__cta svg {
  width: 12px !important;
  height: 12px !important;
  font-size: 0.7rem;
}

.article-related-popup__link:hover .article-related-popup__cta {
  background: var(--ap-teal);
  color: #fff;
}

@media (max-width: 575.98px) {
  .article-related-popup {
    left: 10px;
    right: 10px;
    bottom: 14px;
    width: auto;
  }

  .article-related-popup__link,
  .article-related-popup--no-image .article-related-popup__link {
    grid-template-columns: 96px 1fr;
  }

  .article-related-popup__media img,
  .article-related-popup__media-fallback {
    min-height: 132px;
  }

  .article-related-popup__body {
    padding: 14px 14px 14px 12px;
  }

  .article-related-popup__title {
    font-size: 0.92rem;
  }
}

/* ---------- CTA ---------- */
.site-page__cta {
  margin-top: 1.75rem;
  padding: 1.75rem 1.35rem;
  border-radius: var(--cp-radius);
  background: linear-gradient(135deg, #0a6f78 0%, #1b2a4a 100%);
  color: #fff;
  text-align: center;
  box-shadow: var(--cp-shadow);
}

.site-page__cta h2 {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.site-page__cta p {
  margin: 0 0 1.15rem;
  opacity: 0.9;
  font-size: 0.95rem;
}

.site-page__cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

.site-page__cta-actions .btn {
  border-radius: 10px;
  min-width: 160px;
}

.site-page__cta-actions .btn-light {
  background: #fff;
  color: var(--cp-navy);
  border: 0;
  font-weight: 700;
}

.site-page__cta-actions .btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  font-weight: 600;
}

/* ---------- Sidebar polish inside article ---------- */
.site-article .blog-sidebar {
  margin-top: 0;
  width: 100%;
  max-width: none;
  flex: none;
  padding: 0;
}

.site-article .blog-sidebar-card {
  border: 1px solid var(--cp-border);
  box-shadow: var(--cp-shadow);
}

.site-article .blog-sidebar__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cp-navy);
}
