/* === Global Fixes === */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* === Global Container Safeguards === */
.container,
.row-flex-nsaw {
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

/* === Hide all rows by default; show only when .active class present === */
.row-flex-nsaw {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-bottom: 6rem;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Show active rows */
.row-flex-nsaw.active {
  display: flex;
}

/* === Force Vertical Stack (Image over Card) on All Devices === */
.row-flex-nsaw.active,
.flex-md-row-reverse.active {
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-bottom: 6rem;
}

/* Image and Text columns 95% width always */
.row-flex-nsaw.active > .image-col-nsaw,
.row-flex-nsaw.active > .text-col-nsaw,
.flex-md-row-reverse.active > .image-col-nsaw,
.flex-md-row-reverse.active > .text-col-nsaw {
  width: 95% !important;
  max-width: none !important;
  display: flex !important;
  justify-content: center;
  order: unset !important;
  margin: 0 auto;
  padding: 0;
}

/* Image column order forcing image on top */
.row-flex-nsaw.active > .image-col-nsaw,
.flex-md-row-reverse.active > .image-col-nsaw {
  order: 1 !important;
}

/* Text column order forcing text below image */
.row-flex-nsaw.active > .text-col-nsaw,
.flex-md-row-reverse.active > .text-col-nsaw {
  order: 2 !important;
  align-items: center;
  margin-top: 0 !important;
  padding: 0 1rem;
}

/* Image styling with 95% width */
.image-section-nsaw {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  border-radius: 1rem;
  box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.15);
  object-fit: cover;
}

/* Card styling with max width 95%, padding, border radius */
.overlay-card-nsaw {
  background-color: #F5F6F2;
  color: #111;
  border-radius: 1rem;
  box-shadow: 0 1rem 2rem rgba(239, 62, 66, 0.2);
  padding: 2rem;
  width: 100%;
  max-width: 95%;
  text-align: center;
  margin: -3rem auto 0 auto;
  aspect-ratio: unset;
  position: relative;
  z-index: 3;
}

/* Dark card variant */
.card-dark-nsaw {
  background-color: #132230;
  color: #f1f5f9;
}

.card-dark-nsaw .btn {
  border-color: #f1f5f9;
  color: #f1f5f9;
}

.card-dark-nsaw .btn:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

/* Alternate row background colors for visible rows */
.row-flex-nsaw.active:nth-child(odd) {
  background-color: #132230; /* Navy */
  padding: 2rem 0;
  border-radius: 1rem;
}

.row-flex-nsaw.active:nth-child(even) {
  background-color: #F5F6F2; /* Light grey */
  padding: 2rem 0;
  border-radius: 1rem;
  color: #111;
}

.row-flex-nsaw.active:nth-child(even) .overlay-card-nsaw {
  background-color: #F5F6F2;
  color: #111;
  box-shadow: 0 1rem 2rem rgba(239, 62, 66, 0.2);
}

.row-flex-nsaw.active:nth-child(odd) .overlay-card-nsaw {
  background-color: #132230;
  color: #f1f5f9;
  box-shadow: 0 1rem 2rem rgba(19, 34, 48, 0.4);
}

/* Ensure buttons in cards adjust colors accordingly */
.row-flex-nsaw.active:nth-child(odd) .btn {
  border-color: #f1f5f9;
  color: #f1f5f9;
}

.row-flex-nsaw.active:nth-child(odd) .btn:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

/* === Safari/Apple Specific Fix (Force stacking order) === */
@supports (-webkit-touch-callout: none) {
  .image-col-nsaw {
    order: 1 !important;
  }
  .text-col-nsaw {
    order: 2 !important;
  }
}

/* === Other Unchanged Styles from Your Code === */
.eventDetails, .eventTitle, .padding-top-xl, .row.padding-top-xl {
  display: none !important;
}

.mainImage {
  padding-top: 5px;
  padding-bottom: 15px;
}

.globalFooter {
  background: #122231;
}

.globalFooter-input {
  background-color: #333333;
}

.givingToolbar-toolbar,
.flyoutNav {
  background: #122231;
}

/* === Video Styling === */
.video-wrapper-nsaw {
  position: relative;
  width: 100%;
  max-width: 1920px;
  margin: 1rem auto 5rem auto;
  height: 0;
  padding-bottom: 56.25%;
  border-radius: 1rem;
  overflow: hidden;
  animation: shadowPulse 6s infinite alternate ease-in-out;
}

.video-wrapper-nsaw iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  margin-bottom: -45px;
}

@keyframes shadowPulse {
  0%   { box-shadow: 0 1rem 2rem rgba(30, 41, 59, 0.6); }
  50%  { box-shadow: 0 1rem 2rem rgba(220, 38, 38, 0.6); }
  100% { box-shadow: 0 1rem 2rem rgba(30, 41, 59, 0.6); }
}

/* === Territorial Priorities Panel === */
.tp-panel {
  border-radius: 1rem;
  box-shadow: 0 1rem 2rem rgba(239, 62, 66, 0.2);
  padding: 3rem;
}

.panel-content {
  max-height: 110px;
  overflow: hidden;
  transition: max-height 0.9s ease;
}

input[type="checkbox"] {
  display: none;
}

input[type="checkbox"]:checked + .panel-content {
  max-height: 1000px;
  opacity: 1;
  transform: scaleY(1);
  transition: max-height 1s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.9s ease,
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.view-more-label {
  display: block;
  color: navy;
  cursor: pointer;
  margin-top: 10px;
  text-decoration: underline;
}

/* === Pill Tabs === */
.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto 2rem auto;
  padding: 0 1rem;
}

.tab-button {
  background-color: #132230;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.tab-button.active {
  background-color: #EF3E42;
  color: #fff;
}

.tab-content {
  display: none;
  animation: fadeIn 0.6s ease;
}

.tab-content.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tab-buttons-wrapper {
  margin-top: -30px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tab-buttons-wrapper::-webkit-scrollbar {
  display: none;
}

  .btn.btn-outline-dark {
    border: 1px solid #132230;
    color: #132230;
  }

