/**
 * JM Smart Grid / Carousel — styles (v1)
 * Desktop: grid
 * Mobile: swiper carousel with dots
 * All selectors are scoped to .jmsgc-v1 to avoid collisions in large projects.
 */

.jmsgc-v1 {
  --jmsgc-cols: 3;
  --jmsgc-gap: 24px;
  --jmsgc-radius: 14px;
  --jmsgc-slide-width: 100%;

  /* header layout */
  --jmsgc-head-gap: 30px;
}

.jmsgc-v1,
.jmsgc-v1 * {
  box-sizing: border-box;
}

/* Swiper container (always present) */
.jmsgc-v1 .jmsgc-swiper {
  position: relative;
  width: 100%;
}

/* Slide/card */
.jmsgc-v1 .jmsgc-slide {
  height: auto;
	border-radius: var(--jmsgc-radius);
}

.jmsgc-v1 .jmsgc-card {
  
  overflow: hidden;
  background: #ffffff;
  min-height: 100%;
}

/* Header section: image + (title/subtitle) */
.jmsgc-v1 .jmsgc-head {
  display: flex;
  gap: var(--jmsgc-head-gap);
  align-items: flex-start;
  margin-bottom: 30px;
}

.jmsgc-v1 .jmsgc-image {
  flex: 0 0 auto;
}

.jmsgc-v1 .jmsgc-image img {
  display: block;
  width: 112px; /* can be overridden by control */
  height: auto;
}

.jmsgc-v1 .jmsgc-titles {
  flex: 1 1 auto;
  min-width: 0;
	text-align:center;
}

/* Text blocks */
.jmsgc-v1 .jmsgc-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  color: #7a87f7;
}

.jmsgc-v1 .jmsgc-subtitle {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  color: #111827;
}

.jmsgc-v1 .jmsgc-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #1f2937;
	text-align:center;
}

/* Alignment: left / right / top
 * Alignment class is applied on root (.jmsgc-v1)
 */
.jmsgc-v1.jmsgc-align-left .jmsgc-card {
  text-align: left;
}

.jmsgc-v1.jmsgc-align-right .jmsgc-card {
  text-align: left; /* keep titles readable; only image position changes */
}

/* LEFT: image left, titles right */
.jmsgc-v1.jmsgc-align-left .jmsgc-head {
  flex-direction: row;
}

/* RIGHT: image right, titles left */
.jmsgc-v1.jmsgc-align-right .jmsgc-head {
  flex-direction: row-reverse;
}

/* TOP: image above titles */
.jmsgc-v1.jmsgc-align-top .jmsgc-head {
  flex-direction: column;
  align-items: center;
}

/* Pagination (dots) — mobile only */
.jmsgc-v1 .jmsgc-pagination {
  position: static;
  margin-top: 12px;
  text-align: center;
}

.jmsgc-v1 .jmsgc-pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  opacity: 0.25;
}

.jmsgc-v1 .jmsgc-pagination .swiper-pagination-bullet-active {
  opacity: 0.7;
}

/* Tooltip (only rendered if text exists) */
.jmsgc-v1 .jmsgc-tooltip {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto; /* pushes icon to the far edge in left/top modes */
}

.jmsgc-v1.jmsgc-align-right .jmsgc-tooltip {
  margin-left: 0;
  margin-right: auto; /* mirror for right mode */
}

.jmsgc-v1 .jmsgc-tooltip-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #D7D9DD;
  background: #fff;
  color: #D7D9DD;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 0;
}

.jmsgc-v1 .jmsgc-tooltip-box {
  position: absolute;
  top: 0;
  right: 0;
  transform: translateY(calc(-100% - 10px));
  min-width: 220px;
  max-width: 360px;

  background: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.18);
  border-radius: 12px;
  padding: 14px 16px;

  color: #111827;
  font-size: 14px;
  line-height: 1.45;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 50;
}

/* Show on hover */
.jmsgc-v1 .jmsgc-tooltip:hover .jmsgc-tooltip-box {
  opacity: 1;
  visibility: visible;
}

/* Small arrow */
.jmsgc-v1 .jmsgc-tooltip-box::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid rgba(17, 24, 39, 0.18);
  border-bottom: 1px solid rgba(17, 24, 39, 0.18);
  transform: rotate(45deg);
}

.jmsgc-v1 .jmsgc-tooltip--corner {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}

/* Desktop grid mode */
@media (min-width: 768px) {
  .jmsgc-v1 .jmsgc-pagination {
    display: none;
  }

  /* Disable swiper-like clipping in grid mode */
  .jmsgc-v1 .jmsgc-swiper {
    overflow: visible;
  }

  /* Force wrapper to behave like grid */
  .jmsgc-v1 .jmsgc-wrapper {
    display: grid !important;
    grid-template-columns: repeat(var(--jmsgc-cols), minmax(0, 1fr));
    gap: var(--jmsgc-gap);
    transform: none !important;
  }

  .jmsgc-v1 .jmsgc-slide {
    width: auto !important;
    margin: 0 !important;
  }

  .jmsgc-v1 .jmsgc-card {
    height: 100%;
  }
}

/* Mobile carousel mode */
@media (max-width: 767px) {
  /* Add a little viewport padding like in the screenshot */
  .jmsgc-v1 .jmsgc-swiper {
    overflow: visible;
  }

  .jmsgc-v1 .jmsgc-wrapper {
    display: flex;
  }

  .jmsgc-v1 .jmsgc-slide {
    width: var(--jmsgc-slide-width);
    flex-shrink: 0;
  }
}