/* ==========================================================================
   CansultHub UI refresh layer (October 2026)
   --------------------------------------------------------------------------
   Loaded LAST on every page (web/lib/site/render.tsx), on top of the imported WordPress/Elementor styles in
   global.css. It polishes the existing markup and keeps the brand exactly: same tokens, fonts, logo, pages and
   section order. Nothing here changes what a page says.

   Sections: 1 tokens · 2 base type and rhythm · 3 focus and links · 4 buttons · 5 header and mobile menu ·
   6 cards · 7 forms · 8 tables · 9 page templates · 10 footer · 11 motion · 12 responsive guards · 13 print
   See docs/cansulthub/12-ui-refresh.md.
   ========================================================================== */

/* ---- 1. Tokens: a small spacing / radius / shadow / type scale derived from the current look --------------- */
:root {
  /* Brand tokens stay in global.css (--ink, --ink-soft, --ivory, --paper, --brass, --brass-deep, --emerald,
     --stone, --stone-line, --display, --body, --mono). Tints below are derived from them. */
  --brass-tint: color-mix(in srgb, var(--brass) 9%, var(--paper));
  --emerald-tint: color-mix(in srgb, var(--emerald) 10%, var(--paper));
  --olive-text: #5f661d; /* --emerald darkened for small text (AA on ivory/paper) */
  --ink-wash: color-mix(in srgb, var(--ink) 5%, var(--paper));
  --error: #a32a2a;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --section-y: clamp(64px, 9vw, 112px);

  --radius-s: 4px;
  --radius-m: 10px;
  --radius-l: 16px;

  --shadow-1: 0 1px 2px rgba(18, 42, 49, 0.06), 0 8px 20px -14px rgba(18, 42, 49, 0.22);
  --shadow-2: 0 2px 4px rgba(18, 42, 49, 0.06), 0 24px 44px -26px rgba(18, 42, 49, 0.3);

  --step--1: clamp(0.8125rem, 0.79rem + 0.12vw, 0.875rem);
  --step-0: clamp(1rem, 0.97rem + 0.18vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.07rem + 0.3vw, 1.3125rem);
  --step-2: clamp(1.375rem, 1.25rem + 0.6vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.5rem + 1.1vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.8rem + 2vw, 3.75rem);

  --focus-ring: 3px solid var(--brass-deep);
  --tap: 44px;
  --measure: 68ch;
}

/* ---- 2. Base type and rhythm ------------------------------------------------------------------------------ */
html {
  scroll-padding-top: 96px; /* anchors land below the sticky header */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-size: var(--step-0);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.sec-head h2, .cta-band h2 { font-size: var(--step-3); line-height: 1.14; }
.pack-head h3 { font-size: var(--step-2); }
.sec-head { max-width: 680px; }
.intro, .lede, .sec-head p, .pack-head p.intro { max-width: var(--measure); }

/* one eyebrow style site-wide: mono, caps through CSS only, the same tracking */
.eyebrow, .pack-head .kicker, .pack-head .idx, .kicker {
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow { font-size: 11.5px; letter-spacing: 0.2em; }
.eyebrow.olive, .pack.olive .pack-head .kicker, .track.olive .pack-head .kicker { color: var(--olive-text); }

/* ---- 3. Focus and links ----------------------------------------------------------------------------------- */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}
.why :focus-visible, #site-footer :focus-visible, body.home .cta-band :focus-visible { outline-color: var(--paper); }
main p a:not(.btn):not(.go), main li a:not(.btn):not(.go), main td a:not(.btn):not(.go) {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
main p a:not(.btn):not(.go):hover, main li a:not(.btn):not(.go):hover, main td a:not(.btn):not(.go):hover { text-decoration-color: currentColor; color: var(--brass-deep); }
.skip-link:focus, .skip-link:focus-visible {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-s);
}
abbr[title] { text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 0.2em; cursor: help; }

/* ---- 4. Buttons: one primary, one secondary, one text link ------------------------------------------------ */
.btn, .nav-cta, .ff-btn-submit {
  min-height: 48px;
  border-radius: var(--radius-s);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.07em;
  line-height: 1.2;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary, .nav-cta, .ff-btn-submit {
  background: var(--brass-deep);
  border: 1px solid var(--brass-deep);
  color: var(--paper);
}
.btn-primary:hover, .nav-cta:hover, .ff-btn-submit:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); transform: translateY(-1px); }
.btn:active, .nav-cta:active { transform: translateY(0) scale(0.985); }
.nav-cta { padding: 13px 20px; display: inline-flex; align-items: center; }
.btn-row { gap: var(--space-4); }
/* on the dark bands the primary button inverts so it stays readable */
.why .btn-primary, body.home .cta-band .btn-primary { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.why .btn-primary:hover, body.home .cta-band .btn-primary:hover { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.why .btn-ghost, body.home .cta-band .btn-ghost { border-color: var(--paper); color: var(--paper); }
.why .btn-ghost:hover, body.home .cta-band .btn-ghost:hover { background: var(--paper); color: var(--ink); }
/* text links with an arrow */
.service-card .go, .event-card .go {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--brass-deep);
}

/* ---- 5. Header and mobile menu ---------------------------------------------------------------------------- */
header.site { transition: box-shadow 0.25s ease, background-color 0.25s ease; }
header.site .nav-row { transition: height 0.25s ease; }
header.site .brand-logo { transition: width 0.25s ease; }
header.site.is-compact { background: rgba(251, 250, 245, 0.96); box-shadow: 0 1px 0 var(--stone-line), 0 10px 24px -20px rgba(18, 42, 49, 0.35); }
header.site.is-compact .nav-row { height: 68px; }
header.site.is-compact .brand-logo { width: 116px; height: auto; }
nav.main a { min-height: var(--tap); display: inline-flex; align-items: center; padding-bottom: 0; }
nav.main a.current, nav.main a[aria-current="page"] { color: var(--ink); font-weight: 600; }
nav.main a[aria-current="page"]::after { width: 100%; background: var(--brass-deep); }
nav.main li.has-dropdown:focus-within .dropdown, nav.main li.has-dropdown.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
nav.main li.has-dropdown.esc-closed .dropdown { opacity: 0; visibility: hidden; pointer-events: none; }
.ff-required-note { font-size: var(--step--1); color: var(--text-muted); margin: 0 0 var(--space-4); }
.compass-lede { max-width: 56ch; margin: 0 auto var(--space-5); text-align: center; color: var(--ink-soft); font-size: var(--step-0); }
.dropdown a:hover, .dropdown a:focus-visible { background: var(--brass-tint); }
.nav-toggle { min-width: var(--tap); min-height: var(--tap); }
.mobile-drawer { overflow-y: auto; overscroll-behavior: contain; background: var(--paper); }
.mobile-drawer a { min-height: var(--tap); align-items: center; }
.mobile-drawer .m-cta { margin: 24px 0 32px; justify-content: center; color: var(--paper); border-bottom: 1px solid var(--brass-deep); }
body.nav-open { overflow: hidden; }

/* ---- 6. Cards: one style for service, panel, event, journal, quick-link and package cards ---------------- */
.service-card, .event-card, .client-panel, .journal-card, .info-card, .milestone-card, .plan-card, .special-card {
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
}
.service-card:hover, .event-card:hover, .journal-card:hover, .info-card:hover, .milestone-card:hover, .plan-card:hover,
.special-card:hover, .client-panel:hover {
  box-shadow: var(--shadow-2);
}
.service-card:hover { transform: translateY(-4px); }
.client-panel:hover, .event-card:hover, .journal-card:hover, .info-card:hover { transform: translateY(-2px); }
.media-frame { border-radius: var(--radius-m); overflow: hidden; }
.media-frame img { width: 100%; height: auto; }
.callout { border-radius: var(--radius-m); }
.pkg-pill, .pill { border-radius: 999px; min-height: 40px; }

/* ---- 7. Forms: one field style (Contact, Compass, comments, booking details) ---------------------------- */
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="search"],
select, textarea, .ff-el-form-control {
  min-height: 48px;
  border-radius: 10px;
  font-family: var(--body);
  font-size: 16px; /* never below 16px: iOS zooms smaller inputs */
}
textarea, textarea.ff-el-form-control { min-height: 140px; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .ff-el-form-control:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--brass-deep);
}
.ff-el-input--label label, .field-label { font-weight: 600; color: var(--ink); }
.ff-el-help-message, .field-note, .form-note { color: var(--text-muted); font-size: var(--step--1); margin-top: 6px; }
.ff-el-is-error .ff-el-form-control, .field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--error); }
.text-danger, .field .err, .ff-el-is-error .error {
  color: var(--error);
  font-size: var(--step--1);
  margin-top: 6px;
}
.ff-message-success {
  border: 1px solid color-mix(in srgb, var(--emerald) 55%, transparent);
  background: var(--emerald-tint);
  color: var(--ink);
  border-radius: var(--radius-m);
  padding: 18px 22px;
}
.consent-box { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--stone-line); border-radius: var(--radius-m); padding: 14px 16px; background: var(--paper); }
.consent-box input[type="checkbox"], .ff-el-form-check-input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--brass-deep); }
.consent-box a, .ff-el-form-check-label a { text-decoration: underline; color: var(--brass-deep); }

/* ---- 8. Tables: hairline rows, no horizontal page scroll --------------------------------------------------- */
table.compare th, table.compare td { padding: 14px 16px; }
@media (max-width: 720px) {
  table.compare, .port-table, .mini-table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---- 9. Page templates ----------------------------------------------------------------------------------- */
.meta-row { border-radius: var(--radius-m); }
.meta-item .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.step .stepnum { font-family: var(--mono); color: var(--brass-deep); letter-spacing: 0.12em; }
.ledger-row { align-items: stretch; }
@media (max-width: 640px) {
  .ledger-row { grid-template-columns: repeat(2, 1fr); row-gap: var(--space-6); }
}

/* ---- 10. Footer ----------------------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  border: 1px solid var(--stone-line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--ink); color: var(--paper); }

/* ---- 11. Motion: nothing moves for people who asked for less ------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
}

/* ---- 12. Responsive guards: no horizontal scroll, no clipped text, no upscaled images -------------------- */
html, body { max-width: 100%; overflow-x: clip; }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { overflow-wrap: break-word; }
@media (max-width: 480px) {
  .nav-cta { padding: 12px 12px; font-size: 11px; letter-spacing: 0.04em; }
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row .btn { width: 100%; }
}

/* ---- 12b. Contrast fixes found by the axe scan (WCAG AA) --------------------------------------------------- */
:root { --text-light: #5f665f; } /* the booking and Service Structure pages' "light" grey was #8a8378 (3.6:1) */
.cb-sidebar .cb-nav-item.active .cb-nav-name { color: var(--brass-deep); } /* the page's own style block comes later in the document, so this needs the extra class */
.ph-info-col a { text-decoration: underline; text-underline-offset: 0.2em; }
/* Fluent Forms and the WordPress comment form ship their own blue / pink buttons: use the site's primary button */
.frm-fluent-form .ff-btn-submit, .frm-fluent-form .ff-btn-submit:not(.ff_btn_no_style), #commentform #submit, .comment-form input[type="submit"] {
  background-color: var(--brass-deep) !important;
  border: 1px solid var(--brass-deep) !important;
  color: var(--paper) !important;
  border-radius: var(--radius-s);
  min-height: 48px;
  padding: 12px 24px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.07em;
  cursor: pointer;
}
.frm-fluent-form .ff-btn-submit:hover, .frm-fluent-form .ff-btn-submit:not(.ff_btn_no_style):hover, #commentform #submit:hover, .comment-form input[type="submit"]:hover {
  background-color: var(--ink) !important;
  border-color: var(--ink) !important;
  color: var(--paper) !important;
}

/* ---- 13. Print ------------------------------------------------------------------------------------------ */
@media print {
  header.site, .mobile-drawer, .back-to-top, .cta-band, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
}
