/* =====================================================================
   Evlo — shared site chrome (header nav + footer)

   Self-contained on purpose. Two page families exist:
     * shared/base.css  — index, about, contact, product-uptime-monitor
     * shared/shared.css — moodle, devops, e-commerce, software-development,
                           case studies
   Only shared.css defines the :root design tokens, so every custom property
   used below carries a literal fallback. Load this file LAST so the
   overflow guard under "sticky" wins.

   Namespace: .evl-nav / .evl-foot — no bare element or utility selectors.
   ===================================================================== */

/* Sticky needs a non-scrolling body. Both base stylesheets set
   overflow-x:hidden on body, which makes body a scroll container and breaks
   position:sticky. overflow-x:clip clips identically without that side
   effect, so upgrade where the browser supports it. */
@supports (overflow-x: clip) {
  body { overflow-x: clip; }
}

/* In-page jumps (/#services, #book) must clear the sticky header instead of
   landing underneath it. */
:target { scroll-margin-top: 88px; }
@media (max-width: 900px) { :target { scroll-margin-top: 76px; } }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.evl-nav,
.evl-foot {
  --nv-ink:    #0B1B2A;
  --nv-body:   #3D5468;
  --nv-muted:  #64798C;
  --nv-accent: #267CBA;
  --nv-bright: #0D89E0;
  --nv-navy:   #00304F;
  --nv-line:   #E3EDF5;
  --nv-font:   'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-family: var(--nv-font);
}

/* ==================================================================
   Header
   ================================================================== */

.evl-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--nv-line);
  transition: box-shadow .22s ease, background .22s ease;
}
@supports (backdrop-filter: blur(10px)) {
  .evl-nav { background: rgba(255, 255, 255, .82); backdrop-filter: blur(12px) saturate(1.4); }
}
.evl-nav.is-scrolled { box-shadow: 0 8px 26px rgba(7, 42, 71, .09); }

.evl-nav__bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- wordmark ---- */
.evl-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--nv-ink);
  text-decoration: none;
  margin-right: auto;
  border-radius: 8px;
}

/* Brand lockup. Intrinsic width/height are on the <img> so the bar reserves
   the right space before the image loads — no layout shift. The 224px-wide
   source rendered at 122px is ~1.8x, which stays sharp on retina. */
.evl-nav__logo {
  display: block;
  height: 32px;
  width: auto;
}

/* ---- desktop link row ---- */
.evl-nav__menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.evl-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: var(--nv-body);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease;
}
.evl-nav__link:hover { color: var(--nv-accent); background: rgba(38, 124, 186, .07); }
.evl-nav__link[aria-current="page"] { color: var(--nv-accent); font-weight: 600; }
.evl-nav__chev { width: 11px; height: 11px; transition: transform .2s ease; }
.evl-nav__item--has-menu.is-open .evl-nav__chev { transform: rotate(180deg); }

/* ---- services dropdown ---- */
.evl-nav__item { position: relative; }
.evl-nav__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: 340px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--nv-line);
  border-radius: 15px;
  box-shadow: 0 22px 50px rgba(7, 42, 71, .16);
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.evl-nav__item--has-menu.is-open .evl-nav__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.evl-nav__panel-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  transition: background .16s ease;
}
.evl-nav__panel-link:hover { background: #F2F8FC; }
.evl-nav__panel-link[aria-current="page"] { background: #EAF4FB; }
.evl-nav__panel-title {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--nv-ink);
  line-height: 1.3;
}
.evl-nav__panel-link:hover .evl-nav__panel-title { color: var(--nv-accent); }
.evl-nav__panel-desc {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--nv-muted);
  line-height: 1.4;
}

/* ---- call to action ---- */
.evl-nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 19px;
  margin-left: 6px;
  border-radius: 999px;
  background: linear-gradient(168deg, #0F8FE8, #0C7FD0);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(13, 137, 224, .26);
  transition: transform .16s ease, box-shadow .16s ease;
}
.evl-nav__cta:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(13, 137, 224, .34); }

/* ---- hamburger ---- */
.evl-nav__burger {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--nv-line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.evl-nav__burger span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: var(--nv-ink);
  transition: transform .22s ease, opacity .18s ease;
}
.evl-nav.is-open .evl-nav__burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.evl-nav.is-open .evl-nav__burger span:nth-child(2) { opacity: 0; }
.evl-nav.is-open .evl-nav__burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- focus visibility (keyboard only) ---- */
.evl-nav a:focus-visible,
.evl-nav button:focus-visible,
.evl-foot a:focus-visible {
  outline: 2px solid var(--nv-bright);
  outline-offset: 2px;
}

/* ==================================================================
   Header — mobile
   ================================================================== */

@media (max-width: 900px) {
  .evl-nav__bar { height: 60px; padding: 0 16px; }
  .evl-nav__logo { height: 28px; }
  .evl-nav__burger { display: flex; }

  .evl-nav__drawer {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--nv-line);
    box-shadow: 0 20px 40px rgba(7, 42, 71, .13);
    padding: 10px 16px 18px;
    display: none;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .evl-nav.is-open .evl-nav__drawer { display: block; }

  .evl-nav__menu { flex-direction: column; align-items: stretch; gap: 2px; }
  .evl-nav__link { padding: 12px 12px; font-size: 16px; justify-content: space-between; }
  .evl-nav__chev { display: none; }

  /* The dropdown flattens into an indented list — no nested toggle. */
  .evl-nav__panel {
    position: static;
    transform: none;
    width: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--nv-line);
    border-radius: 0;
    margin: 2px 0 6px 14px;
    padding: 0 0 0 6px;
  }
  .evl-nav__panel-desc { display: none; }
  .evl-nav__panel-link { padding: 9px 10px; }
  .evl-nav__cta { margin: 12px 0 0; justify-content: center; width: 100%; padding: 13px 20px; }
}

@media (min-width: 901px) {
  .evl-nav__drawer { display: contents; }

  /* Bridge the 10px gap between the trigger and the panel. The panel is
     absolutely positioned, so it contributes nothing to the <li>'s hit area
     and the gap belongs to the header bar — the pointer crossing it fires
     mouseleave on the <li> and the menu closes before it can be reached.
     This transparent strip makes the hit area continuous without changing
     the spacing. It inherits the panel's pointer-events, so it is inert
     while the menu is closed. Desktop only: the panel is position:static in
     the mobile drawer, where this would resolve against the <li> instead. */
  .evl-nav__panel::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
  }
}

/* ==================================================================
   Footer
   ================================================================== */

.evl-foot {
  background: var(--nv-navy);
  color: #B9CEDE;
  padding: 54px 20px 26px;
  font-size: 14.5px;
  line-height: 1.7;
}
.evl-foot__grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 38px;
}
@media (max-width: 767px) {
  .evl-foot { padding: 40px 16px 22px; }
  .evl-foot__grid { grid-template-columns: 1fr; gap: 28px; }
}

.evl-foot__blurb { max-width: 40ch; color: #9FBACE; }

.evl-foot__title {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7FA3BC;
}
.evl-foot__list { list-style: none; margin: 0; padding: 0; }
.evl-foot__list li + li { margin-top: 7px; }
.evl-foot__list a {
  color: #C9DCEA;
  text-decoration: none;
  transition: color .16s ease;
}
.evl-foot__list a:hover { color: #fff; }

.evl-foot__bar {
  max-width: 1200px;
  margin: 34px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: #86A5BC;
}
.evl-foot__bar a { color: #C9DCEA; text-decoration: none; }
.evl-foot__bar a:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .evl-nav,
  .evl-nav *,
  .evl-foot * { transition: none !important; }
}
