/* ==========================================================================
   COMPONENT / TOOLS SECTION
   ".article-tool-card" grid ("×›×œ×™× × ×•×¡×¤×™×"). Moved out of pages/_article.css
   (2026) so Category.html can reuse it without duplicating the CSS.

   NOTE: this card is visually identical to the old .kc-card--tool block
   that lived in pages/_category.css (same 570x499 size, same header
   colors E8E6DC/E0EBE2/E3EEF3, same badge/footer layout) â€” that was a
   second hand-copied version of this exact component. .kc-card--tool has
   been removed from _category.css; Category.html now renders its tools
   grid with .article-tool-card from this file, same as Article.html.
   ========================================================================== */

/* --------------------------------------------------------------------------
   5. Additional Tools Section
   -------------------------------------------------------------------------- */
.article-tools-section {
  width: 100%;
  max-width: 1920px;
  margin: 100px auto 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
  box-sizing: border-box;
}

.article-tools-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 40px;
  text-align: right;
  color: #000080;
  width: 1469px;
  max-width: 100%;
  margin: 0 auto;
}

.article-tools-swiper-outer {
  width: 100%;
  position: relative;
}

/* Swiper's own stylesheet (loaded in <head>) puts width:100%,
   height:100%, flex-shrink:0 on .swiper-slide UNCONDITIONALLY â€” those
   rules apply purely from the class being present, regardless of
   whether a Swiper instance is actually running. Before/without an
   active instance (desktop â€” see initResponsiveCardSwiper in
   initResponsiveCardSwiper in assets/js/components/related-cards.js,
   which only creates one below 768px
   and destroys it above), that leaves 3 slides each demanding 100% of the row's width
   with no shrinking, so they overflow instead of sitting side-by-side.
   This reverts the slide wrapper to plain, size-less flow so the real
   card's own CSS (.article-tool-card / .related-card) governs sizing
   through the ordinary flex row / grid, exactly as if the wrapper
   div weren't there at all. */
.article-tools-swiper-outer:not(.swiper-initialized) .swiper-slide,
.article-related-swiper-outer:not(.swiper-initialized) .swiper-slide {
  width: auto;
  height: auto;
  flex-shrink: 1;
}

.article-tools-grid {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 32px;
  width: 100%;
}

/* When no Swiper instance is running (Category.html/Article.html on
   desktop — mobile is a real Swiper via initResponsiveCardSwiper, so
   this deliberately doesn't touch that case, nor Course.html/
   Tool.html's always-on swiper, both of which position slides via
   transform and need the wrapper to stay nowrap for that math to
   work), let extra tools wrap onto a second row instead of silently
   overflowing off-screen with no way to reach them. */
.article-tools-swiper-outer:not(.swiper-initialized) .article-tools-grid {
  flex-wrap: wrap;
}

/* Tool Card Container */
.article-tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 570px;
  height: 499px;
  background: #FFFFFF;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  overflow: hidden;
  box-sizing: border-box;
  flex: 1;
}

/* Tool Card Dashed Overlay Border */
.article-tool-card__dashed-border {
  box-sizing: border-box;
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: 10px;
  background: rgba(255, 255, 255, 0.002);
  opacity: 0.9;
  border: 1.5px dashed #857F78;
  border-radius: 24px;
  pointer-events: none;
  z-index: 2;
}

.article-tool-card__header {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 25px;
  width: 100%;
  height: 222px;
  background: #E8E6DC;
  box-sizing: border-box;
}

.article-tool-card__header--green {
  background: #E0EBE2;
}

.article-tool-card__header--blue {
  background: #E3EEF3;
}

.article-tool-card__badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  gap: 4px;
  min-width: 90px;
  height: 37px;
  background: #C22DAF;
  border-radius: 9999px;
  box-shadow: 0px 20px 25px -5px rgba(0, 0, 0, 0.1);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 16px;
  letter-spacing: 0.3px;
  color: #FFFFFF;
}

.article-tool-card__img {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 120px;
  margin-top: auto;
}

.article-tool-card__img svg {
  max-width: 115px;
  max-height: 120px;
  object-fit: contain;
}

.article-tool-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 12px 36px;
  gap: 15px;
  /* width: 100%; */
  /* height: 277px; */
  box-sizing: border-box;
}

.article-tool-card__category {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 20px;
  text-align: right;
  color: #C22DAF;
}

.article-tool-card__title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  text-align: right;
  color: #000080;
  margin: 0;
}

.article-tool-card__desc {
  font-family: 'Fredoka', sans-serif;
  font-weight: 400;
  font-size: 21px;
  line-height: 25px;
  text-align: right;
  color: #183B51;
  margin: 0;
}

.article-tool-card__tags {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.tool-tag {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 6px 16px;
  height: 30px;
  background: #EEEEFC;
  backdrop-filter: blur(6px);
  border-radius: 9999px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 16px;
  color: #000080;
  box-sizing: border-box;
}

.tool-tag--yellow { background: #F7EED8; }
.tool-tag--pink { background: rgba(247, 192, 255, 0.65); }
.tool-tag--gin { background: #D8E8E0; }
.tool-tag--pink-soft { background: #F6DFEC; }
.tool-tag--mint { background: #BEE1DA; }

.article-tool-card__footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-top: 1px solid rgba(161, 206, 224, 0.2);
  padding-block: 8px;
  justify-content: flex-end;
  padding: 16px 0px 36px 0px;
}

.tool-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 5px 22px;
  /* width: 135px; */
  height: 50px;
  background: #CB6DA7;
  box-shadow: 0px 4px 20px rgba(26, 35, 126, 0.1);
  border-radius: 9999px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
  color: #FFFFFF;
  text-decoration: none;
  transition: background 0.2s ease;
  box-sizing: border-box;
}

.tool-btn:hover {
  background: #b55893;
}

/* --------------------------------------------------------------------------
   Swiper wrapper reset + pagination (split from the combined
   courses/tools/related rules â€” see components/_courses-section.css and
   pages/_article.css for the others)
   -------------------------------------------------------------------------- */
.article-tools-swiper-outer:not(.swiper-initialized) .swiper-slide {
  width: auto;
  height: auto;
  flex-shrink: 1;
}

.article-tools-pagination {
  position: static;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.article-tools-pagination .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: rgba(0, 0, 128, 0.2);
  opacity: 1;
  margin: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.article-tools-pagination .swiper-pagination-bullet-active {
  background: #C22DAF;
  transform: scale(1.15);
}

/* Tools swiper is disabled at >=768px (see modules/carousels.js
   breakpoints), so its dots have no carousel to control there. */
@media (min-width: 768px) {
  .article-tools-pagination {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive (split out of the page-wide media queries that used to live
   in pages/_article.css)
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .article-tools-section {
    padding: 0 24px;
  }

  .article-tools-grid {
    flex-wrap: wrap;
  }

  .article-tool-card {
    width: 100%;
    flex: 1 1 320px;
    height: auto;
  }
}

@media (max-width: 767px) {
  .article-tools-title {
    font-size: 26px;
    line-height: 32px;
  }

  .article-tool-card__desc {
    font-size: 17px;
    line-height: 24px;
  }

  .article-tools-grid {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0; /* Swiper's spaceBetween (see modules/carousels.js) provides
               the gutter via slide margins on mobile, so it doesn't
               stack with a CSS gap here too. */
    margin-bottom: 40px;
  }

  .article-tool-card {
    width: 100%;
    max-width: 380px;
    flex: none;
    flex-shrink: 0;
  }
}
