/* =========================================
   GLOBAL STANDARD MENU
   FILE: global-standard-menu.css

   PURPOSE:
   Reusable standard navigation system for TipCMS sites.
========================================= */

:root {

  /* -----------------------------------------
   HEADER BACKGROUND
----------------------------------------- */
--header-bg: #000000;
--gsm-header-bg: var(--header-bg);

  /* -----------------------------------------
     HEADER BORDER
  ----------------------------------------- */
  --gsm-header-border: transparent;

  /* -----------------------------------------
     HEADER SHADOW
  ----------------------------------------- */
 --gsm-header-shadow: none;

  /* -----------------------------------------
     BRAND / LOGO TEXT COLORS
  ----------------------------------------- */
  --gsm-brand-color: var(--header-logo-color, var(--brand-text-inverse, #ffffff));
  --gsm-brand-tagline-color: rgba(255, 255, 255, 0.74);

  /* -----------------------------------------
     NAV LINK COLORS
  ----------------------------------------- */
  --gsm-link-color: var(--header-nav-color, var(--brand-text-inverse, #ffffff));
  --gsm-link-hover: #ffffff;
  --gsm-link-active: #ffffff;

  /* -----------------------------------------
     DROPDOWN COLORS
  ----------------------------------------- */
  --gsm-dropdown-bg: #D8852C;
  --gsm-dropdown-border: rgba(0, 0, 0, 0.15);
  --gsm-dropdown-shadow: var(--dropdown-shadow, 0 18px 40px rgba(38, 28, 24, 0.12));
  --gsm-dropdown-link-color: #ffffff;
  --gsm-dropdown-link-hover: #ffffff;
  --gsm-dropdown-link-hover-bg: #363535;

  /* -----------------------------------------
     MOBILE MENU PANEL COLORS
  ----------------------------------------- */
  --gsm-mobile-bg: #000000;
  --gsm-mobile-border: var(--mobile-menu-border, rgba(255, 255, 255, 0.12));
  --gsm-mobile-shadow: var(--mobile-menu-shadow, 0 18px 40px rgba(38, 28, 24, 0.12));
  --gsm-mobile-link-color: var(--brand-text-inverse, #ffffff);
  --gsm-mobile-link-hover: #ffffff;
  --gsm-mobile-link-bg: rgba(255, 255, 255, 0.05);
  --gsm-mobile-link-border: rgba(255, 255, 255, 0.12);

  /* -----------------------------------------
     HAMBURGER BUTTON COLORS
  ----------------------------------------- */
  --gsm-toggle-color: var(--brand-text-inverse, #ffffff);
  --gsm-toggle-border: rgba(255, 255, 255, 0.16);
  --gsm-toggle-bg: rgba(255, 255, 255, 0.08);

  /* -----------------------------------------
     TYPOGRAPHY HOOKS
  ----------------------------------------- */
  --gsm-font-heading: var(--font-heading, serif);
  --gsm-font-body: var(--font-body, serif);

  --gsm-font-weight-strong: var(--font-weight-strong, 600);
  --gsm-font-weight-heading: var(--font-weight-heading, 700);

  --gsm-text-small: var(--text-small, 0.95rem);
  --gsm-text-xs: var(--text-xs, 0.82rem);

  /* -----------------------------------------
     SPACING + LAYOUT HOOKS
  ----------------------------------------- */
  --gsm-container-x: var(--space-container-x, 24px);
  --gsm-inline-sm: var(--space-inline-sm, 10px);
  --gsm-inline-md: var(--space-inline-md, 14px);
  --gsm-inline-lg: var(--space-inline-lg, 18px);
  --gsm-gap-md: var(--space-gap-md, 22px);
  --gsm-gap-lg: var(--space-gap-lg, 32px);

  /* -----------------------------------------
     HEADER HEIGHTS
  ----------------------------------------- */
  --gsm-header-height: var(--header-height, 68px);
  --gsm-header-height-mobile: var(--header-height-mobile, 64px);

  /* -----------------------------------------
     BRAND TYPOGRAPHY
  ----------------------------------------- */
  --gsm-brand-font: var(--header-logo-font, var(--font-heading, serif));
  --gsm-brand-size: var(--header-logo-size, clamp(1.05rem, 0.96rem + 0.35vw, 1.35rem));

  /* -----------------------------------------
     NAV TYPOGRAPHY
  ----------------------------------------- */
  --gsm-nav-size: var(--header-nav-size, 0.80rem);
  --gsm-nav-weight: var(--header-nav-weight, 800);
  --gsm-nav-tracking: var(--header-nav-letter-spacing, 0);

  /* -----------------------------------------
     RADII / SHADOWS
  ----------------------------------------- */
  --gsm-radius-sm: var(--card-radius-sm, 18px);
  --gsm-radius-md: var(--card-radius-md, 24px);

  /* -----------------------------------------
     Z-INDEX
  ----------------------------------------- */
  --gsm-z-header: 1000;
}

/* =========================================
   BASE HEADER WRAPPER
========================================= */

.gsm-header {
  position: sticky !important;
  top: 0;
  z-index: var(--gsm-z-header);

  background: var(--gsm-header-bg);

  border-bottom: 0 solid var(--gsm-header-border);
  box-shadow: var(--gsm-header-shadow);
}

/* =========================================
   INNER HEADER LAYOUT
========================================= */

.gsm-inner {
  width: 100%;
  max-width: none;
  min-height: var(--gsm-header-height);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1%;
  padding-right: 2%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gsm-inline-lg);
}

/* =========================================
   BRAND BLOCK
   FIT HQ keeps the brand outside the menu bar,
   so hide the standard menu brand via CSS.
========================================= */

.gsm-brand {
  display: none !important;
}

.gsm-brand:hover,
.gsm-brand:focus-visible {
  color: var(--gsm-brand-color);
  text-decoration: none !important;
}

.gsm-brand-name {
  display: block;
  margin: 0;
  color: var(--gsm-brand-color);
  font-family: var(--gsm-brand-font);
  font-size: var(--gsm-brand-size);
  font-weight: var(--gsm-font-weight-heading);
  line-height: 1.05;
}

.gsm-brand-tagline {
  display: block;
  margin-top: 4px;
  color: var(--gsm-brand-tagline-color);
  font-family: var(--gsm-font-heading);
  font-size: var(--gsm-text-xs);
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

/* =========================================
   DESKTOP NAV
========================================= */

.gsm-nav {
  display: flex;
  align-items: center;
  width: 100%;
  margin-left: 0;
}

.gsm-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  justify-content: space-around;
  margin: 0;
  padding: 0;
}

.gsm-item {
  position: relative;
  margin: 0;
  padding: 0;
}

.gsm-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 10px;
  color: var(--gsm-link-color);
  text-decoration: none !important;
  font-family: var(--gsm-font-heading);
  font-size: var(--gsm-nav-size);
  font-weight: var(--gsm-nav-weight);
  letter-spacing: var(--gsm-nav-tracking);
  line-height: 1.1;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.gsm-link:hover,
.gsm-link:focus-visible {
  color: var(--gsm-link-hover);
  background-color: #710004;
  text-decoration: none !important;
}

.gsm-item.is-active > .gsm-link,
.gsm-link[aria-current="page"] {
  color: var(--gsm-link-active);
}

.gsm-caret {
  display: none;
}

/* =========================================
   DESKTOP DROPDOWN
========================================= */

.gsm-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  list-style: none;
  margin: 0;
  padding: 5px 0;
  background: var(--gsm-dropdown-bg);
  border: 1px solid var(--gsm-dropdown-border);
  border-radius: 4px;
  box-shadow: var(--gsm-dropdown-shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: calc(var(--gsm-z-header) + 10);
}

.gsm-item:hover > .gsm-dropdown,
.gsm-item:focus-within > .gsm-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gsm-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
}

.gsm-dropdown-item {
  position: relative;
  margin: 0;
  padding: 0;
}

.gsm-dropdown-link {
  display: block;
  padding: 7px 20px;
  border-radius: 0;
  color: var(--gsm-dropdown-link-color);
  text-decoration: none !important;
  font-family: Arial, Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.gsm-dropdown-link:hover,
.gsm-dropdown-link:focus-visible {
  background: var(--gsm-dropdown-link-hover-bg);
  color: var(--gsm-dropdown-link-hover);
}

/* =========================================
   THIRD LEVEL DESKTOP MENU
========================================= */

.gsm-third {
  list-style: none;
  margin: 6px 0 8px 0;
  padding: 0 0 0 12px;
}

.gsm-third li {
  margin: 0;
  padding: 0;
}

.gsm-third-link {
  display: block;
  padding: 7px 20px;
  border-radius: 0;
  color: var(--gsm-dropdown-link-color);
  text-decoration: none !important;
  font-family: var(--gsm-font-body);
  font-size: calc(var(--gsm-text-small) * 0.96);
  line-height: 1.4;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.gsm-third-link:hover,
.gsm-third-link:focus-visible {
  background: var(--gsm-dropdown-link-hover-bg);
  color: var(--gsm-dropdown-link-hover);
}

/* =========================================
   HAMBURGER TOGGLE
========================================= */

.gsm-toggle {
  display: none;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gsm-toggle-border);
  border-radius: 14px;
  background: var(--gsm-toggle-bg);
  color: var(--gsm-toggle-color);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
/* =========================================
   HAMBURGER INTERACTION
========================================= */

.gsm-toggle:hover,
.gsm-toggle:focus-visible {
  outline: none;
}

.gsm-toggle span {
  position: relative;
  width: 20px;
  height: 14px;
  display: inline-block;
  background: transparent;
  box-shadow: none;
}

.gsm-toggle span::before,
.gsm-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.gsm-toggle span::before {
  top: 0;
  box-shadow: 0 6px 0 0 currentColor;
}

.gsm-toggle span::after {
  top: 12px;
}

/* =========================================
   MOBILE MENU PANEL
========================================= */

.gsm-mobile {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  background: var(--gsm-mobile-bg);
  border-top: 1px solid var(--gsm-mobile-border);
  box-shadow: var(--gsm-mobile-shadow);
  opacity: 0;
  transition:
    grid-template-rows 0.35s ease,
    opacity 0.25s ease;
}

.gsm-mobile.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.gsm-mobile-list {
  overflow: hidden;
  list-style: none;
  margin: 0;
  padding: 16px var(--gsm-container-x) 24px;
  display: grid;
  gap: 10px;
}

.gsm-mobile-list > li {
  margin: 0;
  padding: 0;
}

.gsm-mobile-link {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--gsm-mobile-link-border);
  border-radius: var(--gsm-radius-sm);
  background: var(--gsm-mobile-link-bg);
  color: var(--gsm-mobile-link-color);
  text-decoration: none !important;
  font-family: Arial, Verdana, sans-serif;
  font-size: var(--gsm-text-small);
  font-weight: var(--gsm-font-weight-strong);
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.gsm-mobile-link:hover,
.gsm-mobile-link:focus-visible {
  color: var(--gsm-mobile-link-hover);
  background-color: #710004;
}

/* =========================================
   MOBILE SECOND LEVEL
========================================= */

.gsm-mobile-sub {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0 0 0 14px;
  display: grid;
  gap: 8px;
}

.gsm-mobile-sub-link {
  display: block;
  padding: 10px 0 8px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none !important;
  font-family: Arial, Verdana, sans-serif;
  font-size: var(--gsm-text-small);
  line-height: 1.4;
}

.gsm-mobile-sub-link:hover,
.gsm-mobile-sub-link:focus-visible {
  color: var(--gsm-mobile-link-hover);
}

/* =========================================
   MOBILE THIRD LEVEL
========================================= */

.gsm-mobile-third {
  list-style: none;
  margin: 4px 0 0 0;
  padding: 0 0 0 14px;
  display: grid;
  gap: 6px;
}

.gsm-mobile-third a {
  display: block;
  padding: 6px 0;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none !important;
  font-family: var(--gsm-font-body);
  font-size: calc(var(--gsm-text-small) * 0.95);
  line-height: 1.4;
}

.gsm-mobile-third a:hover,
.gsm-mobile-third a:focus-visible {
  color: var(--gsm-mobile-link-hover);
}


/* =========================================
   FIT HQ DESKTOP PRESENTATION
   Matches the original black Bootstrap-style menu
   while retaining the standard menu PHP/JS features.
========================================= */

@media (min-width: 992px) {
  .gsm-link {
    font-family: Arial, Verdana, sans-serif;
  }
}

/* =========================================
   RESPONSIVE BEHAVIOR
========================================= */

@media (max-width: 991px) {
  .gsm-inner {
    min-height: var(--gsm-header-height-mobile);
    gap: var(--gsm-inline-md);
  }

  .gsm-brand {
    display: none !important;
  }

  .gsm-brand-name {
    white-space: normal;
    font-size: 1.18rem;
    line-height: 1.15;
  }

  .gsm-brand-tagline {
    display: none;
  }

  .gsm-nav {
    display: none;
  }

  .gsm-toggle {
    display: inline-flex;
  }
}

@media (min-width: 992px) {
  .gsm-mobile,
  .gsm-mobile.is-open {
    display: none !important;
  }
}