/* ============================================================
   CommonHelpSource — Design System
   Shared tokens, header, footer, and global overrides.
   Load AFTER Tailwind/DaisyUI so these take precedence.
   ============================================================ */

/* ── DESIGN TOKENS ───────────────────────────────────────── */
:root {
  /* Canonical newsletter and worksheet palette. Keep these tokens as the
     single visual source of truth for public pages and generated tools. */
  --ink:      #172522;
  --paper:    #fffdf8;
  --cream:    #f6f1e7;
  --white:    #fffefb;
  --red:      #b84933;
  --teal:     #386b68;
  --teal-dk:  #285452;
  --gold:     #d8a94c;
  --sage:     #3f7658;
  --navy:     #294b6a;
  --muted:    #64706c;
  --rule:     #b7b0a4;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
}

/* ── GLOBAL BASE ─────────────────────────────────────────── */
body {
  font-family: var(--font-body) !important;
  -webkit-font-smoothing: antialiased;
}

/* A visible, consistent keyboard location is part of the visual system. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--gold) !important;
  outline-offset: 3px !important;
  box-shadow: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── TOP STRIPE ──────────────────────────────────────────── */
.chs-top-stripe {
  height: 4px;
  background: var(--red);
  width: 100%;
}

/* ── SITE HEADER ─────────────────────────────────────────── */
.chs-header {
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 9999;
}
.chs-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.chs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.chs-brand img { height: 28px; width: auto; }
.chs-brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--paper);
  letter-spacing: -0.3px;
}
.chs-brand-name span { color: var(--red); }

.chs-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.chs-nav a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.6);
  text-decoration: none;
  padding: 9px 10px;
  transition: color 0.15s;
}
.chs-nav a:hover { color: var(--paper); }
.chs-nav a[aria-current="page"] {
  color: var(--paper);
  box-shadow: inset 0 -2px 0 var(--red);
}
.chs-nav a.chs-nav-cta {
  background: var(--red);
  color: var(--paper) !important;
  margin-left: 8px;
  padding: 6px 14px;
}
.chs-nav a.chs-nav-cta:hover { background: #a93225; }

.chs-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.chs-menu-btn span {
  width: 21px;
  height: 2px;
  display: block;
  margin: 4px 0;
  background: var(--paper);
}
.chs-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chs-department-context {
  position: relative;
  z-index: 9997;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.chs-department-context > div {
  display: flex;
  box-sizing: border-box;
  width: min(1280px, 100%);
  min-height: 38px;
  margin: 0 auto;
  padding: 8px 24px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}
.chs-department-context span {
  color: var(--red);
  font: 700 9px/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.chs-department-context a { color: var(--ink); font-weight: 800; }
.chs-department-context b { color: #aaa197; font-weight: 400; }
.chs-department-context strong { color: var(--muted); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.chs-department-documentation { box-shadow: inset 5px 0 0 #2c4a6e; }
.chs-department-practice { box-shadow: inset 5px 0 0 var(--teal); }
.chs-department-navigation { box-shadow: inset 5px 0 0 var(--sage); }
.chs-language-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
}
.chs-language-switch button {
  min-width: 34px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(245,240,232,.68);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: .08em;
  cursor: pointer;
}
.chs-language-switch button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
}
.chs-skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 10001;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
}
.chs-skip-link:focus { top: 12px; }

@media (max-width: 920px) {
  .chs-nav { display: none; }
  .chs-menu-btn { display: block; }
  .chs-nav.chs-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: fixed;
    top: 64px;
    left: 0; right: 0;
    background: var(--ink);
    padding: 16px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 9998;
  }
  .chs-nav.chs-open a { width: 100%; padding: 12px 0; }
  .chs-nav.chs-open a[aria-current="page"] { box-shadow: none; color: var(--paper); }
  .chs-nav.chs-open .chs-nav-cta { margin: 8px 0 0; padding: 10px 14px; width: auto; }
}
@media (max-width: 560px) {
  .chs-brand-name { font-size: 16px; }
  .chs-header-inner { padding-inline: 14px; }
  .chs-header-actions { gap: 8px; }
  .chs-department-context > div { flex-wrap: wrap; gap: 5px 8px; padding-inline: 16px; }
}

/* ── PAGE TITLE BAR ──────────────────────────────────────── */
.chs-page-title {
  background: var(--ink);
  padding: 40px 24px 44px;
  text-align: left;
}
.chs-page-title-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.chs-page-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
  display: block;
}
.chs-page-title h1 {
  font-family: var(--font-display) !important;
  font-size: clamp(28px, 5vw, 52px) !important;
  font-weight: 900 !important;
  letter-spacing: -1px !important;
  color: var(--paper) !important;
  line-height: 1.1 !important;
  margin: 0 0 12px !important;
}
.chs-page-title p {
  font-size: 16px;
  color: rgba(245,240,232,0.55);
  max-width: 560px;
  line-height: 1.65;
  margin: 0;
}

/* ── SITE FOOTER ─────────────────────────────────────────── */
.chs-footer {
  background: #111110;
  padding: 56px 24px 32px;
  margin-top: auto;
}
.chs-footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.7fr repeat(4,1fr);
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 768px) {
  .chs-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .chs-footer-grid { grid-template-columns: 1fr; }
}
.chs-footer-brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--paper);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.chs-footer-brand span { color: var(--red); }
.chs-footer-desc {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,253,248,0.72);
  max-width: 260px;
}
.chs-footer-language {
  max-width: 300px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,253,248,.72);
  font-size: 11px;
  line-height: 1.6;
}
.chs-footer-col h4 {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,253,248,0.62);
  margin-bottom: 16px;
}
.chs-footer-col ul { list-style: none; padding: 0; margin: 0; }
.chs-footer-col ul li { margin-bottom: 10px; }
.chs-footer-col ul a {
  font-size: 13px;
  color: rgba(255,253,248,0.76);
  text-decoration: none;
  transition: color 0.15s;
}
.chs-footer-col ul a:hover { color: var(--paper); }
.chs-footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.chs-footer-bottom p {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255,253,248,0.62);
}
.chs-footer-support {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.chs-footer-support:hover { opacity: 1; }

/* ── CONTENT WRAPPER ──────────────────────────────────────── */
.chs-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

/* ── SHARED BUTTON OVERRIDES ──────────────────────────────── */
/* Kills the AI blue gradient on any leftover Tailwind buttons */
.bg-blue-600,
.bg-blue-700,
.hover\:bg-blue-700:hover {
  background-color: var(--teal) !important;
}
a.bg-blue-600,
button.bg-blue-600 {
  background-color: var(--teal) !important;
}

/* ── ASSESSMENT CARD OVERRIDES ────────────────────────────── */
/* Replace blue top-border cards with ink */
.border-blue-600 { border-color: var(--teal) !important; }
.text-blue-600   { color: var(--teal) !important; }
.bg-blue-100     { background-color: #e0f0f0 !important; }

/* Soften over-rounded cards */
.rounded-xl { border-radius: 4px !important; }
.rounded-lg { border-radius: 3px !important; }
.rounded-full { border-radius: 50% !important; } /* keep circles circular */

/* Tone down heavy shadows */
.shadow-lg  { box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important; }
.shadow-xl  { box-shadow: 0 4px 16px rgba(0,0,0,0.10) !important; }

/* ── FORM ELEMENT OVERRIDES ───────────────────────────────── */
input[type="text"], input[type="number"], input[type="email"],
select, textarea {
  border-radius: 2px !important;
  border-color: var(--rule) !important;
  font-family: var(--font-body) !important;
}
input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: var(--teal) !important;
  box-shadow: 0 0 0 2px rgba(42,107,107,0.15) !important;
}

/* ── PROGRESS / STEP INDICATORS ───────────────────────────── */
.steps .step:before,
.steps .step:after {
  background-color: var(--teal) !important;
}
.step-primary + .step:before,
.steps .step-primary:after {
  background-color: var(--teal) !important;
}

/* ── RADIO / CHECKBOX ANSWERS ─────────────────────────────── */
.answer-btn, .answer-option {
  border-radius: 2px !important;
}

/* ── TAILWIND GRADIENT / BLUE KILLSWITCH ──────────────────── */
/* Any element using Tailwind's blue/purple gradient classes   */
[class*="from-blue"],
[class*="from-purple"],
[class*="from-indigo"] {
  --tw-gradient-from: #2a6b6b !important;
}
[class*="to-purple"],
[class*="to-blue"],
[class*="to-indigo"] {
  --tw-gradient-to: #1f5252 !important;
}
/* Hero sections that still use Tailwind gradient pattern */
section[class*="bg-gradient"],
div[class*="bg-gradient"] {
  background: var(--ink) !important;
  background-image: none !important;
}
/* White card overrides — tone to warm white */
.bg-white { background-color: var(--white) !important; }
/* Gray bg overrides */
.bg-gray-50, .bg-gray-100 { background-color: var(--paper) !important; }
/* Blue text overrides */
.text-blue-600, .text-blue-700, .text-blue-800 { color: var(--teal) !important; }
.text-purple-600, .text-purple-700 { color: var(--navy) !important; }
/* Blue bg overrides */
.bg-blue-50, .bg-blue-100 { background-color: #e0f0f0 !important; }
.bg-blue-600, .bg-blue-700 { background-color: var(--teal) !important; }
.bg-purple-600, .bg-purple-700 { background-color: var(--navy) !important; }
/* Border overrides */
.border-blue-500, .border-blue-600 { border-color: var(--teal) !important; }
/* Focus ring */
.focus\:ring-blue-500:focus,
.focus\:border-blue-500:focus {
  --tw-ring-color: rgba(42,107,107,0.35) !important;
  border-color: var(--teal) !important;
}
/* hover:bg overrides */
.hover\:bg-blue-700:hover { background-color: var(--teal-dk) !important; }

/* ── NOTE TYPE SELECTOR ────────────────────────────────────── */
.note-type-option {
  border: 1px solid var(--rule) !important;
  border-radius: 2px !important;
  background: var(--white) !important;
  transition: border-color 0.12s !important;
  box-shadow: none !important;
}
.note-type-option:hover {
  border-color: var(--teal) !important;
  background: var(--paper) !important;
}

/* ── LARGE TAILWIND CARDS ─────────────────────────────────── */
.rounded-xl { border-radius: 2px !important; }
.rounded-lg { border-radius: 2px !important; }
.shadow-lg, .shadow-xl, .shadow-md {
  box-shadow: none !important;
  border: 1px solid var(--rule);
}
/* Accessible status for complete-page Spanish localization. */
.chs-translation-status {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  max-width: min(30rem, calc(100vw - 2rem));
  margin: 0;
  padding: .75rem 1rem;
  border: 1px solid #7aa79d;
  border-radius: .35rem;
  background: #edf7f4;
  color: #123f38;
  box-shadow: 0 8px 24px rgba(18, 63, 56, .16);
  font: 600 .85rem/1.45 Inter, system-ui, sans-serif;
}
.chs-translation-status.is-error {
  border-color: #bd7a68;
  background: #fff1ed;
  color: #7f2f20;
}
.chs-translation-status[hidden] { display: none; }
.chs-tool-access-notice{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem clamp(1rem,4vw,3rem);background:#fff4d8;border-bottom:2px solid #d7a93b;color:#24352f}.chs-tool-access-notice div{display:grid;gap:.25rem}.chs-tool-access-notice strong{font-size:.95rem;line-height:1.45}.chs-tool-access-notice span{font-size:.82rem;line-height:1.4}.chs-tool-access-notice a{flex:0 0 auto;padding:.7rem 1rem;border-radius:.5rem;background:#176b67;color:#fff;font-weight:800;text-decoration:none}.chs-tool-access-notice a:focus-visible{outline:3px solid #24352f;outline-offset:3px}@media(max-width:700px){.chs-tool-access-notice{align-items:stretch;flex-direction:column;gap:.65rem;padding:.75rem 1rem}.chs-tool-access-notice strong{font-size:.86rem;line-height:1.35}.chs-tool-access-notice span{display:none}.chs-tool-access-notice a{padding:.65rem .85rem;text-align:center}}
