/*
Theme Name: Clineo
Template: generatepress
Description: Clineo child theme — brand tokens, light/dark themes, WCAG 2.2 AA+ components.
Version: 1.0.0
*/

/* ============ Design tokens (single source; both themes) ==================== */
:root {
  --bg: #F1F6F4;
  --surface: #E9F1EE;
  --border: #C9DAD5;
  --ink: #0B2027;
  --muted: #40534F;           /* slate-teal darkened for 7:1 on --bg */
  --primary: #0E4C54;
  --interactive: #0C6660;     /* link color, >=7:1 on bg */
  --interactive-hover: #12857E;
  --coral: #FB6B52;           /* the beat — once per view (header CTA) */
  --coral-ink: #0B2027;
  --focus: #0C6660;
  --good: #12857E; --warn: #C98A1E; --crit: #C7442E;
}
[data-theme="dark"] {
  --bg: #061518;
  --surface: #0E272C;
  --border: #1E3D42;
  --ink: #E6F0ED;
  --muted: #A9C0BB;
  --primary: #2FB6AC;
  --interactive: #4FCAC0;
  --interactive-hover: #7FDCD4;
  --coral: #FF7A63;
  --coral-ink: #061518;
  --focus: #4FCAC0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #061518; --surface: #0E272C; --border: #1E3D42; --ink: #E6F0ED;
    --muted: #A9C0BB; --primary: #2FB6AC; --interactive: #4FCAC0;
    --interactive-hover: #7FDCD4; --coral: #FF7A63; --coral-ink: #061518; --focus: #4FCAC0;
  }
}

/* ============ Base ============================================================ */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
.site-content, .entry-content { max-width: 75ch; }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -0.02em; line-height: 1.25; }
h1 { font-size: 2.4rem; font-weight: 600; }
h2 { font-size: 1.75rem; font-weight: 600; margin-top: 2.2rem; }
h3 { font-size: 1.3rem; font-weight: 600; }
a { color: var(--interactive); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--interactive-hover); }
code, pre, .clineo-mono { font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace; }

/* Focus: visible, >=3:1, 3px — WCAG 2.2 */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============ Header / nav ==================================================== */
.site-header, .main-navigation { background: var(--surface); }
.main-navigation .main-nav ul li a { color: var(--ink); font-weight: 500; }
.site-header .main-title a, .site-header .site-logo { color: var(--primary); }

/* Header CTA — the single coral beat per view */
.clineo-cta a, a.clineo-cta {
  background: var(--coral);
  color: var(--coral-ink) !important;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  min-height: 24px;
}
.clineo-cta a:hover, a.clineo-cta:hover { filter: brightness(1.06); }

/* ============ Buttons ========================================================= */
.wp-block-button__link, button, input[type="submit"] {
  background: var(--primary);
  color: #FFFFFF;
  border: 0;
  border-radius: 6px;
  padding: 12px 22px;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
}
[data-theme="dark"] .wp-block-button__link,
[data-theme="dark"] button,
[data-theme="dark"] input[type="submit"] { color: #061518; }
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent; color: var(--interactive); border: 2px solid var(--interactive);
}

/* ============ Content components ============================================= */
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table th, .wp-block-table td {
  border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top;
}
.wp-block-table th { background: var(--surface); }
.wp-block-table { overflow-x: auto; }
.wp-block-group.is-style-clineo-panel, .clineo-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.4rem 1.6rem;
}
.wp-block-separator { border-color: var(--border); }
.wp-block-details { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem 1.2rem; margin-bottom: 0.8rem; }
.wp-block-details summary { font-weight: 600; cursor: pointer; }

/* Forms (Gravity Forms) */
.gform_wrapper label, .gfield_label { color: var(--ink); font-weight: 600; }
.gform_wrapper input[type="text"], .gform_wrapper input[type="email"],
.gform_wrapper input[type="url"], .gform_wrapper input[type="tel"],
.gform_wrapper textarea, .gform_wrapper select {
  background: var(--bg); color: var(--ink); border: 1.5px solid var(--muted);
  border-radius: 6px; padding: 10px 12px; width: 100%; min-height: 44px;
}
.gform_wrapper .gfield_error [aria-invalid="true"] { border-color: var(--crit); }
.gform_wrapper .validation_message { color: var(--crit); font-weight: 500; }
[data-theme="dark"] .gform_wrapper .validation_message { color: #FF9A87; }

/* ============ Theme toggle ==================================================== */
.clineo-theme-toggle {
  background: transparent; border: 2px solid var(--muted); color: var(--ink);
  border-radius: 999px; min-width: 44px; min-height: 34px; padding: 4px 12px;
  font-size: 0.9rem; font-weight: 600;
}
.clineo-theme-toggle:hover { border-color: var(--interactive); }

/* ============ Interview (fit-check) widget ==================================== */
#clineo-interview { max-width: 46rem; }
.ci-log { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 1rem; min-height: 12rem; }
.ci-msg { margin: 0 0 0.75rem; padding: 0.6rem 0.9rem; border-radius: 8px; max-width: 90%; }
.ci-msg--bot { background: var(--bg); border: 1px solid var(--border); }
.ci-msg--you { background: var(--primary); color: #fff; margin-left: auto; }
[data-theme="dark"] .ci-msg--you { color: #061518; }
.ci-row { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.ci-row input { flex: 1; min-height: 44px; border: 1.5px solid var(--muted); border-radius: 6px; padding: 10px 12px; background: var(--bg); color: var(--ink); }
.ci-reco { border: 2px solid var(--primary); border-radius: 10px; padding: 1.2rem 1.4rem; margin-top: 1rem; }

/* ============ Motion & a11y ==================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.screen-reader-text {
  clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; width: 1px;
  overflow: hidden; position: absolute !important; word-wrap: normal !important;
}
