/* ========================================================================
   POST PAGE — page-specific CSS
   trantienduy.com
   ======================================================================== */

/* ========== READING PROGRESS BAR ========== */
.reading-progress {
  position: fixed;
  top: 72px;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  z-index: 999;
  transition: width 0.1s linear;
}

/* ========== ARTICLE LAYOUT ========== */
.article-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 40px 80px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
}
article {
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ========== ARTICLE HEADER ========== */
.article-tag {
  display: inline-block;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
  background: var(--teal-light);
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.article-title {
  font-family: 'Source Serif 4', serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 24px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.article-meta__author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.article-meta__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.article-meta__name {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}
.article-meta__sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #CBD5E1;
  flex-shrink: 0;
}
.article-meta__date,
.article-meta__read {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  color: var(--slate);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* ========== ARTICLE FEATURED IMAGE ========== */
.article-featured {
  width: 100%;
  height: 400px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 36px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  position: relative;
}
.article-featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========== ARTICLE BODY TYPOGRAPHY ========== */
.article-body p {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: #475569;
  margin-bottom: 24px;
}
.article-body strong {
  font-weight: 600;
  color: var(--navy);
}
.article-body a {
  color: var(--teal);
  text-decoration: none;
  transition: all 0.2s;
}
.article-body a:hover {
  text-decoration: underline;
}
.article-body h2 {
  font-family: 'Source Serif 4', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-left: 16px;
  border-left: 3px solid var(--teal);
  line-height: 1.3;
  scroll-margin-top: 110px;
}
.article-body h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  margin-top: 32px;
  margin-bottom: 12px;
  line-height: 1.4;
  scroll-margin-top: 110px;
}
.article-body ul {
  padding-left: 20px;
  margin-bottom: 24px;
}
.article-body ul li {
  position: relative;
  padding-left: 16px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: #475569;
  margin-bottom: 8px;
}
.article-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
}
.article-body ol {
  padding-left: 0;
  margin-bottom: 24px;
  counter-reset: ol-counter;
}
.article-body ol li {
  position: relative;
  padding-left: 36px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: #475569;
  margin-bottom: 8px;
  counter-increment: ol-counter;
  list-style: none;
}
.article-body ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.article-body blockquote {
  border-left: 4px solid var(--teal);
  padding: 24px 28px;
  background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
  border-radius: 16px;
  margin: 32px 0;
  font-family: 'Source Serif 4', serif;
  font-style: italic;
  font-size: 17px;
  line-height: 1.7;
  color: #475569;
  position: relative;
}
.article-body blockquote::before {
  content: '\201C';
  position: absolute;
  top: 12px;
  right: 20px;
  font-family: 'Source Serif 4', serif;
  font-size: 48px;
  color: var(--teal);
  opacity: 0.12;
  line-height: 1;
}
.article-body blockquote strong {
  font-style: normal;
}
.article-body pre {
  background: #1E293B;
  color: #E2E8F0;
  padding: 24px;
  border-radius: 12px;
  margin: 24px 0;
  overflow-x: auto;
  max-width: 100%;
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
}
.article-body code {
  background: #F1F5F9;
  color: var(--teal);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 14px;
}
.article-body pre code {
  background: transparent;
  color: #E2E8F0;
  padding: 0;
  border-radius: 0;
  font-size: 14px;
}

/* ========== INLINE TOC ========== */
.inline-toc {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.inline-toc__title {
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 2px solid #F1F5F9;
}
.inline-toc__title svg { color: var(--teal); flex-shrink: 0; }
.inline-toc__list {
  display: flex;
  flex-direction: column;
}
.inline-toc__link {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate);
  padding: 8px 0;
  border-bottom: 1px solid #F8FAFC;
  transition: color 0.3s, padding-left 0.3s;
}
.inline-toc__link:last-child { border-bottom: none; }
.inline-toc__link:hover { color: var(--teal); padding-left: 6px; }
.inline-toc__link--sub { padding-left: 20px; font-size: 13px; }
.inline-toc__link--sub:hover { padding-left: 26px; }

/* ========== SHARE BUTTONS ========== */
.article-share {
  margin-top: 48px;
  background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 16px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.article-share__label {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.article-share__label svg { color: var(--teal); flex-shrink: 0; }
.article-share__btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--navy);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.share-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.share-btn--fb:hover { background: #1877F2; border-color: #1877F2; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(24,119,242,0.3); }
.share-btn--tw:hover { background: #0F172A; border-color: #0F172A; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(15,23,42,0.3); }
.share-btn--li:hover { background: #0A66C2; border-color: #0A66C2; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(10,102,194,0.3); }
.share-btn--copy:hover { background: var(--teal); border-color: var(--teal); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(13,148,136,0.3); }
.share-btn--copied {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  color: #fff !important;
}

/* ========== TAGS ========== */
.article-tags {
  margin-top: 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.article-tags__item {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
  transition: all 0.3s;
  cursor: pointer;
}
.article-tags__item:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* ========== AUTHOR BOX (bottom of article) ========== */
.author-box {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 16px;
  padding: 28px;
  margin-top: 40px;
}
.author-box__avatar {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Source Serif 4', serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}
.author-box__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.author-box__name {
  font-family: 'Manrope', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 2px;
}
.author-box__role {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--teal);
  margin-bottom: 10px;
}
.author-box__bio {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.7;
  margin-bottom: 16px;
}
.author-box__socials {
  display: flex;
  align-items: center;
  gap: 10px;
}
.author-box__social {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(13,148,136,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.author-box__social:hover {
  background: var(--teal);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13,148,136,0.25);
}

/* ========== SIDEBAR ========== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar__inner {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar-card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px;
}

/* TOC */
.toc__title {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
}
.toc__list {
  display: flex;
  flex-direction: column;
}
.toc__link {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  color: var(--slate);
  padding: 8px 0;
  padding-left: 12px;
  border-bottom: 1px solid #F1F5F9;
  border-left: 3px solid transparent;
  transition: all 0.3s;
  display: block;
}
.toc__link:last-child { border-bottom: none; }
.toc__link:hover {
  color: var(--teal);
}
.toc__link.active {
  color: var(--teal);
  border-left-color: var(--teal);
  font-weight: 600;
  background: rgba(13,148,136,0.03);
}
.toc__link--sub {
  padding-left: 24px;
  font-size: 12px;
}

/* Author Card */
.author-card {
  text-align: center;
}
.author-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Source Serif 4', serif;
  font-weight: 700;
  font-size: 26px;
  margin: 0 auto 12px;
}
.author-card__name {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.author-card__role {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  color: var(--slate);
  margin-bottom: 12px;
}
.author-card__bio {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 16px;
}
.author-card__cta {
  display: block;
  width: 100%;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--teal);
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}
.author-card__cta:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13,148,136,0.3);
  color: #fff;
}

/* Related Posts Sidebar */
.sidebar-related__title {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
}
.sidebar-related__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #F1F5F9;
  transition: opacity 0.3s;
}
.sidebar-related__item:last-child { border-bottom: none; }
.sidebar-related__item:hover { opacity: 0.8; }
.sidebar-related__thumb {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--teal-light), #d4f7f0);
}
.sidebar-related__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-related__info {
  flex: 1;
  min-width: 0;
}
.sidebar-related__item-title {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-related__item-date {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  color: var(--slate);
}

/* ========== RELATED POSTS (full width) ========== */
.related-section {
  padding: 80px 40px;
  background: var(--bg);
}
.related-section__container {
  max-width: var(--max-w);
  margin: 0 auto;
}
.related-section__header {
  text-align: center;
  margin-bottom: 48px;
}
.related-section__eyebrow {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--teal);
  position: relative;
  display: inline-block;
  padding-left: 20px;
  margin-bottom: 12px;
}
.related-section__eyebrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--teal);
  border-radius: 50%;
}
.related-section__title {
  font-family: 'Source Serif 4', serif;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ========== CTA MINI ========== */
.cta-mini {
  padding: 80px 40px;
  background: linear-gradient(145deg, #0F766E, #0D9488 40%, #065F46);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-mini__grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
}
.cta-mini__container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.cta-mini__title {
  font-family: 'Source Serif 4', serif;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.cta-mini__desc {
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 32px;
  line-height: 1.7;
}

/* ========== POST RESPONSIVE ========== */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .sidebar__inner {
    position: static;
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .article-layout { padding: 32px 16px 60px; gap: 32px; }
  .article-title { font-size: 26px; }
  .article-featured { height: 220px; border-radius: 14px; }
  .article-body h2 { font-size: 22px; margin-top: 36px; }
  .article-body h3 { font-size: 18px; }
  .article-body p { font-size: 15px; }
  .article-meta { gap: 8px; }
  .article-meta__sep { display: none; }
  .article-meta__date,
  .article-meta__read { font-size: 12px; }
  .related-section { padding: 56px 16px; }
  .related-grid { grid-template-columns: 1fr; }
  .cta-mini { padding: 56px 16px; }
  .cta-mini__title { font-size: 26px; }
  .article-body pre { padding: 16px; font-size: 13px; }
  .article-body blockquote { padding: 16px 18px; font-size: 15px; }
  .inline-toc { padding: 20px; }
  .inline-toc__link { font-size: 13px; }
  .author-box { flex-direction: column; align-items: center; text-align: center; padding: 24px 20px; }
  .author-box__socials { justify-content: center; }
}

@media (max-width: 480px) {
  .article-title { font-size: 22px; line-height: 1.3; }
  .article-meta { gap: 6px; }
  .article-featured { height: 180px; }
  .article-share { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .article-share__btns { gap: 6px; }
  .share-btn { padding: 7px 12px; font-size: 11px; }
  .article-body h2 { font-size: 20px; padding-left: 12px; margin-top: 32px; }
  .article-body h3 { font-size: 17px; }
  .article-body p, .article-body ul li, .article-body ol li { font-size: 14.5px; }
  .inline-toc { padding: 16px; border-radius: 12px; }
  .inline-toc__title { font-size: 14px; }
  .inline-toc__link { font-size: 12.5px; padding: 6px 0; }
  .author-box__avatar { width: 60px; height: 60px; min-width: 60px; font-size: 24px; }
  .author-box__name { font-size: 16px; }
}
