/**
 * Site-wide compact NativeChurch header + green contact top bar.
 * Loaded on every front-end page. Does not edit the theme.
 * Palette: green #005B40, white, black.
 *
 * Shared wrap: logo and address share the same left edge;
 * menu and social icons share the same right edge.
 */

:root {
  --ipb3-green: #005B40;
  --ipb3-wrap-width: min(1160px, calc(100% - 40px));
  --ipb3-header-h: 100px;
  --ipb3-logo-h: 74px;
}

@media (max-width: 640px) {
  :root {
    --ipb3-wrap-width: min(1160px, calc(100% - 28px));
  }
}

@media (max-width: 992px) {
  :root {
    --ipb3-header-h: 72px;
    --ipb3-logo-h: 56px;
  }
}

/* -------------------------------------------------------------------------- */
/* Green contact top bar (site-wide, not sticky)                              */
/* -------------------------------------------------------------------------- */
.ipb3-topbar {
  --green: #005B40;
  --green-dark: #004632;
  background: #005B40;
  color: #E8F3EE;
  font-size: 0.86rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  line-height: 1.4;
  position: relative;
  z-index: 1200;
  box-sizing: border-box;
}

.ipb3-topbar *,
.ipb3-topbar *::before,
.ipb3-topbar *::after {
  box-sizing: border-box;
}

.ipb3-topbar .wrap {
  width: var(--ipb3-wrap-width) !important;
  max-width: 1160px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.ipb3-topbar a { color: #E8F3EE; text-decoration: none; }
.ipb3-topbar a:hover { color: #ffffff; }
.ipb3-topbar .topbar-meta { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.ipb3-topbar .topbar-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ipb3-topbar .social { display: flex; gap: 10px; align-items: center; }
.ipb3-topbar .social a {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}
.ipb3-topbar .social a:hover { background: #004632; border-color: #004632; }

/* Guard against a double-injected bar (body_open + fallback). */
body > .ipb3-topbar ~ .ipb3-topbar {
  display: none !important;
}


@media (max-width: 640px) {
  .ipb3-topbar .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 12px;
  }
  .ipb3-topbar .topbar-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px 12px;
  }
}

/* -------------------------------------------------------------------------- */
/* Slim white bar: logo + menu on one row                                     */
/* -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

body.admin-bar .site-header {
  top: 32px;
}

.site-header .topbar,
.header-style5 .site-header,
.header-style6 .site-header {
  background-color: #ffffff !important;
  background-image: none !important;
  background-size: auto !important;
}

.site-header .topbar {
  height: var(--ipb3-header-h) !important;
  min-height: var(--ipb3-header-h);
  max-height: var(--ipb3-header-h);
  position: relative;
  z-index: 333;
  box-shadow: none;
}

/* Same centered wrap as .ipb3-topbar .wrap (beats theme width:100% on .topbar > .container).
   Height is only locked on the logo row; the mobile slide-down menu must stay height:auto. */
.site-header .topbar > .container,
.site-header .main-menu-wrapper > .container {
  width: var(--ipb3-wrap-width) !important;
  max-width: 1160px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  position: relative;
  box-sizing: border-box !important;
}

.site-header .topbar > .container {
  height: var(--ipb3-header-h);
  display: flex;
  align-items: center;
}

.site-header .topbar > .container > .row {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  height: var(--ipb3-header-h);
  display: flex;
  align-items: center;
}

.site-header .main-menu-wrapper > .container > .row {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.site-header .topbar .row > [class*="col-"],
.site-header .main-menu-wrapper .col-md-12 {
  float: none;
  height: auto;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Bigger, vertically centered logo. Kill theme absolute / left:40% on the img. */
.site-header h1.logo {
  height: auto !important;
  max-height: var(--ipb3-logo-h);
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible;
  display: flex;
  align-items: center;
  line-height: 0;
  z-index: 1301;
  position: relative;
  left: auto !important;
  top: auto !important;
  max-width: none;
}

.site-header h1.logo a {
  display: flex;
  align-items: center;
  line-height: 0;
  position: relative !important;
  left: auto !important;
  top: auto !important;
}

.site-header h1.logo img,
.site-header h1.logo .default-logo img,
.site-header h1.logo .retina-logo img,
.site-header h1.logo a img {
  max-height: var(--ipb3-logo-h) !important;
  width: auto !important;
  height: auto !important;
  display: block;
  max-width: 220px;
  position: static !important;
  left: auto !important;
  top: auto !important;
}

/* Hide the theme search — cleaner than squeezing it into the compact bar. */
.site-header .top-search {
  display: none !important;
}

/* Hamburger stays inside the shared wrap, right-aligned and tappable. */
.site-header .hs4-menu {
  position: absolute;
  top: 50%;
  right: 0;
  left: auto;
  width: auto;
  transform: translateY(-50%);
}

.site-header .menu-toggle,
.site-header a.menu-toggle {
  margin: 0 !important;
  float: none;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: #111111 !important;
  font-size: 20px !important;
  text-decoration: none;
}

/* -------------------------------------------------------------------------- */
/* Desktop: menu sits in the same row, no floating white box                  */
/* -------------------------------------------------------------------------- */
@media (min-width: 993px) {
  .site-header .sticky-wrapper {
    height: 0 !important;
    min-height: 0 !important;
    position: static;
  }

  .site-header .main-menu-wrapper,
  .site-header .is-sticky .main-menu-wrapper,
  .is-sticky .main-menu-wrapper {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: var(--ipb3-header-h) !important;
    min-height: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: 400;
    pointer-events: none;
  }

  .site-header .main-menu-wrapper .container,
  .site-header .main-menu-wrapper .row,
  .site-header .main-menu-wrapper .col-md-12 {
    height: var(--ipb3-header-h);
    pointer-events: none;
  }

  .site-header .navigation {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: var(--ipb3-header-h) !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    pointer-events: auto;
    z-index: 500;
    padding-left: 220px; /* keep items off the larger logo */
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .site-header .navigation > ul {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
    float: none;
    width: auto;
  }

  .site-header .navigation > ul > li {
    display: inline-block;
    line-height: 1.2;
    float: none;
  }

  .site-header .navigation > ul > li > a {
    color: #111111;
    padding: 10px 14px;
    line-height: 1.2;
  }

  .site-header .navigation > ul > li:last-child > a {
    padding-right: 0;
  }

  .site-header .navigation > ul > li > a:hover,
  .site-header .navigation > ul > li.current-menu-item > a,
  .site-header .navigation > ul > li.current_page_item > a,
  .site-header .navigation > ul > li.current-menu-ancestor > a {
    color: #005B40;
  }

  /* Dropdowns (Institucional and nested items) stay absolutely positioned. */
  .site-header .navigation > ul > li ul {
    top: 100%;
    left: 0;
    margin-left: 0;
    text-align: left;
    background: #ffffff;
    z-index: 1200;
  }
}

/* -------------------------------------------------------------------------- */
/* Mobile / tablet: compact logo + hamburger; slide-down menu preserved       */
/* -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .site-header .topbar {
    height: var(--ipb3-header-h) !important;
    min-height: var(--ipb3-header-h);
    max-height: var(--ipb3-header-h);
  }

  .site-header h1.logo,
  .site-header h1.logo img,
  .site-header h1.logo .default-logo img,
  .site-header h1.logo .retina-logo img,
  .site-header h1.logo a img {
    max-height: var(--ipb3-logo-h) !important;
  }

  .site-header h1.logo img {
    max-width: 160px;
  }

  .site-header a.menu-toggle,
  .site-header .menu-toggle {
    display: inline-flex !important;
  }

  .site-header .sticky-wrapper {
    height: auto !important;
    min-height: 0 !important;
  }

  .site-header .main-menu-wrapper,
  .is-sticky .main-menu-wrapper {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: #ffffff !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    z-index: 1200;
    pointer-events: auto;
  }

  .site-header .main-menu-wrapper > .container,
  .site-header .main-menu-wrapper > .container > .row,
  .site-header .main-menu-wrapper .col-md-12 {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    display: block;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .site-header .navigation {
    position: relative !important;
    height: auto !important;
    width: 100% !important;
    background: #ffffff !important;
    box-shadow: none !important;
    text-align: left;
    padding-left: 0;
  }

  .site-header .navigation > ul > li > a {
    color: #111111;
  }

  .site-header .navigation > ul > li > a:hover,
  .site-header .navigation > ul > li.current-menu-item > a,
  .site-header .navigation > ul > li.current_page_item > a {
    color: #005B40;
  }
}

/* Customizer rule is max-width 767px / 56px — keep 56px here with !important. */
@media (max-width: 767px) {
  .site-header h1.logo img,
  body .site-header h1.logo img,
  .site-header h1.logo .default-logo img,
  .site-header h1.logo .retina-logo img,
  .site-header h1.logo a img {
    max-height: 56px !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
  }
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

/* Inner pages used extra breadcrumb padding to clear the hanging menu box. */
.body ol.breadcrumb {
  padding-top: 12px !important;
}
