/* Shared header menu, site search, and footer. Base nav styles live in styles.css.
   Markup source: mrtechfix/site-partials/site-{nav,footer}.html, stamped by scripts/gm-nav-sync.py */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Links take the free space so logo sits left and links + actions sit right */
.nav-links { margin-left: auto; }
.nav-actions { display: flex; align-items: center; gap: 6px; }

.nav-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.nav-search-btn:hover,
.nav-search-btn[aria-expanded="true"] { color: var(--text-primary); background: var(--bg-elevated); }

.site-search {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  padding: 18px 0 20px;
}
.site-search[hidden] { display: none; }
.site-search-form input {
  width: 100%;
  padding: 14px 18px;
  font: inherit;
  font-size: 17px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}
.site-search-form input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.site-search-form input::placeholder { color: var(--text-secondary); }
.site-search-form input:focus { outline: 3px solid var(--accent-gold); outline-offset: 2px; }
.site-search-results {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: min(60vh, 520px);
  overflow-y: auto;
}
.site-search-results a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
}
.site-search-results a:hover,
.site-search-results a:focus,
.site-search-results li.is-first a { background: var(--bg-elevated); }
.site-search-results strong { display: block; color: var(--text-primary); font-size: 16px; font-weight: 600; }
.site-search-results span { display: block; margin-top: 3px; color: var(--text-secondary); font-size: 14px; line-height: 1.45; }
.site-search-empty { padding: 12px 14px; color: var(--text-secondary); font-size: 15px; }


.nav-group { position: relative; }

.nav-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  background: none;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 15px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.nav-group-btn:hover,
.nav-group.open .nav-group-btn,
.nav-group-btn.has-active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-chev {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s;
}
.nav-group.open .nav-chev { transform: translateY(1px) rotate(-135deg); }

.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 230px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  z-index: 1001;
}
/* Hover bridge so the menu does not close crossing the gap */
.nav-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
.nav-menu-right { left: auto; right: 0; }
/* focus-within = no-JS fallback: keyboard/tap focus on the button still reveals the links */
.nav-group.open .nav-menu,
html:not(.site-nav-js) .nav-group:focus-within .nav-menu { display: block; }
.nav-group.open .nav-menu-wide,
html:not(.site-nav-js) .nav-group:focus-within .nav-menu-wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
  min-width: 430px;
}

.nav-links .nav-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
}

.nav-col-label {
  margin: 0;
  padding: 6px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

/* Collapsed (hamburger) header up to 1000px: the full bar needs ~970px. styles.css only collapses at 768px,
   so its mobile nav rules are repeated here for the 769-1000px range. */
@media (max-width: 1000px) {
  .nav-hamburger { display: flex; padding: 10px; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    background: rgba(10, 10, 12, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 14px 18px 22px;
    gap: 4px;
  }
  .nav-links.mobile-open { display: flex; }
  .nav-links a { width: 100%; padding: 14px 16px; border-radius: 10px; font-size: 16px; }
  .nav-links .nav-cta { text-align: center; margin-top: 10px; padding: 15px 16px; }
  .nav-actions { margin-left: auto; }

  .nav-links.mobile-open {
    background: var(--bg-dark);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  .nav-group { width: 100%; }
  .nav-group-btn {
    width: 100%;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 16px;
  }
  .nav-menu,
  .nav-menu-right {
    position: static;
    min-width: 0;
    padding: 0 0 6px 12px;
    background: none;
    border: none;
    box-shadow: none;
  }
  .nav-menu::before { display: none; }
  .nav-group.open .nav-menu-wide,
  html:not(.site-nav-js) .nav-group:focus-within .nav-menu-wide { display: block; min-width: 0; }
  .nav-col-label { padding: 10px 16px 4px; }
}

/* ===== Footer ===== */
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 0.8fr;
  gap: 36px 40px;
  margin-bottom: 40px;
}
.footer-brand,
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-brand .footer-logo { height: 40px; margin-bottom: 6px; }
.footer-tag { margin: 0 0 4px; color: var(--text-secondary); font-size: 14px; }
.footer-head {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-gold);
}
.footer-col a,
.footer-contact,
.footer-legal a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.footer-col a:hover,
.footer-contact:hover,
.footer-legal a:hover { color: var(--text-primary); text-decoration: underline; }
.footer-contact { font-size: 15px; color: var(--text-primary); }
.footer-cta {
  margin-top: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--brand-red);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.footer-cta:hover { background: var(--brand-red-light); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-legal a { font-size: 13px; }

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; }
}


/* ===== Brand lockup: GM mark + gold rule + ASSOCIATES in the site font ===== */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand .brand-mark { width: auto; height: 34px; }
nav.main-nav.scrolled .brand .brand-mark { height: 28px; }
.brand-rule {
  width: 1px;
  height: 28px;
  background: linear-gradient(var(--accent-gold), var(--accent-gold-deep));
}
.brand-word {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #F5F2EA;
}
.brand:hover .brand-word { color: #fff; }
.brand-footer { margin-bottom: 6px; }
.brand-footer .brand-mark { height: 40px; }
.brand-footer .brand-rule { height: 32px; }
.brand-footer .brand-word { font-size: 16px; }

@media (max-width: 1000px) {
  .brand { gap: 10px; }
  .brand .brand-mark { height: 30px; }
  .brand-rule { height: 24px; width: 2px; }
  .brand-word { font-size: 13px; letter-spacing: 0.22em; }
}
