/*
Theme Name: Zenith Go2
Theme URI: https://go2zenith.com
Author: Zenith Business Growth
Description: Agency site theme for Zenith Business Growth. Implements the zh-* component contract that Autopilot's section library emits, so pages are plain HTML in post_content with no page builder and no inline CSS. Brand tokens (the 2025 identity deck: four colours, Bomstad Display + Sora) live in assets/css/brand.css; components in assets/css/base.css.
Version: 1.4.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: Proprietary
Text Domain: zenith-go2
*/

/* ============================================================================
   RESET + TYPOGRAPHY.
   Components are in assets/css/base.css, brand tokens in assets/css/brand.css.
   This file is loaded LAST so the theme header above is what WordPress reads,
   but it must not depend on load order for anything but the reset.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Durations AND delays. A 240ms stagger with a 0.001ms duration is still a
     quarter of a second of nothing happening, which is the thing a reader who
     turned motion off was asking not to see. */
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* No horizontal page scroll at phone width, whatever a section does. */
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; }
img { border-style: none; }

:where(h1, h2, h3, h4, h5, h6) { font-family: var(--heading); color: var(--dark); letter-spacing: -.012em; }
/* :where() has ZERO specificity on purpose. This file is enqueued LAST, so a
   plain `h1, h2 { color: var(--dark) }` here ties with every single-class
   component rule in base.css and wins on order. That is how a heading inside
   a dark section ends up black on black. */

a { color: var(--sky-ink); }
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

/* Skip link: visible only when focused. */
.zh-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 12px 18px;
  background: #fff;
  color: var(--dark);
  font-family: var(--sans);
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
}
.zh-skip:focus { left: 0; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- header --- */
.zh-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(170%) blur(12px);
  border-bottom: 1px solid var(--border);
}
/* The lift once the page has scrolled. It is a shadow PAINTED AT REST on a
   pseudo-element and faded in, not an animated box-shadow and not a change of
   height: the header must never resize under a reader's cursor. The .is-stuck
   class comes from the inline script in functions.php; with no script the
   header is simply the flat one. */
.zh-site-header::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: 0 10px 30px -12px rgba(26, 79, 173, .30);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.zh-site-header.is-stuck::after { opacity: 1; }
.zh-site-header__inner {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 18px;
}
.zh-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.zh-brand__mark {
  width: 34px; height: 34px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--sky) 0%, var(--navy) 100%);
  color: #fff;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
}
.zh-brand__name {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.1;
  color: var(--dark);
  white-space: nowrap;
}
.zh-brand__name small { display: block; font-family: var(--sans); font-weight: 500; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Uploaded lockup. Height-constrained so a logo exported at any width lands
   the same; width auto so the mark-plus-wordmark never distorts. */
.zh-brand--img { padding: 2px 0; }
.zh-brand__logo { display: block; width: auto; height: 34px; max-width: 220px; object-fit: contain; }
@media (min-width: 720px) { .zh-brand__logo { height: 40px; max-width: 260px; } }

.zh-nav { display: none; }
@media (min-width: 1000px) {
  .zh-nav { display: block; }
  .zh-nav ul { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
  .zh-nav a {
    position: relative;
    display: inline-block;
    padding: 6px 0;
    font-family: var(--sans);
    font-size: .94rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
  }
  /* A rule that grows from the left rather than an underline that appears.
     transform only, and it reserves no space, so the nav never reflows. */
  .zh-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--sky);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--dur) var(--ease);
  }
  .zh-nav a:hover { color: var(--sky-ink); }
  .zh-nav a:hover::after { transform: scaleX(1); }
  .zh-nav .current-menu-item > a { color: var(--sky-ink); font-weight: 600; }
  .zh-nav .current-menu-item > a::after { transform: scaleX(1); }

  /* ----------------------------------------------------- services panel ---
     ONE panel with three columns, not a cascade of flyouts. A second-level
     flyout puts a diagonal gap between the mouse and its target, and the menu
     closes the moment the pointer leaves the parent item, which is why that
     pattern needs JavaScript and a timer to be usable at all. Here the whole
     tree is open the moment the panel is.

     It opens on :hover AND on :focus-within, so it is reachable by keyboard
     with no script. visibility (not display) keeps the closed panel out of
     the tab order while still letting it transition. */
  .zh-nav li { position: relative; }

  .zh-nav > ul > li > .sub-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    display: flex;
    align-items: start;
    gap: 34px;
    margin: 0;
    padding: 22px 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-card-hover);
    opacity: 0;
    visibility: hidden;
    translate: -50% 6px;
    transition:
      opacity var(--dur-fast) var(--ease),
      translate var(--dur-fast) var(--ease),
      visibility 0s linear var(--dur-fast);
  }
  .zh-nav > ul > li:hover > .sub-menu,
  .zh-nav > ul > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    translate: -50% 0;
    transition-delay: 0s;
  }

  /* The 14px between the item and the panel is dead space the pointer has to
     cross. This bridges it, and it only exists while the panel is open, so an
     invisible strip is never sitting over the page content underneath. */
  .zh-nav > ul > li.menu-item-has-children:hover::after,
  .zh-nav > ul > li.menu-item-has-children:focus-within::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 16px;
  }

  /* The caret. ::before, because ::after on the link is the underline rule. */
  .zh-nav > ul > li.menu-item-has-children > a { padding-right: 15px; }
  .zh-nav > ul > li.menu-item-has-children > a::after { right: 15px; }
  .zh-nav > ul > li.menu-item-has-children > a::before {
    content: '';
    position: absolute;
    right: 1px;
    top: 50%;
    width: 5px;
    height: 5px;
    margin-top: -4px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    rotate: 45deg;
    opacity: .45;
    transition: rotate var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
  }
  .zh-nav > ul > li.menu-item-has-children:hover > a::before,
  .zh-nav > ul > li.menu-item-has-children:focus-within > a::before {
    rotate: -135deg;
    margin-top: -1px;
    opacity: 1;
  }

  /* A column: the hub, ruled off, then its service pages. */
  .zh-nav > ul > li > .sub-menu > li { min-width: 178px; max-width: 210px; }
  .zh-nav .sub-menu a::after { display: none; }
  .zh-nav > ul > li > .sub-menu > li > a {
    display: block;
    padding: 0 0 9px;
    margin-bottom: 9px;
    border-bottom: 1px solid var(--border);
    font-family: var(--heading);
    font-size: .88rem;
    font-weight: 700;
    color: var(--dark);
  }
  .zh-nav > ul > li > .sub-menu > li > a:hover { color: var(--sky-ink); }

  /* Third level sits inside its column, in normal flow: it inherits the
     flex/absolute rules above otherwise. */
  .zh-nav .sub-menu .sub-menu {
    position: static;
    display: block;
    opacity: 1;
    visibility: visible;
    translate: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transition: none;
  }
  .zh-nav .sub-menu .sub-menu a {
    display: block;
    padding: 5px 0;
    font-size: .87rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--muted);
  }
  .zh-nav .sub-menu .sub-menu a:hover { color: var(--sky-ink); }
  .zh-nav .sub-menu .current-menu-item > a { color: var(--sky-ink); font-weight: 600; }
}

.zh-header__cta { display: flex; align-items: center; gap: 10px; }
/* The phone is the primary conversion on a phone-sized screen; the button text
   collapses but the number never does. */
.zh-header__phone {
  font-family: var(--heading);
  font-weight: 700;
  font-size: .98rem;
  color: var(--dark);
  text-decoration: none;
  white-space: nowrap;
}
.zh-header__phone:hover { color: var(--sky-ink); }
.zh-header__cta .zh-btn { display: none; }
@media (min-width: 620px) { .zh-header__cta .zh-btn { display: inline-flex; } }

/* Mobile menu: a checkbox, so no JavaScript. */
.zh-burger { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer; }
.zh-burger span, .zh-burger span::before, .zh-burger span::after {
  display: block; width: 18px; height: 2px; background: var(--dark); border-radius: 2px; content: '';
}
.zh-burger span { position: relative; }
.zh-burger span::before { position: absolute; top: -6px; }
.zh-burger span::after { position: absolute; top: 6px; }
@media (min-width: 1000px) { .zh-burger { display: none; } }

#zh-menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.zh-mobile-nav { position: relative; z-index: 1; display: none; border-top: 1px solid var(--border); background: #fff; }
#zh-menu-toggle:checked ~ .zh-mobile-nav { display: block; }
@media (min-width: 1000px) { .zh-mobile-nav { display: none !important; } }
.zh-mobile-nav ul { list-style: none; margin: 0; padding: 8px var(--gutter) 18px; }
.zh-mobile-nav li { border-bottom: 1px solid var(--border); }
.zh-mobile-nav li:last-child { border-bottom: 0; }
.zh-mobile-nav a { display: block; padding: 14px 2px; font-family: var(--sans); font-size: 1rem; font-weight: 500; color: var(--text); text-decoration: none; }

/* The services tree, open. Not an accordion: an accordion needs a control per
   branch, and the only no-JS control is another checkbox per item, which is a
   hidden input and a label pretending to be a heading. A list the thumb
   scrolls past is the cheaper answer at this length.
   The left rule is what makes the nesting readable without indent alone. */
.zh-mobile-nav .sub-menu { padding: 2px 0 10px 14px; margin: 0 0 4px; border-left: 2px solid var(--border); }
.zh-mobile-nav .sub-menu li { border-bottom: 0; }
.zh-mobile-nav .sub-menu > li > a { padding: 10px 2px 6px; font-size: .96rem; font-weight: 600; }
.zh-mobile-nav .sub-menu .sub-menu { border-left: 0; padding: 0 0 2px 12px; margin: 0; }
.zh-mobile-nav .sub-menu .sub-menu a { padding: 7px 2px; font-size: .92rem; font-weight: 500; color: var(--muted); }

/* --------------------------------------------------------------- footer --- */
.zh-site-footer {
  position: relative;
  background: var(--bg-dark);
  color: rgba(255,255,255,.76);
  font-family: var(--sans);
}
/* The same 2px of brand gradient that opens the trust bar and the closing
   band. Three uses, always on the top edge of a black surface: it is the
   site's one repeated ornament, which is what makes it read as an identity
   rather than as decoration. */
.zh-site-footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--grad-brand);
  opacity: .55;
}
.zh-site-footer__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 68px) var(--gutter) 28px;
  display: grid;
  gap: 32px;
}
@media (min-width: 860px) { .zh-site-footer__inner { grid-template-columns: 1.3fr 1fr 1fr; } }
.zh-site-footer h2 { font-family: var(--heading); font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #fff; margin: 0 0 16px; }
.zh-site-footer a { color: rgba(255,255,255,.76); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.zh-site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.zh-site-footer ul { list-style: none; margin: 0; padding: 0; }
.zh-site-footer li { margin-bottom: 9px; font-size: .94rem; }
.zh-site-footer p { font-size: .94rem; line-height: 1.75; margin: 0 0 12px; }
/* NAP block. The number here is the DISPLAY number and must equal
   clients.primary_phone. See the note in footer.php. */
.zh-nap { font-style: normal; font-size: .94rem; line-height: 1.8; }
.zh-nap strong { color: #fff; font-family: var(--heading); }
.zh-site-footer__bar {
  border-top: 1px solid rgba(255,255,255,.1);
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 18px var(--gutter) 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  justify-content: space-between;
  font-size: .84rem;
  color: rgba(255,255,255,.58);
}
.zh-site-footer__bar ul { display: flex; flex-wrap: wrap; gap: 16px; }

/* ----------------------------------------------------- generic page body -- */
/* A page written without the zh-* sections still has to read well. */
.zh-page { padding: var(--section-y) var(--gutter); }
.zh-page__inner { max-width: var(--wrap-text); margin-inline: auto; }
.zh-page__inner h1 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); line-height: 1.1; margin: 0 0 18px; }
.zh-page__inner h2 { font-size: clamp(1.4rem, 2.8vw, 1.9rem); line-height: 1.2; margin: 34px 0 12px; }
.zh-page__inner h3 { font-size: 1.15rem; margin: 26px 0 8px; }
.zh-page__inner p, .zh-page__inner li { font-size: 1.0625rem; line-height: 1.8; }
.zh-page__inner ul, .zh-page__inner ol { padding-left: 1.15em; }

/* The entry content of a zh-* page must not be constrained: its sections are
   full-bleed and set their own gutters. */
.entry-content--full { width: 100%; }
