/* ==========================================================================
   Site header nav bar (header.php)
   Design: Figma "Website", section READY — desktop nav 1228:2795 (1280 wide),
   mobile nav 1484:344 (390 wide).
   All header styles live here (style.css no longer has any). Menu list:
   inc/site-menu.php; behaviour: media/js/header-nav.js.
   Kept from before: the dropdown arrows (glyph, colour, size) and the look of the
   desktop dropdown lists. The mobile menu (.eb-mnav) is in the hub's style.
   ========================================================================== */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/hub/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The "→" in the menu's trial button (same 1 KB file as the hub buttons' arrow). */
@font-face {
  font-family: "EB Arrow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/hub/inter-arrow.woff2") format("woff2");
  unicode-range: U+2192;
}

/* Header height, border included. The page content and sticky bars start below it. */
:root { --eb-header-h: 74px; }                         /* mobile: 73px bar + 1px border (design 64px + 15%) */
@media (min-width: 1024px) {
  :root { --eb-header-h: 85px; }                       /* desktop: 84px bar + 1px border (design 77px + 10%) */
}

.body-container-wrapper { padding-top: var(--eb-header-h); }
.countdown--timer.js-sticky,
.c-blog-progress.js-sticky { top: var(--eb-header-h); }

/* ---------- Bar ---------- */
/* Fixed at the top, one height on every page and while scrolling. */
.c-header {
  position: fixed;
  z-index: 99;
  width: 100%;
  height: var(--eb-header-h);
  background-color: #fff;
  border-bottom: 1px solid #e6e8e8;
}
.c-header .l-container {
  max-width: 1180px;
  padding-right: 20px;
  padding-left: 20px;
}
.c-header .c-header-inner {
  height: calc(var(--eb-header-h) - 1px);
  align-items: center;
}

/* Logo 157 × 32 */
.c-header .c-logo { flex-shrink: 0; }
.c-header .c-logo img {
  display: block;
  width: 157px;
  max-width: 157px;
  height: auto;
}

/* "Free trial" pill */
.c-header a.eb-nav-trial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  background-color: #3ee65c;
  color: #0f2a30;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 14.5px;
  letter-spacing: 0;                                   /* style.css gives every link 0.5px */
  white-space: nowrap;
  text-decoration: none;
}
.c-header a.eb-nav-trial:hover,
.c-header a.eb-nav-trial:focus-visible {
  background-color: #2fd84e;
  color: #0f2a30;
}

/* ---------- Desktop (≥1024px) ---------- */
.c-header-nav {
  display: none;
  flex-grow: 2;
  justify-content: flex-end;
}

@media (min-width: 1024px) {
  .c-header .l-container {
    padding-right: 32px;
    padding-left: 32px;
  }
  .c-header .c-header-inner { gap: 32px; }
  .c-header .c-header-nav {
    display: flex;
    align-self: stretch;
    align-items: center;
    gap: 32px;
  }
  .c-header .c-header-nav-mob { display: none; }

  /* Menu: items fill the bar height, so a list opens right at its bottom edge. */
  .eb-nav,
  .eb-nav__list {
    display: flex;
    align-self: stretch;
    height: 100%;
  }
  .eb-nav__list {
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .eb-nav__item {
    position: relative;
    display: flex;
    align-items: center;
  }
  .eb-nav .eb-nav__top {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #5c6466;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15.5px;                                 /* design 15px, enlarged on request */
    font-weight: 500;
    line-height: 24.75px;
    letter-spacing: 0;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
  }
  .eb-nav__item:hover > .eb-nav__top,
  .eb-nav .eb-nav__top:focus-visible { color: #028ca6; }
  .eb-nav .eb-nav__top:focus:not(:focus-visible) { outline: none; }
  .eb-nav .eb-nav__top:focus-visible {
    outline: 3px solid #5fd0e0;
    outline-offset: 4px;
    border-radius: 4px;
  }

  /* Arrow after a section name: the same glyph, colour and size as before. */
  .eb-nav__item--has-sub > .eb-nav__top::after {
    content: "\f078";
    position: relative;
    top: -1px;
    display: inline-block;
    margin-left: 5px;
    color: #028ca6;
    font-family: "FontAwesome";
    font-size: 12.448px;
    font-weight: 400;
    line-height: 1;
  }

  /* Section list: opens on hover, keyboard focus or a click on a section button;
     Escape closes it (.is-dismissed, set by header-nav.js). Same look as before. */
  .eb-nav__sub {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 99999;
    display: none;
    min-width: 100%;
    margin: 0;
    padding: 16px;
    background: #028ca6;
    list-style: none;
  }
  .eb-nav__item:hover > .eb-nav__sub,
  .eb-nav__item:focus-within > .eb-nav__sub,
  .eb-nav__top[aria-expanded="true"] + .eb-nav__sub { display: block; }
  .eb-nav__item.is-dismissed > .eb-nav__sub { display: none; }
  .eb-nav__sub li {
    display: block;
    padding: 6.4px;
  }
  .eb-nav .eb-nav__sublink {
    display: block;
    color: #fff;
    font-family: Noway-Round-Regular, sans-serif;
    font-size: 13.6px;
    line-height: 20.4px;
    letter-spacing: .5px;
    white-space: nowrap;
    text-decoration: none;
  }
  .eb-nav .eb-nav__sublink:hover { color: #fff; }
  .eb-nav .eb-nav__sublink:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

  .c-header .c-header-nav-btn {
    flex-shrink: 0;
    align-self: center;
  }
  .c-header .c-header-nav-btn a.eb-nav-trial { padding: 11px 20px; }
}

/* Narrow desktops: the design's spacing does not fit, so the gaps get smaller. */
@media (min-width: 1024px) and (max-width: 1139px) {
  .c-header .l-container {
    padding-right: 24px;
    padding-left: 24px;
  }
  .c-header .c-header-inner,
  .c-header .c-header-nav { gap: 18px; }
  .eb-nav__list { gap: 13px; }
}

/* ---------- Mobile and tablet (<1024px) ---------- */
@media (max-width: 1023px) {
  .c-header .c-header-nav-mob {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
  }
}

/* ---------- Mobile menu (<1024px): button + panel under the bar ----------
   Same look as the hub pages: white surface, #0f2a30 text, tinted #f2f8f9 cards,
   green pill button. Behaviour: media/js/header-nav.js. */
.eb-mnav-toggle,
.eb-mnav { display: none; }

@media (max-width: 1023px) {
  /* Menu button: the 24px icon from the design, with a 44px tap area around it. */
  .c-header .eb-mnav-toggle {
    position: relative;
    display: block;
    box-sizing: content-box;
    width: 24px;
    height: 24px;
    margin: -10px;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .eb-mnav-toggle__icon {
    position: absolute;
    top: 10px;
    left: 10px;
    display: block;
    width: 24px;
    height: 24px;
    transition: opacity .15s ease, transform .2s ease;
  }
  .eb-mnav-toggle__icon--close { opacity: 0; transform: rotate(-90deg); }
  .eb-mnav-toggle[aria-expanded="true"] .eb-mnav-toggle__icon--open { opacity: 0; transform: rotate(90deg); }
  .eb-mnav-toggle[aria-expanded="true"] .eb-mnav-toggle__icon--close { opacity: 1; transform: none; }

  /* Panel: fills the screen below the bar; the page under it does not scroll. */
  .eb-mnav {
    position: fixed;
    top: var(--eb-header-h);
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    color: #0f2a30;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    letter-spacing: 0;
    text-align: left;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  }
  .eb-mnav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity .2s ease, transform .2s ease, visibility 0s;
  }
  html.eb-mnav-lock,
  html.eb-mnav-lock body { overflow: hidden; }

  .eb-mnav__list {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .eb-mnav__item { border-bottom: 1px solid #e6e8e8; }

  /* Top-level rows: a section button (opens its links) or a plain link. */
  .eb-mnav .eb-mnav__parent,
  .eb-mnav .eb-mnav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 60px;
    margin: 0;
    padding: 16px 4px;
    border: 0;
    border-radius: 0;
    background: none;
    color: #0f2a30;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  /* The same arrow as on the desktop menu, turning over when the section is open. */
  .eb-mnav__parent::after {
    content: "\f078";
    flex-shrink: 0;
    margin-left: 16px;
    color: #028ca6;
    font-family: "FontAwesome";
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    transition: transform .25s ease;
  }
  .eb-mnav__parent[aria-expanded="true"]::after { transform: rotate(180deg); }
  .eb-mnav .eb-mnav__link[aria-current="page"] { color: #0b6f80; }

  /* Section links: a tinted card that slides open. */
  .eb-mnav__sub {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows .25s ease, visibility 0s linear .25s;
  }
  .eb-mnav__parent[aria-expanded="true"] + .eb-mnav__sub {
    grid-template-rows: 1fr;
    visibility: visible;
    transition: grid-template-rows .25s ease, visibility 0s;
  }
  .eb-mnav__clip {
    min-height: 0;
    overflow: hidden;
  }
  .eb-mnav__sublist {
    margin: 0 0 16px;
    padding: 6px;
    border-radius: 16px;
    background: #f2f8f9;
    list-style: none;
  }
  .eb-mnav .eb-mnav__sublink {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #3f5a60;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .eb-mnav .eb-mnav__sublink:hover,
  .eb-mnav .eb-mnav__sublink:active {
    background: #e3eff1;
    color: #0f2a30;
  }
  .eb-mnav .eb-mnav__sublink[aria-current="page"] {
    background: #dceff2;
    color: #0b6f80;
    font-weight: 600;
  }

  /* Trial button at the bottom, as on the hub ("Start your … free trial →"). */
  .eb-mnav__cta {
    margin-top: auto;
    padding-top: 24px;
  }
  .eb-mnav .eb-mnav__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 28px;
    border-radius: 999px;
    background: #3ee65c;
    color: #0f2a30;
    font-size: 16px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0;
    text-decoration: none;
    transition: background-color .2s ease;
  }
  .eb-mnav .eb-mnav__btn:hover,
  .eb-mnav .eb-mnav__btn:focus-visible {
    background: #2fd84e;
    color: #0f2a30;
  }
  .eb-mnav__arrow { font-family: "EB Arrow", "Plus Jakarta Sans", sans-serif; font-weight: 600; }

  /* Keyboard focus, as on the hub (cyan ring); none after a tap or click. */
  .c-header .eb-mnav-toggle:focus:not(:focus-visible),
  .eb-mnav button:focus:not(:focus-visible),
  .eb-mnav a:focus:not(:focus-visible) { outline: none; }
  .c-header .eb-mnav-toggle:focus-visible,
  .eb-mnav .eb-mnav__btn:focus-visible {
    outline: 3px solid #5fd0e0;
    outline-offset: 3px;
  }
  .eb-mnav .eb-mnav__parent:focus-visible,
  .eb-mnav .eb-mnav__link:focus-visible,
  .eb-mnav .eb-mnav__sublink:focus-visible {
    outline: 3px solid #5fd0e0;
    outline-offset: -3px;
    border-radius: 10px;
  }
}

/* Tablets: the button keeps its own width instead of stretching across the screen. */
@media (min-width: 600px) and (max-width: 1023px) {
  .eb-mnav .eb-mnav__btn {
    display: inline-flex;
    width: auto;
  }
}

@media (max-width: 1023px) and (prefers-reduced-motion: reduce) {
  .eb-mnav,
  .eb-mnav.is-open,
  .eb-mnav__sub,
  .eb-mnav__parent[aria-expanded="true"] + .eb-mnav__sub,
  .eb-mnav__parent::after,
  .eb-mnav-toggle__icon { transition: none; }
}

/* Very small phones: logo, button and menu icon would not fit side by side. */
@media (max-width: 359px) {
  .c-header .c-logo img {
    width: 128px;
    max-width: 128px;
  }
  .c-header .c-header-nav-mob { gap: 12px; }
  .c-header a.eb-nav-trial { padding: 8px 14px; }
  .eb-mnav .eb-mnav__parent,
  .eb-mnav .eb-mnav__link { font-size: 16px; }       /* "Who should use EasyBooks?" stays on one line */
}

/* ==========================================================================
   Footer menu (footer.php; list from inc/site-menu.php). Same look as before.
   ========================================================================== */

/* Desktop (≥1200px; .js-footer-nav in style.css shows it): one column per item. */
.eb-fnav__list {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0 24px;
  list-style: none;
}
.eb-fnav__col { padding: 0 12px; }
@media (min-width: 1400px) {
  .eb-fnav__col { padding: 0 24px; }
}
.eb-fnav__links {
  margin: 0;
  padding: 0;
  list-style: none;
}
.eb-fnav .eb-fnav__head {
  color: #fff;
  font-weight: bold;
}
.eb-fnav .eb-fnav__link {
  color: #fff;
  font-size: .875em;
  font-weight: normal;
}
.eb-fnav a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Mobile and tablet (<1200px): one line per item; a section opens its links. */
.eb-fnav-mob__list,
.eb-fnav-mob__sub {
  margin: 0;
  padding: 0;
  list-style: none;
}
.eb-fnav-mob .eb-fnav-mob__parent,
.eb-fnav-mob .eb-fnav-mob__link {
  display: inline-block;
  margin: 0;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #fff;
  font-family: Noway-Round-Medium, sans-serif;
  font-size: 16px;
  font-weight: normal;
  line-height: 24px;
  letter-spacing: .5px;
  text-decoration: none;
  cursor: pointer;
}
/* The arrow after a section name: down when closed, up when open (as before). */
.eb-fnav-mob__parent::after {
  content: "\f078";
  position: relative;
  top: -1px;
  display: inline-block;
  padding-left: 8px;
  color: #fff;
  font-family: "FontAwesome";
  font-size: 12.448px;
  font-weight: 400;
}
.eb-fnav-mob__parent[aria-expanded="true"]::after { content: "\f077"; }
.eb-fnav-mob .eb-fnav-mob__sublink {
  display: inline-block;
  padding: 6px 0;
  color: #fff;
  font-family: Noway-Round-Regular, sans-serif;
  font-size: 14px;
  line-height: 21px;
}
.eb-fnav-mob .eb-fnav-mob__parent:focus:not(:focus-visible) { outline: none; }
.eb-fnav-mob button:focus-visible,
.eb-fnav-mob a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
