/* Template Cards. Self-contained: the component renders in a shadow root,
   so the site styles it needs are mirrored here. */

* {
  box-sizing: border-box;
}

/* --- Swiper base ---
   Site CSS can't reach into the shadow root, so the Swiper layout rules
   are mirrored here. */
.swiper {
  position: relative;
  overflow: hidden;
  width: 100%;
  background-color: transparent;
}

.swiper.is-carousel {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding-top: var(--_spacing---space--32);
  padding-bottom: var(--_spacing---space--32);
}

.swiper.is-carousel.height-full.padding_custom {
  padding-top: var(--_spacing---space--32);
  padding-bottom: var(--_spacing---space--32);
}

.height-full {
  height: 100%;
}

/* --- Carousel grid mode ---
   The carousel script adds .is-grid-mode when there are too few cards to
   fill a view. Cards stretch to share the row (flex). Mirrors the script's
   own styles; keep in sync. */
.swiper.is-carousel.is-grid-mode .swiper-wrapper {
  /* Matches Swiper's spaceBetween: 24 (no Swiper instance in this mode). */
  gap: 24px;
}

.swiper.is-carousel.is-grid-mode .swiper-slide {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.swiper.is-carousel.is-grid-mode .slider_gradient {
  display: none;
}

/* --- Static grid (Slider: No) ---
   No Swiper markup, so the carousel script ignores it. Column tracks (not
   flex) keep a partial row at column width. Counts come from the
   --grid-cols-* variables set by the Grid props. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols-desktop, 3), 1fr);
  gap: 24px;
  width: 100%;
  padding-top: var(--_spacing---space--32);
  padding-bottom: var(--_spacing---space--32);
}

@media (max-width: 991px) {
  .card-grid {
    grid-template-columns: repeat(var(--grid-cols-tablet, 2), 1fr);
  }
}

@media (max-width: 767px) {
  .card-grid {
    grid-template-columns: repeat(var(--grid-cols-mobile, 1), 1fr);
  }
}

/* --- Edge fades --- */
.slider_gradient {
  --gradient-color: var(--_theme---background);
  position: absolute;
  inset: 0% auto 0% 0%;
  top: 0;
  left: 0;
  z-index: 2;
  width: 15%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(270deg,
    color-mix(in srgb, var(--gradient-color) 0%, transparent) 0%,
    color-mix(in srgb, var(--gradient-color) 0.552296%, transparent) 8.07%,
    color-mix(in srgb, var(--gradient-color) 2.17837%, transparent) 15.54%,
    color-mix(in srgb, var(--gradient-color) 4.832%, transparent) 22.5%,
    color-mix(in srgb, var(--gradient-color) 8.46696%, transparent) 29.04%,
    color-mix(in srgb, var(--gradient-color) 13.037%, transparent) 35.26%,
    color-mix(in srgb, var(--gradient-color) 18.496%, transparent) 41.25%,
    color-mix(in srgb, var(--gradient-color) 24.7976%, transparent) 47.1%,
    color-mix(in srgb, var(--gradient-color) 31.8957%, transparent) 52.9%,
    color-mix(in srgb, var(--gradient-color) 39.744%, transparent) 58.75%,
    color-mix(in srgb, var(--gradient-color) 48.2963%, transparent) 64.74%,
    color-mix(in srgb, var(--gradient-color) 57.5064%, transparent) 70.96%,
    color-mix(in srgb, var(--gradient-color) 67.328%, transparent) 77.5%,
    color-mix(in srgb, var(--gradient-color) 77.715%, transparent) 84.46%,
    color-mix(in srgb, var(--gradient-color) 88.621%, transparent) 91.93%,
    var(--gradient-color) 100%
  );
}

.slider_gradient.is-right {
  left: auto;
  right: 0;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--gradient-color) 0%, transparent) 0%,
    color-mix(in srgb, var(--gradient-color) 0.552296%, transparent) 8.07%,
    color-mix(in srgb, var(--gradient-color) 2.17837%, transparent) 15.54%,
    color-mix(in srgb, var(--gradient-color) 4.832%, transparent) 22.5%,
    color-mix(in srgb, var(--gradient-color) 8.46696%, transparent) 29.04%,
    color-mix(in srgb, var(--gradient-color) 13.037%, transparent) 35.26%,
    color-mix(in srgb, var(--gradient-color) 18.496%, transparent) 41.25%,
    color-mix(in srgb, var(--gradient-color) 24.7976%, transparent) 47.1%,
    color-mix(in srgb, var(--gradient-color) 31.8957%, transparent) 52.9%,
    color-mix(in srgb, var(--gradient-color) 39.744%, transparent) 58.75%,
    color-mix(in srgb, var(--gradient-color) 48.2963%, transparent) 64.74%,
    color-mix(in srgb, var(--gradient-color) 57.5064%, transparent) 70.96%,
    color-mix(in srgb, var(--gradient-color) 67.328%, transparent) 77.5%,
    color-mix(in srgb, var(--gradient-color) 77.715%, transparent) 84.46%,
    color-mix(in srgb, var(--gradient-color) 88.621%, transparent) 91.93%,
    var(--gradient-color) 100%
  );
}

.swiper-wrapper {
  display: flex;
  width: 100%;
  align-items: stretch;
}

.swiper-slide {
  width: 100%;
  flex: 0 0 auto;
}

.swiper-slide > * {
  width: 100%;
}

.swiper-slide.is-feature-cards {
  height: auto !important;
}

/* --- Scroll reveal ---
   Separate wrapper so the entrance transform doesn't conflict with the
   card's hover transform. Fills the slide or grid cell; easing matches the
   site's GSAP 'siteEase'. */
.card-reveal {
  width: 100%;
  height: 100%;
  min-width: 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.21, 0.47, 0.32, 0.98), transform 0.6s cubic-bezier(0.21, 0.47, 0.32, 0.98);
}

.card-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .card-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.template_card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  height: 100%;
  /* Keeps the link at the bottom when no stretched row height applies. */
  min-height: 27rem;
  padding: 2rem 1.5rem;
  overflow: clip;
  border-radius: var(--_default---radius--main);
  background-color: var(--_theme---background-2);
  transition: box-shadow 0.5s ease, transform 0.5s ease;
}

/* Hover lift on pointer devices only (avoids sticky hover on touch). */
@media (hover: hover) and (pointer: fine) {
  .template_card:hover {
    transform: translateY(-4px);
    box-shadow: 0px 20px 40px -12px rgba(52, 34, 55, 0.18);
  }
}

.template_card_wrap {
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--_spacing---space--16);
  width: 100%;
  height: 100%;
}

.column {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  position: relative;
}

.template_icons_wrap {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: var(--_spacing---space--64);
}

/* No icons (error or empty apps): collapse the spacer. */
.template_icons_wrap.is-empty {
  margin-bottom: 0;
}

.avatar_stack_wrapper {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.avatar_stack_circle_wrap {
  padding: 0.25rem;
  margin-right: -0.7rem;
  border-radius: var(--_default---radius--round);
  background-color: rgba(255, 255, 255, 0.4);
  border: 0.5px solid rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow:
    0 0 1px rgba(0, 0, 0, 0.08),
    0 21px 8px rgba(10, 13, 18, 0.02),
    0 12px 7px rgba(10, 13, 18, 0.06),
    0 5px 5px rgba(10, 13, 18, 0.1),
    0 1px 3px rgba(10, 13, 18, 0.11);
}

.avatar_stack_item {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 2.875rem;
  height: 2.875rem;
  padding: 0.625rem;
  border-radius: var(--_default---radius--round);
  background-color: #fff;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow:
    0 0 1px rgba(0, 0, 0, 0.08),
    0 21px 8px rgba(10, 13, 18, 0.02),
    0 12px 7px rgba(10, 13, 18, 0.06),
    0 5px 5px rgba(10, 13, 18, 0.1),
    0 1px 3px rgba(10, 13, 18, 0.11);
}

/* Overflow ("+N") circle; same size as the icon circles. */
.avatar_stack_item.background-2 {
  background-color: var(--_theme---background-2);
}

.avatar_stack_item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Loading placeholder circle. */
.avatar_stack_item.is-skeleton {
  background-color: var(--_theme---background-2);
  animation: template_card_pulse 1.4s ease-in-out infinite;
}

.flex-vertical-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: var(--_spacing---space--16);
}

.width-full {
  width: 100%;
}

.heading-style-h5 {
  margin: 0;
  font-family: var(--_typography---font--primary-family);
  font-size: var(--_typography---font-size--h5);
  /* 36px */
  line-height: 2.25rem;
  font-weight: var(--_typography---font--primary-medium);
  letter-spacing: 0px;
}

.line-clamp-3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.line-clamp-4 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
}

.rich-text-md p {
  margin: 0;
  font-family: var(--_typography---font--primary-family);
  font-size: var(--_typography---font-size--text-main);
  line-height: var(--_typography---line-height--md);
  font-weight: var(--_typography---font--primary-regular);
  color: var(--_theme---text-secondary);
}

.clickable {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* --- Focus ---
   The link fills a clipped card, so the ring is drawn on the card itself.
   The transparent outline keeps focus visible in forced-colors mode. */
.clickable:focus-visible {
  outline: 2px solid transparent;
}

/* Outline, not box-shadow: box-shadow is transitioned for hover and would
   fade slowly when focus moves. */
.template_card:has(.clickable:focus-visible) {
  outline: 2px solid var(--_default---swatch--brand-500-main);
  outline-offset: 2px;
}

/* The slider clips overflow; add 4px each side so the ring isn't cut off
   on the edge cards, without shifting layout. */
.swiper.is-carousel:has(.clickable:focus-visible) {
  width: calc(100% + 8px);
  max-width: none;
  margin-left: -4px;
  padding-left: 4px;
  padding-right: 4px;
}

.link-btn {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--_spacing---space--16);
  border-radius: var(--_default---radius--small);
  color: var(--_theme---text-link--text);
}

.main-style-text {
  margin: 0;
  font-family: var(--_typography---font--primary-family);
  font-size: var(--_typography---font-size--text-main);
  line-height: var(--_typography---line-height--md);
  font-weight: var(--_typography---font--primary-regular);
  letter-spacing: 0px;
}

/* Must follow .main-style-text to win the cascade. */
.weight-bold {
  font-weight: var(--_typography---font--primary-bold, 700);
}

.btn-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.btn-icon.is-icon-only {
  width: 0.75rem;
  height: 0.75rem;
  flex: none;
  display: block;
}

.template_card_bg {
  position: absolute;
  inset: 0% 0% auto;
  /* Above the card background, below the content (z-index: 2). */
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 15rem;
  object-fit: fill;
}

/* Arrow shaft draws in on hover (pointer devices only). */
.arrow_shaft {
  stroke-dasharray: 12;
}

@media (hover: hover) and (pointer: fine) {
  .arrow_shaft {
    stroke-dashoffset: 12;
    transition: stroke-dashoffset 0.25s ease;
  }

  .template_card:hover .arrow_shaft {
    stroke-dashoffset: 0;
  }
}

/* --- Loading skeleton --- */
.skeleton-block {
  display: block;
  border-radius: var(--_default---radius--small);
  background-color: var(--_theme---background-2);
  animation: template_card_pulse 1.4s ease-in-out infinite;
}

.skeleton-title {
  width: 70%;
  height: 1.5rem;
  margin-bottom: 0.75rem;
}

.skeleton-line {
  width: 100%;
  height: 0.875rem;
  margin-bottom: 0.5rem;
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

.skeleton-line-short {
  width: 60%;
}

@keyframes template_card_pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .template_card {
    transition: none;
  }

  .avatar_stack_item.is-skeleton,
  .skeleton-block {
    animation: none;
  }
}

/* Names the overlay card link as text inside the <a> rather than an
   aria-label: GTM's Click Text reads the link's own text, and was empty. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Reveal (keep last) ---
   The site head hides code components until their CSS loads, to avoid a
   flash of unstyled shadow DOM. !important inside the shadow tree wins and
   undoes that rule once this file applies. */
:host {
  display: contents !important;
  height: auto !important;
  overflow: visible !important;
  visibility: visible !important;
}

