/* ============================================================
   article.css · Editorial article reader (Phase 100 — Bundle D)
   Tier 1-4: progress + drop cap + share rail + TOC + lightbox + ...
   ============================================================ */

/* ─── Tier 1.1 · Reading progress bar ─── */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2), var(--gold));
  z-index: 9999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 8px var(--gold);
}

/* ─── Article detail v2 layout (Phương án A v2 · Uniform 760px) ─── */
.article-detail-v2 {
  padding: 40px 0 60px;
}
/* Uniform width — title, hero, content all flush at 760px on desktop.
   ~73-76 CPL with Inter 18px Vietnamese (sweet spot for VI long-form). */
.article-detail-v2 .container-narrow {
  max-width: 760px;
  padding: 0 24px;
}

.breadcrumb {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.4px;
  margin-bottom: 28px;
}
.breadcrumb a { color: var(--text-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }

/* ─── Article header ─── */
.article-header { margin-bottom: 40px; }
.cat-badge {
  display: inline-block;
  background: var(--cat-color, var(--gold));
  color: var(--maroon-4);
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 18px;
}
.article-detail-v2 h1.title {
  font-size: clamp(36px, 5.4vw, 60px);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -1px;
  font-weight: 500;
}
.article-excerpt {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.55;
  color: var(--gold-2);
  margin: 0 0 24px;
  padding-left: 16px;
  border-left: 2px solid var(--gold);
}

/* ─── Tier 2.2 · Stats banner ─── */
.stats-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 0;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.4px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}
.stats-banner .stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
}
.stats-banner .stat:first-child { padding-left: 0; }
.stats-banner .stat .stat-icon { color: var(--gold); }
.stats-banner .stat-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
}

/* ─── Tier 1.4 · Hero figure ─── */
.hero-figure {
  margin: 36px 0 40px;
  padding: 0;
}
.hero-figure .hero-img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  cursor: zoom-in;
  box-shadow: 0 18px 48px rgba(60,30,10,0.14);
}
.hero-figure figcaption {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  margin-top: 12px;
  padding: 0 20px;
}

/* ─── Tags display ─── */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 32px;
}
.tag-chip {
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  background: rgba(245,240,232,0.05);
  color: var(--text-2);
  border-radius: 14px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: 0.2s;
}
.tag-chip:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* TOC removed per user request — H2/H3 anchor IDs still added for deep-linking. */

/* ─── Tier 1.3 · Better typography for content ─── */
.article-content {
  font-size: 18px;
  line-height: 1.85;
  color: var(--text);
  /* Uniform với container — không có box trong box. Cân đối với title + hero. */
  max-width: 100%;
  margin: 0;
}
.article-content p {
  margin-bottom: 1.4em;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Inline figures stay full content width (uniform with title/hero) */
.article-content > figure,
.article-content > .breakout { max-width: 100%; }

/* ─── Tier 1.2 · Drop cap on first paragraph ─── */
.article-content > p.lede:first-child::first-letter,
.article-content > p:first-child::first-letter {
  font-family: 'Cormorant Garamond', Georgia, serif;
  float: left;
  font-size: 5em;
  line-height: 0.9;
  margin: 0.05em 0.12em 0 0;
  color: var(--gold);
  font-weight: 600;
  font-style: italic;
}

/* ─── Tier 1.3 · Lede style for first paragraph ─── */
.article-content > p.lede {
  font-size: 1.15em;
  color: var(--gold-2);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  line-height: 1.7;
}
.article-content > p.lede::first-letter {
  /* drop cap still applies, but adjust */
}

/* H2/H3 in content */
.article-content h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(26px, 3.4vw, 34px);
  color: var(--gold);
  margin: 1.6em 0 0.6em;
  line-height: 1.25;
  font-weight: 500;
  scroll-margin-top: 80px;
}
.article-content h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(22px, 2.8vw, 26px);
  color: var(--gold-2);
  margin: 1.4em 0 0.5em;
  line-height: 1.3;
  font-weight: 500;
  scroll-margin-top: 80px;
}

.article-content a {
  color: var(--gold);
  border-bottom: 1px dotted var(--gold);
  transition: 0.2s;
}
.article-content a:hover {
  color: var(--gold-2);
  border-bottom-style: solid;
}

/* ─── Tier 1.5 · Pull quote auto-style (inset narrower for visual focus) ─── */
.article-content blockquote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.5;
  color: var(--gold-2);
  text-align: center;
  max-width: 600px;       /* narrower than body for editorial impact */
  margin: 2.4em auto;
  padding: 32px 28px;
  border: 0;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  position: relative;
}
.article-content blockquote::before,
.article-content blockquote::after {
  content: '';
  position: absolute;
  width: 40px; height: 1px;
  background: var(--gold);
  left: 50%;
  transform: translateX(-50%);
}
.article-content blockquote::before { top: -1px; box-shadow: 0 0 0 1px var(--maroon-3); }
.article-content blockquote::after { bottom: -1px; box-shadow: 0 0 0 1px var(--maroon-3); }
.article-content blockquote p {
  margin: 0;
  text-align: center;
}
.article-content blockquote p::before { content: '"'; color: var(--maroon); margin-right: 4px; font-size: 1.2em; }
.article-content blockquote p::after { content: '"'; color: var(--maroon); margin-left: 4px; font-size: 1.2em; }

/* Inline images */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.6em auto;
  display: block;
  cursor: zoom-in;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  transition: 0.3s;
}
.article-content img:hover { transform: scale(1.01); }

.article-content ul, .article-content ol {
  margin: 1.2em 0;
  padding-left: 1.6em;
}
.article-content li { margin-bottom: 0.4em; }

.article-content em { color: var(--gold-2); }
.article-content strong { color: var(--text); font-weight: 700; }

.article-content hr {
  border: 0;
  text-align: center;
  margin: 2.4em auto;
}
.article-content hr::before {
  content: '◆ ◆ ◆';
  color: var(--gold);
  letter-spacing: 1.5em;
  font-size: 12px;
}

/* ─── Tier 2.1 · Floating share rail (left desktop) ─── */
.share-rail {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
}
.share-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(60,30,10,0.12);
  background: rgba(255,253,248,0.94);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.25s;
  text-decoration: none;
  padding: 0;
}
.share-btn:hover {
  background: var(--gold);
  color: #241B15;
  border-color: var(--gold);
  transform: scale(1.1);
}
.share-btn.share-copy.copied {
  background: #22C55E;
  color: white;
  border-color: #22C55E;
}
.share-tts.playing {
  background: var(--maroon);
  color: var(--cream);
  border-color: var(--maroon);
  animation: pulse-tts 1.5s ease-in-out infinite;
}
@keyframes pulse-tts {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,26,26,0.6); }
  50% { box-shadow: 0 0 0 10px rgba(139,26,26,0); }
}

/* ─── Tier 4.5 · Font size adjuster ─── */
.font-adjuster {
  position: fixed;
  right: 24px;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255,253,248,0.94);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 6px;
  z-index: 90;
}
.fa-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--text-2);
  cursor: pointer;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  transition: 0.2s;
  font-size: 12px;
}
.fa-btn.fa-default { font-size: 14px; }
.fa-btn:hover { color: var(--gold); }
.fa-btn.active {
  background: var(--gold);
  color: #241B15;
}

/* Font size variants applied to body */
body[data-fs="-1"] .article-content { font-size: 16px; }
body[data-fs="0"] .article-content { font-size: 18px; }
body[data-fs="1"] .article-content { font-size: 20px; }
body[data-fs="2"] .article-content { font-size: 22px; }

/* ─── Tier 2.3 · Engagement bar ─── */
.engagement-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  margin: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.eng-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(245,240,232,0.04);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: 0.25s;
}
.eng-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.eng-btn.active {
  background: var(--maroon);
  color: white;
  border-color: var(--maroon);
}
.eng-btn.active svg { fill: white; }
.eng-count {
  font-weight: 600;
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
}
.eng-divider {
  flex: 1;
}
.eng-views {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.5px;
}
.eng-views .stat-icon { color: var(--gold); margin-right: 4px; }

/* ─── Tier 3.5 · Newsletter block ─── */
.newsletter-block {
  background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(139,26,26,0.06));
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 36px 32px;
  margin: 48px 0;
  text-align: center;
}
.newsletter-block .newsletter-icon { font-size: 36px; margin-bottom: 12px; }
.newsletter-block h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(22px, 2.6vw, 28px);
  color: var(--gold);
  margin: 0 0 8px;
}
.newsletter-block p {
  color: var(--text-2);
  font-size: 14px;
  margin: 0 0 20px;
}
.newsletter-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
}
.newsletter-form input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(10,10,10,0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.newsletter-form input:focus {
  outline: 0;
  border-color: var(--gold);
}
.newsletter-form button {
  padding: 12px 22px;
  background: var(--maroon);
  color: white;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
}
.newsletter-form button:hover {
  background: var(--gold);
  color: #241B15;
}
.nl-msg {
  font-size: 13px;
  color: #86EFAC;
  margin-top: 12px;
}

/* ─── Tier 3.1 · Author byline card ─── */
.author-card {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 32px 28px;
  background: rgba(245,240,232,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 48px 0 32px;
}
.author-card .author-avatar {
  flex: 0 0 110px;
}
.author-card .author-avatar img {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  padding: 3px;
  background: var(--maroon-4);
}
.author-card .author-info {
  flex: 1;
}
.author-tag {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 6px;
}
.author-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(22px, 2.8vw, 28px);
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.2;
}
.author-card h3 em { color: var(--gold); font-weight: 400; }
.author-quote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--gold-2);
  margin: 0 0 12px;
  line-height: 1.4;
}
.author-bio {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 16px;
  line-height: 1.6;
}
.author-links {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.author-links a {
  font-size: 12px;
  padding: 6px 12px;
  background: rgba(245,240,232,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
  text-decoration: none;
  transition: 0.2s;
}
.author-links a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ─── Tier 3.4 · Category footer ─── */
.cat-footer {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--text-2);
  padding: 32px 20px;
  margin: 32px 0;
}
.cat-footer a {
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  text-decoration: none;
  padding: 0 6px;
  transition: 0.2s;
}
.cat-footer a:hover {
  background: var(--gold);
  color: #241B15;
}

/* ─── Tier 4.9 · Prev/Next nav ─── */
.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 48px 0 32px;
}
.pn-link {
  padding: 20px 22px;
  background: rgba(245,240,232,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: 0.25s;
}
.pn-link.pn-next { text-align: right; }
.pn-link:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.05);
}
.pn-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 600;
}
.pn-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: var(--text);
  line-height: 1.3;
}

/* ─── Tier 3.2 · Related articles v2 ─── */
.related-section {
  margin: 48px 0;
}
.section-rule {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(22px, 2.6vw, 28px);
  color: var(--gold);
  margin: 0 0 28px;
  position: relative;
  padding: 16px 0;
}
.section-rule::before, .section-rule::after {
  content: '';
  position: absolute;
  width: 60px; height: 1px;
  background: var(--gold);
  top: 50%;
}
.section-rule::before { left: 50%; transform: translateX(calc(-50% - 120px)); }
.section-rule::after { left: 50%; transform: translateX(calc(-50% + 120px)); }
@media (max-width: 600px) {
  .section-rule::before, .section-rule::after { display: none; }
}
.related-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.related-card-v2 {
  background: rgba(245,240,232,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: 0.25s;
  display: flex;
  flex-direction: column;
}
.related-card-v2:hover {
  transform: translateY(-4px);
  border-color: var(--cat-color, var(--gold));
}
.related-card-v2 .rel-cover {
  aspect-ratio: 16/9;
  background-size: cover; background-position: center;
}
.related-card-v2 .rel-cover-placeholder {
  background: linear-gradient(135deg, var(--maroon-3), var(--maroon-4));
}
.related-card-v2 .rel-body { padding: 14px 16px 16px; }
.related-card-v2 .rel-cat {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--cat-color, var(--gold));
  text-transform: uppercase;
  font-weight: 600;
}
.related-card-v2 h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: var(--text);
  margin: 6px 0 0;
  line-height: 1.25;
}
.related-card-v2 .rel-excerpt {
  font-size: 12px;
  color: var(--text-3);
  margin: 8px 0 0;
  line-height: 1.5;
}

/* ─── Tier 4.1 · Lightbox ─── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.active {
  display: flex;
  animation: fade-in 0.3s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  background: transparent;
  border: 0;
  color: var(--gold);
  font-size: 48px;
  font-family: 'Cormorant Garamond', serif;
  cursor: pointer;
  line-height: 1;
  transition: 0.2s;
}
.lightbox-close:hover { transform: rotate(90deg); }

/* ─── Mobile responsive ─── */
@media (max-width: 1100px) {
  .share-rail {
    left: auto;
    right: 16px;
    bottom: 16px;
    top: auto;
    transform: none;
    flex-direction: row;
    background: rgba(255,253,248,0.96);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 6px;
  }
  .share-btn { width: 36px; height: 36px; border: 0; }
  .font-adjuster {
    right: 16px;
    top: 80px;
    flex-direction: row;
    border-radius: 32px;
  }
}
@media (max-width: 768px) {
  .article-detail-v2 { padding: 24px 0 40px; }
  .author-card { flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 24px 20px; }
  .prev-next { grid-template-columns: 1fr; }
  .pn-link.pn-next { text-align: left; }
  .stats-banner { font-size: 11px; gap: 6px 0; }
  .stats-banner .stat { padding: 0 8px; }
  .article-content { font-size: 17px; }
  .article-content > p:first-child::first-letter,
  .article-content > p.lede::first-letter { font-size: 4em; }
  .newsletter-form { flex-direction: column; }
}

/* ─── Print stylesheet (Tier 4.4) ─── */
@media print {
  .topnav, .reading-progress, .share-rail, .font-adjuster,
  .engagement-bar, .newsletter-block, .author-card,
  .cat-footer, .prev-next, .related-section, .site-footer,
  .article-toc, .lightbox, .bg-layer { display: none !important; }
  body { background: white !important; color: black !important; }
  .article-detail-v2 { padding: 0; }
  .article-content { font-size: 12pt; line-height: 1.6; color: black; }
  .article-content h1, .article-content h2, .article-content h3 { color: #333; }
  .article-content blockquote { border-color: #999; color: #444; }
  .article-content a { color: #555; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 10pt; color: #777; }
  .article-detail-v2 h1.title { color: #000; }
  .hero-figure .hero-img { max-height: 300px; box-shadow: none; }
}

/* light theme legibility */
blockquote, blockquote p { color: #7d5f1e; }
.lede { color: rgba(36,27,21,0.86); }
