/* ============================================================
   AMBLER COAL — NEW HEADER & NAV
   header-nav.css  |  Do not edit master.css
   ============================================================ */

/* ── CSS custom properties (tokens) ──────────────────────── */
:root {
  --nav-bg:              #473531;
  --nav-text:            #f4e1a7;
  --nav-hover:           #ffffff;
  --nav-border:          rgba(244,225,167,0.25);

  --topbar-bg:           #2e1f1c;
  --topbar-text:         #f4e1a7;

  --btn-phone-bg:        #f4e1a7;
  --btn-phone-text:      #473531;
  --btn-phone-hover-bg:  #ffffff;

  --dropdown-bg:         #2e1f1c;
  --dropdown-text:       #f4e1a7;
  --dropdown-hover-bg:   #473531;
  --dropdown-border:     #f7ce40;

  /* Background highlight on hovered/open nav item.
     Replaces the old bottom-border underline so there is no
     visual conflict with the dropdown panel's top border.   */
  --nav-item-active-bg:  rgba(247,206,64,0.18);

  --drawer-width:        320px;
  --drawer-bg:           #2e1f1c;

  --focus-ring:          #f7ce40;

  --transition-fast:     150ms ease;
  --transition-med:      250ms ease;
}

/* ── Scoped reset ───────────────────────────────────────── */
.acbs-topbar *,  .acbs-topbar *::before,  .acbs-topbar *::after,
.acbs-navbar *,  .acbs-navbar *::before,  .acbs-navbar *::after,
.acbs-drawer *,  .acbs-drawer *::before,  .acbs-drawer *::after {
  box-sizing: border-box;
}

/* ============================================================
   TOP BAR  — About · divider · Contact · divider · phone btn
   ============================================================ */
.acbs-topbar {
  background: var(--topbar-bg);
  color: var(--topbar-text);
}

.acbs-topbar__inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 40px;
  gap: 0;
}

/* About / Contact text links */
.acbs-topbar__link {
  color: var(--topbar-text) !important;
  font-size: .85em;
  font-weight: 400 !important;
  text-decoration: none !important;
  padding: 6px 12px;
  border-radius: 3px;
  white-space: nowrap;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.acbs-topbar__link:hover,
.acbs-topbar__link:focus-visible {
  color: #ffffff !important;
  background: rgba(255,255,255,0.08);
  text-decoration: none !important;
}

/* Thin vertical rule */
.acbs-topbar__divider {
  width: 1px;
  height: 18px;
  background: var(--nav-border);
  flex-shrink: 0;
  margin: 0 4px;
}

/* Phone button — rightmost */
.acbs-topbar__phone {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--btn-phone-bg);
  color: var(--btn-phone-text) !important;
  font-weight: 700 !important;   /* bold always, including hover */
  font-size: .85em;
  text-decoration: none !important;
  padding: 5px 14px;
  border-radius: 3px;
  white-space: nowrap;
  margin-left: 8px;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.acbs-topbar__phone svg { flex-shrink: 0; }
.acbs-topbar__phone:hover,
.acbs-topbar__phone:focus-visible {
  background: var(--btn-phone-hover-bg);
  color: var(--nav-bg) !important;
  font-weight: 700 !important;   /* explicitly keep bold */
  text-decoration: none !important;
}

/* ============================================================
   LOGO ROW  (negative margins from master.css are untouched)
   ============================================================ */
.acbs-logorow {
  position: relative;
  z-index: 9999;
  max-width: 1600px;
  margin: 0 auto;
}

/* Clip any horizontal bleed from absolute-positioned dropdowns
   at the header level — prevents the phantom right-margin in
   dev tools without hiding the dropdowns themselves           */
.logorow-container {
  overflow-x: clip;          /* clip (not hidden) preserves absolute positioning */
}

/* ============================================================
   PRIMARY NAV BAR
   ============================================================ */
.acbs-navbar {
  background: var(--nav-bg);
  position: relative;
  z-index: 9998;
  overflow: visible;         /* must stay visible so dropdowns escape the bar */
}

.acbs-navbar__inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 8px;            /* minimal padding — items have their own padding */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 52px;
}

/* ── Nav list ───────────────────────────────────────────── */
.acbs-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.acbs-nav__item {
  position: relative;
  display: flex;
  align-items: center;
  height: 52px;           /* matches navbar min-height so bg fill looks full-bleed */
  transition: background var(--transition-fast);
}

/* Subtle fill on hover/open — replaces the bottom-border
   underline. Means there's no competing line when the
   dropdown's gold top-border appears directly below.      */
.acbs-nav__item:hover,
.acbs-nav__item--open {
  background: var(--nav-item-active-bg);
}

/* Top-level link / button */
.acbs-nav__link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  gap: 4px;
  padding: 0 12px;           /* tighter horizontal padding */
  color: var(--nav-text) !important;
  font-size: .82em;          /* slightly smaller so items fit comfortably */
  font-weight: 700 !important;
  opacity: .80;              /* dimmed at rest — no layout shift on hover */
  text-decoration: none !important;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

.acbs-nav__link:hover,
.acbs-nav__link:focus-visible,
.acbs-nav__item--open > .acbs-nav__link {
  color: var(--nav-hover) !important;
  opacity: 1;
  text-decoration: none !important;
  outline: none;
}

/* Chevron */
.acbs-nav__chevron {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.acbs-nav__item--open > .acbs-nav__link .acbs-nav__chevron {
  transform: rotate(180deg);
}

/* ── Dropdown panel ──────────────────────────────────────── */
.acbs-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--dropdown-bg);
  border-top: 3px solid var(--dropdown-border);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity var(--transition-med),
    transform var(--transition-med),
    visibility 0s var(--transition-med);
  z-index: 10000;
  overflow: hidden;          /* prevents content from contributing to page width */
}

/* JS adds .acbs-dropdown--right when the panel would clip the viewport edge */
.acbs-dropdown--right {
  left: auto;
  right: 0;
}

.acbs-nav__item--open > .acbs-dropdown,
.acbs-nav__item:hover  > .acbs-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity var(--transition-med),
    transform var(--transition-med),
    visibility 0s 0s;
}

.acbs-dropdown:focus-within {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.acbs-dropdown__item { display: block; }

.acbs-dropdown__link {
  display: block;
  padding: 9px 20px;
  color: var(--dropdown-text) !important;
  font-size: .87em;
  font-weight: 400 !important;
  text-decoration: none !important;
  white-space: nowrap;
  border-left: 3px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.acbs-dropdown__link:hover,
.acbs-dropdown__link:focus-visible {
  background: var(--dropdown-hover-bg);
  color: #ffffff !important;
  border-left-color: var(--dropdown-border);
  text-decoration: none !important;
  outline: none;
}

/* ── Focus-visible rings ─────────────────────────────────── */
.acbs-nav__link:focus-visible,
.acbs-dropdown__link:focus-visible,
.acbs-topbar__link:focus-visible,
.acbs-topbar__phone:focus-visible,
.acbs-hamburger:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ============================================================
   HAMBURGER  (hidden on desktop; shown ≤ 960px in the topbar)
   ============================================================ */
.acbs-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nav-text);
  border-radius: 4px;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.acbs-hamburger:hover { background: rgba(255,255,255,0.1); }

.acbs-hamburger__bars {
  position: relative;
  width: 22px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.acbs-hamburger__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: absolute;
  transition: transform var(--transition-med), opacity var(--transition-fast);
}
.acbs-hamburger__bar:nth-child(1) { transform: translateY(-7px); }
.acbs-hamburger__bar:nth-child(3) { transform: translateY(7px); }

.acbs-hamburger[aria-expanded="true"] .acbs-hamburger__bar:nth-child(1) {
  transform: translateY(0) rotate(45deg);
}
.acbs-hamburger[aria-expanded="true"] .acbs-hamburger__bar:nth-child(2) {
  opacity: 0;
}
.acbs-hamburger[aria-expanded="true"] .acbs-hamburger__bar:nth-child(3) {
  transform: translateY(0) rotate(-45deg);
}

/* ============================================================
   DRAWER  (mobile — slides in from the right)
   ============================================================ */
.acbs-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 19998;
  opacity: 0;
  transition: opacity var(--transition-med);
}
.acbs-drawer-overlay--visible { display: block; }
.acbs-drawer-overlay--active  { opacity: 1; }

.acbs-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--drawer-width);
  max-width: 90vw;
  background: var(--drawer-bg);
  z-index: 19999;
  transform: translateX(100%);
  transition: transform var(--transition-med);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.acbs-drawer--open { transform: translateX(0); }

.acbs-drawer__close {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--nav-text);
  cursor: pointer;
  font-size: 1em;
  align-self: flex-end;
  border-radius: 4px;
  margin: 6px 6px 0 0;
}
.acbs-drawer__close:hover { background: rgba(255,255,255,0.08); }
.acbs-drawer__close:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Phone link inside drawer */
.acbs-drawer__phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 16px 16px;
  padding: 10px 14px;
  background: var(--btn-phone-bg);
  color: var(--btn-phone-text) !important;
  font-weight: 700 !important;
  font-size: .95em;
  text-decoration: none !important;
  border-radius: 4px;
}
.acbs-drawer__phone:hover {
  background: #fff;
  text-decoration: none !important;
}

/* Drawer nav */
.acbs-drawer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.acbs-drawer-nav__item {
  border-top: 1px solid rgba(255,255,255,0.07);
}

.acbs-drawer-nav__row {
  display: flex;
  align-items: stretch;
}

.acbs-drawer-nav__link {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 13px 20px;
  color: var(--nav-text) !important;
  font-size: .92em;
  font-weight: 700 !important;
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.acbs-drawer-nav__link:hover,
.acbs-drawer-nav__link:focus-visible {
  background: rgba(255,255,255,0.08);
  color: #fff !important;
}

.acbs-drawer-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  background: none;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.07);
  color: var(--nav-text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.acbs-drawer-nav__toggle:hover { background: rgba(255,255,255,0.08); }
.acbs-drawer-nav__toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}
.acbs-drawer-nav__toggle svg {
  transition: transform var(--transition-fast);
}
.acbs-drawer-nav__item--open .acbs-drawer-nav__toggle svg {
  transform: rotate(180deg);
}

.acbs-drawer-subnav {
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(0,0,0,0.25);
  display: none;
}
.acbs-drawer-nav__item--open .acbs-drawer-subnav {
  display: block;
}
.acbs-drawer-subnav__link {
  display: block;
  padding: 10px 20px 10px 32px;
  color: rgba(244,225,167,0.85) !important;
  font-size: .88em;
  font-weight: 400 !important;
  text-decoration: none !important;
  border-left: 3px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.acbs-drawer-subnav__link:hover,
.acbs-drawer-subnav__link:focus-visible {
  background: rgba(255,255,255,0.08);
  color: #fff !important;
  border-left-color: var(--dropdown-border);
  text-decoration: none !important;
}

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

/* ≤ 992px: switch to mobile layout */
@media (max-width: 992px) {

  /* Hide desktop nav links */
  .acbs-nav { display: none; }

  /* Show hamburger */
  .acbs-hamburger { display: flex; }

  /* Hide the entire navbar bar — nothing left to show in it */
  .acbs-navbar { display: none; }

  /* Top bar becomes the only header element.
     Phone + hamburger sit right-aligned.                     */
  .acbs-topbar {
    background: #473531;
  }
  .acbs-topbar__inner {
    justify-content: flex-end;
    padding: 5px 12px;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .acbs-topbar__link    { display: none; }
  .acbs-topbar__divider { display: none; }
  .acbs-topbar__phone   { margin-left: 0; }
}

/* ============================================================
   SKIP LINK
   ============================================================ */
.acbs-skip-link {
  position: absolute;
  top: -100%;
  left: 12px;
  z-index: 99999;
  background: var(--focus-ring);
  color: #1a2930 !important;
  font-weight: 700 !important;
  padding: 8px 16px;
  border-radius: 0 0 4px 4px;
  text-decoration: none !important;
  font-size: .9em;
  transition: top var(--transition-fast);
}
.acbs-skip-link:focus { top: 0; }
