/*
 * ViLo Pulse — Shared Blog Styles
 * -------------------------------------------------------
 * Used by every blog post. Each post just links this file.
 * Design: light reading surface + ViLoLabs gold brand accents
 * -------------------------------------------------------
 */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:    #C8963C;
  --gold2:   #E8BC72;
  --char:    #1A1108;
  --ink:     #1e1a14;
  --ink2:    #3a342a;
  --muted:   #7a6e62;
  --rule:    #e8e2d8;
  --bg:      #faf8f4;
  --bg2:     #f2ede4;
  --white:   #ffffff;
  --red:     #c0392b;
  --green:   #27ae60;
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', 'Segoe UI', sans-serif;
  --max-w:   820px;
  --wide-w:  1200px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── Top nav bar ── */
.blog-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--char);
  border-bottom: 1px solid rgba(200,150,60,.25);
  padding: 0 24px;
  height: 54px;
  display: flex; align-items: center; justify-content: space-between;
}
.blog-nav-brand {
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: .02em;
}
.blog-nav-brand span { color: #fff; opacity: .7; font-size: .85em; margin-left: 6px; }
.blog-nav-back {
  color: var(--gold2);
  font-size: .82rem;
  text-decoration: none;
  opacity: .8;
  transition: opacity .2s;
}
.blog-nav-back:hover { opacity: 1; }

/* ── Progress bar ── */
#read-progress {
  position: fixed; top: 54px; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  width: 0%; z-index: 99;
  transition: width .1s linear;
}

/* ── Hero ── */
.post-hero {
  background: var(--char);
  padding: 56px 24px 48px;
  text-align: center;
}
.post-category {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(200,150,60,.4);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 20px;
}
.post-title {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  max-width: 820px;
  margin: 0 auto 16px;
}
.post-title em { color: var(--gold2); font-style: normal; }
.post-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,.6);
  max-width: 600px;
  margin: 0 auto 28px;
}
.post-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; flex-wrap: wrap;
  font-size: .8rem;
  color: rgba(255,255,255,.45);
}
.post-meta-dot { opacity: .3; }

/* ── Quick stats strip (skimmer bar) ── */
.skim-bar {
  background: var(--gold);
  padding: 0;
  overflow: hidden;
}
.skim-bar-inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.skim-stat {
  padding: 18px 24px;
  border-right: 1px solid rgba(255,255,255,.2);
  text-align: center;
}
.skim-stat:last-child { border-right: none; }
.skim-stat-num {
  display: block;
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--char);
  line-height: 1;
}
.skim-stat-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(26,17,8,.7);
  margin-top: 4px;
}

/* ── TL;DR box ── */
.tldr {
  background: var(--bg2);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin: 32px 0;
}
.tldr-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.tldr ul { padding-left: 18px; }
.tldr li { margin-bottom: 6px; font-size: .95rem; color: var(--ink2); }
.tldr li strong { color: var(--ink); }

/* ── Two-column page layout (article + sidebar) ── */
.post-layout {
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0 48px;
  align-items: start;
  padding: 0 48px;
}

/* Article fills its column */
.post-layout article { min-width: 0; }

/* Sticky sidebar */
.post-sidebar {
  position: sticky;
  top: 74px;
  padding: 32px 0 40px;
}
.sb-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px 18px 16px;
  margin-bottom: 16px;
}
.sb-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 12px;
}
/* Table of Contents */
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc-link {
  display: block;
  padding: 6px 8px;
  font-size: .82rem;
  color: var(--ink2);
  text-decoration: none;
  border-radius: 5px;
  transition: background .15s, color .15s;
  border-left: 2px solid transparent;
}
.toc-link:hover,
.toc-link.active {
  background: var(--bg2);
  color: var(--gold);
  border-left-color: var(--gold);
}
/* Affiliate card */
.sb-affiliate { border-top: 3px solid var(--gold); position: relative; }
.sb-affiliate p { font-size: .82rem; color: var(--ink2); margin-bottom: 12px; line-height: 1.5; }

/* Affiliate "coming soon" state — kept visible but dimmed so the layout
   doesn't shift later when affiliate is enabled. Add class="coming-soon"
   on .sb-affiliate to activate. Remove to make it live. */
.sb-affiliate.coming-soon { filter: blur(1.4px) saturate(.6); opacity: .55; pointer-events: none; user-select: none; }
.sb-affiliate.coming-soon::after {
  content: "Coming soon";
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--bg); border: 1px solid var(--gold);
  color: var(--gold); padding: 6px 14px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  filter: blur(0) saturate(1); opacity: 1;
  pointer-events: none; white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   AD SLOTS — hidden by default, made visible by adding .live class.
   When ad networks (AdSense / direct sponsors) are wired up, just
   add class="live" on the slot div and drop the ad code inside.
   ═══════════════════════════════════════════════════════════════ */
.ad-slot {
  display: none;                /* hidden until activated */
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  margin: 2rem auto;            /* horizontal auto-center within parent */
  box-sizing: border-box;
  background: rgba(0,0,0,.03);
  border: 1px dashed rgba(0,0,0,.12);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-family: 'Outfit', sans-serif;
}
.ad-slot.live    { display: flex; margin: 2rem auto; }
.ad-slot.live::before { content: "Advertisement"; opacity: .55; }
.ad-slot.preview { display: flex; margin: 2rem auto; background: rgba(200,150,60,.04); border-color: rgba(200,150,60,.22); color: var(--gold); }
.ad-slot.preview::before { content: "Ad slot · " attr(data-size); opacity: .85; }

/* sidebar ad slot — fills the .post-sidebar card width */
.ad-slot.sb-ad { max-width: 100%; min-height: 250px; margin: 0 0 16px; }
.ad-slot.sb-ad.preview::before { content: "Sidebar ad · " attr(data-size); }

/* hide ad slots on print/PDF */
@media print { .ad-slot { display: none !important; } }
.sb-btn {
  display: block;
  background: var(--gold);
  color: var(--char);
  text-align: center;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s;
  margin-bottom: 8px;
}
.sb-btn:hover { background: var(--gold2); }
.sb-disclosure { font-size: .68rem; color: var(--muted); font-style: italic; }
/* Tool links */
.sb-tool-link {
  display: block;
  font-size: .82rem;
  color: var(--ink2);
  text-decoration: none;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  transition: color .15s;
}
.sb-tool-link:last-child { border-bottom: none; }
.sb-tool-link:hover { color: var(--gold); }

/* ── References section ── */
.references {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 40px 0 0;
}
.references-title {
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.references-list {
  padding-left: 20px;
  font-size: .82rem;
  color: var(--ink2);
  line-height: 1.7;
}
.references-list li { margin-bottom: 8px; }
.references-list a { color: var(--gold); }
.references-note {
  font-size: .75rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}

/* ── Main layout (post body inside layout) ── */
.post-body {
  max-width: var(--max-w);
  margin: 0;
  padding: 32px 0 40px;
}

/* Wide blocks still stretch to article column width */
.post-layout .wide-block {
  margin-left: -32px;
  margin-right: -32px;
  padding: 0 32px;
  max-width: none;
}

/* ── Wide blocks (charts, tables) — defined in responsive section below ── */

/* ── Typography ── */
.post-body h2 {
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--rule);
}
.post-body h2::before {
  content: '';
  display: inline-block;
  width: 4px; height: 1.1em;
  background: var(--gold);
  margin-right: 12px;
  vertical-align: middle;
  border-radius: 2px;
}
.post-body h3 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin: 32px 0 12px;
}
.post-body p { margin-bottom: 18px; color: var(--ink2); }
.post-body p:first-child { font-size: 1.05rem; }
.post-body a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body em { font-style: italic; color: var(--muted); }

/* ── Callout / highlight box ── */
.callout {
  background: #fff8ed;
  border: 1px solid rgba(200,150,60,.3);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: .93rem;
}
.callout-icon { margin-right: 8px; }
.callout.warning { background: #fff5f5; border-color: rgba(192,57,43,.3); }
.callout.info { background: #f0f7ff; border-color: rgba(52,152,219,.3); }

/* ── Chart containers ── */
.chart-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 28px 24px 20px;
  margin: 32px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.chart-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.chart-note {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.chart-wrap {
  position: relative;
  width: 100%;
}

/* ── Data table ── */
.data-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--rule);
  margin: 24px 0;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  background: var(--white);
}
.data-table th {
  background: var(--char);
  color: var(--gold2);
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.data-table th:hover { background: #2d2318; }
.data-table th .sort-icon { margin-left: 6px; opacity: .5; }
.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg2); }
.data-table .rank { color: var(--muted); font-size: .8rem; }
.price-bar-cell { display: flex; align-items: center; gap: 10px; }
.price-bar {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  min-width: 4px;
  flex-shrink: 0;
}
.price-bar.low { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.price-bar.high { background: linear-gradient(90deg, #e74c3c, #c0392b); }
td.price-val { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.badge-cheap { background: #d5f5e3; color: #1e8449; border-radius: 4px; padding: 1px 7px; font-size: .72rem; font-weight: 600; }
.badge-costly { background: #fde8e8; color: #a93226; border-radius: 4px; padding: 1px 7px; font-size: .72rem; font-weight: 600; }

/* ── Table search/filter ── */
.table-controls {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 12px; flex-wrap: wrap;
}
.table-search {
  flex: 1; min-width: 180px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: .88rem;
  background: var(--white);
  color: var(--ink);
  outline: none;
}
.table-search:focus { border-color: var(--gold); }
.table-label { font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* ── Key insight cards ── */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.insight-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px 20px;
  border-top: 3px solid var(--gold);
}
.insight-card.red-top { border-top-color: #e74c3c; }
.insight-card.green-top { border-top-color: #27ae60; }
.insight-card.blue-top { border-top-color: #2980b9; }
.insight-num {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.insight-label { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.insight-state { font-size: .85rem; font-weight: 600; color: var(--ink2); margin-top: 6px; }

/* ── FAQ ── */
.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
}
.faq-q {
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.faq-q .faq-icon { color: var(--gold); font-size: 1.2rem; flex-shrink: 0; transition: transform .2s; }
.faq-q.open .faq-icon { transform: rotate(45deg); }
.faq-a {
  font-size: .93rem;
  color: var(--ink2);
  padding-top: 10px;
  display: none;
  line-height: 1.7;
}
.faq-a.open { display: block; }

/* ── Footer / disclaimer ── */
.post-footer {
  background: var(--char);
  border-top: 1px solid rgba(200,150,60,.2);
  padding: 40px 24px;
  text-align: center;
}
.post-footer-brand {
  font-family: var(--font-head);
  color: var(--gold);
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.post-footer p {
  font-size: .78rem;
  color: rgba(255,255,255,.3);
  max-width: 560px;
  margin: 0 auto 6px;
  line-height: 1.6;
}
.post-footer a { color: rgba(255,255,255,.4); }

/* ── Affiliate disclosure ── */
.disclosure {
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 48px;
  font-style: italic;
}

/* ── Share bar ── */
.share-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 40px 0;
  flex-wrap: wrap;
}
.share-label { font-size: .8rem; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.share-btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-block;
  transition: opacity .2s;
}
.share-btn:hover { opacity: .85; }
.share-btn.whatsapp { background: #25D366; color: #fff; }
.share-btn.twitter  { background: #1DA1F2; color: #fff; }
.share-btn.copy     { background: var(--bg2); color: var(--ink); border: 1px solid var(--rule); }

/* ── Ad slot placeholder ── */
.ad-slot {
  background: var(--bg2);
  border: 2px dashed var(--rule);
  border-radius: 8px;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: .8rem;
  margin: 32px 0;
}

/* ── Responsive ── */
/* ── Sidebar hidden on tablet/mobile ── */
@media (max-width: 1020px) {
  .post-layout {
    grid-template-columns: 1fr;
    padding: 0 20px;
  }
  .post-sidebar { display: none; }
  .post-body { padding: 28px 0 40px; }
  .post-layout .wide-block { margin-left: -20px; margin-right: -20px; padding: 0 20px; }
}
@media (max-width: 600px) {
  .post-layout { padding: 0 14px; }
  .post-layout .wide-block { margin-left: -14px; margin-right: -14px; padding: 0 14px; }
  .post-body { padding: 20px 0 32px; }
}

/* ── Two-chart side-by-side grid ── */
.two-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .two-chart-grid { grid-template-columns: 1fr; }
  .two-chart-grid .chart-card { margin: 0 0 8px; }
}

/* ── Wide block max width ── */
.wide-block {
  max-width: var(--wide-w);
  margin: 40px auto;
  padding: 0 24px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  :root { --max-w: 100%; }
  .post-body { padding: 28px 20px 60px; }
  .wide-block { padding: 0 20px; }
  .skim-bar-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .post-body { padding: 20px 14px 50px; }
  .wide-block { padding: 0 14px; }
  .skim-bar-inner { grid-template-columns: repeat(2, 1fr); }
  .chart-card { padding: 16px 12px; }
  .data-table th, .data-table td { padding: 8px 8px; font-size: .8rem; }
  .post-title { font-size: clamp(1.6rem, 6vw, 2.2rem); }
  .insight-grid { grid-template-columns: 1fr 1fr; }
}
