/* ==========================================================
   Bootstrap 5 compatibility fixes (Bootstrap 4 style markup)
   - Agenda header (#box1)
   - Sponsors section (.cBlueBGWhite)
   ========================================================== */


/* ------------------------------
   A) AGENDA HEADER FIX (#box1)
   Problem: .cTbsDay contains .col-* children without a .row
   Fix: turn .cTbsDay into a flex "row" and size children
------------------------------ */

#box1.cAgendaHeader {
  padding-bottom: 0 !important;
}

#box1 .cTbsDay {
  display: flex;
  flex-wrap: wrap;
  width: 100%;

  /* BS5 gutter simulation for a row */
  margin-left: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
  margin-right: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
}

/* Apply gutters to "fake columns" */
#box1 .cTbsDay > .col-sm-12.col-md-4.col-lg-4 {
  box-sizing: border-box;
  padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
  padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
}

/* 3 equal columns on md+ */
@media (min-width: 768px) {
  #box1 .cTbsDay > .col-sm-12.col-md-4.col-lg-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }
}

/* Stack on mobile */
@media (max-width: 767.98px) {
  #box1 .cTbsDay > .col-sm-12.col-md-4.col-lg-4 {
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 0.75rem;
    text-align: center;
  }
}

/* Optional: keep your alignment helpers working */
#box1 .cAlignRight { text-align: right; }
#box1 .cAlignLeft  { text-align: left; }

@media (max-width: 767.98px) {
  #box1 .cAlignRight,
  #box1 .cAlignLeft {
    text-align: center;
  }
}

/* Optional (safe): make the tab links consistent */
#box1 .cTbsDay h4 {
  margin: 0;
}

#box1 .cTbsDay a {
  text-decoration: none;
  display: inline-block;
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
}

#box1 .cTbsDay a:hover {
  text-decoration: none;
}


/* ------------------------------
   B) SPONSORS SECTION FIX
   Problem: nested .col-* without .row (BS4 style)
   Fix: convert key wrappers into flex rows + gutters
------------------------------ */

/* Any .col-* directly holding other .col-* should act like a .row */
.cBlueBGWhite .SponsorBlock,
.cBlueBGWhite .SponsorBlock > .col-sm-12.col-md-10.col-lg-10 {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

/* Row gutter simulation */
.cBlueBGWhite .SponsorBlock,
.cBlueBGWhite .SponsorBlock > .col-sm-12.col-md-10.col-lg-10 {
  margin-left: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
  margin-right: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
}

/* Apply gutters to direct children */
.cBlueBGWhite .SponsorBlock > .col-sm-12.col-md-2.col-lg-2,
.cBlueBGWhite .SponsorBlock > .col-sm-12.col-md-10.col-lg-10,
.cBlueBGWhite .SponsorBlock > .col-sm-12.col-md-10.col-lg-10 > .col-sm-12.col-md-4.col-lg-4 {
  box-sizing: border-box;
  padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
  padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
}

/* md+ widths: 2/10 + 4/4/4 */
@media (min-width: 768px) {
  .cBlueBGWhite .SponsorBlock > .col-sm-12.col-md-2.col-lg-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .cBlueBGWhite .SponsorBlock > .col-sm-12.col-md-10.col-lg-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }

  .cBlueBGWhite .SponsorBlock > .col-sm-12.col-md-10.col-lg-10 > .col-sm-12.col-md-4.col-lg-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }
}

/* Mobile: stack */
@media (max-width: 767.98px) {
  .cBlueBGWhite .SponsorBlock > .col-sm-12.col-md-2.col-lg-2,
  .cBlueBGWhite .SponsorBlock > .col-sm-12.col-md-10.col-lg-10,
  .cBlueBGWhite .SponsorBlock > .col-sm-12.col-md-10.col-lg-10 > .col-sm-12.col-md-4.col-lg-4 {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* Optional tidy styling (safe) */
.cBlueBGWhite .SponsorBlock {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.cBlueBGWhite .SponsorLogo {
  display: flex;
  align-items: center;
  justify-content: center; /* change to flex-start for left align */
  min-height: 90px;
}

.cBlueBGWhite .SponsorLogo img {
  max-width: 100%;
  height: auto;
  display: block;
}
