/* Section 7 - blog slides. Front end only (not loaded in the Elementor editor).
   Selectors follow the markup Elementor renders for the Loop Grid:
   #blog-slides [role="list"] > [role="listitem"] > slide > ( text , media ) */

/* ---------- All widths (stacked list on tablet and mobile) ---------- */

/* Fallback slide tint by position (post tint overrides it through --bs-tint). */
#blog-slides [role="listitem"]:nth-child(3n+1) > div { background-color: var(--bs-tint, #EFF6FE); }
#blog-slides [role="listitem"]:nth-child(3n+2) > div { background-color: var(--bs-tint, #DFEEFF); }
#blog-slides [role="listitem"]:nth-child(3n)   > div { background-color: var(--bs-tint, #B2CFF2); }

/* Numbers: CSS counter, two digits (01, 02, ...). */
#blog-slides [role="list"] { counter-reset: bs; }
#blog-slides [role="listitem"] { counter-increment: bs; }
#blog-slides [role="listitem"] > div > div:first-child > p:first-of-type {
  font-size: 0 !important;
  line-height: 1;
}
#blog-slides [role="listitem"] > div > div:first-child > p:first-of-type::before {
  content: counter(bs, decimal-leading-zero);
  font-size: 16px;
}

/* Empty excerpt or missing featured image: hide, no broken layout. */
#blog-slides p:empty { display: none; }
#blog-slides img:not([src]),
#blog-slides img[src=""] { display: none; }

/* Long titles and excerpts. */
#blog-slides h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
#blog-slides [role="listitem"] > div > div:first-child > p:nth-of-type(2) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
#blog-slides [role="listitem"] > div > div:first-child > p:nth-of-type(2):empty { display: none; }

/* ---------- Desktop stage (added by the script as .bs-ready) ---------- */

#bs-track { position: relative; }

#blog-slides.bs-ready {
  position: sticky;
  top: 0;
  overflow: hidden;
  display: block;
}
#blog-slides.bs-ready > div,                 /* loop wrapper */
#blog-slides.bs-ready [role="list"] {
  display: block !important;
  position: relative;
  height: 100%;
  padding: 0;
  margin: 0;
}
#blog-slides.bs-ready [role="listitem"] {
  position: absolute;
  inset: 0;
  width: 100%;
  will-change: transform;
}
#blog-slides.bs-ready [role="listitem"] > div {
  position: relative;
  display: block !important;
  height: 100%;
  padding: 0 !important;
  overflow: hidden;
}

/* Text: left 35%, vertically centred. */
#blog-slides.bs-ready [role="listitem"] > div > div:first-child {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 35%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 3vw 0 4vw !important;
}
#blog-slides.bs-ready [role="listitem"] > div > div:first-child h3 { font-size: clamp(22px, 2.2vw, 36px) !important; }

/* Image: landscape, 27% of the width, vertically centred; the script moves it sideways. */
#blog-slides.bs-ready [role="listitem"] > div > div:last-child {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 27%;
  display: flex;
  align-items: center;
  padding: 0 !important;
  will-change: transform;
}
#blog-slides.bs-ready [role="listitem"] > div > div:last-child img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* Keep the sticky header above the stage if it is hidden behind it (verify first). */
/* .elementor-location-header { position: relative; z-index: 100; } */
