/* Website widgets driven by the admin (/ct): banner slider, popups, chat assistant + live chat.
   Ported from the Morning Tax build and re-coloured to Clarus navy/blue. Loaded on every public page. */
:root{--ease:cubic-bezier(.22,.61,.36,1);--font-head:var(--ff);--muted:var(--ink-500);--navy:var(--navy-900);--radius:var(--r-lg);--shadow-lg:0 30px 60px -28px rgba(10,30,68,.34)}

.bslider {
  position: relative;
  /* Full-bleed, like the header — a capped width left white gaps at the sides
     that read as the banner being cut off. */
  width: 100%;
  /* The default ratio reserves the banner's space from the very first paint, so
     the sections below never jump up while the image is loading. main.js then
     overrides --bslider-ratio with the banner's real proportions. */
  aspect-ratio: var(--bslider-ratio, 1920 / 830);
  overflow: hidden;
  background: #fff;
}
/* No banner written into the page: skip the empty stage so the hero paints at
   once; while a banner is showing, the hero stays out of the way. */
.bslider:not(:has(.bslider__track)) { display: none; }
.bslider:not([hidden]):has(.bslider__track) + [data-hero] { display: none; }
/* Quiet placeholder shown only until the first banner is ready. */
.bslider.is-loading {
  background: linear-gradient(100deg, #EBEEF4 30%, #f7faf8 50%, #EBEEF4 70%) #EBEEF4;
  background-size: 200% 100%;
  animation: bsliderShimmer 1.4s ease-in-out infinite;
}
@keyframes bsliderShimmer {
  from { background-position: 150% 0; }
  to   { background-position: -50% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bslider.is-loading { animation: none; }
}
.bslider__track {
  display: flex;
  align-items: stretch;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
/* Set while snapping from the cloned slide back to the real one. */
.bslider__track.is-instant { transition: none; }
.bslider__slide { position: relative; flex: 0 0 100%; height: 100%; }
/* contain, not cover: the whole banner is always visible and nothing is
   trimmed. A banner that is exactly 1280x500 fills the stage edge to edge. */
.bslider__slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bslider__slide a { display: block; height: 100%; }
.bslider__dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 9px; z-index: 2; }
.bslider__dot { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.55); cursor: pointer; padding: 0; transition: background .2s, transform .2s; }
.bslider__dot.is-active { background: #fff; transform: scale(1.25); }
.bslider__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(44, 69, 118,0.45); color: #fff; display: grid; place-items: center;
  transition: background .2s;
}
.bslider__arrow:hover { background: rgba(44, 69, 118,0.75); }
.bslider__arrow svg { width: 22px; height: 22px; }
.bslider__arrow--prev { left: 14px; }
.bslider__arrow--next { right: 14px; }
@media (max-width: 640px) { .bslider__arrow { width: 34px; height: 34px; } .bslider__arrow svg { width: 18px; height: 18px; } }

.cx-pop-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(28, 43, 73,0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity 0.25s var(--ease); }
.cx-pop-overlay.show { opacity: 1; }
.cx-pop {
  position: relative; background: #fff; border-radius: 18px;
  max-width: 430px; width: 100%;
  box-shadow: 0 24px 64px rgba(28, 43, 73,0.4);
  border-top: 6px solid #2A416E;                 /* flat brand accent */
  overflow: hidden;
  transform: translateY(16px) scale(0.96); transition: transform 0.3s var(--ease);
}
.cx-pop-overlay.show .cx-pop { transform: none; }
.cx-pop__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: #EBEEF4; color: #283E69; font-size: 20px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; transition: background .15s, color .15s;
}
.cx-pop__close:hover { background: #2A416E; color: #fff; }
.cx-pop__img { display: block; width: 100%; height: auto; }

.cx-pop__body { padding: 40px 32px 34px; text-align: center; position: relative; }
/* flat-colour icon badge (text popups) */
.cx-pop__body::before {
  content: "★"; display: grid; place-items: center;
  width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 50%;
  background: #FFF0D7; color: #2453B2; font-size: 28px;
  box-shadow: 0 0 0 7px rgba(255,160,6,0.16);
}
.cx-pop__body h3 {
  margin: 0 0 14px; font-size: 1.55rem; font-weight: 700; color: #2A416E; line-height: 1.2;
}
.cx-pop__body h3::after {
  content: ""; display: block; width: 46px; height: 3px;
  background: #F09400; border-radius: 2px; margin: 14px auto 0;   /* flat gold accent */
}
.cx-pop__body p { margin: 0 0 26px; color: #314C81; line-height: 1.65; font-size: 1rem; }
/* solid flat-green CTA (overrides the generic gold button inside the popup) */
.cx-pop__body .btn {
  background: #2A416E; color: #fff; border: 0;
  padding: 14px 34px; border-radius: 40px; font-weight: 700; letter-spacing: .01em;
  box-shadow: 0 8px 20px rgba(42, 65, 110,0.28); transition: background .15s, transform .15s, box-shadow .15s;
}
.cx-pop__body .btn:hover { background: #263A63; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(42, 65, 110,0.34); }


.cx-bot-fab {
  /* Above .site-header (z-index:100) — the sticky nav used to paint over
     the panel, hiding its top edge on short screens. */
  position: fixed; right: 20px; bottom: 86px; z-index: 121;
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: #2A416E; color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(42, 65, 110,0.4);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.cx-bot-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 16px 36px rgba(42, 65, 110,0.5); }
.cx-bot-fab__chat { width: 27px; height: 27px; }
.cx-bot-fab__x { width: 24px; height: 24px; display: none; }
.cx-bot-fab.open .cx-bot-fab__chat { display: none; }
.cx-bot-fab.open .cx-bot-fab__x { display: block; }
.cx-bot-fab::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(42, 65, 110,0.5); animation: cxBotPulse 2.6s infinite;
}
.cx-bot-fab.open::after { animation: none; }
@keyframes cxBotPulse {
  0% { box-shadow: 0 0 0 0 rgba(42, 65, 110,0.45); }
  70% { box-shadow: 0 0 0 15px rgba(42, 65, 110,0); }
  100% { box-shadow: 0 0 0 0 rgba(42, 65, 110,0); }
}

/* Teaser bubble that points at the chat button */
.cx-bot-teaser {
  position: fixed; right: 20px; bottom: 152px; z-index: 119;
  width: 244px; max-width: calc(100vw - 40px);
  background: #fff; color: var(--navy);
  border-radius: 14px; padding: 14px 16px 14px 15px;
  box-shadow: 0 14px 34px rgba(28, 43, 73,0.26);
  border-left: 4px solid #2A416E;
  cursor: pointer;
  opacity: 0; transform: translateY(10px) scale(0.96); pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.cx-bot-teaser.show { opacity: 1; transform: none; pointer-events: auto; }
.cx-bot-teaser:hover { box-shadow: 0 18px 40px rgba(28, 43, 73,0.34); }
.cx-bot-teaser strong { display: block; font-size: 0.95rem; color: #2A416E; margin-bottom: 3px; }
.cx-bot-teaser span { display: block; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.cx-bot-teaser::after {           /* tail pointing down at the button */
  content: ""; position: absolute; right: 22px; bottom: -8px;
  width: 16px; height: 16px; background: #fff; transform: rotate(45deg);
  box-shadow: 3px 3px 8px rgba(28, 43, 73,0.10);
}
.cx-bot-teaser__x {
  position: absolute; top: 6px; right: 8px;
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: transparent; color: #8C9AB6; font-size: 17px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.cx-bot-teaser__x:hover { background: #EBEEF4; color: #2A416E; }

.cx-bot {
  position: fixed; right: 20px; bottom: 156px; z-index: 120;
  width: 344px; max-width: calc(100vw - 40px);
  height: 460px;
  /* Two max-heights on purpose. A browser without dvh support drops that
     declaration entirely and keeps the first — without a fallback the
     panel stayed a fixed 460px and its top ran off the top of short
     screens, hiding the header. On a fixed element a percentage resolves
     against the viewport, so calc(100% - …) works everywhere. */
  max-height: calc(100% - 190px);
  max-height: calc(100dvh - 190px);
  background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(28, 43, 73,0.35);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(0.98); pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.cx-bot.show { opacity: 1; transform: none; pointer-events: auto; }
.cx-bot__head { background: #2A416E; color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 8px; flex: none; position: relative; z-index: 2; }
.cx-bot__head strong { display: block; font-size: 0.95rem; font-family: var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-bot__head small { display: block; color: #C7CEDB; font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-bot__title { flex: 1 1 auto; min-width: 0; }
.cx-bot__live, .cx-bot__end {
  display: inline-flex; align-items: center; gap: 5px; flex: none; white-space: nowrap;
  color: #fff; border: 1px solid rgba(255,255,255,0.25); border-radius: 20px;
  padding: 6px 10px; font: inherit; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.cx-bot__live { background: rgba(255,255,255,0.14); }
.cx-bot__live:hover { background: rgba(255,255,255,0.26); }
.cx-bot__end { background: rgba(220,90,80,0.3); }
.cx-bot__end:hover { background: rgba(220,90,80,0.55); }
.cx-bot__live svg, .cx-bot__end svg { width: 14px; height: 14px; flex: none; }
/* Narrow panels: keep the buttons on one line by dropping their labels. */
@media (max-width: 400px) {
  .cx-bot__live span, .cx-bot__end span { display: none; }
  .cx-bot__live, .cx-bot__end { padding: 7px 9px; }
}
.cx-bot__msg--sys { align-self: center; background: #E4E8F0; color: #37548F; font-size: 0.78rem; max-width: 92%; text-align: center; border-radius: 10px; }
.cx-bot__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #FFA006; box-shadow: 0 0 0 3px rgba(255,160,6,0.3); }
.cx-bot__msgs { flex: 1; overflow-y: auto; padding: 16px; background: #F3F5F8; display: flex; flex-direction: column; gap: 10px; }
.cx-bot__msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 0.9rem; line-height: 1.5; }
.cx-bot__msg--bot { background: #fff; color: #29406D; border: 1px solid #E0E5EE; border-bottom-left-radius: 4px; align-self: flex-start; }
.cx-bot__msg--user { background: #2A416E; color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.cx-bot__msg--typing { padding: 12px 14px; }
.cx-bot__dots { display: inline-flex; gap: 4px; }
.cx-bot__dots i { width: 7px; height: 7px; border-radius: 50%; background: #96A3BC; display: inline-block; animation: cxBotDot 1.2s infinite ease-in-out both; }
.cx-bot__dots i:nth-child(2) { animation-delay: 0.15s; }
.cx-bot__dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cxBotDot { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
.cx-bot__link { display: inline-block; margin-top: 8px; font-weight: 600; color: #2A416E; text-decoration: none; background: #FFF0D7; padding: 6px 12px; border-radius: 20px; font-size: 0.82rem; }
.cx-bot__msg--user .cx-bot__link { background: rgba(255,255,255,0.2); color: #fff; }
.cx-bot__form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #E0E5EE; background: #fff; }
.cx-bot__input { flex: 1; border: 1px solid #CED5E4; border-radius: 22px; padding: 10px 14px; font: inherit; font-size: 0.9rem; outline: none; }
.cx-bot__input:focus { border-color: #2A416E; }
.cx-bot__send { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #2A416E; color: #fff; cursor: pointer; display: grid; place-items: center; }
.cx-bot__send:hover { background: #263A63; }
.cx-bot__send svg { width: 18px; height: 18px; }
@media (max-width: 480px) {
  .cx-bot {
    right: 12px; left: 12px; width: auto; max-width: none;
    bottom: 150px; height: auto;
    max-height: calc(100% - 180px);
    max-height: calc(100dvh - 180px);
  }
}

/* ---------- Admin-managed sections (inc/cms-sections.php), in the Clarus look ---------- */
.cms-logos{border-block:1px solid var(--line)}
.cms-logos__row{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:clamp(22px,4vw,56px)}
.cms-logos__row img{height:44px;width:auto;max-width:160px;object-fit:contain;filter:grayscale(1);opacity:.7;transition:filter .2s,opacity .2s}
.cms-logos__row a:hover img,.cms-logos__row img:hover{filter:none;opacity:1}

.cms-quotes{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px;margin-top:44px}
.cms-quote{display:flex;flex-direction:column;gap:16px;margin:0;padding:26px;background:var(--white);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow-sm)}
.cms-quote__stars{display:flex;gap:2px;color:var(--orange-500)}
.cms-quote__stars .i{width:17px;height:17px}
.cms-quote blockquote{margin:0;flex:1;color:var(--ink-700);font-size:.94rem;line-height:1.65}
.cms-quote figcaption{display:flex;align-items:center;gap:12px;padding-top:16px;border-top:1px solid var(--line-soft)}
.cms-quote figcaption img,.cms-quote__av{width:44px;height:44px;flex:none;border-radius:50%;object-fit:cover}
.cms-quote__av{display:grid;place-items:center;background:var(--blue-50);color:var(--blue-600);font-weight:800}
.cms-quote figcaption b{display:block;color:var(--ink-900);font-size:.92rem}
.cms-quote figcaption small{color:var(--ink-400);font-size:.8rem}

.cms-team{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:20px;margin-top:44px}
.cms-member{padding:28px 22px;text-align:center;background:var(--white);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow-sm)}
.cms-member img{width:120px;height:120px;margin:0 auto 16px;border-radius:50%;object-fit:cover}
.cms-member h3{font-size:1.08rem}
.cms-member__role{margin-top:2px;color:var(--blue-500);font-weight:700;font-size:.86rem}
.cms-member p:last-child:not(.cms-member__role){margin-top:10px;font-size:.88rem}

/* chat button in Clarus navy */
.cx-bot-fab{background:linear-gradient(135deg,var(--navy-900),var(--blue-500))}

/* When banners replace the hero, the stats strip sits below them instead of overlapping
   (its negative margin was made for the hero, and would hide the slider's dots). */
.bslider ~ .statwrap .statstrip{margin-top:clamp(24px,3vw,40px)}

/* ---------- Blog (blog.php) ---------- */
.blog-card{padding:0;overflow:hidden;background:var(--white);border:1px solid var(--line);color:var(--ink-500)}
.blog-card:hover{background:var(--white)}
.blog-card>*:not(.blog-card__img){margin-inline:22px}
.blog-card__img{display:block;aspect-ratio:16/9;overflow:hidden;margin-bottom:18px}
.blog-card__img img{width:100%;height:100%;object-fit:cover;transition:transform .4s ease}
.blog-card:hover .blog-card__img img{transform:scale(1.03)}
.blog-card time{display:block;margin-top:22px;font-size:.76rem;font-weight:700;letter-spacing:.06em;color:var(--blue-500)}
.blog-card__img+time{margin-top:0}
.blog-card h3{margin-top:6px;font-size:1.08rem;color:var(--ink-900)}
.blog-card h3 a{text-decoration:none}
.blog-card h3 a:hover{color:var(--blue-500)}
.blog-card p{margin-top:8px;font-size:.9rem;color:var(--ink-500)}
.blog-card .arrow-link{display:inline-flex;align-items:center;gap:.4em;margin-top:16px;margin-bottom:22px;color:var(--blue-500);font-weight:700;font-size:.88rem;text-decoration:none}
.blog-cover{display:block;width:100%;max-width:960px;margin:0 auto 36px;border-radius:var(--r-lg);aspect-ratio:16/8;object-fit:cover}
.blog-prose h2{border-top:0;padding-top:8px}
.blog-prose h3{margin:26px 0 10px;font-size:1.1rem}
.blog-prose img{max-width:100%;height:auto;margin:22px auto;border-radius:var(--r-md)}
.blog-prose a{color:var(--blue-500)}
.blog-prose blockquote{margin:22px 0;padding:6px 0 6px 18px;border-left:3px solid var(--blue-500);color:var(--ink-700)}
.blog-prose ol{list-style:decimal;padding-left:22px;display:grid;gap:8px;margin:0 0 18px}
.cx-pop:has(.cx-pop__img) { max-width: min(560px, 82vh); }
.cx-pop:has(.cx-pop__img) .cx-pop__img { border-radius: 18px; }
