/* =========================================================================
 * FMG Suite — Resources page (v5)
 * Per-type columns / slider previews are generated from rf_types() in the
 * PHP file (added inline after this file). This file holds the shared styles.
 * ====================================================================== */

/* ---------- 1) Slider (no filter) ---------- */

/* Swiper basics, in case Swiper's own CSS isn't on the page. */
.rf-loop .rf-swiper {
  position: relative;
  overflow: hidden;
  display: block;
  width: auto;
  /* Room for card shadows (Swiper clips everything outside its box); the
   * negative margin keeps the cards exactly where they were. */
  padding: 4px 10px 12px;
  margin: -4px -10px -12px;
}
.rf-loop .rf-swiper > .swiper-wrapper {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  box-sizing: content-box;
  transition-property: transform;
  z-index: 1;
}
.rf-loop .rf-swiper.swiper-grid > .swiper-wrapper {
  flex-wrap: wrap;
}
.rf-loop .rf-swiper .swiper-slide {
  flex-shrink: 0;
  position: relative;
  height: auto;
}
.rf-loop .rf-swiper .swiper-slide > .e-con {
  height: 100%;
}

/* Elementor's "Load more" never shows on a slider. */
.rf-slider-mode .e-load-more-anchor,
.rf-slider-mode .e-loop__load-more,
.rf-slider-mode .e-load-more-wrapper,
.rf-slider-mode .e-load-more-message,
.rf-slider-mode .e-load-more-spinner {
  display: none !important;
}

/* Arrows + "1 / 3" counter (matches the old carousels). */
.rf-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.rf-nav-top {
  margin-bottom: 18px;
}
.rf-nav-bottom {
  margin-top: 18px;
}
.rf-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: #f0f0f0;
  color: #2d69ff;
  cursor: pointer;
  transition: background-color .2s ease, opacity .2s ease;
}
/* Beat Hello Elementor's reset (button:hover/:focus → #c36 pink-red). */
.rf-nav .rf-arrow:hover,
.rf-nav .rf-arrow:focus,
.rf-nav .rf-arrow:active {
  background-color: #e2e8f8;
  color: #2d69ff;
  border: 0;
  text-decoration: none;
  outline: none;
}
.rf-nav .rf-arrow:focus-visible {
  outline: 2px solid #2d69ff;
  outline-offset: 2px;
}
.rf-arrow.swiper-button-disabled {
  opacity: .4;
  cursor: default;
}
.rf-nav .rf-fraction {
  /* Swiper's CSS makes the counter absolute + 100% wide; keep it inline. */
  position: static !important;
  inset: auto !important;
  width: auto !important;
  transform: none !important;
  flex: 0 0 auto;
}
.rf-fraction {
  min-width: 40px;
  font-size: 16px;
  line-height: 1;
  color: #000;
  text-align: center;
}
/* Swiper hides navigation it doesn't need ("lock"). */
.rf-nav .swiper-button-lock,
.rf-nav .swiper-pagination-lock {
  display: none;
}
.rf-nav:has(.swiper-button-lock) {
  display: none;
}

/* ---------- 2) Filtered grid ---------- */

/* Stacking the intro above the grid (Workshops, Checklists) is generated
 * from 'intro_beside' in rf_types(), so other sections keep their header. */

/* Scroll-nav links to a type with nothing in the selected topic. */
.bdt-navbar-nav a[data-rf-empty] {
  opacity: .45;
}

/* "Load more" button. */
.rf-grid-mode .e-loop__load-more,
.rf-grid-mode .e-load-more-wrapper {
  margin-top: 30px;
  text-align: center;
}

/* ---------- 3) Guide cover + secondary image ----------
 * The pair always fills the card width (56% + 56% − 12% overlap = 100%) and
 * both images get the same portrait shape, so screenshots of any size line
 * up and every card in a row is the same height. !important beats the margin
 * set on the widgets in the Elementor loop template. */
.guide-img-con {
  align-items: flex-start;
  width: 100%;
}
.guide-img-con .front-img,
.guide-img-con .back-img {
  flex: 0 0 56% !important;
  width: 56% !important;
  max-width: 56% !important;
}
.guide-img-con .back-img {
  margin-left: -12% !important; /* how far the back image tucks behind the front one */
  margin-top: 4px !important;
}
.guide-img-con .front-img img,
.guide-img-con .back-img img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 200 / 260;
  object-fit: cover;
  object-position: top center;
  box-shadow: 2px 2px 3px rgba(0, 0, 0, .32);
}

/* ---------- 4) Loading overlay ---------- */
.rf-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .7);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
body.rf-is-loading .rf-loader {
  opacity: 1;
  visibility: visible;
}
.rf-loader-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  font-weight: 600;
  color: #333;
}
.rf-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #d6e2ff;
  border-top-color: #2d69ff;
  border-radius: 50%;
  animation: rf-spin .7s linear infinite;
}
@keyframes rf-spin { to { transform: rotate(360deg); } }