/* =========================================================
   Chartnote Blog — Brand overrides (Brand Manual v1.0, Nov 2026) + v1.1 fixes
   Load AFTER the base stylesheet (last <link> in <head>).
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Arvo:wght@700&family=Roboto:wght@400;500;700&display=swap");

:root {
  /* Brand palette */
  --cn-blue-500: #799AF1;  /* logo blue: graphics, icons, big highlighted words */
  --cn-blue-700: #4C6CBF;  /* buttons, links, eyebrows, bands */
  --cn-blue-300: #BBCBF7;  /* borders, gradient end */
  --cn-blue-100: #E8EEFC;  /* heroes, cards, soft backgrounds */
  --cn-ink:      #242424;  /* every headline + body text */
  --cn-gold-400: #F5C142;  /* one highlight / badge max */

  /* Map onto the theme's existing variables */
  --paper: #ffffff;
  --paper-deep: var(--cn-blue-100);
  --ink: var(--cn-ink);
  --muted: #5b6272;
  --line: #dfe6f8;
  --accent: var(--cn-blue-700);
  --accent-soft: var(--cn-blue-100);
  --periwinkle: var(--cn-blue-500);

  /* Typography: Rockwell → Arvo Bold on web; everything else Roboto. No third family. */
  --serif: Rockwell, "Rockwell Std", "Arvo", Georgia, serif;
  --sans: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --mono: "Roboto", "Helvetica Neue", Arial, sans-serif;

  --radius: 14px;          /* containers */
  --cn-radius-btn: 8px;    /* buttons */
  --cn-shadow: 0 8px 24px rgba(76, 108, 191, 0.12); /* soft, blue-tinted */
}

/* ---------- Base ---------- */
body {
  font-family: var(--sans);
  color: var(--cn-ink);
  background: #fff;
}
h1, h2, h3, .featured h2, .story h2 {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--cn-ink);
  letter-spacing: -0.01em;
}
a { color: var(--cn-blue-700); }

/* ---------- Header + official logo ---------- */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .brand { display: inline-flex; align-items: center; gap: 10px; }
.site-header .brand img.cn-logo { height: 38px; width: auto; display: block; }
.site-header .brand-blog {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cn-blue-700);
  background: var(--cn-blue-100);
  padding: 4px 10px;
  border-radius: 999px;
}
.primary-nav a, .compare-toggle { color: var(--cn-ink); font-family: var(--sans); font-weight: 500; }
.primary-nav a:hover, .compare-toggle:hover { color: var(--cn-blue-700); }

/* ---------- Buttons (solid Blue 700 or white outline, 8px) ---------- */
.btn, .header-cta .btn {
  background: var(--cn-blue-700) !important;
  color: #fff !important;
  border: 0;
  border-radius: var(--cn-radius-btn);
  font-family: var(--sans);
  font-weight: 700;
  box-shadow: none;
}
.btn:hover { background: #3f5ca8 !important; }
.btn-ghost {
  background: #fff !important;
  color: var(--cn-blue-700) !important;
  border: 1.5px solid var(--cn-blue-700) !important;
  border-radius: var(--cn-radius-btn);
}

/* ---------- Masthead: signature gradient White → 100 → 300 ---------- */
.masthead {
  background: linear-gradient(180deg, #ffffff 0%, var(--cn-blue-100) 100%);
  border-radius: 0 0 28px 28px;
  padding-bottom: 2.5rem;
}
.masthead h1 { color: var(--cn-ink); }
.masthead h1 em {
  display: block;
  font-family: var(--sans) !important;
  font-style: normal !important;
  font-weight: 400;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  letter-spacing: 0;
  color: var(--cn-blue-700);
  margin-top: .75rem;
}

/* Category filters as pills */
.filters { gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 1.75rem; }
.filters a {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--cn-blue-700);
  background: #fff;
  border: 1px solid var(--cn-blue-300);
  border-radius: 999px;
  padding: 6px 14px;
  text-decoration: none;
}
.filters a:hover { background: var(--cn-blue-100); }
.filters a[aria-current="page"] {
  background: var(--cn-blue-700);
  border-color: var(--cn-blue-700);
  color: #fff;
}

/* ---------- Featured post ---------- */
.featured {
  background: var(--cn-blue-100);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--cn-shadow);
}
.featured-media img { border-radius: var(--radius); }
.featured h2, .featured h2 a { color: var(--cn-ink); }
.featured h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  line-height: 1.15;
}

/* ---------- Story cards ---------- */
.story-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 28px !important;
  align-items: stretch;
}
.story-grid .story { grid-column: auto !important; grid-row: auto !important; margin: 0 !important; width: auto !important; }
.story {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--cn-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  padding-bottom: 18px;
}
.story:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(76,108,191,.18); }
.story-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--cn-blue-100); }
.story-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story h2, .story .meta-row { padding-left: 20px; padding-right: 20px; }
.story h2 { font-size: 1.3rem; line-height: 1.25; margin-top: 16px; }
.story h2 a { color: var(--cn-ink); text-decoration: none; }
.story h2 a:hover { color: var(--cn-blue-700); }

/* Eyebrows / tags */
.tag, .kicker, .compare-kicker {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cn-blue-700);
  background: var(--cn-blue-100);
  border-radius: 999px;
  padding: 3px 10px;
  text-decoration: none;
}
.meta-quiet { font-family: var(--sans); color: var(--muted); font-size: 13px; }

/* ---------- CTA band + newsletter ---------- */
.band {
  background: var(--cn-blue-100);
  border-radius: var(--radius);
}
.newsletter { background: #fff; border-top: 1px solid var(--line); }

/* Pagination */
.pager a { border-radius: var(--cn-radius-btn); font-family: var(--sans); }
.pager a[aria-current="page"] { background: var(--cn-blue-700); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--cn-blue-100); color: var(--cn-ink); }
.site-footer h2 { font-family: var(--sans); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--cn-blue-700); }
.site-footer a { color: var(--cn-ink); }
.site-footer a:hover { color: var(--cn-blue-700); }
.footer-brand img.cn-logo { height: 32px; width: auto; }

/* =========================================================
   v1.1 fixes (preview QA). Same palette + fonts; #3f5ca8 is the
   hover shade already used above, reused for small text on Blue 100.
   ========================================================= */
:root { --cn-blue-700-text: #3f5ca8; } /* 4.99:1 → 5.5:1+ on Blue 100; Blue 700 on Blue 100 is only 4.3:1 */

/* 1. Small text on Blue 100 must pass WCAG AA (Blue 700 = 4.3:1) */
.site-header .brand-blog,
.tag, .kicker, .compare-kicker,
.site-footer h2 { color: var(--cn-blue-700-text); }

/* 2. Hero as an inset rounded card (target look), not full-bleed */
.masthead {
  max-width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
  border-radius: 0 0 28px 28px;
}
.masthead h1 em { margin-top: 1.5rem; color: var(--cn-blue-700-text); }

/* 3. Ghost button hover: .btn:hover turned it Blue-on-dark-blue (invisible) */
.btn-ghost:hover { background: var(--cn-blue-100) !important; color: var(--cn-blue-700) !important; }

/* 4. CTA band: theme's white-on-navy text became white-on-Blue-100 */
.band, .band h2 { color: var(--cn-ink); }
.band p { color: var(--muted); }
.band h2 { line-height: 1.2; }

/* 5. Card body text sat flush against the card edge */
.story p, .story .excerpt, .story > :not(.story-media):not(h2):not(.meta-row) { padding-left: 20px; padding-right: 20px; }
.story .meta-row { margin-top: 16px; }

/* 6. Grid never forces 300px columns wider than the viewport */
.story-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)) !important; }

/* 7. Newsletter form: brand inputs + no overflow on phones */
.newsletter input[type="email"], .newsletter input[type="text"] {
  font-family: var(--sans);
  border: 1px solid var(--cn-blue-300);
  border-radius: var(--cn-radius-btn);
  background: #fff;
  min-width: 0;
  flex: 1 1 auto;
}
.newsletter input:focus { outline: 2px solid var(--cn-blue-700); outline-offset: 1px; border-color: var(--cn-blue-700); }
.newsletter form { max-width: 100%; }

/* 8. Pager: non-current pages in brand colors */
.pager a { color: var(--cn-blue-700); border-color: var(--cn-blue-300); }
.pager a[aria-current="page"] { border-color: var(--cn-blue-700); }

/* 9. Footer divider was white-on-light (invisible) */
.site-footer .legal, .site-footer hr { border-color: var(--line); color: var(--muted); }

/* 10. Keyboard focus + reduced motion */
a:focus-visible, button:focus-visible, .btn:focus-visible { outline: 2px solid var(--cn-blue-700); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .story, .story:hover { transition: none; transform: none; } }

/* 11. Mobile */
@media (max-width: 640px) {
  .site-header .brand img.cn-logo { height: 30px; }
  .site-header .brand-blog { font-size: 10px; padding: 3px 8px; }
  .masthead { max-width: none; margin-inline: 12px; border-radius: 0 0 20px 20px; padding-bottom: 1.75rem; }
  .filters { gap: 6px; }
  .filters a { font-size: 12px; padding: 5px 12px; }
  .featured { border-radius: 12px; padding: 20px; }
  .band { padding: 28px 24px; }
  .newsletter form { flex-direction: column; width: 100%; }
  .newsletter form .btn { width: 100%; }
}
