/* ==========================================================================
   Roti Foundation — additions for the dynamic site.
   style.css is the untouched original design; this file only adds the
   security check (captcha) block and the honeypot used on public forms.
   ========================================================================== */

/* honeypot: invisible to people, tempting for bots */
.rf-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- captcha ---------- */
.rf-captcha__row {          /* image · refresh · input always on one row */
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}
.rf-captcha__img {
  display: inline-flex;
  flex-shrink: 0;
  border: 1.5px solid #e4ded3;
  border-radius: 14px;
  overflow: hidden;
  background: #fbf6ec;
  line-height: 0;
}
.rf-captcha__img img { width: 170px; height: 50px; object-fit: cover; display: block; }
.rf-captcha__refresh {
  flex-shrink: 0;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 1.5px solid #e4ded3;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy-700);
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, transform 0.5s var(--ease);
}
.rf-captcha__refresh:hover { border-color: var(--gold-500); color: var(--gold-500); }
.rf-captcha__refresh.is-spinning i { animation: rfSpin 0.6s var(--ease); }
@keyframes rfSpin { to { transform: rotate(360deg); } }
.rf-captcha__input { flex: 1 1 auto; min-width: 0; }
.rf-captcha__input input { text-transform: uppercase; letter-spacing: 0.18em; font-weight: 700; }
.rf-captcha__input input::placeholder { text-transform: none; letter-spacing: normal; font-weight: 400; }
.rf-captcha .form-error { display: block; }

/* compact version (newsletter / comments): appears once the form is in use */
.rf-captcha--compact {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s var(--ease), opacity 0.35s, margin 0.35s;
}
form:focus-within .rf-captcha--compact,
.rf-captcha--compact.is-shown,
.rf-captcha--compact.has-error {
  max-height: 220px;
  margin: 14px 0 6px;
  opacity: 1;
}
.rf-captcha--compact > label { font-size: 13px; }
.bl-news .rf-captcha--compact > label { color: inherit; }

/* narrow phones */
@media (max-width: 480px) {
  .rf-captcha__row { gap: 6px; }
  .rf-captcha__img img { width: 118px; height: 40px; }
  .rf-captcha__refresh { width: 40px; height: 40px; }
  .rf-captcha__input input { padding-left: 40px; letter-spacing: 0.08em; }
}

/* captcha image placeholder while the PNG is being fetched */
.rf-captcha__img.is-loading {
  background: linear-gradient(90deg, #f6efe2 0%, #fdf9f1 40%, #f6efe2 80%) 0 0 / 300% 100%;
  animation: rfShimmer 1.2s linear infinite;
}
@keyframes rfShimmer { to { background-position: -300% 0; } }

/* ---------- 404 page ---------- */
.rf-404 { padding: 60px 0 90px; }
.rf-404__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; align-items: center; }
.rf-404__art { position: relative; display: flex; justify-content: center; }
.rf-404__num { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: clamp(110px, 18vw, 200px); line-height: 1; color: var(--navy-700); letter-spacing: -0.02em; }
.rf-404__plate { display: inline-grid; place-items: center; width: 0.82em; height: 0.82em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6e1, #f1d9a6 60%, #d09420); box-shadow: inset 0 -10px 24px rgba(11, 55, 88, 0.12), 0 18px 40px rgba(208, 148, 32, 0.3); }
.rf-404__plate i { font-size: 0.36em; color: var(--navy-700); }
.rf-404__steam { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.rf-404__steam i { width: 6px; height: 34px; border-radius: 6px; background: linear-gradient(transparent, rgba(208, 148, 32, 0.55)); animation: rf404Steam 2.4s ease-in-out infinite; }
.rf-404__steam i:nth-child(2) { animation-delay: .4s; height: 44px; }
.rf-404__steam i:nth-child(3) { animation-delay: .8s; }
@keyframes rf404Steam { 0%, 100% { opacity: .2; transform: translateY(6px) scaleY(.8); } 50% { opacity: 1; transform: translateY(-6px) scaleY(1); } }
.rf-404__eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 30px; background: #fdf4e3; color: #9a6a12; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.rf-404__text h2 { margin: 14px 0 10px; font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; color: var(--navy-text, #0b3758); }
.rf-404__text p { color: var(--muted); margin-bottom: 20px; }
.rf-404__search { position: relative; display: flex; gap: 8px; margin-bottom: 18px; max-width: 520px; }
.rf-404__search > i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #9aa7b6; }
.rf-404__search input { flex: 1 1 auto; min-width: 0; height: 52px; padding: 0 16px 0 44px; border: 1.5px solid #e4ded3; border-radius: 40px; font: inherit; background: #fff; outline: 0; }
.rf-404__search input:focus { border-color: var(--gold-500); box-shadow: 0 0 0 4px rgba(208, 148, 32, .15); }
.rf-404__links { list-style: none; padding: 0; margin: 50px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rf-404__links a { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 18px; background: #fff; border: 1.5px solid #efe7d8; color: var(--navy-700); transition: transform .3s, box-shadow .3s, border-color .3s; }
.rf-404__links a:hover { transform: translateY(-3px); border-color: var(--gold-500); box-shadow: 0 14px 30px rgba(11, 55, 88, .1); }
.rf-404__links i { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; display: grid; place-items: center; background: #fdf4e3; color: var(--gold-500); font-size: 18px; }
.rf-404__links span { display: flex; flex-direction: column; }
.rf-404__links small { color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  .rf-404__grid { grid-template-columns: 1fr; text-align: center; }
  .rf-404__search, .rf-404__text .wd-actions { margin-left: auto; margin-right: auto; justify-content: center; }
  .rf-404__links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) { .rf-404__links { grid-template-columns: 1fr; } .rf-404__search { flex-direction: column; } .rf-404__search > i { top: 26px; } }

/* ---------- 500 / other errors (standalone page) ---------- */
.rf-errorpage { min-height: 100vh; margin: 0; background: radial-gradient(circle at 15% 10%, #fdf4e3, transparent 40%), radial-gradient(circle at 90% 90%, #e8f0f7, transparent 45%), #fffdf9; }
.rf-errorpage__main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 30px 16px; text-align: center; }
.rf-errorpage__logo img { width: 200px; height: auto; }
.rf-errorpage__card { position: relative; max-width: 560px; width: 100%; padding: 44px 28px 34px; border-radius: 28px; background: #fff; border: 1.5px solid #efe7d8; box-shadow: 0 30px 60px rgba(11, 55, 88, .1); overflow: hidden; }
.rf-errorpage__code { position: absolute; right: -10px; top: -30px; font-family: var(--font-display); font-size: 150px; color: rgba(11, 55, 88, .05); line-height: 1; }
.rf-errorpage__card h1 { margin: 16px 0 8px; font-family: var(--font-display); font-weight: 400; font-size: 30px; color: var(--navy-700); }
.rf-errorpage__card p { color: var(--muted); margin-bottom: 22px; }
.rf-errorpage__help { color: var(--muted); font-size: 14px; }

/* ---------- offer popup (Admin → Offer Popups) ---------- */
.rf-popup-lock, .rf-popup-lock body { overflow: hidden; }
.rf-popup { position: fixed; inset: 0; z-index: 9990; display: flex; align-items: center; justify-content: center; padding: 20px; pointer-events: none; }
.rf-popup__overlay { position: absolute; inset: 0; background: rgba(4, 28, 48, 0.62); backdrop-filter: blur(3px); opacity: 0; transition: opacity .35s ease; pointer-events: auto; }
.rf-popup__box {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto;
  background: #fff; border-radius: 26px; box-shadow: 0 40px 90px rgba(4, 28, 48, 0.35);
  transform: translateY(26px) scale(.96); opacity: 0; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .35s ease;
  pointer-events: auto;
}
.rf-popup.is-open .rf-popup__overlay { opacity: 1; }
.rf-popup.is-open .rf-popup__box { transform: none; opacity: 1; }
.rf-popup--small .rf-popup__box { max-width: 380px; }
.rf-popup--large .rf-popup__box { max-width: 820px; }
.rf-popup__close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.92); color: var(--navy-700, #0b3758); font-size: 17px; box-shadow: 0 6px 16px rgba(4, 28, 48, .18);
  transition: transform .3s, background .3s, color .3s;
}
.rf-popup__close:hover { transform: rotate(90deg); background: var(--gold-500, #d09420); color: #fff; }
.rf-popup__media { display: block; line-height: 0; background: #f6efe2; }
.rf-popup__img { display: block; width: 100%; height: auto; max-height: 56vh; object-fit: cover; }
.rf-popup__body { padding: 26px 28px 30px; text-align: center; }
.rf-popup__title { margin: 0 0 8px; font-family: var(--font-display, "DM Serif Display", Georgia, serif); font-weight: 400; font-size: 28px; line-height: 1.2; color: var(--navy-700, #0b3758); }
.rf-popup__text { margin: 0 0 20px; color: var(--muted, #5b6573); font-size: 16px; line-height: 1.6; }
.rf-popup__btn { display: inline-flex; }
.rf-popup--image-only .rf-popup__img { max-height: 80vh; object-fit: contain; }
.rf-popup--text-only .rf-popup__body { padding: 44px 32px 36px; background: radial-gradient(circle at 10% 0%, #fdf4e3, transparent 55%), #fff; }
/* large + image-text: image left, text right */
@media (min-width: 768px) {
  .rf-popup--large.rf-popup--image-text .rf-popup__box { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .rf-popup--large.rf-popup--image-text .rf-popup__img { height: 100%; max-height: none; }
  .rf-popup--large.rf-popup--image-text .rf-popup__body { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left; padding: 40px 36px; }
}
/* corner popups: small card, no dark overlay, page stays usable */
.rf-popup--bottom-right, .rf-popup--bottom-left { align-items: flex-end; padding: 18px; }
.rf-popup--bottom-right { justify-content: flex-end; }
.rf-popup--bottom-left { justify-content: flex-start; }
.rf-popup--bottom-right .rf-popup__box, .rf-popup--bottom-left .rf-popup__box { max-width: 360px; border-radius: 20px; }
.rf-popup--bottom-right .rf-popup__title, .rf-popup--bottom-left .rf-popup__title { font-size: 22px; }
.rf-popup--bottom-right .rf-popup__body, .rf-popup--bottom-left .rf-popup__body { padding: 18px 20px 22px; }
.rf-popup--bottom-right .rf-popup__img, .rf-popup--bottom-left .rf-popup__img { max-height: 200px; }
@media (max-width: 540px) {
  .rf-popup { padding: 14px; }
  .rf-popup__title { font-size: 23px; }
  .rf-popup__body { padding: 20px 20px 24px; }
  .rf-popup--bottom-right, .rf-popup--bottom-left { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .rf-popup__box, .rf-popup__overlay { transition: none; } }

/* ---------- softer text colours (blue / blue-grey instead of near-black) ----------
   All text in style.css uses these three tokens, so changing them here recolours
   every page. Contrast on white stays above WCAG AA (4.5:1). */
:root {
  --navy-text: #174472;  /* headings, links, labels: deep blue  (was #0a2342) */
  --ink: #3f5469;        /* body text: slate blue-grey           (was #1b2a3a) */
  --muted: #627589;      /* secondary text: soft grey-blue       (was #3a4757) */
}
/* long-form reading text that had its own hard-coded dark colour */
.bp-body,
.tm-modal__bio,
.lg-body p,
.lg-list li,
.lg-table td,
.lg-compare__col li,
.cs-story { color: var(--ink); }

/* ---------- testimonial quotes: readable body font instead of the headline serif ---------- */
.ts-quote blockquote {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.25vw, 18px);
  font-weight: 500;
  line-height: 1.75;
  color: var(--ink);
}
.ts-quote__author b { font-weight: 800; letter-spacing: 0.005em; }

/* ---------- top strips: blue on gold, crisp white on navy (no near-black text) ---------- */
/* no double-tap zoom (page zoom is also blocked in site.js + viewport meta) */
html { touch-action: manipulation; }
/* off-canvas menu: header blur (backdrop-filter) would make the fixed .main-nav position
   against the header, so the hidden panel (translateX 105%) pushed the page sideways */
@media (max-width: 1279px) {
  .site-header.is-scrolled { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
}
/* gold ticker */
.tax-notice { color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(11, 49, 88, 0.35); }
.tax-notice strong { color: #fff; }
.tax-notice i { color: #fff; opacity: 0.95; }
.tax-notice__item::after { background: transparent; }
/* navy contact bar */
.topbar { color: rgba(255, 255, 255, 0.94); font-weight: 600; }
.topbar__info i { color: var(--gold-400); }
.topbar__info a:hover { color: var(--gold-300); }
.topbar__info li + li::before { background: rgba(255, 255, 255, 0.4); }
.topbar__link { color: var(--gold-300); }
.topbar__social a { color: var(--white); background: rgba(255, 255, 255, 0.12); }

/* ==========================================================================
   SITEMAP page (/sitemap) — prefix .sm-
   ========================================================================== */
/* quick-jump chips in the banner */
.sm-jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.sm-jump a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}
.sm-jump a i { color: var(--gold-300); font-size: 13px; transition: color 0.3s; }
.sm-jump a:hover { color: var(--navy-900); background: var(--gold-grad); border-color: transparent; transform: translateY(-2px); }
.sm-jump a:hover i { color: var(--navy-900); }

/* layout */
.sm-main { padding: clamp(36px, 4vw, 60px) 0 clamp(64px, 7vw, 100px); background: linear-gradient(180deg, #fff 0%, var(--cream-2) 100%); }
.sm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.sm-card--wide { grid-column: 1 / -1; }

/* card */
.sm-card {
  scroll-margin-top: calc(var(--header-h) + 20px);
  padding: 24px 24px 18px;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid #efe7d8;
  box-shadow: 0 12px 30px rgba(10, 35, 66, 0.06);
}
.sm-card__head {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 16px; margin-bottom: 10px;
  border-bottom: 1.5px dashed #ebe1cf;
}
.sm-card__icon {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  font-size: 19px; color: var(--white);
  background: var(--gold-grad);
  box-shadow: 0 10px 20px rgba(208, 148, 32, 0.3);
}
.sm-card__heading { flex: 1; min-width: 0; }
.sm-card__num { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em; color: var(--gold-500); }
.sm-card__heading h2 { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.15; color: var(--navy-text); }
.sm-card__count {
  flex-shrink: 0; padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; color: var(--navy-text); background: var(--sky);
}

/* tiles (main pages, policies) */
.sm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; padding-top: 6px; }
.sm-tiles a {
  display: flex; align-items: center; gap: 12px; height: 100%;
  padding: 12px 14px; border-radius: 14px;
  font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--navy-text);
  background: var(--cream-2); border: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.sm-tiles a > i:first-child {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 14px;
  color: var(--gold-500); background: var(--white);
  transition: background 0.3s, color 0.3s;
}
.sm-tiles a > span { flex: 1; min-width: 0; }

/* lists (programs, cases, posts) */
.sm-list li + li { border-top: 1px solid #f3ede2; }
.sm-list a {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 6px; border-radius: 12px;
  transition: background 0.3s;
}
.sm-list__icon {
  flex-shrink: 0; width: 32px; height: 32px; margin-top: 1px; border-radius: 10px;
  display: grid; place-items: center; font-size: 13px;
  color: var(--gold-500); background: var(--cream-3);
  transition: background 0.3s, color 0.3s;
}
.sm-list a > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sm-list b { font-size: 15.5px; font-weight: 800; line-height: 1.35; color: var(--navy-text); transition: color 0.3s; }
.sm-list small {
  font-size: 13.5px; line-height: 1.5; color: var(--muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.sm-list small i { color: var(--gold-500); font-size: 11.5px; margin-right: 2px; }
.sm-list--scroll { max-height: 520px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }

/* arrow that slides in on hover */
.sm-go { flex-shrink: 0; align-self: center; font-size: 12px; color: var(--gold-500); opacity: 0.45; transition: opacity 0.3s, transform 0.3s var(--ease); }

@media (hover: hover) {
  .sm-tiles a:hover { background: var(--white); border-color: var(--gold-300); box-shadow: 0 10px 22px rgba(10, 35, 66, 0.08); transform: translateY(-2px); }
  .sm-tiles a:hover > i:first-child,
  .sm-list a:hover .sm-list__icon { color: var(--white); background: var(--gold-grad); }
  .sm-list a:hover { background: var(--cream-2); }
  .sm-list a:hover b { color: var(--gold-500); }
  .sm-tiles a:hover .sm-go,
  .sm-list a:hover .sm-go { opacity: 1; transform: translateX(3px); }
}

.sm-xml { margin-top: 16px; padding-top: 14px; border-top: 1.5px dashed #ebe1cf; font-size: 14px; color: var(--muted); }
.sm-xml i { color: var(--gold-500); margin-right: 4px; }
.sm-xml a { font-weight: 800; color: var(--navy-text); text-decoration: underline; text-decoration-color: var(--gold-300); text-underline-offset: 3px; }

/* tablets: programs + cases side by side, blog full width */
@media (max-width: 1099px) {
  .sm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  #blog.sm-card { grid-column: 1 / -1; }
  .sm-list--scroll { max-height: none; }
}
/* phones: one column, compact cards */
@media (max-width: 767px) {
  .sm-grid { grid-template-columns: 1fr; gap: 16px; }
  .sm-card { padding: 18px 16px 12px; border-radius: 18px; }
  .sm-card__head { gap: 12px; padding-bottom: 14px; }
  .sm-card__icon { width: 42px; height: 42px; font-size: 17px; border-radius: 12px; }
  .sm-card__heading h2 { font-size: 21px; }
  .sm-jump { gap: 8px; margin-top: 20px; }
  .sm-jump a { padding: 7px 12px; font-size: 13px; }
  .sm-list b { font-size: 15px; }
  .sm-list a { padding: 12px 2px; }
}
@media (max-width: 575px) {
  /* main pages: two compact columns instead of one long list */
  .sm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sm-tiles a { gap: 9px; padding: 10px; font-size: 14px; border-radius: 12px; }
  .sm-tiles a > i:first-child { width: 28px; height: 28px; font-size: 12.5px; border-radius: 8px; }
  .sm-tiles .sm-go { display: none; }
}
