/*
 * Hand-written additions for the rebuilt chrome. Everything here exists to
 * keep the accessibility fixes in inc/chrome.php from changing how the site
 * looks. Loaded after assets/shared.css.
 */

/* ---------------------------------------------------------------- skip link
 * The site-wide Customizer CSS sets `.skip-link { display: none !important }`,
 * which was silently disabling both GeneratePress's skip link and the one in
 * the page content -- the site had no working skip link at all. This one uses
 * its own class so that rule cannot reach it.
 */
.hobbs-skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--navy);
  color: var(--white);
  padding: 8px 16px;
  z-index: 10000;
  transition: top 0.3s;
}

.hobbs-skip-link:focus {
  top: 0;
}

/* ------------------------------------------------------- dropdown as button
 * The Services trigger is now a <button> so it can be operated from the
 * keyboard. These rules strip the default button chrome so it renders exactly
 * like the <a class="nav-link"> it replaced.
 */
.dropdown-toggle {
  background: none;
  border: 0;
  margin: 0;
  font: inherit;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  text-align: left;
}

/* GeneratePress styles bare <button> elements as buttons, including
 * `button:hover, button:focus { background-color: #3f4047 }`. Our
 * `.dropdown-toggle { background: none }` only answers the resting state, so
 * hovering or focusing Services turned it into a dark grey box while the other
 * nav items just took a gold underline. `.dropdown-toggle:hover` is 0,2,0
 * against GeneratePress's 0,1,1, so it wins. Colour already matched
 * .nav-link:hover; only the background needed answering.
 */
.dropdown-toggle:hover,
.dropdown-toggle:focus {
  background: none;
  color: var(--primary-blue);
}

/* With JS running (.js-ready) .active is the single source of truth for the
 * menu; chrome.js sets it for hover, click and keyboard and keeps aria-expanded
 * in step. shared.css keeps :hover / :focus-within only for the no-JS case. */
.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hover bridge. The open menu settles from a 10px offset, which leaves a thin
 * strip between the button and the card while it animates. This invisible strip
 * belongs to the menu, so a pointer crossing it does not leave the dropdown. */
.dropdown-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

/* --------------------------------------------------------- focus indicators
 * Keyboard focus has to be visible on the controls that are now reachable.
 */
.dropdown-toggle:focus-visible,
.dropdown-item:focus-visible,
.mobile-toggle:focus-visible,
.nav-link:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

/* The skip link sits on the navy top bar, so it keeps a gold ring (6.42:1). */
.hobbs-skip-link:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* --------------------------------------------------------- footer headings
 * The footer column headings are <h2> now instead of <h4>, so the heading
 * outline does not jump a level. These restore the previous appearance.
 */
.footer-column .footer-column-title {
  color: var(--navy) !important;
  font-family: var(--font-body) !important;
  font-weight: 600 !important;
  margin: 0 0 16px 0 !important;
  font-size: 1rem !important;
  line-height: 1.3;
  text-align: center !important;
}

@media (max-width: 768px) {
  .footer-column .footer-column-title {
    text-align: center !important;
  }
}

/* ------------------------------------------------------------ footer social
 * The Facebook mark is an inline <svg>, so it needs the sizing that used to
 * apply to the Lucide <i>.
 */
.footer-social .social-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.footer-social a:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

/* -------------------------------------------------------------- footer grid
 * Even the gutters WITHOUT moving the brand or newsletter columns.
 *
 * The gutters measured 40 / 156 / 127px. The gap was never the problem: the
 * brand and newsletter columns fill their width, but the two link lists used
 * only 99px and 128px of their 215px, and that slack inside the column reads
 * as extra whitespace.
 *
 * So the link columns are sized to their text, the outer two keep exactly the
 * widths they had (27.99% and 24.26% of 1152px = 322px and 280px, unchanged),
 * and space-between shares the 203px that frees up equally across the three
 * gutters -- 108px each. The brand text wraps exactly as before and the
 * newsletter column still sits flush right.
 */
.footer-grid {
  /*
   * calc(), not percentages. The original widths were 1.5fr and 1.3fr of
   * (container - the three 40px gaps), i.e. (100% - 120px) * 1.5/4.8 and
   * * 1.3/4.8. A flat percentage of the container reproduces that at exactly
   * 1152px and drifts at every other width, which would change where the brand
   * paragraph wraps.
   *
   * The brand column is 0.2713 rather than the original 0.3125: that puts it at
   * 280px against a 250px logo, so the paragraph sits close to the logo instead
   * of running well past it, and wraps to four lines. The four-line band is
   * 260-320px, so 280 sits in the middle of it rather than on an edge where a
   * font substitution could tip it to five.
   *
   * The 265px floor keeps it there: below about 1150px the proportional width
   * would fall under 260 and the paragraph would wrap to five lines.
   */
  grid-template-columns:
    max(265px, calc((100% - 120px) * 0.2713))
    auto
    auto
    calc((100% - 120px) * 0.2708333);
  justify-content: space-between;
}

/* Keep the newsletter controls inside their column. */
.footer-newsletter-form {
  width: 100%;
}

.footer-newsletter-form input {
  min-width: 0;
  flex: 1 1 auto;
}



/* Tablet widths (769-1024px). The four-column rule above keeps a 265px floor
   on the brand column plus two auto columns, and shared.css makes the brand
   span the full row at <=1024px, so between 769 and 1024px the tracks added up
   to more than the container and every page scrolled sideways by ~11px on an
   820px iPad. Three equal columns under the full-width brand row fit. */
@media (min-width: 769px) and (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    justify-content: normal;
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .footer-brand,
  .footer-column {
    align-items: center;
    text-align: center !important;
  }

  .footer-newsletter-form {
    max-width: 360px;
    margin-inline: auto;
  }
}

/* ------------------------------------------------------- newsletter signup
 * Honeypot: off-screen rather than display:none, because some bots skip
 * hidden fields. aria-hidden and tabindex="-1" keep it out of the
 * accessibility tree and out of the tab order.
 */
.hobbs-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.footer-newsletter-consent {
  font-size: 12px;
  line-height: 1.5;
  color: var(--deep-blue);
  margin: 10px 0 0;
}

.footer-newsletter-consent a {
  text-decoration: underline;
}

/* The newsletter label is visible: a placeholder is not a label, and it
 * disappears once typing starts. Navy on the white footer is 15.54:1. */
.footer-newsletter-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--navy);
}

/* The status message must read as success or failure without relying on
 * colour, so the text itself always says which it is. Colour is a second
 * signal, not the only one. */
#newsletterMessage {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
}

#newsletterMessage:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

.footer-newsletter-form input[aria-invalid='true'] {
  border-color: #B3261E;
  box-shadow: 0 0 0 1px #B3261E;
}

/* ------------------------------------------------------------ icon sizing
 * Icons are inline <svg> now, not <i> replaced by script. The old CSS sized
 * the <i>, so the same sizes are restated for svg. Icons inherit text colour
 * through fill/stroke="currentColor".
 */
.top-bar-item svg,
.footer-top-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mobile-toggle svg,
.dropdown-toggle svg {
  width: 20px;
  height: 20px;
}

/* ------------------------------------------------- mobile toggle colour
 * GeneratePress styles every <button> as a filled button, and two of its
 * rules set `color: #fff`:
 *
 *   button, input[type="button"], input[type="reset"], input[type="submit"]
 *   button, html input[type="button"], ..., a.wp-block-button__link:not(...)
 *
 * shared.css strips this button's background and border but never restated
 * its colour, so the hamburger inherited white and painted white-on-white
 * against the header: measured 1.00:1 on live at 375px, i.e. no visible
 * menu affordance at all until it was tapped. (.dropdown-toggle above does
 * restate its colour, which is why only this one was invisible.)
 *
 * Navy on the white header is 15.54:1, well past the 3:1 WCAG 1.4.11 asks
 * of a UI component. Every state is restated because GeneratePress
 * overrides :hover and :focus as well, and a focus colour it still owns
 * would put the icon back to white the moment the button is tabbed to.
 */
.mobile-toggle,
.mobile-toggle:hover,
.mobile-toggle:focus,
.mobile-toggle:focus-visible,
.mobile-toggle:active {
  color: var(--navy);
  background: none;
}

.dropdown-toggle svg {
  width: 16px;
  height: 16px;
}

/* Lucide icons are ISC licensed - https://lucide.dev/license
 * Inlined from lucide-static, pinned in devDependencies. */

/* The fax number sits beside the phone, in BOTH bars: the footer bar and,
   since 2026-10-12 at Garrett's request, the header top bar. One rule serves
   both because the two bars are the same thing - navy ground, 14px, sky-blue
   links. .top-bar-fax exists only so the header markup does not have to call
   itself "footer".

   shared.css already styles .footer-fax at 13px and 70% white. This block
   loads after it and overrides both - but note the font-size: without it the
   fax stayed 13px against the phone's 14px, the two line boxes came out
   23.8px and 22.1px, and `align-items: center` then centred boxes of
   different heights so the baselines never matched. That is what made the
   pair look misaligned. .top-bar-fax inherits nothing from shared.css, so
   `font-size: inherit` is doing the same job there from a different start.

   Matching the size makes both line boxes 23.8px, so centring and baseline
   alignment coincide. The divider separates them and the colour matches the
   phone link at Garrett's request; sky-blue is this bar's link colour and the
   fax is not a link, so the divider and the "Fax" label carry that
   distinction. #7EC8E3 on navy is 8.33:1. */
.footer-fax,
.top-bar-fax {
  font-size: inherit;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--sky-blue);
  white-space: nowrap;
}

/* ------------------------------------------------ former Customizer CSS
 * Moved here from the Customizer "Additional CSS" field (post 2677) on
 * 2026-10-09 so the theme is the single source of the site chrome. It strips
 * GeneratePress's containers around the page fragments and hides the parent
 * theme's own header, which the child theme replaces. Unchanged otherwise. */
/* ==================== REMOVE WORDPRESS CONTAINERS ==================== */
body.page .site,
body.page .site-content,
body.page .content-area,
body.page .inside-article,
body.page .ast-container,
body.page main,
body.page article,
body.page .entry-content,
body.page .generate-columns-container,
body.page .grid-container {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

body.page .wp-block-html,
body.page .wp-block-html > * {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    body.page .site-content,
    body.page .content-area {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* ==================== WHITE STRIP FIX ==================== */
.wp-site-blocks,
.site,
#page,
#content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.generate-columns-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* GeneratePress specific - removes space reserved for sticky header */
.gen-sidebar-nav,
.has-mobile-header,
.gp-mobile-menu-controls {
    margin-top: 0 !important;
}

/* ==================== GLOBAL BOX SIZING ==================== */
body.page,
body.page * {
    box-sizing: border-box;
}
/* Fix white strip on custom HTML pages */
.site-header,
.main-navigation,
#masthead,
.wp-block-template-part {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
}

.wp-site-blocks > .wp-block-template-part {
    display: none !important;
}

/* ------------------------------------------------- Services in the phone menu
 * Inside the open phone menu the submenu expands in place, in the flow, so it
 * pushes Providers, About Us and Contact down instead of floating over them.
 * Hidden with display:none (out of the tab order) until .active.
 */
@media (max-width: 768px) {
  /* The nav centres its children, so the list shrank to its widest link. Let it
   * span the menu so the open submenu can be full width. The links stay
   * centred inside it (the list still centres its own items). */
  .nav-list {
    align-self: stretch;
  }

  .dropdown {
    width: 100%;
  }

  .dropdown-toggle {
    width: 100%;
    justify-content: center;
  }

  .dropdown-toggle svg {
    transition: transform 0.2s ease;
  }

  .dropdown.active .dropdown-toggle svg {
    transform: rotate(180deg);
  }

  .dropdown-menu {
    display: none;
    position: static;
    min-width: 0;
    width: 100%;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    opacity: 1;
    transform: none;
    transition: none;
  }

  .dropdown.active .dropdown-menu {
    display: block;
  }

  .dropdown-menu::before {
    display: none;
  }

  .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 20px;
    text-align: center;
  }

  .dropdown-item:hover {
    padding-left: 20px;
  }
}

/* ------------------------------------------------- tablet header (audit M31)
 * Between 769px (where the desktop nav takes over) and about 880px the nav and
 * the 300px logo do not fit side by side, so "About Us" broke onto two lines
 * and the header grew from 92 to 114px. Keep every top-level item on one line;
 * from 769 to 899px trim the side padding (20px -> 10px) and the gap (8px ->
 * 4px) so the row fits and the logo keeps most of its width. From 900px up
 * nothing changes beyond nowrap, which has no effect where there is room.
 */
@media (min-width: 769px) {
  .nav-list .nav-link,
  .nav-list .dropdown-toggle {
    white-space: nowrap;
  }
}

@media (min-width: 769px) and (max-width: 899px) {
  .nav-list {
    gap: 4px;
  }

  .nav-list .nav-link,
  .nav-list .dropdown-toggle {
    padding-left: 10px;
    padding-right: 10px;
  }

  .nav-list .nav-link::after {
    left: 10px;
    right: 10px;
  }
}
