/* ===============================
   BottelX Post Content
   Scope: .post-body
   =============================== */

.post-body {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--post-text);
}

/* ---------- Typography ---------- */

.post-body p {
  margin: 0 0 1.2rem;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
  font-weight: 700;
  line-height: 1.4;
  margin: 2.2rem 0 1rem;
  color: var(--post-heading);
}

.post-body h2 {
  font-size: 1.6rem;
  border-right: 4px solid var(--post-link);
  padding-right: 10px;
}

.post-body h3 {
  font-size: 1.35rem;
  opacity: 0.95;
}

.post-body h4 {
  font-size: 1.15rem;
  opacity: 0.9;
}

/* ---------- Inline Text ---------- */

.post-body strong {
  font-weight: 700;
}

.post-body em {
  font-style: italic;
  opacity: 0.9;
}

/* ---------- Lists ---------- */

.post-body ul,
.post-body ol {
  margin: 1rem 1.2rem 1.5rem;
  padding: 0;
}

.post-body li {
  margin-bottom: 0.5rem;
}

/* ---------- Links ---------- */

.post-body a {
  color: var(--post-link);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--post-link) 60%, transparent);
}

.post-body a:hover {
  border-bottom-style: solid;
}

/* ---------- Images (Professional) ---------- */

.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2.2rem auto;
  border-radius: 16px;
  background: var(--image-bg);
  box-shadow: var(--image-shadow);
}

/* Optional caption style */
.post-body figure {
  margin: 2.5rem 0;
  text-align: center;
}

.post-body figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  opacity: 0.65;
}

/* ---------- Blockquote ---------- */

.post-body blockquote {
  margin: 2rem 0;
  padding: 1.2rem 1.5rem;
  background: var(--box-info-bg);
  border-right: 4px solid var(--box-info-border);
  border-radius: 14px;
  font-style: italic;
}

/* ---------- Code ---------- */

.post-body code {
  background: rgba(0,0,0,0.25);
  padding: 3px 6px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
}

.post-body pre {
  background: rgba(0,0,0,0.4);
  padding: 1.2rem;
  border-radius: 14px;
  overflow-x: auto;
  margin: 2rem 0;
}

/* ===============================
   Custom Blocks
   =============================== */

.post-body .info-box {
  background: var(--box-info-bg);
  border-right: 4px solid var(--box-info-border);
  padding: 1.3rem;
  border-radius: 16px;
  margin: 2.5rem 0;
}

.post-body .note-box {
  background: var(--box-note-bg);
  border-right: 4px solid var(--box-note-border);
  padding: 1.3rem;
  border-radius: 16px;
  margin: 2.5rem 0;
}

.post-body .cta-box {
  background: var(--box-cta-bg);
  padding: 1.8rem;
  border-radius: 20px;
  margin: 3rem 0;
  text-align: center;
}

.post-body .cta-button {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--cta-btn-bg);
  color: var(--cta-btn-text);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Two Column ---------- */

.post-body .two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2.5rem 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .post-body {
    font-size: 0.95rem;
    line-height: 1.8;
  }

  .post-body h2 {
    font-size: 1.35rem;
  }

  .post-body h3 {
    font-size: 1.15rem;
  }

  .post-body .two-col {
    grid-template-columns: 1fr;
  }
}
/* ===============================
   Reading Progress Bar
=============================== */

.reading-progress {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,.08);
  z-index: 9999;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transition: width 0.12s linear;
}

/* ===============================
   Reading Time
=============================== */

.reading-time {
  margin-top: 10px;
  font-size: 13px;
  color: var(--subtext);
  opacity: .9;
}

/* ===============================
   TOC – Smart Sticky Navigation
=============================== */

.toc {
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;

  padding: 20px 18px;
  border-radius: 18px;

  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Title */
.toc h4 {
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--post-heading);
}

/* List */
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Items */
.toc li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* Sub headings (H3) */
.toc li.toc-sub {
  padding-right: 14px;
  font-size: 12.5px;
  opacity: 0.85;
}

/* Links */
.toc a {
  display: block;
  color: var(--post-link);
  text-decoration: none;
  opacity: 0.7;
  border-right: 2px solid transparent;
  padding-right: 8px;
  transition: all .25s ease;
}

/* Hover */
.toc a:hover {
  opacity: 1;
}

/* Active */
.toc a.active {
  opacity: 1;
  font-weight: 600;
  border-right-color: var(--accent);
  color: var(--accent);
}

/* Scrollbar (Webkit) */
.toc::-webkit-scrollbar {
  width: 6px;
}
.toc::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}

/* Hide on mobile */
@media (max-width: 992px) {
  .toc {
    display: none;
  }
}
/* ===============================
   Image + Caption Block
=============================== */

.post-body figure.post-image {
  margin: 3.2rem 0;
  text-align: center;
}

.post-body figure.post-image img {
  max-width: 100%;
  height: auto;
  border-radius: 22px;
  background: var(--image-bg);
  box-shadow: var(--image-shadow);
}

/* Caption */
.post-body figure.post-image figcaption {
  margin-top: 12px;
  font-size: 13px;
  opacity: 0.65;
}

/* Alignment Helpers */
.post-body figure.align-left {
  text-align: left;
}

.post-body figure.align-right {
  text-align: right;
}

.post-body figure.align-center {
  text-align: center;
}
/* ===============================
   Circular Reading Progress
=============================== */

.reading-circle {

  opacity: 0.85;
  transition: opacity .2s ease, transform .2s ease;
}
.reading-circle {



  padding: 6px;
  cursor: pointer;
}
.reading-circle {
  position: fixed;
  bottom: 110px; /* بالاتر از bottom nav */
  left: 16px;
  width: 48px;
  height: 48px;
  z-index: 999;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* موبایل */
@media (max-width: 768px) {
  .reading-circle {
    bottom: 90px;
    left: 12px;
    transform: scale(0.95);
  }
}

.reading-circle:hover {
  opacity: 1;
  transform: scale(1.05);
}

.reading-circle svg {
  transform: rotate(-90deg); /* شروع از بالا */
}
/* ===============================
   Lazy Load Images – Blur Effect
=============================== */

/* Lazy Image */
.lazy-img {
  filter: blur(18px);
  transform: scale(1.08);
  transition:
    filter .6s ease,
    transform .6s ease,
    opacity .4s ease;
  opacity: .9;
}

.lazy-img.is-loaded {
  filter: blur(0);
  transform: none;
  opacity: 1;
}

/* تصویر داخل پست */
.post-image {
  margin: 2rem 0;
  text-align: center;
}

.post-image img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: var(--image-shadow);
}
/*tags*/
/* =========================
   Post Tags
   ========================= */

.tag-title {
  margin-bottom: 18px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--post-heading);
}

/* container */
.post-tags {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* tag badge */
.post-tags .tag {
  position: relative;
  padding: 6px 14px;
  font-size: 0.85rem;
  line-height: 1.8;
  border-radius: 999px;
  color: var(--post-link);
  text-decoration: none;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.12),
    rgba(56, 189, 248, 0.04)
  );
  border: 1px solid rgba(56, 189, 248, 0.25);
  backdrop-filter: blur(6px);
  transition: 
    transform .25s ease,
    box-shadow .25s ease,
    background .25s ease,
    color .25s ease;
  overflow: hidden;
}

/* subtle glow */
.post-tags .tag::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(56, 189, 248, 0.35),
    transparent 60%
  );
  opacity: 0;
  transition: opacity .3s ease;
}

/* hover */
.post-tags .tag:hover {
  transform: translateY(-2px);
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.45),
    rgba(14, 165, 233, 0.35)
  );
  box-shadow:
    0 6px 20px rgba(56, 189, 248, 0.35),
    inset 0 0 0 1px rgba(255,255,255,.15);
}

.post-tags .tag:hover::before {
  opacity: 1;
}

/* active / focus (SEO + accessibility) */
.post-tags .tag:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(56,189,248,.45);
}

/* mobile tweak */
@media (max-width: 640px) {
  .post-tags {
    gap: 8px;
  }

  .post-tags .tag {
    font-size: 0.8rem;
    padding: 5px 12px;
  }
}
/* base */
.post-tags .tag {
  --tag-hue: 200;
  background: hsl(var(--tag-hue) 90% 60% / 0.12);
  border-color: hsl(var(--tag-hue) 90% 60% / 0.3);
  color: hsl(var(--tag-hue) 90% 70%);
}

/* common tech tags */
.post-tags .tag[data-tag*="ai"],
.post-tags .tag[data-tag*="automation"] {
  --tag-hue: 190;
}

.post-tags .tag[data-tag*="bot"],
.post-tags .tag[data-tag*="telegram"] {
  --tag-hue: 260;
}

.post-tags .tag[data-tag*="seo"] {
  --tag-hue: 120;
}
.post-tags .tag::after {
  content: "مشاهده مطالب مرتبط";
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) scale(.95);
  background: rgba(15,23,42,.9);
  color: #e5e7eb;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
}

.post-tags .tag:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
