/* =============================================
   SINGLE POST — Amanah Epoxy Theme
   Mobile-first, BEM naming, clean & readable
   ============================================= */

/* ── Reading Progress Bar ── */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--primary);
  z-index: 9999;
  transition: width .1s linear;
  border-radius: 0 2px 2px 0;
}

/* ── Layout Wrapper ── */
.single-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  max-width: 1200px;
  margin: 100px auto 0;
  padding: 40px 20px 80px;
}

@media (min-width: 1024px) {
  .single-wrap {
    grid-template-columns: minmax(0, 720px) 300px;
    gap: 60px;
    padding: 48px 24px 100px;
  }
}

/* ── Breadcrumb ── */
.breadcrumb { margin-bottom: 28px; }

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb__link {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.breadcrumb__link:hover { color: var(--primary); }

.breadcrumb__sep { color: var(--border); margin: 0 2px; }
.breadcrumb__current { color: var(--heading); font-weight: 500; }

/* ── Post Header ── */
.post-header { margin-bottom: 36px; }

.post-header__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.post-cat-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: all .2s;
}
.post-cat-badge:hover {
  background: var(--primary);
  color: var(--white);
}

.post-header__title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  color: var(--heading);
  line-height: 1.25;
  margin-bottom: 20px;
  letter-spacing: -.3px;
}

/* ── Post Meta ── */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.post-meta__author-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--heading);
  font-weight: 600;
  transition: color .2s;
}
.post-meta__author-link:hover { color: var(--primary); }

.post-meta__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.post-meta__sep { color: var(--border); }

.post-meta__read-time {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}

/* ── Featured Image ── */
.post-header__thumbnail {
  margin: 0 0 36px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  line-height: 0;
}

.post-header__img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

.post-header__caption {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 8px 12px;
  background: var(--light);
  line-height: 1.6;
}

/* ── Table of Contents ── */
.toc {
  background: var(--light);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 0 0 36px;
  overflow: hidden;
}

.toc__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 14px;
  color: var(--heading);
  cursor: pointer;
}
.toc__header svg { color: var(--primary); flex-shrink: 0; }

.toc__toggle {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 0;
  transition: transform .25s;
}
.toc__toggle.collapsed { transform: rotate(-90deg); }

.toc__list {
  padding: 0 18px 14px 36px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toc__list.hidden { display: none; }

.toc__item { font-size: 14px; }

.toc__link {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
  display: block;
  padding: 2px 0;
}
.toc__link:hover,
.toc__link.active { color: var(--primary); font-weight: 600; }

/* ── Post Content (Typography) ── */
.post-content {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  max-width: 100%;
}

.post-content h2 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  color: var(--heading);
  margin: 2.2em 0 .7em;
  padding-bottom: .5em;
  border-bottom: 2px solid var(--primary-light);
  scroll-margin-top: 100px;
}

.post-content h3 {
  font-size: clamp(17px, 2.5vw, 21px);
  font-weight: 700;
  color: var(--heading);
  margin: 1.8em 0 .6em;
  scroll-margin-top: 100px;
}

.post-content h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
  margin: 1.5em 0 .5em;
}

.post-content p {
  margin-bottom: 1.5em;
}

.post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}
.post-content a:hover { color: var(--primary-dark); }

.post-content ul,
.post-content ol {
  margin: 0 0 1.5em 1.5em;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-content ul { list-style: none; margin-left: 0; }
.post-content ul li {
  padding-left: 22px;
  position: relative;
}
.post-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .65em;
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
}

.post-content ol { list-style: decimal; }
.post-content ol li { padding-left: 4px; }

.post-content blockquote {
  margin: 2em 0;
  padding: 20px 24px;
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 17px;
  font-style: italic;
  color: var(--heading);
  line-height: 1.7;
}
.post-content blockquote p { margin-bottom: 0; }
.post-content blockquote cite {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 1.5em auto;
  display: block;
}

.post-content figure {
  margin: 2em 0;
  text-align: center;
}
.post-content figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.post-content pre {
  background: #1e2130;
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.7;
  margin: 1.5em 0;
}

.post-content code {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .875em;
  font-family: var(--font-mono, monospace);
}
.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 1.5em 0;
  overflow-x: auto;
  display: block;
}
.post-content th {
  background: var(--dark);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}
.post-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.post-content tr:nth-child(even) td { background: var(--light); }

/* ── Inline CTA (Auto-inserted) ── */
.inline-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 100%);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 2.5em 0;
  flex-wrap: wrap;
}

.inline-cta__icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}

.inline-cta__text { flex: 1; min-width: 200px; }
.inline-cta__title {
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
  display: block;
  margin-bottom: 4px;
}
.inline-cta__desc {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  line-height: 1.5;
}

.inline-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25D366;
  color: var(--white);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all .25s;
  white-space: nowrap;
}
.inline-cta__btn:hover {
  background: #1ebe5a;
  color: var(--white);
  transform: translateY(-1px);
}

/* ── Post Tags ── */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 36px 0 28px;
  font-size: 13px;
  color: var(--muted);
}
.post-tags svg { flex-shrink: 0; }

.post-tag {
  display: inline-block;
  background: var(--light);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  text-decoration: none;
  transition: all .2s;
}
.post-tag:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* ── Social Share ── */
.social-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.social-share__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
}

.social-share__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.social-share__btn--wa  { background: #25D366; color: #fff; }
.social-share__btn--fb  { background: #1877F2; color: #fff; }
.social-share__btn--x   { background: #000;    color: #fff; }
.social-share__btn--copy{ background: var(--light); color: var(--heading); border: 1px solid var(--border); }

.social-share__btn:hover { opacity: .87; transform: translateY(-1px); color: inherit; }
.social-share__btn--copy:hover { border-color: var(--primary); color: var(--primary); }

/* ── Author Box ── */
.author-box {
  display: flex;
  gap: 20px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 36px;
  align-items: flex-start;
}

.author-box__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.author-box__content { flex: 1; }
.author-box__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.author-box__name {
  font-size: 17px;
  font-weight: 800;
  color: var(--heading);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: color .2s;
}
.author-box__name:hover { color: var(--primary); }

.author-box__bio {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

/* ── Post Navigation ── */
.post-nav { margin-bottom: 48px; }

.post-nav__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .post-nav__grid { grid-template-columns: 1fr; }
}

.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all .25s;
}
.post-nav__item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.post-nav__item--next {
  text-align: right;
  align-items: flex-end;
}

.post-nav__dir {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
}
.post-nav__item--next .post-nav__dir { flex-direction: row-reverse; }

.post-nav__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Related Posts ── */
.related-posts { margin-bottom: 48px; }

.related-posts__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--primary-light);
}
.related-posts__title svg { color: var(--primary); }

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.related-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all .3s;
}
.related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.related-card__img-link { display: block; overflow: hidden; }
.related-card__img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}
.related-card:hover .related-card__img { transform: scale(1.04); }

.related-card__no-img {
  width: 100%;
  height: 160px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  opacity: .5;
}

.related-card__body { padding: 14px 16px 16px; }
.related-card__cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  display: block;
  margin-bottom: 6px;
}
.related-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}
.related-card__title a:hover { color: var(--primary); }
.related-card__date { font-size: 12px; color: var(--muted); }

/* ── Inline CTA Bottom ── */
.cta-block--bottom {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--primary-light);
  border: 1.5px solid #BFDBFE;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 0 0 40px;
  flex-wrap: wrap;
}

.cta-block__icon {
  width: 52px;
  height: 52px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--white);
}

.cta-block__text { flex: 1; min-width: 180px; }
.cta-block__text strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 4px;
}
.cta-block__text p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Comments ── */
.comments-section { margin-top: 16px; }

.comments-section .comments-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--primary-light);
}

.comment-list { list-style: none; padding: 0; margin: 0 0 32px; }

.comment-body {
  background: var(--light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
}

/* ── Sidebar ── */
.single-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Sidebar CTA Card */
.sidebar-cta {
  background: var(--dark);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  position: sticky;
  top: 100px;
}

.sidebar-cta__icon {
  width: 56px;
  height: 56px;
  background: rgba(37,99,235,.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent);
}

.sidebar-cta__title {
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
}

.sidebar-cta__desc {
  color: rgba(255,255,255,.55);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.sidebar-cta__btn {
  width: 100%;
  justify-content: center;
  display: flex;
  margin-bottom: 16px;
}

.sidebar-cta__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.4);
}

/* Sidebar TOC */
.sidebar-toc {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.sidebar-toc__header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--heading);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-toc__header svg { color: var(--primary); }

.sidebar-toc__list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  counter-reset: toc-counter;
}

.sidebar-toc__item {
  counter-increment: toc-counter;
}

.sidebar-toc__link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.sidebar-toc__link::before {
  content: counter(toc-counter) '.';
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  min-width: 18px;
}
.sidebar-toc__link:hover,
.sidebar-toc__link.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* Sidebar Widget */
.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.sidebar-widget__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--heading);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-recent {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-recent__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.sidebar-recent__img-wrap {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sidebar-recent__img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.sidebar-recent__img-wrap:hover .sidebar-recent__img { transform: scale(1.05); }

.sidebar-recent__content { flex: 1; }
.sidebar-recent__title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
  text-decoration: none;
  line-height: 1.45;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s;
}
.sidebar-recent__title:hover { color: var(--primary); }
.sidebar-recent__date { font-size: 11px; color: var(--muted); }

/* ── Sticky CTA Bottom Bar ── */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 990;
  background: var(--dark);
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 12px 20px;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.sticky-cta.visible { transform: translateY(0); }
.sticky-cta[hidden] { display: none; }

.sticky-cta__inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.sticky-cta__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}
.sticky-cta__text strong { color: var(--white); font-size: 14px; }
.sticky-cta__text span { color: rgba(255,255,255,.55); font-size: 12px; }

.sticky-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: var(--white);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all .2s;
  flex-shrink: 0;
}
.sticky-cta__btn:hover { background: #1ebe5a; color: var(--white); }

.sticky-cta__close {
  background: rgba(255,255,255,.1);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,.6);
  flex-shrink: 0;
  transition: all .2s;
}
.sticky-cta__close:hover {
  background: rgba(255,255,255,.2);
  color: var(--white);
}

/* ── Responsive Hide ── */
@media (max-width: 1023px) {
  .sidebar-toc { display: none; }
}

@media (max-width: 600px) {
  .author-box { flex-direction: column; }
  .author-box__avatar { width: 60px; height: 60px; }
  .inline-cta { flex-direction: column; text-align: center; }
  .cta-block--bottom { flex-direction: column; text-align: center; }
  .cta-block__icon { margin: 0 auto; }
  .social-share { flex-direction: column; align-items: flex-start; }
  .sticky-cta__text span { display: none; }
}
