/* cmsms stylesheet: theme-main-anim modified: Sunday, June 7, 2026 10:36:50 PM */
/* stylesheet.css — v3.39 */
/* =========================================================
   Nicholas Shore — Chemistry Consultant
   Aesthetic: Technical precision · Clean, structured, confident
   Fonts: Served locally — upload woff2 files per SETUP_GUIDE
   ========================================================= */

/* ── LOCAL FONT DECLARATIONS ──────────────────────────────
   Upload these files to /uploads/fonts/ on your server.
   Download links are in SETUP_GUIDE.md
   --------------------------------------------------------- */
@font-face {
  font-family: 'Source Serif';
  src: url('/uploads/fonts/sourceserif4-variable.woff2') format('woff2-variations'),
       url('/uploads/fonts/sourceserif4-variable.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif';
  src: url('/uploads/fonts/sourceserif4-italic-variable.woff2') format('woff2-variations'),
       url('/uploads/fonts/sourceserif4-italic-variable.woff2') format('woff2');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('/uploads/fonts/cabinetgrotesk-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── DESIGN TOKENS ── */
:root {
  /* Palette — slate + teal accent, cream ground */
  --ink:          #1a1f2e;
  --ink-mid:      #4a5068;
  --ink-muted:    #8a90a8;
  --canvas:       #f8f7f4;
  --surface:      #ffffff;
  --accent:       #1a6b5a;   /* deep teal — precision, science, trust */
  --accent-lt:    #e8f4f1;
  --accent-dk:    #124d41;
  --rule:         #e4e2dc;
  --rule-dark:    #c8c5bc;

  /* Type */
  --font-display: 'Source Serif', Georgia, 'Times New Roman', serif;
  --font-body:    'Cabinet Grotesk', system-ui, sans-serif;

  /* Space */
  --sp-xs:  0.5rem;
  --sp-sm:  1rem;
  --sp-md:  2rem;
  --sp-lg:  4rem;
  --sp-xl:  7rem;

  /* Misc */
  --radius:     4px;
  --radius-lg:  8px;
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --t:          0.28s var(--ease);
  --shadow-sm:  0 2px 8px rgba(26,31,46,0.07);
  --shadow-md:  0 6px 24px rgba(26,31,46,0.10);
  --shadow-lg:  0 16px 48px rgba(26,31,46,0.13);

  /* Nav dropdown */
  --dropdown-bg: var(--surface);
  --dropdown-w:  220px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Disable browser auto-text-inflation on mobile (Firefox Android,
     Safari iOS). Without this, Firefox Android's font-inflation can
     enlarge text and break responsive layouts — text spills past its
     container, justified edge-to-edge. Our design is already mobile-
     responsive, so we opt out explicitly across browsers.            */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Smooth scroll only for users who haven't requested reduced motion.
   Removed from global html rule to avoid surprise smooth-scrolls when
   the browser jumps to anchors on navigation. The back-to-top button
   and other deliberate scrolls still pass behavior:'smooth' in JS.   */
@media (prefers-reduced-motion: no-preference) {
  html:focus-within { scroll-behavior: smooth; }
}
body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink);
  background: var(--canvas);
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 3rem);   letter-spacing: -0.015em; }
h3 { font-size: clamp(1.3rem, 2vw, 1.75rem);  letter-spacing: -0.01em; }
h4 { font-size: 1.1rem; font-family: var(--font-body); font-weight: 600; }

p  { margin-bottom: var(--sp-sm); max-width: 68ch; }
a  { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent-dk); }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; }

/* ── TinyMCE / content block image alignment ──────────────────
   TinyMCE adds alignment via class (mce-class) or inline style.
   We must NOT use display:block globally or float stops working.
   ─────────────────────────────────────────────────────────────*/

/* TinyMCE alignment classes */
img.align-left,
img[style*="float: left"],
img[style*="float:left"] {
  float: left;
  margin: 0.25em 1.5em 1em 0;
  display: inline;
}
img.align-right,
img[style*="float: right"],
img[style*="float:right"] {
  float: right;
  margin: 0.25em 0 1em 1.5em;
  display: inline;
}
img.align-center,
img[style*="margin: 0 auto"],
img[style*="margin:0 auto"],
img[style*="display: block; margin-left: auto"],
img[style*="display:block; margin-left:auto"] {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* figure/figcaption from TinyMCE 5+ */
figure {
  margin: 1.5em 0;
  display: table;       /* shrink-wraps to image width */
}
figure.align-left  { float: left;  margin-right: 1.5em; }
figure.align-right { float: right; margin-left: 1.5em;  }
figure.align-center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
figcaption {
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-align: center;
  padding-top: 0.4em;
  display: table-caption;
  caption-side: bottom;
}

/* Clearfix for content blocks containing floated images */
.site-main .container::after,
.svc-panel-body::after {
  content: '';
  display: table;
  clear: both;
}

/* Images inside content blocks that have NO alignment set —
   keep them inline/natural rather than forcing block */
.site-main p img,
.svc-panel-body p img {
  vertical-align: middle;
}

ul, ol { padding-left: 1.4em; margin-bottom: var(--sp-sm); }
li + li { margin-top: 0.3em; }
hr { border: none; border-top: 1px solid var(--rule); margin: var(--sp-lg) 0; }

blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--sp-sm) var(--sp-md);
  margin: var(--sp-md) 0;
  background: var(--accent-lt);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--ink-mid);
}

/* ── LAYOUT ── */
.container { width: min(1160px, 92vw); margin-inline: auto; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.8em 1.8em;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  transition: all var(--t);
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dk);
  border-color: var(--accent-dk);
  color: #fff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-dark);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--canvas);
  border-color: var(--ink);
}

/* ════════════════════════════════════════════════
   HEADER & NAVIGATION
   ════════════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(248, 247, 244, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow var(--t), padding var(--t);
  padding: 0;
}
.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: var(--sp-md);
  width: min(1160px, 92vw);
  margin-inline: auto;
  height: 64px;
}

/* ── Logo ── */
.site-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
  transition: opacity var(--t);
}
.site-logo:hover { opacity: 0.7; color: var(--ink); }

/* ── Logo image ── */
/* Fills the header bar height regardless of source image dimensions.
   Aspect ratio is preserved; width auto-adjusts.                    */
.site-logo-img {
  height: 48px;          /* fills the 64px header with 8px top/bottom margin */
  width: auto;
  max-width: 200px;      /* safety cap for very wide logos */
  object-fit: contain;
  display: block;
  margin-right: 0.6rem;  /* gap between logo and site name text */
  flex-shrink: 0;
}

/* In the dark footer, scale slightly smaller and keep proportional */
.site-footer .site-logo-img {
  height: 36px;
  margin-right: 0.5rem;
}

/* ── Top-level nav list ── */
.site-nav { display: flex; align-items: stretch; }

.nav-list {
  display: flex;
  list-style: none;
  padding: 0; margin: 0;
  align-items: stretch;
  gap: 0;
}

/* ── Top-level item ── */
.nav-item {
  position: relative;
  display: flex;
  align-items: stretch;
}
.nav-item > a {
  display: flex;
  align-items: center;
  gap: 0.3em;
  padding: 0 1rem;
  font-size: 0.825rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-mid);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--t), border-color var(--t);
  text-decoration: none;
}
.nav-item > a:hover,
.nav-item.current > a,
.nav-item.is-open > a {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* Arrow indicator for items with children */
.nav-arrow {
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.5;
  transition: transform var(--t);
}
.nav-item.is-open > a .nav-arrow,
.dropdown-item.is-open > a .nav-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

/* ── Level 1 dropdown ── */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: var(--dropdown-w);
  background: var(--dropdown-bg);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 0.4rem 0;
  z-index: 300;
  animation: dropIn 0.18s var(--ease) both;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.nav-item.is-open > .dropdown,
.dropdown-item.is-open > .dropdown { display: block; }

/* ── Hover-triggered dropdowns (desktop) ──
   :hover opens the dropdown; JS .is-open is kept as fallback for touch.
   The top-level <a> remains fully clickable — hover shows the menu,
   click follows the link. The 0.15s delay prevents flicker on mouse-through. */
@media (hover: hover) and (pointer: fine) {
  .nav-item:hover > .dropdown { display: block; }
  .dropdown-item:hover > .dropdown--sub { display: block; }
}

/* Level 1 dropdown items */
.dropdown-item {
  position: relative;
}
.dropdown-item > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-mid);
  transition: background var(--t), color var(--t);
  text-decoration: none;
  white-space: nowrap;
}
.dropdown-item > a:hover,
.dropdown-item.current > a,
.dropdown-item.is-open > a {
  background: var(--accent-lt);
  color: var(--accent-dk);
}
.dropdown-item > a .nav-arrow {
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  border-right: none;
  width: auto; height: auto;
}
.dropdown-item.is-open > a .nav-arrow { transform: none; }

/* ── Level 2 sub-dropdown ── */
.dropdown--sub {
  top: 0;
  left: 100%;
  border-top: 2px solid var(--accent);
  /* dropIn animation in animations.css */
}

/* ── Mobile toggle button ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  align-self: center;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ink);
  transition: all var(--t);
  transform-origin: center;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--ink);    /* image set via content block 'hero_bg_image' on the element */
  padding-top: 64px;               /* clears fixed header */
}
.hero-inner {
  width: min(1160px, 92vw);
  margin-inline: auto;
  position: relative;
  z-index: 2;
  padding: var(--sp-xl) 0;
  max-width: 780px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4ecfb0;          /* bright teal — visible on dark hero bg */
  margin-bottom: var(--sp-md);
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 28px; height: 2px;
  background: #4ecfb0;     /* match bright teal */
}
.hero-title {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: var(--sp-md);
}
.hero-title em {
  font-style: italic;
  color: #4ecfb0;   /* bright teal on dark bg */
  font-weight: 400;
}
.hero-sub {
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255,255,255,0.72);
  max-width: 54ch;
  line-height: 1.75;
  margin-bottom: var(--sp-lg);
}
.hero-cta {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}
.hero .btn-ghost {
  color: rgba(255,255,255,0.75);
  border-color: rgba(255,255,255,0.25);
}
.hero .btn-ghost:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
}

/* Geometric background decoration — structured grid, no clichés */
.hero-deco {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.deco-grid {
  position: absolute;
  top: 0; right: 0;
  width: 50%; height: 100%;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.6), transparent);
}
.deco-bar {
  position: absolute;
  right: 0;
  width: 4px;
  background: var(--accent);
  opacity: 0.7;
}
.deco-bar--1 { top: 15%; height: 22%; }
.deco-bar--2 { top: 50%; height: 14%; opacity: 0.35; }


/* ══════════════════════════════════════════════════════════════════════
   CENTRED CONTENT COLUMN with scroll-progress accent bar
   ══════════════════════════════════════════════════════════════════════
   Layout (default template only — services template uses its own layout):
     .site-main > .container holds a CSS grid with three tracks:
       1. left margin (auto, fluid)
       2. content column (centred, max ~720px for ideal CPL)
       3. right rail (160px) — holds the scroll progress bar
     On viewports below 900px, collapse to single column (no rail visible).

   The scroll progress bar uses CSS scroll-driven animations
   (animation-timeline: scroll()) — pure CSS, runs on the compositor.
   For browsers without support (Firefox <129, Safari <26) we provide
   a JS fallback in default_template.tpl that toggles a CSS variable.
   ══════════════════════════════════════════════════════════════════════ */

/* Default-template content area: 3-column grid on .site-main.
   .container sits in column 2 (centred), .scroll-rail in column 3.
   .container itself remains a normal block element so floats inside it
   (e.g. images set to float right in TinyMCE) work as expected.       */
.page-inner .site-main {
  display: grid;
  grid-template-columns:
    1fr
    minmax(0, 720px)
    1fr;
  column-gap: 0;
  align-items: start;
}
.page-inner .site-main > .container {
  grid-column: 2;
  width: 100%;
  max-width: none;              /* override the global .container width */
  margin-inline: 0;             /* grid handles centring now */
}
.page-inner .site-main > .scroll-rail {
  grid-column: 3;
  justify-self: start;
  position: sticky;
  top: 80px;
  height: calc(100vh - 96px);
  width: 8px;
  margin-left: 2.5rem;
  pointer-events: none;
}

/* The bar itself — looks like a Gantt-style progress bar, vertical */
.scroll-rail-bar {
  display: block;
  width: 8px;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(
    to bottom,
    var(--accent-dk) 0%,
    var(--accent) 50%,
    var(--accent-dk) 100%
  );
  /* Default opacity for browsers without scroll-driven animations.
     The JS fallback in default_template.tpl will override this. */
  opacity: var(--scroll-progress, 0.15);
  transition: opacity 0.05s linear;
  box-shadow: 0 1px 3px rgba(26,107,90,0.2);
}

/* Native scroll-driven animation — Chrome 115+, Safari 26+, Firefox-flag */
@supports (animation-timeline: scroll()) {
  @keyframes scroll-fade-in {
    from { opacity: 0.12; }
    to   { opacity: 0.95; }
  }
  .scroll-rail-bar {
    animation: scroll-fade-in linear;
    animation-timeline: scroll(root block);
  }
}

/* Hide rail on narrow viewports — content goes full-width */
@media (max-width: 900px) {
  .page-inner .site-main {
    display: block;             /* normal flow, full width */
  }
  .page-inner .site-main > .container {
    margin-inline: auto;        /* restore standard centring */
    max-width: min(720px, 92vw);
  }
  .scroll-rail { display: none; }
}

/* ════════════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════════════ */
.site-main {
  padding-top: var(--sp-xl);
  padding-bottom: var(--sp-xl);
}
.page-home .site-main { padding-top: var(--sp-md); }

.page-header {
  padding-bottom: var(--sp-lg);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--sp-lg);
}
.page-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.page-eyebrow:empty { display: none; }
.page-title { font-size: clamp(2rem, 4vw, 3.5rem); }

/* ── Section chrome ── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-md);
}
.section-label::before {
  content: '';
  display: block;
  width: 24px; height: 2px;
  background: var(--accent);
}

/* ── Services / expertise grid ── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5px;                    /* tight gap = structured grid feel */
  background: var(--rule);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: var(--sp-lg);
}
.service-item {
  background: var(--surface);
  padding: var(--sp-md) var(--sp-md) calc(var(--sp-md) + 0.5rem);
  transition: background var(--t);
}
.service-item:hover { background: var(--accent-lt); }
.service-num {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 300;
  font-style: italic;
  color: var(--rule-dark);
  line-height: 1;
  margin-bottom: var(--sp-sm);
  transition: color var(--t);
}
.service-item:hover .service-num { color: var(--accent); }
.service-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--ink);
}
.service-desc { font-size: 0.9rem; color: var(--ink-mid); line-height: 1.65; }

/* ── Expertise / credentials strip ── */
.credentials-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin: var(--sp-lg) 0;
}
.credential-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.4em 0.9em;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-mid);
  transition: all var(--t);
}
.credential-tag:hover {
  border-color: var(--accent);
  color: var(--accent-dk);
  background: var(--accent-lt);
}

/* ── Project / case study cards ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-md);
  margin-top: var(--sp-lg);
}
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--rule-dark);
  transform: translateY(-3px);
}
.card-band {
  height: 4px;
  background: var(--accent);
}
.card-body { padding: var(--sp-md); }
.card-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
}
.card-excerpt { font-size: 0.9rem; color: var(--ink-mid); }
.card-footer {
  padding: var(--sp-sm) var(--sp-md);
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-meta { font-size: 0.78rem; color: var(--ink-muted); }

/* ── Split / about section ── */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--sp-lg);
  align-items: center;
  margin: var(--sp-xl) 0;
}
.split-image {
  aspect-ratio: 3/4;
  background: var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.split-image img { width: 100%; height: 100%; object-fit: cover; }
.split-content { padding: var(--sp-md) 0; }
.split-content h2 { margin-bottom: var(--sp-md); }

/* ── Contact form ── */
.contact-form { max-width: 640px; margin-top: var(--sp-md); }
.form-group { margin-bottom: var(--sp-md); }
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-mid);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75em 1em;
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,107,90,0.1);
}
.form-group textarea { min-height: 150px; resize: vertical; }

/* ════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════ */
.site-footer {
  background: var(--ink);
  color: rgba(248,247,244,0.65);
  padding: var(--sp-xl) 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-lg);
  width: min(1160px, 92vw);
  margin-inline: auto;
  padding-bottom: var(--sp-lg);
  border-bottom: 1px solid rgba(248,247,244,0.08);
}
.site-footer .site-logo  { color: #fff; font-size: 1.2rem; margin-bottom: 0.75rem; }
.site-footer .site-logo:hover { opacity: 0.6; color: #fff; }
.footer-tagline { font-size: 0.88rem; max-width: 32ch; line-height: 1.6; }

/* ── Legal page links in footer (under brand/tagline) ── */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0;
  margin-top: 0.9rem;
}
.footer-legal-link {
  font-size: 0.75rem;
  font-family: var(--font-body);
  color: rgba(248,247,244,0.35);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--t);
  white-space: nowrap;
}
.footer-legal-link::after {
  content: '·';
  margin: 0 0.45em;
  color: rgba(248,247,244,0.2);
}
.footer-legal-link:last-child::after { content: none; }
.footer-legal-link:hover { color: rgba(248,247,244,0.75); }
.footer-nav ul  { list-style: none; padding: 0; }
.footer-nav li + li { margin-top: 0.55rem; }
.footer-nav a   { font-size: 0.85rem; color: rgba(248,247,244,0.5); transition: color var(--t); }
.footer-nav a:hover { color: #fff; }

/* ── Footer prev / up / next arrow buttons ──
   Teal outline on the dark ink footer; fill teal on hover with bone text.
   Matches the haptic feel of the "Full details" button.                 */
.footer-arrows {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.footer-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.5em 1em;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  text-decoration: none;
  transition: all var(--t);
  white-space: nowrap;
}
.footer-arrow:hover {
  background: var(--accent);
  color: var(--canvas);          /* bone text on teal */
  border-color: var(--accent);
}
.footer-arrow-icon { font-size: 1.05em; line-height: 1; transition: transform var(--t); }
.footer-arrow--prev:hover .footer-arrow-icon { transform: translateX(-3px); }
.footer-arrow--next:hover .footer-arrow-icon { transform: translateX(3px); }
.footer-arrow--up:hover   .footer-arrow-icon { transform: translateY(-3px); }
/* Disabled (no prev/next available) */
.footer-arrow.is-disabled {
  color: rgba(248,247,244,0.2);
  border-color: rgba(248,247,244,0.12);
  cursor: default;
}

/* ── Back to top button (end of content area) ── */
.back-to-top-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-lg);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--rule);
}
.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.6em 1.3em;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--t);
}
.back-to-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.back-to-top-icon { font-size: 1.05em; line-height: 1; transition: transform var(--t); }
.back-to-top:hover .back-to-top-icon { transform: translateY(-3px); }
.footer-contact-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.footer-contact p { font-size: 0.9rem; }
.social-links { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.social-links a {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(248,247,244,0.15);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: rgba(248,247,244,0.5);
  transition: all var(--t);
}
.social-links a:hover { border-color: var(--accent); color: var(--accent); background: rgba(26,107,90,0.1); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(1160px, 92vw);
  margin-inline: auto;
  padding: var(--sp-md) 0;
  font-size: 0.78rem;
  color: rgba(248,247,244,0.28);
}

/* Animations: see /uploads/css/animations.css (loaded via template) */
  to   { opacity: 1; transform: none; }
}
/* .animate-in rules live in /uploads/css/animations.css */


/* ══════════════════════════════════════════════════════════════════════
   PAGE BACKGROUND IMAGE + OVERLAY — LAYER MODEL
   ══════════════════════════════════════════════════════════════════════
   Pattern (confirmed by CSS spec and multiple sources):
     1. Put background-image on the WRAPPER (.site-main) via inline <style>
     2. ::before on the SAME wrapper = overlay (position:absolute, inset:0)
     3. All direct children get position:relative; z-index:1 to sit above overlay
     4. Header and footer are outside .site-main entirely — unaffected

   This is the canonical ::before overlay pattern. It works because:
   - background-image is on .site-main itself (not body, not a pseudo-element)
   - ::before is absolute-positioned over it with rgba background
   - Content children are z-index:1, overlay is z-index:0
   ══════════════════════════════════════════════════════════════════════ */

/* The overlay is now a layered linear-gradient on the bg-image itself,
   set by the inline <style> tag in the template when page_bg_url is present.
   No ::before, no position:relative needed — much simpler and more reliable. */
.site-main {
  min-height: calc(100vh - 64px); /* always at least viewport-fill below header */
}

/* Header: fixed, always on top */
.site-header {
  z-index: 200;
}

/* Footer: solid background — bg-image on .site-main cannot bleed through
   because .site-footer is a sibling of .site-main, not a child           */
.site-footer {
  position: relative;
  z-index: 10;
  background: var(--ink);
}

/* ── Protected email links (rendered by /uploads/js/email-protect.js) ── */
.email-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color 0.2s ease;
}
.email-link:hover { color: var(--accent-dk); }
/* Before JS runs, show fallback text inline (set in HTML) instead of empty link */
.email-link:not([data-activated]):empty::before {
  content: attr(data-l);
  color: var(--ink-muted);
}

/* ════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .split-section { grid-template-columns: 1fr; }
  .footer-inner  { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: 64px; right: 0; bottom: 0;
    width: min(340px, 88vw);    /* wider panel */
    background: var(--surface);
    border-left: 1px solid var(--rule);
    padding: var(--sp-md) var(--sp-md) var(--sp-xl); /* extra bottom padding */
    overflow-y: auto;           /* scrollable if many items */
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform var(--t);
    z-index: 190;
    box-shadow: none;
  }
  .site-nav.is-open { transform: none; box-shadow: var(--shadow-lg); }

  .nav-list { flex-direction: column; gap: 0; align-items: stretch; }
  .nav-item  { flex-direction: column; align-items: stretch; }
  .nav-item > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
    border-left: none;
    font-size: 1rem;             /* larger tap target */
    letter-spacing: 0.04em;
    min-height: 48px;            /* WCAG touch target */
  }
  .nav-item.current > a { color: var(--accent); }

  /* Mobile dropdowns — stack inline, indented */
  .dropdown, .dropdown--sub {
    position: static;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0 0 0 var(--sp-sm);
    animation: none;
    background: var(--accent-lt);
    margin: 0 calc(-1 * var(--sp-md));
    padding: 0 var(--sp-md) 0 calc(var(--sp-md) + var(--sp-sm));
  }
  .dropdown-item > a {
    padding: 0.75rem 0;
    font-size: 0.95rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(26,107,90,0.12);
  }
  .dropdown--sub {
    background: rgba(26,107,90,0.06);
    padding-left: calc(var(--sp-md) + var(--sp-md));
  }

  .footer-inner { grid-template-columns: 1fr; gap: var(--sp-md); }
  .footer-bottom { flex-direction: column; gap: 0.4rem; text-align: center; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
}

/* ══════════════════════════════════════════════════════════════════════
   STRATEGY A — Mobile content normalisation
   Constrains user-generated content (TinyMCE output) to behave on small
   screens regardless of inline width attributes, floats, or oversized
   embedded elements. Applied at <=700px so tablets and desktop retain
   their flow-around behaviour.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Universal media constraint — applies at ALL widths ──
   Even on desktop, no image/figure/table/iframe should ever push past
   its container. The override is necessary because TinyMCE writes
   width="800" attributes directly on <img>, and HTML width attributes
   beat plain CSS width rules.                                       */
.site-main img,
.site-main figure,
.site-main table,
.site-main iframe,
.site-main video,
.svc-panel-body img,
.svc-panel-body figure,
.svc-panel-body table,
.svc-panel-body iframe,
.svc-panel-body video {
  max-width: 100%;
  height: auto;
}
.site-main table,
.svc-panel-body table {
  /* tables with many columns get an overflow scroll wrapper instead
     of breaking the layout; wrap them in a div.table-wrap in content. */
  display: block;          /* allow horizontal scroll on overflow */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Mobile-only rules ── */
@media (max-width: 700px) {

  /* Container side padding — consistent left/right gutter for ALL content */
  .container {
    width: 100%;
    padding-inline: 1rem;
  }

  /* Unfloat everything — on mobile, images and figures stack full-width.
     This catches TinyMCE classes, inline styles, and figure variants. */
  .site-main img,
  .site-main figure,
  .svc-panel-body img,
  .svc-panel-body figure {
    float: none !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1em;
    margin-bottom: 1em;
    max-width: 100%;
    width: auto;
    height: auto;
  }

  /* Override inline width/height attributes that TinyMCE emits */
  .site-main img[width],
  .site-main img[style*="width"],
  .svc-panel-body img[width],
  .svc-panel-body img[style*="width"] {
    width: auto !important;
    max-width: 100% !important;
  }

  /* figures with display: table need to be block on mobile to span */
  .site-main figure,
  .svc-panel-body figure {
    display: block;
    width: 100% !important;
  }

  /* When figure is block (mobile), figcaption can't be table-caption.
     Make it a plain block centred below the image.                  */
  .site-main figcaption,
  .svc-panel-body figcaption {
    display: block;
    caption-side: unset;
    margin-top: 0.5rem;
    text-align: center;
  }

  /* Paragraph max-width caps shouldn't constrain narrower than the column */
  .site-main p,
  .svc-panel-body p {
    max-width: 100%;
  }

  /* Headings — slight tightening on very small screens */
  h1 { line-height: 1.15; }
  h2, h3 { line-height: 1.2; }

  /* Long words and URLs — break instead of overflowing */
  .site-main, .svc-panel-body {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
}
