/*
 * Rcfo design layer for RCFO Starter Templates.
 * Built from Rcfo's UCLA-blue/gold tokens, Inter-based typography,
 * accessible focus treatment, soft borders, 14px surfaces and compact controls.
 * Demo-specific brand colors and fonts are supplied on .rcfo-tpl by PHP.
 */
.rcfo-tpl {
  --kb-primary-color: var(--color-brand, #2774ae);
  --kb-primary-dark: var(--color-brand-dark, #1e5a8a);
  --kb-secondary-color: var(--color-accent, #ffd100);
  --kb-text-primary: var(--color-navy, #101828);
  --kb-text-secondary: #475467;
  --kb-surface: #fff;
  --kb-surface-muted: #f8fafc;
  --kb-border-color: #e4e7ec;
  --kb-radius: 14px;
  --kb-shadow: 0 10px 30px rgb(16 24 40 / 10%);
  color: var(--kb-text-secondary);
  font-family: var(--font-sans, Inter, ui-sans-serif, system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.rcfo-tpl :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-display, var(--font-sans, Inter, sans-serif));
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.rcfo-tpl :is(a, button, input, select, textarea):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--kb-primary-color) 38%, transparent);
  outline-offset: 3px;
}

.rcfo-tpl .btn-primary,
.rcfo-tpl .btn-outline,
.rcfo-tpl .btn-navy,
.rcfo-tpl .btn-ghost-light {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.005em;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.rcfo-tpl .btn-primary {
  background: var(--kb-primary-color);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--kb-primary-color) 24%, transparent);
  color: #fff;
}

.rcfo-tpl .btn-primary:hover {
  background: var(--kb-primary-dark);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--kb-primary-color) 28%, transparent);
  transform: translateY(-2px);
}

.rcfo-tpl .btn-outline {
  border-color: color-mix(in srgb, var(--kb-primary-color) 36%, #e4e7ec);
  color: var(--kb-text-primary);
}

.rcfo-tpl .btn-outline:hover {
  border-color: var(--kb-primary-color);
  background: color-mix(in srgb, var(--kb-primary-color) 7%, #fff);
  color: var(--kb-primary-dark);
}

.rcfo-tpl .btn-navy {
  background: var(--color-navy, #0f1c2e);
  box-shadow: 0 4px 12px rgb(15 28 46 / 28%);
  color: #fff;
}

.rcfo-tpl .btn-navy:hover {
  background: color-mix(in srgb, var(--color-navy, #0f1c2e) 88%, #fff);
  box-shadow: 0 8px 18px rgb(15 28 46 / 32%);
  transform: translateY(-2px);
}

.rcfo-tpl .btn-ghost-light {
  border-color: rgb(255 255 255 / 32%);
  background: rgb(255 255 255 / 5%);
  color: #fff;
}

.rcfo-tpl .btn-ghost-light:hover {
  border-color: rgb(255 255 255 / 66%);
  background: rgb(255 255 255 / 10%);
}

.rcfo-tpl .eyebrow {
  color: var(--kb-primary-dark);
  letter-spacing: 0.12em;
}

.rcfo-tpl .field,
.rcfo-tpl input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),
.rcfo-tpl select,
.rcfo-tpl textarea {
  border-color: var(--kb-border-color);
  border-radius: 10px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.rcfo-tpl .field:focus,
.rcfo-tpl input:focus,
.rcfo-tpl select:focus,
.rcfo-tpl textarea:focus {
  border-color: var(--kb-primary-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--kb-primary-color) 16%, transparent);
  outline: none;
}

.rcfo-tpl .card-lift {
  border-radius: var(--kb-radius);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.rcfo-tpl .card-lift:hover {
  border-color: color-mix(in srgb, var(--kb-primary-color) 22%, #e4e7ec);
  box-shadow: var(--kb-shadow);
  transform: translateY(-4px);
}


.rcfo-tpl header.sticky {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/*
 * Browsing comfort on RCFO pages — the theme skips its own enhancement layer
 * on .rcfo-tpl pages (lienzo_is_rcfo_template_page), so these live here instead:
 * smooth anchor scrolling and back-to-top.
 */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Small breathing room so anchored content doesn't hug the viewport edge. */
.rcfo-tpl [id] { scroll-margin-top: 1.5rem; }

/* Back to top — bottom-left; the chat bubble owns the bottom-right corner. */
.rcfo-btt {
  align-items: center;
  background: var(--color-navy, #0f1c2e);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgb(15 28 46 / .3);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  height: 2.75rem;
  inset-block-end: 1.5rem;
  inset-inline-start: 1.5rem;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transform: translateY(.5rem);
  transition: opacity .2s ease, transform .2s ease;
  width: 2.75rem;
  z-index: 190;
}

.rcfo-btt.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.rcfo-btt:hover {
  transform: translateY(-2px);
}

.rcfo-btt:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-brand, #59b8a9) 45%, transparent);
  outline-offset: 3px;
}

/*
 * Custom menu items the importer flagged as buttons (e.g. the intranet
 * login link) live in the theme header, outside .rcfo-tpl — style the
 * anchor as a pill so it reads as an action, not a plain nav link.
 */
.site-header .rcfo-menu-btn > a,
.site-navigation-dropdown .rcfo-menu-btn > a {
  display: inline-flex;
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 9999px;
  padding: .45rem 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.site-header .rcfo-menu-btn > a:hover {
  transform: translateY(-2px);
}

/*
 * Structural guards for block-converted markup.
 *
 * 1) If a WP layout class ever survives RCFO_ST_Assets::strip_layout_classes
 *    its blockGap margin would push later grid children down — keep card
 *    rows' top edges aligned no matter what.
 * 2) Checklist items are <li class="flex gap-3"> with a leading checkmark
 *    svg. Pages imported before li classes were preserved lose that flex
 *    context — :has() restores it regardless of the serialized markup.
 */
.rcfo-tpl :where(.is-layout-flow, .is-layout-constrained, .is-layout-flex, .is-layout-grid) > * + * {
  margin-block-start: 0;
}

.rcfo-tpl ul li:has(> svg:first-child) {
  align-items: flex-start;
  display: flex;
  gap: .75rem;
}

.rcfo-tpl ul li > svg:first-child {
  flex-shrink: 0;
}

.rcfo-tpl ul li > svg:first-child:not([class*="mt-"]) {
  margin-block-start: .125rem;
}

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