/*
  The BG-CMS home page (site/home/home.html, js/bg-home.js): carousel + side tiles, in
  bankgaborone.co.bw's own look (as on 2026-11-27: the carousel and side navigation web parts,
  BG.css's .carousel/.productnav1 rules). Scoped to .bgh; px only; prefixed class names.

  Sizes follow the box's own width (container queries), so the Home page manager's preview,
  drawn at a phone's or a large screen's width, shows exactly this layout:
    1184 px and wider  carousel 2/3 and tiles 1/3 side by side (as col-lg-8 / col-lg-4 from
                       1200), as tall as --bgh-h (set by bg-home.js: 500-860 px, the window's
                       free height), the tiles sharing that height
    576-1183 px        carousel 500 px, tiles under it, two per row, 220 px
    up to 575 px       carousel 440 px, tiles one per row, 180 px
*/

/* The page's own column, full width (the layout's col-lg-8 / col-lg-4, see bg-home.js) */
.sp-app.sp-app.bgh {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  container: bgh / inline-size;
}

div.col-lg-8.bgh-col,
div.col-lg-8:has(.bgh) {
  width: 100% !important;
  float: none !important;
}

div.col-lg-4.bgh-col-off {
  display: none !important;
}

/* SharePoint lays the zone's web parts out as inline-table cells: the empty CSS and JS parts
   still sit on a line of text, which put a 20 px white gap above and below the carousel
   (www, 2026-11-27). No line there; .bgh sets its own size again (tokens.css) */
div.col-lg-8.bgh-col .ms-webpart-zone,
div.col-lg-8:has(.bgh) .ms-webpart-zone {
  font-size: 0;
  line-height: 0;
}

div.col-lg-8.bgh-col .ms-webpart-zone > .ms-webpartzone-cell,
div.col-lg-8:has(.bgh) .ms-webpart-zone > .ms-webpartzone-cell {
  vertical-align: top;
}

.bgh .bgh-row {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ---- Carousel ---- */
.bgh .bgh-carousel {
  position: relative;
  overflow: hidden;
  height: 500px;
  background: #eef0f3;
  touch-action: pan-y;
}

.bgh .bgh-slides {
  position: absolute;
  inset: 0;
}

.bgh .bgh-slide {
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.bgh .bgh-slide.is-active,
.bgh .bgh-slide.is-entering {
  visibility: visible;
}

.bgh .bgh-slide.is-moving {
  visibility: visible;
  transition: transform 0.6s ease-in-out;
}

/* The picture, at its focus point; BG.css's light navy tint over every slide */
.bgh .bgh-slide__bg {
  position: absolute;
  inset: 0;
  background-color: #eef0f3;
  background-repeat: no-repeat;
  background-size: cover;
}

.bgh .bgh-slide__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(1, 20, 51, 0.2);
}

/* "Words in the picture": the link covers the left part, where the words are (all on phones) */
.bgh a.bgh-slide__hit {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 42%;
  height: 100%;
}

/* "Text on the picture": the site's white text block */
.bgh .bgh-text {
  position: absolute;
  z-index: 3;
  max-width: 92%;
  padding: 0 18px;
  color: #fff;
  font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
  font-weight: 700;
}

.bgh .bgh-text .bgh-text__intro,
.bgh .bgh-text .bgh-text__heading,
.bgh .bgh-text .bgh-text__para {
  color: #fff !important;
  font-family: inherit;
}

.bgh .bgh-text .bgh-text__intro {
  margin: 0;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
}

.bgh .bgh-text .bgh-text__heading {
  margin: 4px 0 10px;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.1;
}

.bgh .bgh-text .bgh-text__para {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.43;
}

.bgh .bgh-text a.bgh-text__more:is(:link, :visited, :hover) {
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
}

.bgh .bgh-text a.bgh-text__more:hover {
  text-decoration: underline !important;
}

.bgh .bgh-text .bgh-text__arrow {
  width: 10px;
  height: 16px;
  vertical-align: -2px;
}

.bgh .bgh-text .bgh-text__overlay {
  display: block;
  width: 100%;
  max-width: 500px;
  height: auto;
  margin-top: 14px;
}

/* On the red box (the site's e-Pula slide): smaller type, the box runs down off the slide */
.bgh .bgh-text--red {
  height: 400px;
  background: linear-gradient(90deg, rgba(225, 0, 0, 0.93) 0%, rgba(162, 8, 0, 0.93) 50%, rgba(98, 4, 0, 0.93) 100%);
}

.bgh .bgh-text--red .bgh-text__intro { margin-top: 16px; font-size: 18px; }
.bgh .bgh-text--red .bgh-text__heading { margin-top: 20px; font-size: 24px; }

/* Indicators: navy rings, the current one filled (as the site's), each a 20 px target */
.bgh .bgh-dots {
  position: absolute;
  bottom: 6px;
  left: 20%;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 21%;
}

.bgh .bgh-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.bgh .bgh-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid #002b58;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.bgh .bgh-dot[aria-current="true"]::before {
  width: 12px;
  height: 12px;
  background: #002b58;
}

.bgh .bgh-dot:focus-visible {
  outline: 2px solid #ee2e24;
  outline-offset: 0;
}

/* ---- Side tiles (the site's .productnav1: picture, white heading top left, red on hover) ---- */
.bgh .bgh-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.bgh .bgh-tile {
  position: relative;
  display: block;
  height: 220px;
  overflow: hidden;
  text-decoration: none !important;
}

.bgh .bgh-tile__bg {
  position: absolute;
  inset: 0;
  background-color: #dde1e7;
  background-repeat: no-repeat;
  background-size: cover;
  transition: transform 0.4s ease;
}

.bgh .bgh-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background-color 0.1s ease-out 0.2s;
}

.bgh .bgh-tile__title {
  position: relative;
  z-index: 1;
  display: block;
  padding: 5% 5% 0;
  color: #fff;
  font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: color 0.1s ease-out 0.2s;
}

.bgh a.bgh-tile:is(:link, :visited, :hover) {
  color: #fff !important;
}

.bgh a.bgh-tile:hover::after,
.bgh a.bgh-tile:focus-visible::after {
  background: rgba(255, 255, 255, 0.2);
}

.bgh a.bgh-tile:hover .bgh-tile__title,
.bgh a.bgh-tile:focus-visible .bgh-tile__title {
  color: #ee2e24;
}

.bgh a.bgh-tile:hover .bgh-tile__bg {
  transform: scale(1.03);
}

.bgh a.bgh-tile:focus-visible {
  outline: 3px solid #ee2e24;
  outline-offset: -3px;
}

/* ---- Large screens: side by side, filling the window's height ---- */
@container bgh (min-width: 1184px) {
  .bgh .bgh-row {
    flex-direction: row;
    height: var(--bgh-h, 500px);
  }

  .bgh .bgh-carousel {
    flex: 2 1 0;
    height: auto;
  }

  .bgh .bgh-tiles {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
  }

  .bgh .bgh-tile {
    flex: 1 1 0;
    height: auto;
  }
}

/* ---- Tablets and phones ---- */
@container bgh (max-width: 767px) {
  .bgh .bgh-text {
    left: 6% !important;
    top: 10% !important;
    max-width: 88%;
  }

  .bgh .bgh-text .bgh-text__intro { font-size: 22px; }
  .bgh .bgh-text .bgh-text__heading { font-size: 26px; }
  .bgh .bgh-text .bgh-text__para { font-size: 15px; }
  .bgh .bgh-text--red { height: auto; padding-bottom: 12px; }
  .bgh .bgh-text--red .bgh-text__heading { font-size: 22px; }
  .bgh .bgh-text .bgh-text__overlay { max-width: 260px; }

  .bgh .bgh-dots {
    left: 0;
    width: 100%;
  }
}

@container bgh (max-width: 575px) {
  .bgh .bgh-carousel { height: 440px; }
  .bgh .bgh-tiles { grid-template-columns: 1fr; }
  .bgh .bgh-tile { height: 180px; }
  .bgh a.bgh-slide__hit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .bgh .bgh-slide.is-moving,
  .bgh .bgh-tile__bg { transition: none; }
}

/* ?bgcms-preview=1 */
.bgh-preview-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100000;
  padding: 8px 16px;
  background: #d42019;
  color: #fff;
  font-family: Calibri, Arial, sans-serif;
  font-size: 15px;
  text-align: center;
}

.bgh-preview-bar a:is(:link, :visited, :hover) {
  color: #fff !important;
  text-decoration: underline !important;
}
