/* =========================================================
   Wealthronic — shared editorial styles
   Forest green + cream financial-newspaper aesthetic
   ========================================================= */

:root {
  /* Color */
  --ink:        #14201a;
  --ink-2:      #3d4a43;
  --ink-3:      #7c8780;
  --ink-4:      #b3b8b0;
  --paper:      #ffffff;
  --cream:      #f3ecdb;
  --cream-soft: #faf5e8;
  --cream-deep: #e9e0c8;
  --line:       #d8d0bd;
  --line-soft:  #e7e0cf;
  --forest:     #1f3d2d;
  --forest-2:   #29543b;
  --forest-3:   #3d6e51;
  --moss:       #7a9b7f;
  --gold:       #b07c3a;
  --signal:     #a4332a;

  /* Type */
  --serif:  "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans:   "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:   "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Spacing scale */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  /* Container */
  --container: 1240px;
  --gutter: 32px;

  /* Radius */
  --r1: 2px; --r2: 4px; --r3: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--forest-2); text-decoration-thickness: 2px; }

::selection { background: var(--forest); color: var(--cream-soft); }

/* Type helpers */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  font-weight: 500;
}
.eyebrow.muted { color: var(--ink-3); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 5.2vw, 76px); line-height: 1.02; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.08; }
h3 { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; }
h4 { font-size: 17px; line-height: 1.3; }

p { margin: 0; text-wrap: pretty; }

/* Container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.masthead-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-soft);
}
.masthead-top .date { letter-spacing: 0.16em; }
.masthead-top .tickers { display: flex; gap: 20px; }
.masthead-top .tick { display: inline-flex; gap: 6px; }
.masthead-top .tick b { color: var(--ink); font-weight: 500; }
.masthead-top .tick .up { color: var(--forest-2); }
.masthead-top .tick .dn { color: var(--signal); }

.masthead-brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 18px;
  gap: 24px;
}
.brand {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 38px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand .dot { color: var(--forest); }
.brand-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-left: 1px solid var(--line);
  padding-left: 14px;
  margin-left: 10px;
  line-height: 1.4;
}
.brand-side {
  display: flex; align-items: center; gap: 10px;
}

.nav {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
}
.nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 28px;
}
.nav a {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav a:hover { color: var(--forest); }
.nav a.active { color: var(--forest); }
.nav-search {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  border: 1px solid var(--line); padding: 7px 12px; border-radius: var(--r1);
  background: var(--cream-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  padding: 11px 18px; border-radius: var(--r1);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
/* Author avatar — when a profile picture exists, fill the circle */
.av.has-photo, .av-big.has-photo { padding: 0; overflow: hidden; background: var(--cream-deep); }
.av.has-photo img, .av-big.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.btn-primary, a.btn-primary { background: var(--forest); color: var(--cream-soft); }
.btn-primary:hover, a.btn-primary:hover { background: var(--forest-2); color: var(--cream-soft); }
.btn-ghost, a.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover, a.btn-ghost:hover { background: var(--ink); color: var(--cream-soft); }
.btn-link {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0; background: none; border: 0; color: var(--forest);
  border-bottom: 1px solid var(--forest);
  padding-bottom: 2px;
}
.btn-link:hover { color: var(--forest-2); border-color: var(--forest-2); }

/* ---------- Cards / Article previews ---------- */
.kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--forest);
  display: inline-flex; align-items: center; gap: 8px;
}
.kicker::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  background: var(--forest); border-radius: 50%;
}
.kicker.gold { color: var(--gold); }
.kicker.gold::before { background: var(--gold); }
.kicker.ink { color: var(--ink); }
.kicker.ink::before { background: var(--ink); }

.byline {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}
.byline b { color: var(--ink); font-weight: 500; }
.byline .sep { padding: 0 8px; color: var(--ink-4); }

.headline-link {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 200ms ease;
}
.headline-link:hover { background-size: 100% 1px; color: var(--ink); }

.dek {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink-2);
  font-weight: 400;
  font-style: italic;
}

.story { display: flex; flex-direction: column; gap: 10px; }
.story .thumb {
  aspect-ratio: 16/10;
  background: var(--cream-deep);
  position: relative; overflow: hidden;
}
.story .thumb.tall { aspect-ratio: 4/5; }
.story .thumb.square { aspect-ratio: 1/1; }
.story .thumb.wide  { aspect-ratio: 21/9; }
.story h3 { font-size: 22px; line-height: 1.18; }
.story.small h3 { font-size: 17px; line-height: 1.25; }
.story.small .dek { font-size: 14.5px; }
.story.large h3 { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.1; }

/* Placeholder imagery */
.ph {
  background:
    repeating-linear-gradient(135deg, transparent 0 12px, rgba(31,61,45,0.04) 12px 13px),
    linear-gradient(180deg, #ddd2b6, #c9bea0);
  position: relative;
  color: var(--forest);
  display: flex; align-items: flex-end; justify-content: flex-start;
}
.ph::after {
  content: attr(data-label);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--forest);
  background: rgba(243,236,219,0.85);
  padding: 4px 8px;
  margin: 10px;
  border: 1px solid rgba(31,61,45,0.15);
}
.ph.tone-2 { background:
  repeating-linear-gradient(135deg, transparent 0 12px, rgba(255,255,255,0.05) 12px 13px),
  linear-gradient(180deg, #2a5238, #1f3d2d);
  color: var(--cream);
}
.ph.tone-2::after { background: rgba(20,32,26,0.55); color: var(--cream); border-color: rgba(243,236,219,0.2); }
.ph.tone-3 { background:
  repeating-linear-gradient(135deg, transparent 0 12px, rgba(31,61,45,0.06) 12px 13px),
  linear-gradient(180deg, #f3ecdb, #e3d7b8);
}

/* Divider lines */
.rule { height: 1px; background: var(--line); border: 0; }
.rule.heavy { background: var(--ink); }
.rule.dashed { height: 0; border: 0; border-top: 1px dashed var(--line); background: none; }

/* Grids */
.grid { display: grid; gap: var(--s6); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Footer */
.footer {
  background: var(--ink);
  color: var(--cream);
  padding: 64px 0 32px;
  margin-top: 80px;
}
.footer h4 {
  color: var(--cream);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 14px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer a { color: var(--cream); text-decoration: none; opacity: 0.85; font-size: 14px; }
.footer a:hover { opacity: 1; text-decoration: underline; }
.footer .brand { color: var(--cream); }
.footer .brand .dot { color: var(--moss); }
.footer-bottom {
  border-top: 1px solid rgba(243,236,219,0.15);
  margin-top: 48px;
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(243,236,219,0.6);
}

/* Ad placeholder */
.ad-slot {
  border: 1px dashed var(--line);
  background: var(--cream-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3);
  min-height: 90px;
}
.ad-slot.leaderboard { min-height: 110px; }
.ad-slot.rect { min-height: 250px; }
.ad-slot.sky { min-height: 600px; }
.ad-label { padding: 6px 10px; }

/* Newsletter inline */
.newsletter-card {
  background: var(--forest);
  color: var(--cream);
  padding: 36px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
}
.newsletter-card h3 {
  color: var(--cream);
  font-size: 32px;
  line-height: 1.1;
}
.newsletter-card .eyebrow { color: var(--moss); }
.newsletter-card form { display: flex; gap: 8px; }
.newsletter-card input {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(243,236,219,0.4);
  color: var(--cream);
  padding: 13px 14px;
  font-family: var(--sans);
  font-size: 14px;
  border-radius: var(--r1);
}
.newsletter-card input::placeholder { color: rgba(243,236,219,0.5); }
.newsletter-card .btn-primary { background: var(--cream); color: var(--ink); }
.newsletter-card .btn-primary:hover { background: var(--cream-soft); }
.newsletter-card .fineprint {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(243,236,219,0.6);
  margin-top: 12px;
}

/* Section heading */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 28px;
}
.section-head h2 { font-size: 28px; line-height: 1; }
.section-head .meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}

/* Utility */
.muted { color: var(--ink-3); }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }

@media (max-width: 900px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .masthead-top .tickers { display: none; }
  .nav ul { gap: 18px; overflow-x: auto; white-space: nowrap; }
  .newsletter-card { grid-template-columns: 1fr; padding: 24px; }
}
