/*
 * Responsive overrides for the BRICS TB Research Network site.
 * Loaded after style.css; keeps the original template (and its Sass) untouched.
 */

img {
  max-width: 100%;
  height: auto;
}

/* Long e-mail addresses and URLs must wrap on small screens */
a {
  overflow-wrap: anywhere;
}

/* ---------- Hero ---------- */
/* Centre the text with flexbox instead of fixed negative offsets, so long text never overflows */
.fh5co-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  background-position: center;
}
/* Parallax hero (replaces the jQuery Stellar plugin); off on touch/small screens where it jitters */
@media screen and (hover: hover) and (min-width: 769px) {
  .fh5co-cover {
    background-attachment: fixed;
  }
}
.fh5co-cover .desc {
  position: relative;
  top: auto;
  margin-top: 0;
  max-width: 1000px;
  padding: 0 15px;
}
.fh5co-cover .desc h2 {
  font-size: clamp(28px, 6vw, 60px);
}
.fh5co-cover .desc h3 {
  color: #fff;
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.5;
}
@media screen and (max-width: 768px) {
  .fh5co-cover,
  .fh5co-hero {
    height: auto;
    min-height: 420px;
  }
}

/* ---------- Country flags (home page) ---------- */
.flag-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto 1.5em;
  padding: 0;
}
.flag-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid #ccc;
}
@media screen and (max-width: 480px) {
  .flag-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Equal-height card rows (news & events) ---------- */
/* Floats stair-step when card heights differ; flexbox keeps rows aligned */
.row-equal {
  display: flex;
  flex-wrap: wrap;
}
.row-equal:before,
.row-equal:after {
  display: none;
}
.row-equal > [class*="col-"] {
  float: none;
  display: flex;
}
.row-equal > [class*="col-"] > * {
  width: 100%;
}
.row-equal .fh5co-blog {
  display: flex;
  flex-direction: column;
}
.row-equal .fh5co-blog .blog-text {
  flex: 1;
}
@media screen and (max-width: 767px) {
  .row-equal > [class*="col-"] {
    width: 100%;
  }
}

/* ---------- Members / partners tabs (Bootstrap 5 JS on Bootstrap 3 CSS) ---------- */
.member-tabs {
  margin-top: 1em;
  text-align: left;
}
.member-tabs .nav-tabs > li > a {
  color: #555;
}
.member-tabs .nav-tabs > li > a.active,
.member-tabs .nav-tabs > li > a.active:hover,
.member-tabs .nav-tabs > li > a.active:focus {
  color: #ff5722;
  background: #fff;
  border: 1px solid #ddd;
  border-bottom-color: transparent;
  cursor: default;
}
.member-tabs .tab-content {
  background: #fff;
  border: 1px solid #ddd;
  border-top: 0;
  padding: 20px 20px 0;
}
.member-tabs .tab-content h4 {
  margin-top: 0;
  font-weight: 700;
}
@media screen and (max-width: 767px) {
  /* One scrollable row of tabs instead of a ragged multi-line stack */
  .member-tabs .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .member-tabs .nav-tabs:before,
  .member-tabs .nav-tabs:after {
    display: none;
  }
  .member-tabs .nav-tabs > li {
    float: none;
    flex: 0 0 auto;
  }
  .member-tabs .tab-content {
    padding: 15px 15px 0;
  }
}

/* ---------- Misc ---------- */
.meeting-list {
  text-align: left;
  padding-left: 1.25em;
}
