.nav {
  --bs-nav-link-padding-x: 1rem;
  --bs-nav-link-padding-y: 0.5rem;
  --bs-nav-link-color: #ddd;
  --bs-nav-link-hover-color: #fff;
  --bs-nav-link-disabled-color: #666;
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
  justify-content: space-evenly;
}

.nav-link {
  display: block;
  padding: var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);
  font-size: 1rem;
  font-weight: 700;
  color: var(--bs-nav-link-color);
  text-decoration: none;
  border: 0;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
  cursor: pointer;
  background: #990000;
}

.nav-link i {
  min-width: 47px;
  padding-right: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .nav-link {
    transition: none;
  }
}

.nav-link:hover,
.nav-link:focus {
  color: var(--bs-nav-link-hover-color);
  background: #cb2026;
}

.nav-link:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.nav-tabs {
  --bs-nav-tabs-border-width: 2px;
  --bs-nav-tabs-border-color: black;
  --bs-nav-tabs-link-hover-border-color: transparent;
  --bs-nav-tabs-link-active-color: white;
  --bs-nav-tabs-link-active-bg: #cb2026;
  --bs-nav-tabs-link-active-border-color: #900;
  border-bottom: var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color);
  text-transform: uppercase;
}

.tabbedSection {
  position: relative;
  width: 100%;
  margin-top: 0px;
  padding-top: 15px;
  margin-bottom: 0px;
  padding-bottom: 25px;
  overflow: visible;
}
.outroSection {
  margin-bottom: 60px;
}
.tab-pane {
  display: none;
}


/*  MOBILE ACCORDION STYLES (< 991px) */

@media (max-width: 990px) {

  .tabbedSection {
    width: 100%;
  }

  .tabbedSection .container {
    width: 100%;
    max-width: 1170px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
  }

  .tabbedSection .nav.nav-tabs {
    width: 90%;
    max-width: 900px;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0;
    padding-right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: none;
  }

  .tabbedSection .nav-tabs .nav-item {
    width: 100%;
    list-style: none;
  }

  /* Mobile accordion header closed/default */
  .tabbedSection .nav-tabs .nav-link {
    width: 100%;
    text-align: left;
    display: inline-flex;
    position: relative;
    align-items: center;
    padding: 20px 60px 20px 20px;
    border: 2px solid #900;
    border-radius: 0;
    color: #cb2026;
    background-color: #fff;
    font-size: larger;
    font-family: 'nobel', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
  }

  /* Expand/Collapse Plus Icon */
  .tabbedSection .nav-tabs .nav-link::after {
    font-family: "Font Awesome 6 Pro", sans-serif;
    content: "\2b";
    color: #cb2026;
    font-weight: 700;
    margin-right: 20px;
    transform: rotate(0);
    transition: transform 0.2s ease-out, color 0.2s;
    position: absolute;
    right: 0;
    align-self: center;
  }

  .tabbedSection .nav-tabs .nav-link:hover,
  .tabbedSection .nav-tabs .nav-link:focus {
    background-color: #cb2026;
    color: #fff;
  }

  .tabbedSection .nav-tabs .nav-link:hover::after,
  .tabbedSection .nav-tabs .nav-link:focus::after {
    color: #fff;
  }

  /* Mobile accordion header - active/open */
  .tabbedSection .nav-tabs .nav-link.active {
    color: #fff;
    background-color: #cb2026;
    border-color: #900;
    border-bottom: 0;
  }

  .tabbedSection .nav-tabs .nav-link.active::after {
    color: #fff;
    transform: rotate(135deg);
  }

  /* Mobile accordion content panel */
  .tabbedSection .tab-pane.active {
    display: block;
    text-transform: none;
    padding: 25px 30px 34px;
    background-color: #fff;
    color: #000;
    border-left: 2px dashed #cb2026;
    border-right: 2px dashed #cb2026;
    border-bottom: 2px dashed #cb2026;
    border-top: 0;
    margin-top: -10px;
    margin-bottom: 10px;
    box-sizing: border-box;
  }

  /* Force inner content to stay black */
  .tabbedSection .tab-pane.active,
  .tabbedSection .tab-pane.active p,
  .tabbedSection .tab-pane.active li,
  .tabbedSection .tab-pane.active span,
  .tabbedSection .tab-pane.active h1,
  .tabbedSection .tab-pane.active h2,
  .tabbedSection .tab-pane.active h3,
  .tabbedSection .tab-pane.active h4,
  .tabbedSection .tab-pane.active h5,
  .tabbedSection .tab-pane.active h6 {
    color: #000;
  }

  .tabbedSection .tab-pane.active p {
    font-size: 1rem;
    line-height: 1.5;
  }

  .tabbedSection .tab-pane.active strong,
  .tabbedSection .tab-pane.active b {
    color: #000;
    font-weight: 700;
  }

  /* Links inside accordion content */
  .tabbedSection .tab-pane a {
    color: #cb2026;
    text-decoration: underline;
  }

  /* Learn More / CTA button inside accordion content */
  .tabbedSection .tab-pane a.btn,
  .tabbedSection .tab-pane .btn,
  .tabbedSection .tab-pane .button,
  .tabbedSection .tab-pane .learn-more,
  .tabbedSection .tab-pane .learn-more-btn {
    display: block;
    width: fit-content;
    margin: 18px auto 0;
    padding: 12px 24px;
    background-color: #cb2026;
    color: #fff;
    border: 0;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'nobel', sans-serif;
    font-weight: 700;
    line-height: 1.15;
  }

  .tabbedSection .tab-pane a.btn:hover,
  .tabbedSection .tab-pane .btn:hover,
  .tabbedSection .tab-pane .button:hover,
  .tabbedSection .tab-pane .learn-more:hover,
  .tabbedSection .tab-pane .learn-more-btn:hover {
    background-color: #900;
    color: #fff;
    text-decoration: none;
  }

  .tabbedSection .tab-pane .fancyList li {
    font-size: 1rem;
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
  }
}


/* DESKTOP TABBED SECTION (>= 991px) */

@media (min-width: 991px) {
  .tabbedSection .nav.nav-tabs {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;

    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
    list-style: none;
    border-bottom: none;
    background: transparent;
  }

  .tabbedSection .nav-tabs .nav-item {
    display: contents !important;
  }

  .tabbedSection .nav-tabs .nav-link {
    grid-row: 1 !important;

    /*
     * This prevents the active tab text/content from forcing width changes.
     */
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;

    display: flex !important;
    align-items: center;
    justify-content: center;

    min-height: 100px;
    height: 100px;
    max-height: 100px;

    padding: 18px 16px;
    margin: 0;

    background-color: #990000;
    color: #ffffff !important;

    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    font-family: 'nobel', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;

    white-space: normal;
    overflow-wrap: anywhere;
  }

  .tabbedSection .nav-tabs .nav-link.active,
  .tabbedSection .nav-tabs .nav-item.show .nav-link {
    background-color: #cb2026 !important;
    color: #ffffff !important;

    /*
     * Explicitly prevent Bootstrap/theme active styles from changing size.
     */
    padding: 18px 16px !important;
    margin: 0 !important;
    border: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
  }

  .tabbedSection .tab-pane {
    display: none !important;

    /*
     * Critical: hidden panes should not affect grid sizing.
     */
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .tabbedSection .tab-pane.active,
  .tabbedSection .tab-pane.show.active {
    grid-row: 2 !important;
    grid-column: 1 / -1 !important;

    display: block !important;

    /*
     * Critical: this keeps the full-width pane from increasing
     * the width of the active tab's original grid column.
     */
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;

    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;

    margin: 0;
    padding: 40px 50px 50px;

    background-color: #cb2026;
    color: #ffffff;
    border: 0;
    text-transform: none;
  }

  .tabbedSection .tab-pane.active a,
  .tabbedSection .tab-pane.show.active a {
    color: #ffffff;
    text-decoration: underline;
    transition: color 0.2s ease, background-color 0.2s ease, text-decoration-color 0.2s ease;
  }

  /* Hover state: red text with white highlight */
  .tabbedSection .tab-pane.active a:hover,
  .tabbedSection .tab-pane.active a:focus,
  .tabbedSection .tab-pane.show.active a:hover,
  .tabbedSection .tab-pane.show.active a:focus {
    color: #cb2026;
    background-color: #ffffff;
    text-decoration: none;
  }
}