/* ═══════════════════════════════════════════════════════════════════
   FinWise Guide Styles — extends style.css
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reading progress bar ───────────────────────────────────────── */
#progress-bar {
  position: fixed; top: 70px; left: 0; right: 0; height: 3px;
  background: rgba(248,250,252,0.08); z-index: 800;
}
#progress-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg,#0d9488,#14b8a6);
  transition: width 0.1s linear; border-radius: 0 2px 2px 0;
}

/* ── Guide layout ────────────────────────────────────────────────── */
.guide-page { padding-top: 73px; }

.guide-hero {
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy) 100%);
  border-bottom: 1px solid var(--border);
  padding: 4rem 2rem 3rem;
  position: relative; overflow: hidden;
}
.guide-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 15% 50%, rgba(13,148,136,0.1), transparent 65%);
  pointer-events: none;
}
.guide-hero-inner { max-width: 860px; margin: 0 auto; position: relative; }

.guide-hero .breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; flex-wrap: wrap;
}
.guide-hero .breadcrumb a { color: var(--teal-light); text-decoration: none; }
.guide-hero .breadcrumb a:hover { text-decoration: underline; }

.guide-meta {
  display: flex; flex-wrap: wrap; gap: 1.2rem;
  align-items: center; margin-bottom: 1.8rem;
}
.guide-tag {
  background: var(--teal-glow); border: 1px solid rgba(13,148,136,0.35);
  color: var(--teal-light); padding: 4px 14px; border-radius: 100px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em;
}
.guide-read-time {
  color: var(--text-muted); font-size: 0.85rem;
  display: flex; align-items: center; gap: 6px;
}
.guide-hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.025em;
  margin-bottom: 1.2rem;
}
.guide-hero h1 em { font-style: italic; color: var(--teal-light); }
.guide-hero .lead {
  font-size: 1.1rem; color: var(--text-muted); line-height: 1.8;
  max-width: 680px; margin-bottom: 2rem;
}

/* Key takeaways box in hero */
.takeaways {
  background: var(--white-10); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.4rem 1.6rem;
  display: flex; flex-wrap: wrap; gap: 0.7rem 2rem;
}
.takeaways h4 {
  width: 100%; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 0.2rem; font-weight: 600;
}
.takeaway-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.88rem; color: var(--white-80); min-width: 200px; flex: 1;
}
.takeaway-item::before { content: '✓'; color: var(--teal-light); font-weight: 700; flex-shrink: 0; }

/* ── Horizontal anchor nav bar (replaces vertical TOC sidebar) ───── */
.guide-anchor-bar {
  background: var(--navy-mid);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 70px;
  z-index: 500;
  padding: 0 2rem;
}
.guide-anchor-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.guide-anchor-inner::-webkit-scrollbar { display: none; }

.guide-anchor-inner .anchor-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0 14px 0 0;
  margin-right: 4px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.anchor-link {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 12px 12px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.anchor-link:hover { color: var(--white); }
.anchor-link.active {
  color: var(--teal-light);
  border-bottom-color: var(--teal);
}

/* ── Article layout — single full-width column ───────────────────── */
.guide-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.guide-article {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Hide old vertical sidebar entirely */
.guide-body > aside { display: none; }
.guide-toc { display: none; }

/* Share / bookmark bar */
.guide-share {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1.5rem; padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.share-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--white-10); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-muted); font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem; font-weight: 500; padding: 7px 14px;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.share-btn:hover { background: var(--white-20); color: var(--white); }

/* ── Article typography ──────────────────────────────────────────── */
.guide-article h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
  margin: 3rem 0 1.2rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 90px;
}
.guide-article h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.guide-article h3 {
  font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 600;
  margin: 2rem 0 0.8rem; color: var(--white); scroll-margin-top: 90px;
}
.guide-article p {
  font-size: 1.02rem; line-height: 1.85; color: var(--white-80);
  margin-bottom: 1.3rem;
}
.guide-article strong { color: var(--white); font-weight: 600; }
.guide-article em { color: var(--teal-light); font-style: normal; font-weight: 500; }
.guide-article a { color: var(--teal-light); text-decoration: underline; text-underline-offset: 3px; }
.guide-article a:hover { color: var(--white); }

.guide-article ul, .guide-article ol {
  margin: 0.5rem 0 1.3rem 0; padding-left: 0;
  display: flex; flex-direction: column; gap: 0.6rem; list-style: none;
}
.guide-article ul li, .guide-article ol li {
  font-size: 1rem; line-height: 1.75; color: var(--white-80);
  padding-left: 1.6rem; position: relative;
}
.guide-article ul li::before {
  content: '→'; color: var(--teal-light);
  position: absolute; left: 0; font-weight: 700;
}
.guide-article ol { counter-reset: ol-counter; }
.guide-article ol li { counter-increment: ol-counter; }
.guide-article ol li::before {
  content: counter(ol-counter);
  position: absolute; left: 0;
  background: var(--teal-glow); border: 1px solid rgba(13,148,136,0.3);
  color: var(--teal-light); font-size: 0.72rem; font-weight: 700;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  top: 3px;
}

/* ── Callout boxes ───────────────────────────────────────────────── */
.callout {
  border-radius: var(--radius-sm); padding: 1.3rem 1.5rem;
  margin: 1.8rem 0; display: flex; gap: 1rem; align-items: flex-start;
}
.callout-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.callout-body h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.4rem; }
.callout-body p { font-size: 0.9rem; line-height: 1.7; margin: 0; }
.callout.tip    { background: rgba(13,148,136,0.1); border: 1px solid rgba(13,148,136,0.25); }
.callout.tip    .callout-body h4 { color: var(--teal-light); }
.callout.warn   { background: rgba(245,158,11,0.1);  border: 1px solid rgba(245,158,11,0.25); }
.callout.warn   .callout-body h4 { color: var(--gold-light); }
.callout.key    { background: rgba(99,102,241,0.1);  border: 1px solid rgba(99,102,241,0.25); }
.callout.key    .callout-body h4 { color: #a5b4fc; }
.callout.danger { background: rgba(244,63,94,0.1);   border: 1px solid rgba(244,63,94,0.25); }
.callout.danger .callout-body h4 { color: #fda4af; }

/* ── Formula / example boxes ─────────────────────────────────────── */
.formula-card {
  background: var(--navy); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.4rem 1.6rem; margin: 1.5rem 0;
}
.formula-card .fc-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); font-weight: 600; margin-bottom: 0.6rem;
}
.formula-card pre {
  font-family: 'Courier New', monospace; font-size: 0.9rem;
  color: var(--teal-light); line-height: 1.8; white-space: pre-wrap;
}

/* ── Stat highlight ──────────────────────────────────────────────── */
.stat-highlight {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin: 2rem 0;
}
.stat-card {
  background: var(--navy-mid); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.3rem; text-align: center;
}
.stat-card .sv {
  font-family: 'Fraunces', serif; font-size: 2.2rem; font-weight: 700;
  color: var(--teal-light); line-height: 1; display: block; margin-bottom: 0.3rem;
}
.stat-card .sl { font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; }
.stat-card.gold .sv { color: var(--gold-light); }
.stat-card.red  .sv { color: #f87171; }

/* ── Calculator CTA block ────────────────────────────────────────── */
.calc-cta {
  background: linear-gradient(135deg, rgba(13,148,136,0.12), rgba(13,148,136,0.04));
  border: 1px solid rgba(13,148,136,0.3); border-radius: var(--radius);
  padding: 2rem; margin: 2.5rem 0;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.calc-cta-icon { font-size: 2.5rem; flex-shrink: 0; }
.calc-cta-text h4 {
  font-family: 'Fraunces', serif; font-size: 1.15rem;
  font-weight: 700; margin-bottom: 0.4rem;
}
.calc-cta-text p { font-size: 0.9rem; color: var(--text-muted); margin: 0; line-height: 1.6; }
.calc-cta-btn {
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  color: var(--white); text-decoration: none; padding: 12px 24px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 0.95rem;
  white-space: nowrap; box-shadow: var(--shadow-teal);
  transition: transform 0.2s, box-shadow 0.2s; margin-left: auto; flex-shrink: 0;
}
.calc-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(13,148,136,0.4); }

/* ── Comparison table ────────────────────────────────────────────── */
.comparison-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.92rem; }
.comparison-table th {
  background: var(--navy-mid); padding: 12px 16px; text-align: left;
  font-weight: 600; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.comparison-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--white-80); vertical-align: top;
}
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:hover td { background: var(--white-10); }
.comparison-table .good { color: #4ade80; font-weight: 600; }
.comparison-table .bad  { color: #f87171; font-weight: 600; }
.comparison-table .mid  { color: var(--gold-light); font-weight: 600; }

/* ── Interactive quiz ────────────────────────────────────────────── */
.quiz-block {
  background: var(--navy-mid); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; margin: 2.5rem 0;
}
.quiz-block h4 {
  font-family: 'Fraunces', serif; font-size: 1.1rem;
  font-weight: 600; margin-bottom: 0.3rem;
}
.quiz-block .quiz-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.3rem; }
.quiz-options { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.2rem; }
.quiz-opt {
  background: var(--navy); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  cursor: pointer; font-size: 0.92rem; transition: all 0.2s;
  text-align: left; color: var(--white); font-family: 'DM Sans', sans-serif;
  width: 100%;
}
.quiz-opt:hover { border-color: rgba(13,148,136,0.4); background: var(--teal-glow); }
.quiz-opt.correct { border-color: #22c55e; background: rgba(34,197,94,0.12); color: #4ade80; }
.quiz-opt.wrong   { border-color: #f43f5e; background: rgba(244,63,94,0.10); color: #f87171; }
.quiz-explanation {
  display: none; padding: 1rem; background: var(--navy);
  border-radius: var(--radius-sm); font-size: 0.9rem; color: var(--white-80); line-height: 1.7;
}
.quiz-explanation.show { display: block; }

/* ── Steps / process ─────────────────────────────────────────────── */
.guide-steps { display: flex; flex-direction: column; gap: 1.5rem; margin: 1.5rem 0; }
.guide-step {
  display: flex; gap: 1.2rem; align-items: flex-start;
  background: var(--navy-mid); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.4rem;
}
.step-num {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--teal-glow); border: 2px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 1rem; font-weight: 700; color: var(--teal-light);
}
.step-content h4 { font-size: 0.98rem; font-weight: 600; margin-bottom: 0.4rem; }
.step-content p  { font-size: 0.88rem; color: var(--text-muted); margin: 0; line-height: 1.7; }

/* ── Related guides sidebar widget ──────────────────────────────── */
.sidebar-guides h4 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); font-weight: 600; margin-bottom: 1rem;
}
.sidebar-guide-link {
  display: flex; gap: 10px; align-items: flex-start; text-decoration: none;
  color: var(--white); padding: 10px 0;
  border-bottom: 1px solid var(--border); transition: color 0.2s;
}
.sidebar-guide-link:last-child { border-bottom: none; }
.sidebar-guide-link:hover { color: var(--teal-light); }
.sidebar-guide-link .sgl-icon { font-size: 1.2rem; flex-shrink: 0; }
.sidebar-guide-link .sgl-title { font-size: 0.85rem; font-weight: 500; line-height: 1.4; }

/* ── Bottom guide grid ───────────────────────────────────────────── */
.guide-bottom-nav {
  background: var(--navy-mid); border-top: 1px solid var(--border);
  padding: 4rem 2rem;
}
.guide-bottom-nav h3 {
  font-family: 'Fraunces', serif; font-size: 1.4rem;
  font-weight: 700; text-align: center; margin-bottom: 2rem;
}
.guide-cards-row {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem;
}
.guide-nav-card {
  background: var(--navy); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.4rem; text-decoration: none;
  color: var(--white); transition: transform 0.2s, border-color 0.2s;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.guide-nav-card:hover { transform: translateY(-3px); border-color: rgba(13,148,136,0.4); }
.guide-nav-card .gnc-icon { font-size: 1.6rem; }
.guide-nav-card h4 { font-size: 0.92rem; font-weight: 600; line-height: 1.3; }
.guide-nav-card p  { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; margin: 0; flex: 1; }
.guide-nav-card .gnc-tag {
  font-size: 0.72rem; color: var(--teal-light); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .guide-body { padding: 2rem 1.2rem 4rem; }
  .guide-anchor-bar { padding: 0 1rem; }
  .anchor-label { display: none; }
  .calc-cta { flex-direction: column; }
  .calc-cta-btn { margin-left: 0; }
}
@media (max-width: 500px) {
  .guide-hero { padding: 2.5rem 1.2rem 1.8rem; }
  .guide-article h2 { font-size: 1.35rem; }
  .stat-highlight { grid-template-columns: 1fr 1fr; }
}
