/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --color-bg: #ffffff;
  --color-surface: #f7f9fa;
  --color-navy: #14324d;      /* primary — finance trust */
  --color-navy-light: #1f4a6e;
  --color-green: #2e7d5b;     /* accent — health */
  --color-gold: #b5822a;      /* affiliate / CTA highlight */
  --color-text: #1a1a1a;
  --color-text-muted: #55606b;
  --color-border: #e4e7eb;
  --radius: 10px;
  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-base: 19px;
  --max-width: 1180px;
}

/* Admin-adjustable overrides land on <html> as inline custom props */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--color-navy); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-navy);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Visible keyboard focus everywhere — required for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   HEADER / TRUST BAR / HAMBURGER
   ============================================================ */
.masthead {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 100;
}

.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 16px;
}

.hamburger-btn {
  background: none;
  border: 2px solid var(--color-navy);
  border-radius: 8px;
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-navy);
  border-radius: 2px;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--color-navy);
  text-decoration: none;
  text-align: center;
  flex: 1;
}
.site-title small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
}

.header-actions { width: 48px; flex-shrink: 0; }

.trust-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.trust-bar .container {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 8px 48px;
  justify-content: center;
}
.trust-bar span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.trust-bar .dot { color: var(--color-green); font-weight: 900; }
.trust-bar-close {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--color-text-muted);
  padding: 4px 8px;
}
.trust-bar-close:hover { color: var(--color-text); }

/* Slide-out nav drawer */
.nav-drawer {
  position: fixed;
  top: 0; left: 0;
  height: 100%;
  width: min(320px, 85vw);
  background: var(--color-navy);
  color: #fff;
  z-index: 200;
  transform: translateX(-105%);
  transition: transform 0.25s ease;
  padding: 24px;
  overflow-y: auto;
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer h2 { color: #fff; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.08em; }
.nav-drawer a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 14px 4px;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.nav-drawer a:hover { color: var(--color-gold); }
.nav-drawer-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  float: right;
  line-height: 1;
}
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: var(--color-navy);
  color: #fff;
  padding: 56px 24px;
  text-align: center;
}
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.8rem); max-width: 760px; margin: 0 auto 0.4em; }
.hero p { color: rgba(255,255,255,0.85); max-width: 600px; margin: 0 auto; font-size: 1.15rem; }

/* ============================================================
   FEATURED CAROUSEL (horizontal scroll)
   ============================================================ */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 48px 0 20px;
}
.section-heading h2 { margin: 0; font-size: 1.6rem; }
.section-heading .eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-green);
  font-weight: 700;
  margin-bottom: 4px;
}

.carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { height: 8px; }
.carousel::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: 0 8px 24px rgba(20,50,77,0.12); transform: translateY(-2px); }

.carousel .card { flex: 0 0 300px; scroll-snap-align: start; }

.card-img { width: 100%; height: 170px; object-fit: cover; background: var(--color-surface); }
.card-body { padding: 16px; }
.card-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
}
.card-category.finance { background: #e9f0f6; color: var(--color-navy); }
.card-category.health { background: #e8f3ee; color: var(--color-green); }
.card-title { font-size: 1.1rem; margin-bottom: 6px; }
.card-summary { color: var(--color-text-muted); font-size: 0.92rem; margin-bottom: 0; }
.card-meta { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 10px; }

/* Blog grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn {
  border: 2px solid var(--color-border);
  background: #fff;
  padding: 10px 18px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.filter-btn.active { border-color: var(--color-navy); color: var(--color-navy); background: var(--color-surface); }

/* ============================================================
   SINGLE POST VIEW
   ============================================================ */
.post-view { padding-top: 40px; padding-bottom: 80px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}
.post-view h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.post-media { box-sizing: border-box; width: 100%; max-width: 100%; }
.post-hero-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin: 20px 0; box-sizing: border-box; }
.post-video { position: relative; width: 100%; padding-top: 56.25%; margin: 24px 0; border-radius: var(--radius); overflow: hidden; }
.post-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-content { font-size: 1.15rem; line-height: 1.75; max-width: 760px; }
.post-content img { border-radius: var(--radius); margin: 16px 0; max-width: 100%; box-sizing: border-box; }

.author-line { display: flex; align-items: center; gap: 6px; color: var(--color-text-muted); font-size: 0.95rem; margin: 10px 0 20px; }
.verified-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--color-green); color: #fff; font-size: 0.7rem; line-height: 1;
}
.card-category.other { background: var(--color-surface); color: var(--color-text-muted); }

.affiliate-box {
  background: #fdf6ea;
  border: 1px solid #ecdcb5;
  border-radius: var(--radius);
  padding: 20px;
  margin: 28px 0;
}
.affiliate-box .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-gold); font-weight: 700; margin-bottom: 10px; display: block; }
.affiliate-link {
  display: inline-block;
  background: var(--color-gold);
  color: #fff;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 700;
  margin: 4px 8px 4px 0;
}
.affiliate-disclosure { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 10px; }

.post-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
  margin: 28px 0;
}
.action-btn {
  border: 2px solid var(--color-border);
  background: #fff;
  border-radius: 100px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
}
.action-btn.liked { border-color: var(--color-green); color: var(--color-green); background: #eef8f3; }

/* Reviews / comments */
.reviews h2 { font-size: 1.4rem; }
.review-form {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.star-input { display: flex; gap: 6px; margin-bottom: 12px; }
.star-input button { background: none; border: none; font-size: 1.6rem; color: var(--color-border); }
.star-input button.selected { color: var(--color-gold); }

.review-item {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}
.review-item .rname { font-weight: 700; }
.review-item .rstars { color: var(--color-gold); letter-spacing: 2px; font-size: 0.9rem; }
.review-item .rdate { color: var(--color-text-muted); font-size: 0.82rem; }

/* ============================================================
   FORMS (shared: newsletter / contact / login / review)
   ============================================================ */
label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], textarea, select {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-body);
  margin-bottom: 16px;
  background: #fff;
  color: var(--color-text);
}
textarea { min-height: 120px; resize: vertical; }

.btn {
  display: inline-block;
  background: var(--color-navy);
  color: #fff;
  border: none;
  padding: 14px 26px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
}
.btn:hover { background: var(--color-navy-light); }
.btn.secondary { background: #fff; color: var(--color-navy); border: 2px solid var(--color-navy); }
.btn.green { background: var(--color-green); }
.btn.full { width: 100%; text-align: center; }

.form-msg { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.form-msg.success { background: #e8f3ee; color: var(--color-green); }
.form-msg.error { background: #fbeaea; color: #a33232; }

/* ============================================================
   NEWSLETTER / CONTACT
   ============================================================ */
.newsletter {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  margin: 64px 0;
}
.newsletter form { max-width: 460px; margin: 20px auto 0; display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter input { margin-bottom: 0; flex: 1; min-width: 200px; }

.contact-section { margin: 64px 0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { background: var(--color-navy); color: #fff; border-radius: var(--radius); padding: 28px; }
.contact-info h3 { color: #fff; }
.contact-info a { color: #fff; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--color-navy);
  color: rgba(255,255,255,0.75);
  padding: 40px 24px;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 64px;
}
footer a { color: #fff; }

/* ============================================================
   MISC
   ============================================================ */
.hidden { display: none !important; }
.loading-spinner {
  border: 3px solid var(--color-border);
  border-top-color: var(--color-navy);
  border-radius: 50%;
  width: 32px; height: 32px;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }
