/* ==========================================================================
   Blog UI/UX Enhancements (Light & Dark Mode Compatible)
   ========================================================================== */

:root {
  --ux-accent: #00b884;
  --ux-accent-2: #0099cc;
  --ux-accent-soft: rgba(0, 184, 132, 0.1);
  --ux-border-hover: rgba(0, 184, 132, 0.42);
  --ux-shadow-hover: 0 10px 28px rgba(15, 23, 42, 0.08);
}

:root[data-bs-theme="dark"],
html[data-mode="dark"] {
  --ux-accent: #00e6a2;
  --ux-accent-2: #38bdf8;
  --ux-accent-soft: rgba(0, 230, 162, 0.12);
  --ux-border-hover: rgba(0, 230, 162, 0.45);
  --ux-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.36);
}

/* ---------- Reading Progress Bar ---------- */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--ux-accent), var(--ux-accent-2));
  z-index: 1080;
  pointer-events: none;
  transition: width 80ms linear;
  box-shadow: 0 0 10px rgba(0, 230, 162, 0.35);
}

/* ---------- Bengali + English Typography ---------- */
body,
h1,
h2,
h3,
h4,
.post-desc,
.content {
  font-family: "Source Sans Pro", "Noto Sans Bengali", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
}

article header h1 {
  letter-spacing: -0.015em;
  line-height: 1.28;
}

.post-desc {
  line-height: 1.65;
  opacity: 0.88;
}

.content {
  font-size: 1.04rem;
  line-height: 1.82;
}

.content p {
  margin-bottom: 1.25rem;
}

.content h2 {
  margin-top: 2.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--main-border-color);
  letter-spacing: -0.01em;
}

.content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.content hr {
  margin: 2rem auto;
  opacity: 0.25;
}

/* ---------- Post List Cards (/posts/) ---------- */
#post-list .card {
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

#post-list .card:hover {
  transform: translateY(-2px);
  border-color: var(--ux-border-hover);
  box-shadow: var(--ux-shadow-hover);
}

#post-list .preview-img {
  overflow: hidden;
}

#post-list .preview-img img {
  transition: transform 0.35s ease;
}

#post-list .card:hover .preview-img img {
  transform: scale(1.03);
}

#post-list .card-title {
  line-height: 1.35;
  transition: color 0.18s ease;
}

#post-list .card:hover .card-title {
  color: var(--ux-accent);
}

/* ---------- Article Images & Captions ---------- */
article header .preview-img,
.content img.rounded-10 {
  border-radius: 12px !important;
  border: 1px solid var(--main-border-color);
}

article header figcaption,
.content img + em,
.content p:has(> img:only-child) + p > em:only-child {
  display: block;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-muted-color);
  margin-top: 0.45rem;
}

/* ---------- Callouts, Blockquotes & Code Blocks ---------- */
.content blockquote {
  border-radius: 0 10px 10px 0;
  padding: 0.85rem 1.15rem;
}

.content blockquote[class*="prompt-"] {
  border-radius: 12px;
  padding: 1rem 1.25rem 1rem 2.75rem;
}

.content div.highlighter-rouge,
.content pre.highlight {
  border-radius: 10px;
}

.content .table-wrapper table {
  border-radius: 10px;
  overflow: hidden;
}

/* ---------- Tags, Categories & Further Reading ---------- */
.post-tag,
#panel-wrapper .post-tag {
  border-radius: 999px;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.post-tag:hover,
#panel-wrapper .post-tag:hover {
  transform: translateY(-1px);
  border-color: var(--ux-accent);
}

#related-posts .card {
  border-radius: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#related-posts .card:hover {
  transform: translateY(-2px);
  border-color: var(--ux-border-hover);
  box-shadow: var(--ux-shadow-hover);
}

/* ---------- Accessibility & Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .reading-progress-bar,
  #post-list .card,
  #post-list .preview-img img,
  #post-list .card-title,
  .post-tag,
  #related-posts .card {
    transition: none !important;
    transform: none !important;
  }
}
