/*
 * bs3-compat.css
 * Bootstrap-3 compatibility layer on top of Bootstrap 5.
 * Load AFTER bootstrap-5.x.min.css and BEFORE style.css / colors/color1.css.
 * Purpose: existing NativeChurch-theme markup (panels, wells, hidden-*, visible-*,
 * pull-*, btn-default, img-responsive, col-xs-*, input-group-addon, .close)
 * keeps its look without rewriting ~80 .cfm pages.
 */

/* ---------- Panel component (removed in BS4+) ---------- */
.panel {
  margin-bottom: 20px;
  background-color: #fff;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}
.panel-body { padding: 15px; }
.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid transparent;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}
.panel-title {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 16px;
  color: inherit;
}
.panel-title > a,
.panel-title > small,
.panel-title > .small,
.panel-title > small > a,
.panel-title > .small > a { color: inherit; }
.panel-footer {
  padding: 10px 15px;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
  border-bottom-right-radius: 3px;
  border-bottom-left-radius: 3px;
}
.panel-default { border-color: #ddd; }
.panel-default > .panel-heading {
  color: #333;
  background-color: #f5f5f5;
  border-color: #ddd;
}
.panel-primary { border-color: #337ab7; }
.panel-primary > .panel-heading {
  color: #fff;
  background-color: #337ab7;
  border-color: #337ab7;
}
.panel-success { border-color: #d6e9c6; }
.panel-success > .panel-heading {
  color: #3c763d;
  background-color: #dff0d8;
  border-color: #d6e9c6;
}
.panel-info { border-color: #bce8f1; }
.panel-info > .panel-heading {
  color: #31708f;
  background-color: #d9edf7;
  border-color: #bce8f1;
}
.panel-warning { border-color: #faebcc; }
.panel-warning > .panel-heading {
  color: #8a6d3b;
  background-color: #fcf8e3;
  border-color: #faebcc;
}
.panel-danger { border-color: #ebccd1; }
.panel-danger > .panel-heading {
  color: #a94442;
  background-color: #f2dede;
  border-color: #ebccd1;
}
.panel-group { margin-bottom: 20px; }
.panel-group .panel { margin-bottom: 0; border-radius: 4px; }
.panel-group .panel + .panel { margin-top: 5px; }
.panel-group .panel-heading { border-bottom: 0; }
.panel-group .panel-heading + .panel-collapse > .panel-body,
.panel-group .panel-heading + .panel-collapse > .list-group { border-top: 1px solid #ddd; }
.panel-group .panel-footer { border-top: 0; }

/* Accordion collapse plumbing: BS3 used .panel-collapse.collapse; BS5's collapse
 * utility handles the JS but we ensure the visual container is transparent so the
 * panel-body / panel-heading rules above supply the chrome. */
.panel > .panel-collapse > .panel-body,
.panel > .panel-collapse > .list-group { border-top: 1px solid #ddd; }

/* ---------- BS5 .card visual variants — brand teal for all headers ----------
 * The 2026-07-23 panel→card migration converted `panel panel-{color}` to
 * `card border-{color} mb-3`. User wants every card header to use the site's
 * brand teal (#007F7B — the same green as the theme's action buttons and
 * top-nav hover), regardless of border color, for consistent branding. The
 * border stays in the BS3 palette so info/warning/danger still read at a
 * glance, but the header colour is unified. */
.card > .card-header,
.card.border-primary   > .card-header,
.card.border-secondary > .card-header,
.card.border-success   > .card-header,
.card.border-info      > .card-header,
.card.border-warning   > .card-header,
.card.border-danger    > .card-header {
  color: #fff;
  background-color: #007F7B;
  border-color: #007F7B;
}
.card > .card-header a,
.card > .card-header a:hover,
.card > .card-header a:focus { color: #fff; }

/* ---------- Well component (removed in BS4+) ---------- */
.well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
}
.well-lg { padding: 24px; border-radius: 6px; }
.well-sm { padding: 9px; border-radius: 3px; }

/* ---------- .btn-default (renamed to btn-secondary in BS4+) ---------- */
.btn-default {
  color: #333;
  background-color: #fff;
  border-color: #ccc;
}
.btn-default:hover,
.btn-default:focus {
  color: #333;
  background-color: #e6e6e6;
  border-color: #adadad;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
  color: #333;
  background-color: #d4d4d4;
  border-color: #8c8c8c;
}
.btn-default.disabled,
.btn-default[disabled],
fieldset[disabled] .btn-default {
  color: #333;
  background-color: #fff;
  border-color: #ccc;
  opacity: .65;
}

/* ---------- .img-responsive (renamed to img-fluid in BS4+) ---------- */
.img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- .img-thumbnail — visual parity with BS3 look ---------- */
.img-thumbnail {
  padding: 4px;
  line-height: 1.42857143;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: all .2s ease-in-out;
  display: inline-block;
  max-width: 100%;
  height: auto;
}

/* ---------- .thumbnail (BS3 media container, removed in BS4+) ---------- */
.thumbnail {
  display: block;
  padding: 4px;
  margin-bottom: 20px;
  line-height: 1.42857143;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border .2s ease-in-out;
}
.thumbnail > img,
.thumbnail a > img {
  margin-right: auto;
  margin-left: auto;
  display: block;
  max-width: 100%;
  height: auto;
}
.thumbnail .caption { padding: 9px; color: #333; }

/* ---------- Float / centering helpers (removed in BS4+) ---------- */
.pull-left { float: left !important; }
.pull-right { float: right !important; }
.center-block { display: block; margin-right: auto; margin-left: auto; }
.hide { display: none !important; }

/* ---------- BS3 responsive utilities using BS3 breakpoints ---------- */
/* BS3 breakpoints: xs<768, sm 768-991, md 992-1199, lg>=1200.
 * Preserves the original template's mobile/tablet flip points (do not shift
 * to BS5's 576px breakpoint or the layout will re-flow). */

.visible-xs,
.visible-sm,
.visible-md,
.visible-lg,
.visible-xs-block,
.visible-xs-inline,
.visible-xs-inline-block,
.visible-sm-block,
.visible-sm-inline,
.visible-sm-inline-block,
.visible-md-block,
.visible-md-inline,
.visible-md-inline-block,
.visible-lg-block,
.visible-lg-inline,
.visible-lg-inline-block { display: none !important; }

@media (max-width: 767px) {
  .visible-xs { display: block !important; }
  table.visible-xs { display: table !important; }
  tr.visible-xs { display: table-row !important; }
  th.visible-xs, td.visible-xs { display: table-cell !important; }
  .visible-xs-block { display: block !important; }
  .visible-xs-inline { display: inline !important; }
  .visible-xs-inline-block { display: inline-block !important; }
  .hidden-xs { display: none !important; }
}
@media (min-width: 768px) and (max-width: 991px) {
  .visible-sm { display: block !important; }
  table.visible-sm { display: table !important; }
  tr.visible-sm { display: table-row !important; }
  th.visible-sm, td.visible-sm { display: table-cell !important; }
  .visible-sm-block { display: block !important; }
  .visible-sm-inline { display: inline !important; }
  .visible-sm-inline-block { display: inline-block !important; }
  .hidden-sm { display: none !important; }
}
@media (min-width: 992px) and (max-width: 1199px) {
  .visible-md { display: block !important; }
  table.visible-md { display: table !important; }
  tr.visible-md { display: table-row !important; }
  th.visible-md, td.visible-md { display: table-cell !important; }
  .visible-md-block { display: block !important; }
  .visible-md-inline { display: inline !important; }
  .visible-md-inline-block { display: inline-block !important; }
  .hidden-md { display: none !important; }
}
@media (min-width: 1200px) {
  .visible-lg { display: block !important; }
  table.visible-lg { display: table !important; }
  tr.visible-lg { display: table-row !important; }
  th.visible-lg, td.visible-lg { display: table-cell !important; }
  .visible-lg-block { display: block !important; }
  .visible-lg-inline { display: inline !important; }
  .visible-lg-inline-block { display: inline-block !important; }
  .hidden-lg { display: none !important; }
}

/* ---------- .col-{bp}-offset-N (renamed to .offset-{bp}-N in BS4+) ----------
 * Theme pages use `col-md-10 col-md-offset-1` (etc.) to centre a wide column
 * inside a container. BS5 dropped the `col-md-offset-N` form entirely, so
 * without this shim any offset silently does nothing and the column snaps
 * to the left edge. Re-implement as margin-left percentages, wrapped in the
 * matching BS5 min-width breakpoint so smaller viewports don't inherit the
 * offset (the column falls back to full-width like BS5's default). */
.col-xs-offset-0  { margin-left: 0; }
.col-xs-offset-1  { margin-left: 8.333333%; }
.col-xs-offset-2  { margin-left: 16.666667%; }
.col-xs-offset-3  { margin-left: 25%; }
.col-xs-offset-4  { margin-left: 33.333333%; }
.col-xs-offset-5  { margin-left: 41.666667%; }
.col-xs-offset-6  { margin-left: 50%; }
.col-xs-offset-7  { margin-left: 58.333333%; }
.col-xs-offset-8  { margin-left: 66.666667%; }
.col-xs-offset-9  { margin-left: 75%; }
.col-xs-offset-10 { margin-left: 83.333333%; }
.col-xs-offset-11 { margin-left: 91.666667%; }
@media (min-width: 576px) {
  .col-sm-offset-0  { margin-left: 0; }
  .col-sm-offset-1  { margin-left: 8.333333%; }
  .col-sm-offset-2  { margin-left: 16.666667%; }
  .col-sm-offset-3  { margin-left: 25%; }
  .col-sm-offset-4  { margin-left: 33.333333%; }
  .col-sm-offset-5  { margin-left: 41.666667%; }
  .col-sm-offset-6  { margin-left: 50%; }
  .col-sm-offset-7  { margin-left: 58.333333%; }
  .col-sm-offset-8  { margin-left: 66.666667%; }
  .col-sm-offset-9  { margin-left: 75%; }
  .col-sm-offset-10 { margin-left: 83.333333%; }
  .col-sm-offset-11 { margin-left: 91.666667%; }
}
@media (min-width: 768px) {
  .col-md-offset-0  { margin-left: 0; }
  .col-md-offset-1  { margin-left: 8.333333%; }
  .col-md-offset-2  { margin-left: 16.666667%; }
  .col-md-offset-3  { margin-left: 25%; }
  .col-md-offset-4  { margin-left: 33.333333%; }
  .col-md-offset-5  { margin-left: 41.666667%; }
  .col-md-offset-6  { margin-left: 50%; }
  .col-md-offset-7  { margin-left: 58.333333%; }
  .col-md-offset-8  { margin-left: 66.666667%; }
  .col-md-offset-9  { margin-left: 75%; }
  .col-md-offset-10 { margin-left: 83.333333%; }
  .col-md-offset-11 { margin-left: 91.666667%; }
}
@media (min-width: 992px) {
  .col-lg-offset-0  { margin-left: 0; }
  .col-lg-offset-1  { margin-left: 8.333333%; }
  .col-lg-offset-2  { margin-left: 16.666667%; }
  .col-lg-offset-3  { margin-left: 25%; }
  .col-lg-offset-4  { margin-left: 33.333333%; }
  .col-lg-offset-5  { margin-left: 41.666667%; }
  .col-lg-offset-6  { margin-left: 50%; }
  .col-lg-offset-7  { margin-left: 58.333333%; }
  .col-lg-offset-8  { margin-left: 66.666667%; }
  .col-lg-offset-9  { margin-left: 75%; }
  .col-lg-offset-10 { margin-left: 83.333333%; }
  .col-lg-offset-11 { margin-left: 91.666667%; }
}

/* ---------- .col-xs-* (renamed to .col-* in BS4+) ----------
 * Scoped to xs viewport ONLY (< 768px). BS3's col-xs-* was declared without a
 * media query BUT was overridden by col-sm-*/col-md-* via source order at
 * larger breakpoints. Here bs3-compat.css loads AFTER bootstrap-5.x, which
 * would flip the cascade and let col-xs-* win at all widths — so we scope it
 * explicitly to the xs range. Elements combining col-xs-N with col-sm-N or
 * col-md-N (which is every use in this codebase) behave exactly as in BS3. */
@media (max-width: 767.98px) {
  .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6,
  .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
    position: relative;
    width: 100%;
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * .5);
    margin-top: var(--bs-gutter-y, 0);
    box-sizing: border-box;
    flex: 0 0 auto;
  }
  .col-xs-1  { width: 8.333333%; }
  .col-xs-2  { width: 16.666667%; }
  .col-xs-3  { width: 25%; }
  .col-xs-4  { width: 33.333333%; }
  .col-xs-5  { width: 41.666667%; }
  .col-xs-6  { width: 50%; }
  .col-xs-7  { width: 58.333333%; }
  .col-xs-8  { width: 66.666667%; }
  .col-xs-9  { width: 75%; }
  .col-xs-10 { width: 83.333333%; }
  .col-xs-11 { width: 91.666667%; }
  .col-xs-12 { width: 100%; }
}

/* ---------- .input-group-addon (renamed to .input-group-text in BS4+) ---------- */
.input-group-addon {
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--bs-body-color);
  text-align: center;
  white-space: nowrap;
  background-color: var(--bs-tertiary-bg, #e9ecef);
  border: 1px solid var(--bs-border-color, #ced4da);
  border-radius: var(--bs-border-radius, .375rem);
  display: flex;
  align-items: center;
}

/* ---------- .close button — visual equivalent of BS3 close ---------- */
/* Kept for pages we don't hand-edit; the 3 files with data-dismiss have their
 * .close swapped to .btn-close explicitly. */
.close {
  float: right;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: .2;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
}
.close:hover,
.close:focus {
  color: #000;
  opacity: .5;
  text-decoration: none;
}

/* ---------- .form-group (removed in BS5) — preserve spacing ---------- */
.form-group { margin-bottom: 15px; }

/* ---------- .input-lg / .input-sm (renamed to .form-control-{lg,sm} in BS4+) ---------- */
.input-lg {
  height: 46px;
  padding: 10px 16px;
  font-size: 18px;
  line-height: 1.3333333;
  border-radius: 6px;
}
.input-sm {
  height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
}

/* ---------- Theme <ul> reset (protect from BS5 _reboot.scss) ----------
 * BS5 applies `padding-left: 2rem` and `margin-bottom: 1rem` to every <ul>.
 * The NativeChurch theme's site header / superfish menu / megamenu / dropdowns,
 * flexslider (ul.slides), and listings were authored assuming no such padding.
 * Without this reset the dropdowns appear shifted right and the flexslider's
 * slide positioning is offset by 32px. */
.site-header ul,
.site-header ol,
.main-menu-wrapper ul,
.main-menu-wrapper ol,
.navigation ul,
.top-navigation,
.sub-menu,
ul.slides,
ol.slides,
.listing-cont ul,
.listing-cont ol,
.social-icons {
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

/* ---------- Theme containers holding grid columns as non-.row parents ----------
 * BS3's col-* were float:left, so any block-level container of them lined up
 * children horizontally automatically. BS5's col-* rely on the parent being
 * display:flex (BS5's .row is flex). `.featured-blocks` wraps 4 col-md-3
 * cards on the homepage without being a .row itself — make it flex. */
.featured-blocks {
  display: flex;
  flex-wrap: wrap;
}

/* ---------- BS5 navbar visual integration into the theme's .main-menu-wrapper ----
 * nav.cfm was rewritten from a Superfish `.sf-menu` to a BS5 `.navbar` on
 * 2026-07-23. The theme's `.navigation > ul > li` styles no longer match
 * (BS5 puts the ul inside .container > .collapse, breaking the direct-child
 * selector). These rules replicate the uppercase / spaced-out look the theme
 * had for its top-level nav links so the visual match stays close. */
.main-menu-wrapper .navbar        { padding: 0; min-height: 50px; }
.main-menu-wrapper .navbar-nav    { align-items: center; justify-content: center; }
.main-menu-wrapper .nav-link {
    padding: 0 20px;
    line-height: 50px;
    text-transform: uppercase;
    font-size: 15px;
    color: #333;
    display: block;
}
.main-menu-wrapper .nav-link:hover,
.main-menu-wrapper .nav-link:focus,
.main-menu-wrapper .nav-link.active,
.main-menu-wrapper .nav-item.show > .nav-link { color: #007F7B; }
.main-menu-wrapper .dropdown-menu {
    border-radius: 0;
    margin-top: 0;
    border-top: 3px solid #007F7B;
    font-size: 14px;
    text-transform: none;
}
.main-menu-wrapper .dropdown-item        { padding: 8px 16px; }
.main-menu-wrapper .dropdown-item:hover,
.main-menu-wrapper .dropdown-item:focus  { background-color: #f8f7f3; color: #007F7B; }
.main-menu-wrapper .megamenu-sub-title   {
    display: block;
    color: #007F7B;
    font-size: 13px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eceae4;
    margin-bottom: 10px;
}
.main-menu-wrapper .megamenu-sub-title + ul .dropdown-item { padding: 4px 0; }
.main-menu-wrapper .meta-data { font-size: 11px; color: #999; }
/* Mobile collapse: keep the strip readable */
@media (max-width: 991.98px) {
    .main-menu-wrapper .navbar        { min-height: 0; }
    .main-menu-wrapper .nav-link      { line-height: 1.5; padding: 10px 15px; }
    .main-menu-wrapper .dropdown-menu { border-top: 0; box-shadow: none; }
}

/* Defensive: force the main nav visible at lg+ regardless of any theme
   rules. Critical piece: the theme's `.navigation { position: absolute; top: 0 }`
   at style.css:746 was designed for the original Superfish menu to float over
   the beige strip; on the new BS5 navbar it pulls the whole `<nav>` up to the
   viewport top, covering the topbar. Force it back into normal flow here. */
@media (min-width: 992px) {
    .main-menu-wrapper            { display: block !important; height: auto !important; min-height: 50px; }
    .main-menu-wrapper .navigation{
        position: relative !important;
        top: auto !important;
        height: auto !important;
        overflow: visible !important;
    }
    .main-menu-wrapper .navbar,
    .main-menu-wrapper .navbar > .container,
    .main-menu-wrapper .navbar-collapse { display: flex !important; }
    .main-menu-wrapper .navbar-nav      { display: flex !important; flex-direction: row !important; }
    .main-menu-wrapper .nav-item        { display: block !important; }
}

/* ---------- Hero-slider positioning safety-net ----------
 * The theme's base `.hero-slider { top:-81px; margin-bottom:-81px }` was
 * meant to overlap the slider under a semi-transparent 81px header. In BS5
 * the header height changes slightly (font-size / margin reboot), so the
 * -81px pull can leave the top of the slider image cropped above viewport.
 * `.header-style2 .hero-slider { top:0 }` already resets this in style.css,
 * but we force it defensively to catch any style-collision edge cases. */
.hero-slider {
  top: 0 !important;
  margin-bottom: 0 !important;
}

/* ---------- Hero slider background handling (BS5 carousel replacement) ----------
 * The theme's `.parallax { background-attachment: fixed !important }` at
 * style.css:2701 is a parallax effect that anchors the background to the
 * VIEWPORT rather than the element. In the old flexslider markup the theme
 * neutralised this per-slide with `background-attachment:scroll !important`
 * scoped to `.hero-slider.flexslider ul.slides li` (style.css:1211). Now that
 * the hero is a BS5 carousel, that selector no longer matches — so `fixed`
 * wins and the image scales to viewport dimensions (way too big).
 * We force scroll here; background-position is set per-slide via inline
 * style in index.cfm (webdale.jpg has its "Dr. Dale M. Sides" text on the
 * LEFT, so it needs `left top`; bg4.jpg and stargazer4web.jpg have their
 * text on the RIGHT, so they use the default `center top`). */
.hero-slider .carousel-item {
  background-attachment: scroll !important;
  background-position: center top;
  overflow: hidden;
}

/* ---------- BS3 label/badge shims (BS4+ renamed/removed) ---------- */
.label {
  display: inline;
  padding: .2em .6em .3em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: .25em;
  background-color: #777;
}
.label-default  { background-color: #777; }
.label-primary  { background-color: #337ab7; }
.label-success  { background-color: #5cb85c; }
.label-info     { background-color: #5bc0de; }
.label-warning  { background-color: #f0ad4e; }
.label-danger   { background-color: #d9534f; }
