/* =============================================
   BWERA GENERAL HOSPITAL — compat.css
   Loads after main.css — defines ALL nav rules
   ============================================= */

*, *::before, *::after { box-sizing: border-box; }
a { text-decoration: none; }

/* ---- Hide old header elements no longer used ---- */
.gov-bar, .moh-bar, .nav-logo, header, .top-bar { display: none !important; }

/* ============================================
   SITE HEADER — White identity bar
   ============================================ */
.site-header {
  background: #fff;
  border-bottom: 4px solid #1a7c3e;
  padding: 10px 0;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.sh-logo-area { display: flex; align-items: center; gap: 14px; }
.sh-logo { width: 70px; height: 70px; object-fit: contain; flex-shrink: 0; }
.sh-text { display: flex; flex-direction: column; gap: 2px; }
.sh-gov { font-size: 0.65rem; font-weight: 700; color: #b7860a; text-transform: uppercase; letter-spacing: 0.8px; }
.sh-name { font-size: 1.1rem; font-weight: 900; color: #1a1a2e; text-transform: uppercase; line-height: 1.2; }
.sh-loc { font-size: 0.65rem; color: #6c757d; margin-top: 1px; }
.sh-contacts { display: flex; flex-direction: column; gap: 5px; font-size: 0.82rem; color: #444; }
.sh-contact-item { display: flex; align-items: center; gap: 7px; }
.sh-contact-item a { color: #1a7c3e; font-weight: 600; }
.sh-emg { background: #c0392b; color: #fff; padding: 10px 16px; border-radius: 8px; text-align: center; flex-shrink: 0; }
.sh-emg-label { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.5px; margin-bottom: 3px; }
.sh-emg-num { display: block; font-size: 1rem; font-weight: 900; color: #f0a500; }
.sh-emg-sub { font-size: 0.65rem; opacity: 0.85; margin-top: 2px; }

/* ============================================
   MAIN NAV BAR — Green sticky bar
   ============================================ */
.main-nav-bar {
  background: #1a7c3e;
  position: sticky;
  top: 0;
  z-index: 9999;
  box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}
.main-nav-bar > .container {
  display: flex;
  align-items: stretch;
  padding: 0;
  max-width: 1200px;
  margin: 0 auto;
  width: 94%;
}

/* Logo on LEFT of nav */
.nav-logo-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-right: 2px solid rgba(255,255,255,0.22);
  flex-shrink: 0;
  background: rgba(0,0,0,0.18);
  cursor: pointer;
}
.nav-logo-block img {
  width: 44px; height: 44px;
  object-fit: contain;
  background: #fff;
  border-radius: 3px;
  padding: 2px;
  display: block;
}
.nav-logo-block-text { line-height: 1.3; }
.nav-logo-block-text .nlb1 { font-size: 0.58rem; font-weight: 700; color: #f0a500; text-transform: uppercase; display: block; }
.nav-logo-block-text .nlb2 { font-size: 0.76rem; font-weight: 900; color: #fff; display: block; }

/* Nav takes remaining width */
.main-nav-bar nav { flex: 1; overflow: visible; }

/* Top-level UL — horizontal row */
.main-nav-bar nav > ul {
  display: flex !important;
  list-style: none;
  margin: 0; padding: 0;
  align-items: stretch;
  flex-wrap: nowrap;
  height: 100%;
}
.main-nav-bar nav > ul > li { position: relative; flex-shrink: 0; }

/* Top-level links — BOLD UPPERCASE */
.main-nav-bar nav > ul > li > a {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 13px 12px;
  color: #fff;
  font-size: 0.83rem;
  font-weight: 800;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-right: 1px solid rgba(255,255,255,0.1);
  transition: background 0.15s, color 0.15s;
}
.main-nav-bar nav > ul > li > a:hover,
.main-nav-bar nav > ul > li > a.active { background: rgba(0,0,0,0.22); color: #f0a500; }
.main-nav-bar nav > ul > li > a .arrow { font-size: 0.5rem; opacity: 0.7; margin-left: 1px; }

/* Spacer */
.main-nav-bar nav > ul > li.nav-spacer { flex: 1; border: none; }
/* Contact */
.main-nav-bar nav > ul > li.nav-contact > a { color: #ffe082; }
/* Book */
.main-nav-bar nav > ul > li.nav-book > a { background: #f0a500; color: #1a1a2e; font-weight: 900; }
.main-nav-bar nav > ul > li.nav-book > a:hover { background: #d4920a; color: #fff; }
/* Emergency */
.main-nav-bar nav > ul > li.nav-emg > a { background: #c0392b; color: #fff; font-weight: 900; }
.main-nav-bar nav > ul > li.nav-emg > a:hover { background: #a93226; }

/* ============================================
   DROPDOWNS — hidden by default, shown on hover
   Use separate rules with no !important clashes
   ============================================ */

/* 1. All second-level lists hidden */
.main-nav-bar nav > ul > li > .dropdown { display: none; }
.main-nav-bar .dropdown > li.has-sub > .sub-dropdown { display: none; }

/* 2. Show dropdown on hover (desktop) */
.main-nav-bar nav > ul > li:hover > .dropdown { display: block; }
/* 3. Show sub-dropdown on hover (desktop) */
.main-nav-bar .dropdown > li.has-sub:hover > .sub-dropdown { display: block; }

/* 4. Show on mobile toggle class */
.main-nav-bar nav > ul > li.dd-open > .dropdown { display: block; }
.main-nav-bar .dropdown > li.has-sub.sub-open > .sub-dropdown { display: block; }

/* Dropdown panel styling */
.main-nav-bar .dropdown {
  position: absolute;
  top: 100%; left: 0;
  background: #fff;
  min-width: 215px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  list-style: none;
  padding: 5px 0;
  border-top: 3px solid #f0a500;
  z-index: 99999;
}
.main-nav-bar .dropdown > li > a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  font-size: 0.83rem; font-weight: 700;
  color: #1a1a2e; white-space: nowrap;
  border-left: 3px solid transparent;
  text-transform: none;
  transition: all 0.12s;
}
.main-nav-bar .dropdown > li > a:hover { background: #e8f5ee; color: #1a7c3e; border-left-color: #1a7c3e; }
.main-nav-bar .dropdown > li > a.dd-emg { color: #c0392b; font-weight: 800; }
.main-nav-bar .dropdown > li > a.dd-emg:hover { background: #fdecea; border-left-color: #c0392b; }
.main-nav-bar .dropdown > li > a.dd-staff { color: #1a1a2e; font-weight: 800; }
.main-nav-bar .dropdown > li > a.dd-staff:hover { background: #f0f4f8; border-left-color: #1a1a2e; }
.main-nav-bar .dropdown > li.dd-divider { height: 1px; background: #eee; margin: 3px 10px; padding: 0; pointer-events: none; }

/* Sub-dropdown */
.main-nav-bar .dropdown > li.has-sub { position: relative; }
.main-nav-bar .dropdown > li.has-sub > a::after { content: ' ›'; float: right; margin-left: 6px; opacity: 0.6; }
.main-nav-bar .sub-dropdown {
  position: absolute;
  top: 0; left: 100%;
  background: #fff;
  min-width: 200px;
  border-radius: 0 8px 8px 0;
  box-shadow: 4px 4px 18px rgba(0,0,0,0.15);
  list-style: none;
  padding: 5px 0;
  border-top: 3px solid #1a7c3e;
  z-index: 99999;
}
.main-nav-bar .sub-dropdown > li > a {
  display: block; padding: 8px 14px;
  font-size: 0.81rem; font-weight: 700; color: #333;
  border-left: 3px solid transparent;
  text-transform: none; transition: all 0.12s;
}
.main-nav-bar .sub-dropdown > li > a:hover { background: #e8f5ee; color: #1a7c3e; border-left-color: #1a7c3e; }

/* ============================================
   HAMBURGER
   ============================================ */
.nav-hamburger {
  display: none;
  background: none; border: none;
  cursor: pointer; padding: 10px 14px;
  margin-left: auto; flex-shrink: 0;
}
.nav-hamburger span { display: block; width: 24px; height: 3px; background: #fff; border-radius: 2px; margin: 5px 0; }

/* ============================================
   MOBILE (max 900px)
   ============================================ */
@media (max-width: 900px) {
  /* Identity bar compact */
  .sh-contacts, .sh-emg, .sh-gov, .sh-loc { display: none; }
  .sh-logo { width: 50px; height: 50px; }
  .sh-name { font-size: 0.9rem; }

  /* Show hamburger, hide logo text */
  .nav-hamburger { display: block; }
  .nav-logo-block-text { display: none; }
  .nav-logo-block img { width: 36px; height: 36px; }

  /* Mobile top-level nav: hidden until .open */
  .main-nav-bar nav > ul {
    display: none !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 100%; left: 0; right: 0;
    background: #145f30;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    z-index: 99999;
    max-height: 80vh;
    overflow-y: auto;
  }
  .main-nav-bar nav > ul.open { display: flex !important; }

  /* Override hover rules on mobile */
  .main-nav-bar nav > ul > li:hover > .dropdown { display: none; }
  .main-nav-bar .dropdown > li.has-sub:hover > .sub-dropdown { display: none; }

  /* Only toggle classes work on mobile */
  .main-nav-bar nav > ul > li.dd-open > .dropdown { display: block !important; }
  .main-nav-bar .dropdown > li.has-sub.sub-open > .sub-dropdown { display: block !important; }

  /* Mobile item styling */
  .main-nav-bar nav > ul > li > a {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 12px 16px;
    text-transform: none;
    font-size: 0.88rem;
    width: 100%;
  }
  .main-nav-bar nav > ul > li.nav-spacer { display: none; }
  .main-nav-bar nav > ul > li.nav-book > a,
  .main-nav-bar nav > ul > li.nav-emg > a { animation: none; }

  /* Mobile dropdown styling */
  .main-nav-bar .dropdown {
    position: static;
    box-shadow: none; border-radius: 0; border-top: none;
    border-left: 3px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.15);
    margin-left: 14px;
    min-width: unset;
  }
  .main-nav-bar .dropdown > li > a {
    color: rgba(255,255,255,0.9);
    padding: 9px 20px;
    font-size: 0.82rem;
    border-left: none;
  }
  .main-nav-bar .dropdown > li > a:hover { background: rgba(255,255,255,0.12); color: #fff; }
  .main-nav-bar .dropdown > li.dd-divider { background: rgba(255,255,255,0.15); margin: 2px 0; }
  .main-nav-bar .dropdown > li.has-sub > a::after { content: ' ▾'; }
  .main-nav-bar .dropdown > li.has-sub.sub-open > a::after { content: ' ▴'; }

  /* Mobile sub-dropdown */
  .main-nav-bar .sub-dropdown {
    position: static;
    box-shadow: none; border-radius: 0; border-top: none;
    background: rgba(0,0,0,0.1);
    margin-left: 14px;
    min-width: unset;
  }
  .main-nav-bar .sub-dropdown > li > a { color: rgba(255,255,255,0.82); padding: 8px 26px; font-size: 0.79rem; }
}

@media (max-width: 480px) {
  .sh-logo { width: 40px; height: 40px; }
  .sh-name { font-size: 0.78rem; }
}

/* ============================================
   PRINT & ACCESSIBILITY
   ============================================ */
@media print {
  .main-nav-bar, .sh-emg, #back-to-top { display: none !important; }
  body { font-size: 11pt; color: #000; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Force gallery section to show all rows */
#gallery-grid-section {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  min-height: 320px !important;
}
section { overflow: visible !important; height: auto !important; }
