/*
 * Referral Code Geek child theme chrome and palette.
 * Prefix: cgk- (not used on FOMO, Duel, BB, HIS or .io).
 * Existing post markup uses rcg-* classes; those class names stay in the content.
 * This file remaps rcg tokens so tables and review blocks pick up the new palette
 * without any copy edits.
 */

:root, body.cgk-site {
  --cgk-canvas: #F4F1EA;
  --cgk-paper: #FFFDF8;
  --cgk-ink: #22252A;
  --cgk-mute: #5E646E;
  --cgk-line: #D2CDC4;
  --cgk-accent: #3A7A55;
  --cgk-accent-ink: #FFFFFF;
  --cgk-link: #245E8A;
  --cgk-header: #22252A;
  --cgk-header-ink: #F4F1EA;
  --cgk-mark: #C9A227;
  --cgk-font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cgk-font-head: "Newsreader", Georgia, "Times New Roman", serif;
  --cgk-max: 1100px;
}

body.cgk-site {
  background: var(--cgk-canvas);
  color: var(--cgk-ink);
  font-family: var(--cgk-font-body);
  margin: 0;
}

.cgk-skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.cgk-skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: var(--cgk-paper);
  color: var(--cgk-ink);
  padding: 8px 12px;
}

.cgk-wrap {
  max-width: var(--cgk-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.cgk-header {
  background: var(--cgk-header);
  color: var(--cgk-header-ink);
  border-bottom: 1px solid #3A3E45;
}
.cgk-header .cgk-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  flex-wrap: wrap;
}
.cgk-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--cgk-header-ink);
  text-decoration: none;
  font-family: var(--cgk-font-head);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.cgk-brand img {
  height: 40px;
  width: auto;
  display: block;
  border-radius: 8px;
}
.cgk-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.95rem;
}
.cgk-nav a {
  color: var(--cgk-header-ink);
  text-decoration: none;
  opacity: 0.9;
}
.cgk-nav a:hover,
.cgk-nav a:focus {
  color: #FFFFFF;
  text-decoration: underline;
  opacity: 1;
}

.cgk-main {
  min-height: 50vh;
}

.cgk-footer {
  background: var(--cgk-header);
  color: #C8CBD0;
  border-top: 1px solid #3A3E45;
  padding: 1.5rem 0 2rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.cgk-footer-line {
  margin: 0;
}

/* Headings in chrome and as a site default. Does not rewrite heading text. */
body.cgk-site h1,
body.cgk-site h2,
body.cgk-site h3 {
  font-family: var(--cgk-font-head);
  color: var(--cgk-ink);
  letter-spacing: -0.015em;
}
body.cgk-site a {
  color: var(--cgk-link);
}

/* Remap existing rcg-* content tokens to the new palette. Class names stay.
   Include .rcg-rev (review pages); otherwise body.cgk-site h1/a would paint
   dark ink onto the still-dark inline palette and break contrast. */
.rcg,
.rcg-wrap,
.rcg-rev,
body.cgk-site .rcg,
body.cgk-site .rcg-wrap,
body.cgk-site .rcg-rev {
  --bg: var(--cgk-canvas);
  --paper: var(--cgk-paper);
  --line: var(--cgk-line);
  --ink: var(--cgk-ink);
  --mute: var(--cgk-mute);
  --lime: var(--cgk-accent);
  --cyan: var(--cgk-link);
  --sage: var(--cgk-accent);
  font-family: var(--cgk-font-body);
  color: var(--cgk-ink);
  background: transparent;
}
.rcg-header,
.rcg-footer {
  /* If the old injector still prints these, hide the duplicate chrome.
     Remove this block once that injector is off. */
}
body.cgk-site header.rcg-header,
body.cgk-site footer.rcg-footer {
  display: none;
}

.rcg-code { color: var(--cgk-accent); }
.rcg-copy { color: var(--cgk-accent); }
.rcg-linkbtn,
.rcg-revbtn {
  border-color: var(--cgk-link);
  color: var(--cgk-link);
}
.rcg-btn-lime { background: var(--cgk-accent); color: var(--cgk-accent-ink); }
.rcg-btn-cyan { color: var(--cgk-link); border-color: var(--cgk-link); }
.rcg-chip { border-color: var(--cgk-accent); color: var(--cgk-accent); background: rgba(58,122,85,0.1); }
.rcg-word .c { color: var(--cgk-accent); }
.rcg-word .g { color: var(--cgk-link); }

@media (max-width: 800px) {
  .cgk-header .cgk-wrap { padding: 0.75rem 1rem; }
  .cgk-brand { font-size: 1.05rem; }
}


/* Contrast fixes (30 Nov 2026 follow-up). Override inline #111 / #c8dccb
   that fail on the remapped moss palette. Ratios reported in the QA note. */
body.cgk-site a.rcg-btn-lime,
body.cgk-site .rcg-btn-lime,
body.cgk-site .rcg-rev a.btn {
  background-color: #3A7A55;
  color: #FFFFFF;
}

body.cgk-site .rcg-chip,
body.cgk-site .rcg-rev .chip {
  color: #1F5138;
  border-color: #1F5138;
  background: #E1E5DB;
}
body.cgk-site .rcg-chip::before {
  background: #1F5138;
}

body.cgk-site .rcg-copy {
  color: #3A7A55;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
body.cgk-site .rcg-copy svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}
