/* ============================================================
   ZAR MARKET TRENDS — Ghost Theme CSS
   mail.zarmarkettrends.com
   Designed to match newsletter.zarmarkettrends.com exactly.
   ============================================================ */

/* ── Design Tokens — identical to globals.css ────────────── */
:root {
  --bg:           #F8F7F4;
  --bg-soft:      #EFEDE9;
  --bg-card:      #FFFFFF;
  --border:       #E2DED8;
  --text-head:    #1A1A1A;
  --text-body:    #4A4A4A;
  --text-muted:   #9A9A9A;
  --accent:       #9B0000;
  --accent-warm:  #C0392B;
  --nav-bg:       rgba(248,247,244,0.94);
  --shadow:       0 1px 3px rgba(0,0,0,0.08);
  --max-w:        1200px;
  --content-w:    680px;
  --radius:       14px;
  --radius-sm:    8px;
}

/* ── Dark mode — class-based (.dark on <html>), JS-toggled ── */
/* Respects prefers-color-scheme on first visit, then localStorage */
html.dark {
  --bg:           #141414;
  --bg-soft:      #1C1C1E;
  --bg-card:      #1C1C1E;
  --border:       #2C2C2E;
  --text-head:    #E9E9EA;
  --text-body:    #A1A1A6;
  --text-muted:   #636366;
  --nav-bg:       rgba(20,20,20,0.94);
  --shadow:       0 1px 3px rgba(0,0,0,0.4);
}

/* Toggle icon visibility */
html:not(.dark) .icon-sun { display: none; }
html:not(.dark) .icon-moon { display: block; }
html.dark .icon-sun { display: block; }
html.dark .icon-moon { display: none; }

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg) !important;
  color: var(--text-body);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Override Ghost's global a { color: var(--ghost-accent-color) } injection */
a { color: inherit !important; text-decoration: none; }
ul, ol { list-style: none; }

/* ── Navigation — sticky, matching zarmarkettrends.com nav ── */
.gh-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.gh-head-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.gh-head-logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-head) !important;
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  transition: opacity 0.2s;
  text-decoration: none;
}
.gh-head-logo:hover { opacity: 0.8; }
.gh-head-logo img { height: 28px; width: auto; }
.gh-head-logo .accent { color: var(--accent-warm) !important; }

.gh-head-menu { display: flex; align-items: center; gap: 28px; }
.gh-head-menu a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body) !important;
  transition: color 0.2s;
  text-decoration: none;
}
.gh-head-menu a:hover, .gh-head-menu a.current { color: var(--text-head) !important; }

.gh-head-actions { display: flex; align-items: center; gap: 12px; }

.gh-subscribe-btn {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff !important;
  background: var(--accent);
  border-radius: 6px;
  padding: 8px 18px;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
  display: inline-block;
  text-decoration: none !important;
}
.gh-subscribe-btn:hover {
  background: var(--accent-warm);
  transform: translateY(-1px);
  color: #ffffff !important;
}

.gh-head-button {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.gh-head-button:hover { color: var(--text-head); }

/* Theme toggle — 34×34 circle, sun/moon icons, matching zarmarkettrends.com ThemeToggle */
.gh-theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.gh-theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
/* Show sun in dark mode, moon in light mode */
.gh-theme-toggle .icon-sun { display: none; }
.gh-theme-toggle .icon-moon { display: block; }
html.dark .gh-theme-toggle .icon-sun { display: block; }
html.dark .gh-theme-toggle .icon-moon { display: none; }

/* Mobile burger */
.gh-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.gh-burger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-head); border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Page wrapper — centred like newsletter.zarmarkettrends.com ── */
.gh-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Divider ──────────────────────────────────────────────── */
.gh-divider { border: none; border-top: 1px solid var(--border); }

/* ── Eyebrow label — 12px uppercase tracking ─────────────── */
.gh-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-warm);
}

/* ── HOMEPAGE HERO — centred, max-width 680px ────────────── */
.gh-hero {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 80px 32px 64px;
  text-align: center;
}
.gh-hero .gh-eyebrow { margin-bottom: 20px; display: block; }
.gh-hero-title {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.08;
  color: var(--text-head);
  margin-bottom: 24px;
}
.gh-hero-desc {
  font-size: 18px;
  line-height: 1.72;
  color: var(--text-body);
  margin-bottom: 40px;
}

/* Subscribe form — fused input + button, matching the Next.js site */
.gh-subscribe-form { max-width: 460px; margin: 0 auto; }
.gh-subscribe-form form {
  display: flex;
  margin-bottom: 12px;
}
.gh-subscribe-form input[type="email"] {
  flex: 1;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-head);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 13px 18px;
  outline: none;
  transition: border-color 0.2s;
}
.gh-subscribe-form input[type="email"]:focus { border-color: var(--accent); }
.gh-subscribe-form input[type="email"]::placeholder { color: var(--text-muted); }
.gh-subscribe-form button[type="submit"] {
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 13px 24px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}
.gh-subscribe-form button[type="submit"]:hover { background: var(--accent-warm); border-color: var(--accent-warm); }
.gh-subscribe-form .gh-form-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ── WHAT'S INSIDE grid — 6 cards, 3-col ─────────────────── */
.gh-section {
  padding: 64px 0;
}
.gh-section-header { margin-bottom: 48px; }
.gh-section-header .gh-eyebrow { margin-bottom: 10px; display: block; }
.gh-section-title {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: var(--text-head);
  margin-bottom: 12px;
}
.gh-section-subtitle {
  font-size: 16px;
  color: var(--text-body);
  max-width: 480px;
}

.gh-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.gh-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s;
}
.gh-feature-card:hover { border-color: var(--accent); }
.gh-feature-icon { font-size: 28px; margin-bottom: 16px; }
.gh-feature-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-head);
  margin-bottom: 8px;
}
.gh-feature-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-body);
}

/* ── ARCHIVE — numbered list rows, like the newsletter page ── */
.gh-archive-list { display: flex; flex-direction: column; }

.gh-archive-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: color 0.2s;
}
.gh-archive-item:first-child { border-top: 1px solid var(--border); }
.gh-archive-item:hover .gh-archive-title { color: var(--accent-warm); }
.gh-archive-item:hover .gh-archive-arrow { color: var(--accent-warm); }

.gh-archive-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
  padding-top: 2px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.gh-archive-body { flex: 1; }
.gh-archive-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 6px;
}
.gh-archive-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.32;
  color: var(--text-head);
  margin-bottom: 8px;
  transition: color 0.2s;
}
.gh-archive-excerpt {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-body);
  margin-bottom: 8px;
}
.gh-archive-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.gh-archive-arrow {
  font-size: 18px;
  color: var(--text-muted);
  padding-top: 2px;
  flex-shrink: 0;
  transition: color 0.2s;
}

/* Empty state */
.gh-archive-empty {
  padding: 64px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 15px;
}

/* ── Pagination ───────────────────────────────────────────── */
.gh-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 40px 0 0;
}
.gh-pagination a, .gh-pagination span {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  color: var(--text-head);
  transition: border-color 0.2s, color 0.2s;
}
.gh-pagination a:hover { border-color: var(--accent); color: var(--accent); }
.gh-pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Subscribe section — bg-soft strip, centred ─────────── */
.gh-subscribe-section {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}
.gh-subscribe-section-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 80px 32px;
  text-align: center;
}
.gh-subscribe-section .gh-eyebrow { margin-bottom: 10px; display: block; }
.gh-subscribe-section-title {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: var(--text-head);
  margin-bottom: 12px;
}
.gh-subscribe-section-subtitle {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-body);
  max-width: 440px;
  margin: 0 auto 36px;
}
.gh-subscribe-success {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 28px 32px;
  text-align: center;
}
.gh-subscribe-success-icon { font-size: 32px; margin-bottom: 12px; }
.gh-subscribe-success-title { font-weight: 700; font-size: 20px; color: var(--text-head); margin-bottom: 8px; }
.gh-subscribe-success-desc { font-size: 15px; color: var(--text-body); }

/* ── Single Post ──────────────────────────────────────────── */
.gh-post {
  max-width: var(--max-w);
  margin: 0 auto;
}

.gh-post-header {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 64px 32px 40px;
}

.gh-post-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.gh-post-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-warm);
}
.gh-post-meta-dot { color: var(--border); }
.gh-post-meta-text { font-size: 13px; color: var(--text-muted); }

.gh-post-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text-head);
  margin-bottom: 20px;
}
.gh-post-excerpt {
  font-size: 17px;
  line-height: 1.72;
  color: var(--text-body);
  margin-bottom: 28px;
}
.gh-post-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.gh-post-byline-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 700;
  overflow: hidden; flex-shrink: 0;
}
.gh-post-byline-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gh-post-byline-name { font-size: 13px; font-weight: 600; color: var(--text-head); }
.gh-post-byline-date { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* Cover image */
.gh-post-cover {
  max-width: var(--content-w);
  margin: 0 auto 48px;
  padding: 0 32px;
}
.gh-post-cover img {
  width: 100%; border-radius: var(--radius);
  aspect-ratio: 16/9; object-fit: cover;
}

/* Post body — matching prose-zmt styles from globals.css */
.gh-content {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 32px 80px;
  color: var(--text-body);
}
.gh-content h2 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-head);
  margin-top: 2.5rem; margin-bottom: 1rem;
  line-height: 1.2;
}
.gh-content h3 {
  font-size: 20px; font-weight: 700; color: var(--text-head);
  margin-top: 2rem; margin-bottom: 0.75rem;
}
.gh-content h4 {
  font-size: 17px; font-weight: 600; color: var(--text-head);
  margin-top: 1.5rem; margin-bottom: 0.5rem;
}
.gh-content p { margin-bottom: 1.4rem; line-height: 1.75; }
.gh-content strong { color: var(--text-head); font-weight: 600; }
.gh-content a { color: var(--accent-warm); text-decoration: underline; text-underline-offset: 3px; }
.gh-content a:hover { color: var(--accent); }
.gh-content ul, .gh-content ol { margin-bottom: 1.4rem; padding-left: 1.5rem; list-style: revert; }
.gh-content li { margin-bottom: 0.5rem; }
.gh-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem; margin: 2rem 0;
  color: var(--text-muted); font-style: italic;
}
.gh-content hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.gh-content img { border-radius: var(--radius-sm); margin: 2rem 0; }
.gh-content pre {
  background: var(--bg-soft); padding: 20px 24px;
  border-radius: var(--radius-sm); overflow-x: auto; margin-bottom: 1.4rem; font-size: 14px;
}
.gh-content code {
  font-size: 13px; background: var(--bg-soft);
  padding: 2px 6px; border-radius: 4px;
}
.gh-content pre code { background: none; padding: 0; }

/* Ghost Koenig card blocks — both are REQUIRED by Ghost */
.kg-width-wide {
  margin-left: -80px;
  margin-right: -80px;
}
.kg-width-full {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
  width: 100vw;
}
.kg-image-card img { border-radius: var(--radius-sm); width: 100%; }
.kg-image-card figcaption {
  font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 8px;
}
.kg-bookmark-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; margin: 1.5rem 0;
}
.kg-bookmark-container { display: flex; text-decoration: none; }
.kg-bookmark-content { padding: 20px; flex: 1; }
.kg-bookmark-title { font-weight: 600; color: var(--text-head); margin-bottom: 4px; font-size: 15px; }
.kg-bookmark-description { font-size: 13px; color: var(--text-body); }
.kg-bookmark-metadata { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.kg-bookmark-thumbnail { width: 120px; flex-shrink: 0; overflow: hidden; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.kg-callout-card {
  display: flex; gap: 16px; background: var(--bg-soft);
  border-radius: var(--radius-sm); padding: 20px 24px; margin: 1.5rem 0;
  border-left: 3px solid var(--accent);
}
.kg-callout-emoji { font-size: 20px; flex-shrink: 0; }
.kg-callout-text { font-size: 15px; color: var(--text-body); }

/* ── Tag / Author header ──────────────────────────────────── */
.gh-tag-header {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 64px 32px 40px;
  border-bottom: 1px solid var(--border);
}
.gh-tag-title {
  font-size: clamp(28px, 4vw, 42px); font-weight: 700;
  letter-spacing: -1px; color: var(--text-head); margin-bottom: 10px;
}
.gh-tag-desc { font-size: 16px; line-height: 1.7; color: var(--text-body); max-width: 520px; }
.gh-tag-count { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

/* ── Error page ───────────────────────────────────────────── */
.gh-error {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 120px 32px;
  text-align: center;
}
.gh-error-code {
  font-size: 96px; font-weight: 700;
  color: var(--accent); line-height: 1; margin-bottom: 20px;
}
.gh-error-title { font-size: 24px; font-weight: 700; color: var(--text-head); margin-bottom: 12px; }
.gh-error-desc { color: var(--text-body); margin-bottom: 32px; font-size: 16px; }
.gh-error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  font-size: 14px; font-weight: 600; color: #fff !important;
  background: var(--accent); border-radius: 8px; padding: 13px 26px;
  transition: background 0.2s, transform 0.15s; display: inline-block;
}
.btn-primary:hover { background: var(--accent-warm); transform: translateY(-1px); }
.btn-secondary {
  font-size: 14px; font-weight: 600; color: var(--text-head) !important;
  border: 1.5px solid var(--border); border-radius: 8px; padding: 13px 26px;
  transition: border-color 0.2s; display: inline-block;
}
.btn-secondary:hover { border-color: var(--text-head); }

/* ── Footer — matching zarmarkettrends.com footer exactly ── */
.gh-foot { border-top: 1px solid var(--border); }
.gh-foot-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 32px 32px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}
.gh-foot-brand { max-width: 260px; }
.gh-foot-brand-name { font-size: 17px; font-weight: 700; color: var(--text-head); margin-bottom: 8px; }
.gh-foot-brand-name .accent { color: var(--accent-warm); }
.gh-foot-brand-desc { font-size: 13px; color: var(--text-muted); line-height: 1.65; }
.gh-foot-col h4 {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 16px;
}
.gh-foot-col ul { display: flex; flex-direction: column; gap: 10px; }
.gh-foot-col a { font-size: 14px; color: var(--text-body); transition: color 0.2s; }
.gh-foot-col a:hover { color: var(--text-head); }
.gh-foot-bottom {
  max-width: var(--max-w); margin: 0 auto;
  padding: 20px 32px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.gh-foot-copy { font-size: 12px; color: var(--text-muted); }
.gh-foot-disclaimer { font-size: 11px; color: var(--text-muted); max-width: 480px; text-align: right; line-height: 1.5; }

/* ── Fade-in ──────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up   { animation: fadeUp 0.6s ease forwards; opacity: 0; }
.fade-up-1 { animation-delay: 0.1s; }
.fade-up-2 { animation-delay: 0.2s; }
.fade-up-3 { animation-delay: 0.3s; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .gh-head-inner { padding: 0 20px; }
  .gh-head-menu { display: none; }
  .gh-burger { display: flex; }
  .gh-head-menu.is-open {
    display: flex; flex-direction: column;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    padding: 20px; gap: 16px; z-index: 99;
  }
  .gh-hero { padding: 56px 20px 48px; }
  .gh-page { padding: 0 20px; }
  .gh-section { padding: 48px 0; }
  .gh-features-grid { grid-template-columns: 1fr; }
  .gh-features-grid.two-col { grid-template-columns: 1fr 1fr; }
  .gh-post-header { padding: 40px 20px 28px; }
  .gh-post-cover { padding: 0 20px; }
  .gh-content { padding: 0 20px 60px; }
  .kg-width-wide { margin-left: 0; margin-right: 0; }
  .gh-foot-inner { flex-direction: column; padding: 40px 20px 28px; }
  .gh-foot-bottom { flex-direction: column; text-align: center; padding: 16px 20px; }
  .gh-foot-disclaimer { text-align: center; }
  .gh-subscribe-section-inner { padding: 56px 20px; }
  .gh-tag-header { padding: 48px 20px 32px; }
  .gh-subscribe-form input[type="email"] { min-width: 0; }
}
@media (max-width: 480px) {
  .gh-subscribe-form form { flex-direction: column; gap: 8px; }
  .gh-subscribe-form input[type="email"] { border-right: 1.5px solid var(--border); border-radius: 8px; }
  .gh-subscribe-form button[type="submit"] { border-radius: 8px; text-align: center; }
}
