/*
  Shared header/footer styles for the Numaya site shell.
  Namespaced under .xrt- so nothing here can leak into, or be overridden by,
  page-specific styles (questionnaire prototypes, Leaflet, blog posts, etc).
  Design tokens (colors/fonts/radii) are pulled from the existing app palette
  found in prototypes/questionnaire-v6.html's embedded --v6-design styles.
*/

.xrt-scope {
  --xrt-ink: #14231e;       /* --txt */
  --xrt-deep: #0d2d25;      /* topbar background */
  --xrt-deep-d: #0b2c25;    /* --blue-d */
  --xrt-teal: #2f6b5c;      /* --blue-l */
  --xrt-lime: #c8f36a;      /* --green accent */
  --xrt-lime-ink: #123d33;  /* --green-d, text on lime */
  --xrt-cream: #eef0e9;
  --xrt-cream-d: #e1e5dc;
  --xrt-border: #d9dfd8;
  --xrt-border-light: #e9ece8;
  --xrt-on-deep: #ffffff;
  --xrt-on-deep-muted: rgba(255, 255, 255, 0.72);
  --xrt-r-sm: 9px;
  --xrt-r-md: 12px;
  --xrt-r-lg: 18px;
  --xrt-font-h: 'Manrope', sans-serif;
  --xrt-font-b: 'DM Sans', sans-serif;
  --xrt-shadow-sm: 0 2px 8px rgba(11, 31, 25, 0.05);
  --xrt-shadow-md: 0 15px 45px rgba(11, 31, 25, 0.12);
  font-family: var(--xrt-font-b);
  color: var(--xrt-ink);
}

.xrt-scope,
.xrt-scope * {
  box-sizing: border-box;
}

/* ---------------------------------------------------------------------- */
/* Header                                                                  */
/* ---------------------------------------------------------------------- */

.xrt-header {
  position: sticky;
  top: 0;
  z-index: 5000;
  background: #ffffff;
  border-bottom: 1px solid var(--xrt-border);
  box-shadow: var(--xrt-shadow-sm);
  font-family: var(--xrt-font-b);
}

.xrt-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.xrt-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  min-height: 44px;
}

.xrt-logo__img {
  height: 40px;
  width: auto;
  display: block;
}

/* Primary nav (desktop / tablet, >= 768px) --------------------------------*/

.xrt-nav {
  display: none;
}

.xrt-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  row-gap: 4px;
  gap: 4px;
  justify-content: flex-end;
}

.xrt-nav__item {
  position: relative;
  display: flex;
  align-items: stretch;
}

.xrt-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  color: var(--xrt-ink);
  text-decoration: none;
  font-family: var(--xrt-font-h);
  font-weight: 600;
  font-size: 14.5px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--xrt-r-sm);
  white-space: nowrap;
}

/* Matches the .cta button style already used in questionnaire-v6.html
   (min-height:44px, bg var(--green), color var(--txt), border-radius:10px,
   hover: brightness(1.08) + translateY(-1px)) rather than inventing a new
   pill-button style. */
.xrt-nav__cta {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  background: var(--xrt-lime);
  color: var(--xrt-lime-ink);
  text-decoration: none;
  font-family: var(--xrt-font-h);
  font-weight: 700;
  font-size: 14px;
  border-radius: 10px;
  box-shadow: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.1s ease;
}

.xrt-nav__cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.xrt-mobile-nav__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 12px 16px 20px;
  background: var(--xrt-lime);
  color: var(--xrt-lime-ink);
  text-decoration: none;
  font-family: var(--xrt-font-h);
  font-weight: 700;
  font-size: 14.5px;
  border-radius: 10px;
}

.xrt-nav__link:hover,
.xrt-nav__toggle:hover {
  background: var(--xrt-cream);
}

.xrt-nav__link.is-active {
  background: var(--xrt-lime);
  color: var(--xrt-lime-ink);
}

.xrt-nav__link:focus-visible,
.xrt-hamburger:focus-visible,
.xrt-dropdown__link:focus-visible,
.xrt-accordion__trigger:focus-visible,
.xrt-accordion__link:focus-visible {
  outline: 2px solid var(--xrt-teal);
  outline-offset: 2px;
}

.xrt-caret {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform 0.15s ease;
}

.xrt-nav__item--dropdown.is-open .xrt-caret,
.xrt-nav__item--dropdown:hover .xrt-caret {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.xrt-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #ffffff;
  border: 1px solid var(--xrt-border);
  border-radius: var(--xrt-r-md);
  box-shadow: var(--xrt-shadow-md);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 5001;
}

.xrt-dropdown__link {
  display: block;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--xrt-ink);
  text-decoration: none;
  font-size: 14px;
  border-radius: var(--xrt-r-sm);
}

.xrt-dropdown__link:hover {
  background: var(--xrt-cream);
  color: var(--xrt-teal);
}

/* Hover-capable pointers (mouse/trackpad): open on hover as a convenience.
   Touch/tap devices rely solely on the JS click toggle below. */
@media (hover: hover) and (pointer: fine) {
  .xrt-nav__item--dropdown:hover .xrt-dropdown {
    display: flex;
  }
}

.xrt-nav__item--dropdown.is-open .xrt-dropdown {
  display: flex;
}

/* Hamburger (mobile / large-mobile / tablet-portrait touch, < 768px) ------*/

.xrt-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--xrt-border);
  border-radius: var(--xrt-r-sm);
  cursor: pointer;
  flex-shrink: 0;
}

.xrt-hamburger__box {
  position: relative;
  width: 20px;
  height: 14px;
  display: block;
}

.xrt-hamburger__box::before,
.xrt-hamburger__box::after,
.xrt-hamburger__inner {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--xrt-ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.xrt-hamburger__box::before {
  top: 0;
}

.xrt-hamburger__inner {
  top: 6px;
}

.xrt-hamburger__box::after {
  top: 12px;
}

.xrt-hamburger.is-open .xrt-hamburger__box::before {
  top: 6px;
  transform: rotate(45deg);
}

.xrt-hamburger.is-open .xrt-hamburger__inner {
  opacity: 0;
}

.xrt-hamburger.is-open .xrt-hamburger__box::after {
  top: 6px;
  transform: rotate(-45deg);
}

/* Mobile slide-in panel ----------------------------------------------------*/

.xrt-mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 45, 37, 0.45);
  z-index: 5998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.xrt-mobile-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.xrt-mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 86vw);
  height: 100%;
  background: #ffffff;
  z-index: 5999;
  box-shadow: -12px 0 40px rgba(4, 22, 16, 0.2);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 0.9, 0.32, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.xrt-mobile-nav.is-open {
  transform: translateX(0);
}

.xrt-mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--xrt-border);
  min-height: 64px;
  flex: 0 0 auto;
}

.xrt-mobile-nav__title {
  font-family: var(--xrt-font-h);
  font-weight: 700;
  font-size: 15px;
  color: var(--xrt-ink);
}

.xrt-mobile-nav__close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--xrt-border);
  border-radius: var(--xrt-r-sm);
  font-size: 20px;
  line-height: 1;
  color: var(--xrt-ink);
  cursor: pointer;
}

.xrt-mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: 8px 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.xrt-mobile-nav__link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 10px;
  color: var(--xrt-ink);
  text-decoration: none;
  font-family: var(--xrt-font-h);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--xrt-r-sm);
}

.xrt-mobile-nav__link.is-active {
  background: var(--xrt-lime);
  color: var(--xrt-lime-ink);
}

.xrt-mobile-nav__link:hover {
  background: var(--xrt-cream);
}

/* Accordions for Applications / Solutions inside the mobile panel ---------*/

.xrt-accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 10px;
  background: transparent;
  border: none;
  color: var(--xrt-ink);
  text-decoration: none;
  font-family: var(--xrt-font-h);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--xrt-r-sm);
  cursor: pointer;
}

.xrt-accordion__trigger:hover {
  background: var(--xrt-cream);
}

.xrt-accordion__trigger .xrt-caret {
  margin-top: 0;
}

.xrt-accordion.is-open .xrt-accordion__trigger .xrt-caret {
  transform: rotate(-135deg);
}

.xrt-accordion__panel {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 2px 6px 8px 20px;
}

.xrt-accordion.is-open .xrt-accordion__panel {
  display: flex;
}

.xrt-accordion__link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: #4a564f;
  text-decoration: none;
  font-size: 14px;
  border-radius: var(--xrt-r-sm);
}

.xrt-accordion__link:hover {
  background: var(--xrt-cream);
  color: var(--xrt-teal);
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */

.xrt-footer {
  background: var(--xrt-deep);
  color: var(--xrt-on-deep-muted);
  font-family: var(--xrt-font-b);
  position: relative;
  z-index: 10;
  margin-top: 48px;
}

.xrt-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.xrt-footer__col-title {
  font-family: var(--xrt-font-h);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--xrt-on-deep);
  margin: 0 0 14px;
}

.xrt-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.xrt-footer__link {
  color: var(--xrt-on-deep-muted);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.xrt-footer__link:hover {
  color: var(--xrt-lime);
}

.xrt-footer__contact-item {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 10px;
  color: var(--xrt-on-deep-muted);
}

.xrt-footer__contact-item strong {
  color: var(--xrt-on-deep);
  font-weight: 600;
}

.xrt-footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.xrt-footer__brand-chip {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border-radius: var(--xrt-r-sm);
  padding: 6px 10px;
  line-height: 0;
}

.xrt-footer__brand-img {
  height: 26px;
  width: auto;
  display: block;
}

.xrt-footer__tagline {
  font-size: 13px;
  color: var(--xrt-on-deep-muted);
  max-width: 220px;
  line-height: 1.5;
}

.xrt-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px 24px;
}

.xrt-footer__bottom-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.xrt-footer__copyright {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

/* ---------------------------------------------------------------------- */
/* Coming-soon stub page                                                   */
/* ---------------------------------------------------------------------- */

.xrt-stub {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  background: var(--xrt-cream);
}

.xrt-stub__card {
  max-width: 520px;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--xrt-border);
  border-radius: var(--xrt-r-lg);
  padding: 40px 32px;
  box-shadow: var(--xrt-shadow-sm);
}

.xrt-stub__eyebrow {
  font-family: var(--xrt-font-h);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--xrt-teal);
  margin: 0 0 10px;
}

.xrt-stub__title {
  font-family: var(--xrt-font-h);
  font-weight: 800;
  font-size: 28px;
  color: var(--xrt-ink);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.xrt-stub__body {
  font-size: 15px;
  line-height: 1.6;
  color: #4a564f;
  margin: 0 0 20px;
}

.xrt-stub__back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  background: var(--xrt-lime);
  color: var(--xrt-lime-ink);
  text-decoration: none;
  border-radius: var(--xrt-r-sm);
  font-family: var(--xrt-font-h);
  font-weight: 700;
  font-size: 14px;
}

/* ---------------------------------------------------------------------- */
/* Breakpoints                                                            */
/* Mobile: <=480px  Large mobile: 481-767px  Tablet: 768-1024px  Desktop: 1025px+ */
/* ---------------------------------------------------------------------- */

/* Tablet and up: show the horizontal nav, hide the hamburger. */
@media (min-width: 768px) {
  .xrt-nav {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .xrt-nav__cta {
    display: inline-flex;
  }

  .xrt-hamburger {
    display: none !important;
  }

  .xrt-mobile-nav,
  .xrt-mobile-backdrop {
    display: none !important;
  }
}

/* Below tablet: hide the horizontal nav, show the hamburger + slide-in panel. */
@media (max-width: 767px) {
  .xrt-nav {
    display: none !important;
  }

  .xrt-hamburger {
    display: flex;
  }

  .xrt-header__inner {
    padding: 0 16px;
    min-height: 64px;
  }

  .xrt-logo__img {
    height: 32px;
  }
}

/* Large mobile refinement */
@media (max-width: 767px) and (min-width: 481px) {
  .xrt-mobile-nav {
    width: min(360px, 70vw);
  }
}

/* Mobile refinement: full-width slide-in instead of partial panel */
@media (max-width: 480px) {
  .xrt-header__inner {
    padding: 0 12px;
    min-height: 60px;
  }

  .xrt-logo__img {
    height: 28px;
  }

  .xrt-mobile-nav {
    width: 100%;
  }

  .xrt-footer__inner {
    padding: 32px 16px 20px;
  }

  .xrt-footer__bottom {
    padding: 14px 16px;
  }

  .xrt-footer__bottom-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Footer: two columns from 768-1024px, four columns above, one column below 768px */
@media (max-width: 767px) {
  .xrt-footer__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .xrt-footer__inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .xrt-footer__inner {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Guard against horizontal overflow from long content at any width.
   Deliberately NOT overflow-x:hidden here: per the CSS Overflow spec, setting
   only one axis to a non-visible value forces the other axis's USED value to
   `auto` (not `visible`) — that silently turned .xrt-header into a clipping/
   scroll box for its own dropdown children (291px tall vs. the header's
   ~68px), which is what caused Bug 1/2/3. max-width alone is enough here
   since real overflow protection already comes from flex-wrap + max-width on
   the inner containers. */
.xrt-header,
.xrt-footer {
  max-width: 100%;
}

/* Body scroll lock while the mobile slide-in panel is open. */
html.xrt-scroll-lock,
html.xrt-scroll-lock body {
  overflow: hidden;
}
