/* Matheteuo Ministries: button system (installed 2026-10-24, Yvad picked roll-slide with soft 8px corners).
   Linked on every page AFTER the page's own <style>. Install / upgrade only with install-button-system.cjs. */

/* ==== BUTTON SYSTEM: roll-slide v1 ===========================================================
   MASTER COPY: _agency-ops/section-library/_micro-elements/buttons/2026-09_creohaus_roll-slide/button-system.css
   Captured from https://agenflow.webflow.io/ (2026-09-21, frame-sampled). First installed on CreoHaus (Client 2).
   Install with _micro-elements/buttons/_tools/install-button-system.cjs, plus button-system.js (builds the second
   copy of each label and arrow). Per client, edit ONLY the TOKEN BRIDGE. Spec + role picking: BUTTON-SCALE.md

   INVARIANTS: one height (--btn-height) for every button at every breakpoint. One hover family, no colour change:
   the label rolls up out of the button while shrinking to 80%, an identical copy rises from below growing 80% to
   100%, and the arrow slides out to the right while a second arrow slides in from the left. 400ms on enter; on
   leave everything resets instantly, which is invisible because both copies are identical (measured on the
   reference: leave runs no animation, the next hover replays from the start). No lift, shadow or wipe.

   ROLES  .btn-primary / .btn-split-on-light / .btn-split-on-dark  -> accent shell, on-accent label (every band)
          .btn-call          dark shell on light bands, light shell on dark bands; phone controls never move:
                             label and icon stay still, hover is a tint (opacity only)
          .btn-ghost         2px keyline in the band's contrast neutral, label + arrow, no fill
          .btn-outline-rect  2px keyline in the band's contrast neutral, label only
          .btn-square        icon-only accent square, arrow slides through
   BANDS  light is the default. Dark: .on-dark on the button, or an ancestor .text-on-dark / [data-band="dark"] /
          .mobile-cta-bar. Accent-coloured band: .on-accent or ancestor [data-band="accent"].
   Markup is the shared class contract (.btn-split-label + .btn-split-icon). button-system.js wraps the label text in
   .btn-roll (two copies) and the icon svg in .btn-slide (two copies). Without JS the buttons render correctly and
   simply don't roll.
   ============================================================================================ */

/* ---- TOKEN BRIDGE: the only per-client edit. Point each at the client's own tokens. ---- */
:root {
  --btn-height: 52px;                                          /* THE height. Every button, every breakpoint (never under 48px) */
  --btn-radius: 8px;                                           /* soft corners, matching the site's cards and photos (Yvad 2026-10-24) */
  --btn-font: 'Anton', 'Impact', sans-serif;                   /* the heading face */
  --btn-accent: #E8502A;                                       /* --coral */
  --btn-on-accent: #FFFFFF;
  --btn-dark: #0C243C;                                         /* --ink */
  --btn-on-dark: #FEF8F6;                                      /* --bg */
  --btn-light: #FEF8F6;
  --btn-on-light: #0C243C;
  --btn-light-line: #FEF8F6;
  --btn-band-dark: #0C243C;
  --btn-tint-light: rgba(12, 36, 60, 0.06);
  --btn-tint-dark: rgba(254, 248, 246, 0.10);
  --btn-ghost-label-hover-light: #0C243C;
  --btn-ghost-label-hover-dark: #FEF8F6;
}
/* ---- END TOKEN BRIDGE ---- */

/* ---- SYSTEM CONSTANTS: what makes this system THIS system. Measured off the reference (frame-sampled at 60fps,
   fitted rmse 0.003). Change only by re-capturing it, never per client. ---- */
:root {
  --btn-motion: roll;                                          /* read by site-buttons.cjs to pick the right hover check */
  --btn-frame: 2px;                                            /* keyline weight (ghost, outline) */
  --btn-cell: 22px;                                            /* arrow box (the reference's 24px icon block, scaled to our 18px icon) */
  --btn-duration: 400ms;                                       /* enter; leave is instant (0ms), as measured */
  --btn-ease: cubic-bezier(0.46, 1, 0.9, 1);                   /* best fit to the sampled roll (power2-out family) */
  --btn-roll-scale: 0.8;                                       /* outgoing copy shrinks to, incoming copy grows from */
  --btn-gap: 10px;                                             /* label to arrow */
}

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--btn-gap);
  height: var(--btn-height);
  min-height: var(--btn-height);
  padding: 0 20px;
  background: var(--btn-bg, transparent);
  border: var(--line-width, 0px) solid var(--line, transparent);
  border-radius: var(--btn-radius, 0px);   /* bridges from before v1.1 have no radius key: stay sharp */
  color: var(--label, currentColor);
  font-family: var(--btn-font);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  clip-path: none;
  cursor: pointer;
}
@media (min-width: 768px) {
  .btn { padding: 0 24px; font-size: 20px; }
}
/* Tint layer: only the call role (and reduced motion) uses it, so a hover is always visible. Opacity only. */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-tint, transparent);
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--focus-ring, var(--btn-dark)); outline-offset: 3px; }
.text-on-dark, [data-band="dark"], .mobile-cta-bar { --focus-ring: var(--btn-light-line); }

/* ---- Split structure: label + arrow, no cell in this system. ---- */
.btn-split { justify-content: center; }
.btn-split-label { display: inline-flex; align-items: center; }
.btn-split-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--btn-cell);
  width: var(--btn-cell);
  height: var(--btn-cell);
  overflow: hidden;
  color: var(--icon, currentColor);
}
.btn-split-icon svg { width: 18px; height: 18px; display: block; flex: none; }
/* The shared markup carries a diagonal arrow; this system shows it pointing right, like the reference. */
.btn-split:not(.btn-call):not([data-motion-lock="phone"]) .btn-split-icon svg,
.btn-square svg { transform: rotate(45deg); }

/* ---- The roll (label) and the slide (arrow). Built by button-system.js. ---- */
.btn-roll { position: relative; display: inline-block; overflow: hidden; vertical-align: top; line-height: 1.2; }   /* no padding: the copy must land exactly where the first sat */
.btn-roll__a, .btn-roll__b { display: block; transform-origin: 50% 50%; transition: transform 0ms; }
.btn-roll__b { position: absolute; left: 0; right: 0; top: 100%; transform: scale(var(--btn-roll-scale)); }
.btn-slide__a, .btn-slide__b { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; transition: transform 0ms; }
.btn-slide__b { position: absolute; inset: 0; transform: translateX(-100%); }

.btn:not([data-motion-lock="phone"]):hover .btn-roll__a,
.btn:not([data-motion-lock="phone"]):focus-visible .btn-roll__a {
  transform: translateY(-100%) scale(var(--btn-roll-scale));
  transition: transform var(--btn-duration) var(--btn-ease);
}
.btn:not([data-motion-lock="phone"]):hover .btn-roll__b,
.btn:not([data-motion-lock="phone"]):focus-visible .btn-roll__b {
  transform: translateY(-100%) scale(1);
  transition: transform var(--btn-duration) var(--btn-ease);
}
.btn:not([data-motion-lock="phone"]):hover .btn-slide__a,
.btn:not([data-motion-lock="phone"]):focus-visible .btn-slide__a {
  transform: translateX(100%);
  transition: transform var(--btn-duration) var(--btn-ease);
}
.btn:not([data-motion-lock="phone"]):hover .btn-slide__b,
.btn:not([data-motion-lock="phone"]):focus-visible .btn-slide__b {
  transform: translateX(0);
  transition: transform var(--btn-duration) var(--btn-ease);
}
/* Phone controls never move (label, number and icon stay still): the tint shows the hover instead. */
.btn[data-motion-lock="phone"]:hover::after,
.btn[data-motion-lock="phone"]:focus-visible::after { opacity: 1; }

/* ---- Roles. Each sets colours only. ---- */

/* PRIMARY: accent shell, on-accent label and arrow, on every band (the accent reads on light and dark grounds). */
.btn-primary,
.btn-split-on-light,
.btn-split-on-dark {
  --btn-bg: var(--btn-accent);
  --label: var(--btn-on-accent);
  --btn-tint: var(--btn-tint-light);
}
/* On an accent-coloured band the accent shell would vanish: dark shell, light label (derived, not observed). */
.btn-primary.on-accent,
[data-band="accent"] .btn-primary {
  --btn-bg: var(--btn-dark);
  --label: var(--btn-on-dark);
  --btn-tint: var(--btn-tint-dark);
}

/* CALL: the dark neutral shell (observed as the reference's dark nav button); light shell on dark bands. */
.btn-call {
  --btn-bg: var(--btn-dark);
  --label: var(--btn-on-dark);
  --icon: var(--btn-accent);
  --btn-tint: var(--btn-tint-dark);
}
.btn-call.on-dark,
.text-on-dark .btn-call,
[data-band="dark"] .btn-call,
.mobile-cta-bar .btn-call {
  --btn-bg: var(--btn-light);
  --label: var(--btn-on-light);
  --icon: var(--btn-on-light);
  --btn-tint: var(--btn-tint-light);
}

/* GHOST: accent can't be spent here. 2px keyline in the contrast neutral, label + arrow. */
.btn-ghost {
  --line-width: var(--btn-frame);
  --line: var(--btn-dark);
  --label: var(--btn-dark);
  --btn-tint: var(--btn-tint-light);
}
.btn-ghost.on-dark,
.text-on-dark .btn-ghost,
[data-band="dark"] .btn-ghost,
.mobile-cta-bar .btn-ghost {
  --line: var(--btn-light-line);
  --label: var(--btn-light-line);
  --btn-tint: var(--btn-tint-dark);
}

/* OUTLINE secondary (no icon): the same keyline, label only. Never the accent. */
.btn-outline-rect {
  --line-width: var(--btn-frame);
  --line: var(--btn-dark);
  --label: var(--btn-dark);
  --btn-tint: var(--btn-tint-light);
}
.btn-outline-rect.on-dark,
.text-on-dark .btn-outline-rect,
[data-band="dark"] .btn-outline-rect,
.mobile-cta-bar .btn-outline-rect {
  --line: var(--btn-light-line);
  --label: var(--btn-light-line);
  --btn-tint: var(--btn-tint-dark);
}

/* SQUARE: icon-only accent square (back to top, carousel arrows). The arrow slides through. */
.btn-square {
  --btn-bg: var(--btn-accent);
  --label: var(--btn-on-accent);
  width: var(--btn-height);
  padding: 0;
}
.btn-square .btn-split-icon, .btn-square > .btn-slide-box { position: relative; width: var(--btn-cell); height: var(--btn-cell); overflow: hidden; display: inline-flex; }
.btn-square svg { width: 18px; height: 18px; display: block; }

/* Reduced motion: nothing moves; every role shows the tint instead, so a hover is still visible. */
@media (prefers-reduced-motion: reduce) {
  .btn-roll__a, .btn-roll__b, .btn-slide__a, .btn-slide__b { transition: none !important; }
  .btn:hover .btn-roll__a, .btn:focus-visible .btn-roll__a { transform: none; }
  .btn:hover .btn-roll__b, .btn:focus-visible .btn-roll__b { transform: scale(var(--btn-roll-scale)); }
  .btn:hover .btn-slide__a, .btn:focus-visible .btn-slide__a { transform: none; }
  .btn:hover .btn-slide__b, .btn:focus-visible .btn-slide__b { transform: translateX(-100%); }
  .btn:hover::after, .btn:focus-visible::after { opacity: 1; }
}
/* ==== END BUTTON SYSTEM ==== */

/* ==== SITE LAYOUT: button rows (BUTTON-SCALE.md section 8, not part of the system master) ====
   Two buttons never share a row on a phone: under 640px every row stacks, each button full width. */
@media (max-width: 639px) {
  .hero-ctas, .cta-ctas, .pastor-ctas, .visit-ctas, .sl-esh__actions { flex-direction: column; align-items: stretch; }
  .hero-ctas > .btn, .cta-ctas > .btn, .pastor-ctas > .btn, .visit-ctas > .btn, .sl-esh__actions > .btn { width: 100%; }
  .sl-esh__actions { width: 100%; align-self: stretch; }   /* the 404 recipe centres a fit-content column */
}
