/**
 * @file
 * sHTG Icon Gradient Card component styles.
 *
 * Circle sizing and border-radius math:
 *   - The circle SVG is 169:167 (≈1:1 ratio), so at card height H,
 *     circle width ≈ H × (169/167) and left border-radius = circle_width / 2.
 *   - Large (184px): circle ≈ 186px wide → border-radius 93px, padding-left 207px
 *   - Small (120px): circle ≈ 121px wide → border-radius 61px, padding-left 141px
 */

.layout-container {

  /* ==========================================================================
     Container — enables width-based switch to mobile layout when the card
     itself is narrower than 465px, independent of viewport
     ========================================================================== */

  .shtg-icon-gradient-card-container {
    container-type: inline-size;
    container-name: igc-card;
  }

  /* ==========================================================================
     Card — base layout (large, icon-left)
     ========================================================================== */

  .shtg-icon-gradient-card {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 164px;
    /* padding-left = circle width (165px) + gap (28px) */
    padding: 10px 40px 10px 193px;
    /* left radius matches circle radius so card edge curves with the circle */
    border-radius: 93px 20px 20px 93px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 3.88%, #A27CD5 175.08%);
    overflow: hidden;
  }

  .shtg-icon-gradient-card--large {
    background: linear-gradient(to bottom, #4F08B0 1.84%, #21034A 50%, rgba(255, 255, 255, 0.9) 51.94%, #A27CD5 137.54%);
    background-size: 100% 240%;
    background-position: bottom center;
    transition: background-position 0.4s ease;
    height: 100%;
  }

  .shtg-icon-gradient-card:hover,
  .shtg-icon-gradient-card:focus-within {
    background-position: top center;
  }

  /* ==========================================================================
     Size variants
     ========================================================================== */

  .shtg-icon-gradient-card--small {
    min-height: 103px;
    /* padding-left = circle width (104px at 103px height) + gap (20px) */
    padding: 20px 28px 20px 124px;
    border-radius: 52px 20px 20px 52px;
    background: linear-gradient(to bottom, #a27cd5 -75.08%, #ece3f7 45%, #ece3f7 55%, #a27cd5 175.08%);
    background-size: 100% 200%;
    background-position: bottom center;
    transition: background-position 0.4s ease;

    .shtg-icon-gradient-card__title {
      display: flex;
    }
    .shtg-icon-gradient-card__title-link {
      margin-inline: auto;
    }
  }


  /* ==========================================================================
     Icon-right layout
     ========================================================================== */

  .shtg-icon-gradient-card--icon-right {
    padding: 28px 207px 28px 40px;
    border-radius: 20px 93px 93px 20px;
  }

  .shtg-icon-gradient-card--small.shtg-icon-gradient-card--icon-right {
    padding: 20px 124px 20px 28px;
    border-radius: 20px 52px 52px 20px;
  }

  /* Small variant — fixed font sizes (not affected by breakpoint overrides below) */
  .shtg-icon-gradient-card--small .shtg-icon-gradient-card__title {
    font-size: 16px;
    line-height: 20px;
  }

  .shtg-icon-gradient-card--small .shtg-icon-gradient-card__body,
  .shtg-icon-gradient-card--small .shtg-icon-gradient-card__body p {
    font-size: 13px;
    line-height: 15.548px;
  }

  /* ==========================================================================
     Icon circle wrapper — left edge aligns with card left edge
     ========================================================================== */

  .shtg-icon-gradient-card__icon-wrap {
    --igc-ring-fill: white;
    --igc-ring-stroke: var(--color-orange, #FA7821);
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
  }

  .shtg-icon-gradient-card--large:hover .shtg-icon-gradient-card__icon-wrap,
  .shtg-icon-gradient-card--large:focus-within .shtg-icon-gradient-card__icon-wrap {
    --igc-ring-fill: url(#igc_ring_hover);
    --igc-ring-stroke: var(--color-yellow, #FABD26);
  }

  .shtg-icon-gradient-card--small:hover .shtg-icon-gradient-card__icon-wrap,
  .shtg-icon-gradient-card--small:focus-within .shtg-icon-gradient-card__icon-wrap {
    --igc-ring-stroke: var(--color-purple, #4F08B0);
  }

  .shtg-icon-gradient-card--icon-right .shtg-icon-gradient-card__icon-wrap {
    left: auto;
    right: 0;
  }

  /* ==========================================================================
     Circle SVG — scales to full card height; aspect ratio ≈1:1 so width auto
     ========================================================================== */

  .shtg-icon-gradient-card__circle-svg {
    display: block;
    height: 100%;
    width: auto;
    /* circle SVG is not perfectly square, so we need to use aspect ratio to ensure it scales correctly and doesn't crop */
    aspect-ratio: 10 / 9.6;
  }

  /* ==========================================================================
     Icon image — centered within inner white circle of SVG
     ========================================================================== */

  .shtg-icon-gradient-card__icon {
    position: absolute;
    /* 49% to account for the circle not being perfectly square */
    top: 49%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: opacity 0.4s ease;
  }

  .shtg-icon-gradient-card__icon--hover {
    opacity: 0;
  }

  .shtg-icon-gradient-card:hover .shtg-icon-gradient-card__icon-wrap--has-hover .shtg-icon-gradient-card__icon--default,
  .shtg-icon-gradient-card:focus-within .shtg-icon-gradient-card__icon-wrap--has-hover .shtg-icon-gradient-card__icon--default {
    opacity: 0;
  }

  .shtg-icon-gradient-card:hover .shtg-icon-gradient-card__icon-wrap--has-hover .shtg-icon-gradient-card__icon--hover,
  .shtg-icon-gradient-card:focus-within .shtg-icon-gradient-card__icon-wrap--has-hover .shtg-icon-gradient-card__icon--hover {
    opacity: 1;
  }

  /* ==========================================================================
     Content
     ========================================================================== */

  .shtg-icon-gradient-card__content {
    flex: 1;
    min-width: 0;
    z-index: 1;
  }

  /* ==========================================================================
     Title
     ========================================================================== */

  .shtg-icon-gradient-card--large:hover .shtg-icon-gradient-card__title,
  .shtg-icon-gradient-card--large:focus-within .shtg-icon-gradient-card__title,
  .shtg-icon-gradient-card--large:hover .shtg-icon-gradient-card__body,
  .shtg-icon-gradient-card--large:hover .shtg-icon-gradient-card__body p,
  .shtg-icon-gradient-card--large:focus-within .shtg-icon-gradient-card__body,
  .shtg-icon-gradient-card--large:focus-within .shtg-icon-gradient-card__body p {
    color: #ffffff;
  }
  a#gradiant-card-tele {
    text-decoration: underline;
  }
  .shtg-icon-gradient-card__title {
    font-family: Poppins, sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    letter-spacing: 0px;
    color: #4F08B0;
    margin: 0 0 8px;
    transition: color 0.4s ease;
  }

  .shtg-icon-gradient-card__title-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    transition: none;
  }

  /* Stretch the title link across the whole card so the entire card is clickable.
     Resolves to .shtg-icon-gradient-card (position: relative); the icon-wrap and
     corner are pointer-events: none, so clicks land on this overlay everywhere. */
  .shtg-icon-gradient-card__title-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
  }

  .shtg-icon-gradient-card__title-link:hover {
    text-decoration: none;
    color: inherit;
  }

  .shtg-icon-gradient-card__arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
  }

  /* ==========================================================================
     Body
     ========================================================================== */

  .shtg-icon-gradient-card__body,
  .shtg-icon-gradient-card__body p {
    font-family: Poppins, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.2px;
    color: #4F08B0;
    margin: 0;
    transition: color 0.4s ease;
  }

  /* ==========================================================================
     Corner graphic — clipped by card's overflow:hidden + border-radius
     ========================================================================== */

  .shtg-icon-gradient-card__corner {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 108px;
    height: 113px;
    line-height: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    /* clips the corner SVG to the card's bottom-right rounded corner */
    border-bottom-right-radius: 20px;
  }

  .shtg-icon-gradient-card__corner svg {
    display: block;
    width: 100%;
    height: 100%;
  }

  .shtg-icon-gradient-card--icon-right .shtg-icon-gradient-card__corner {
    right: auto;
    left: 0;
    /* scaleX(-1) mirrors the element: physical border-bottom-right-radius
       becomes the visual bottom-left, matching the card's 20px bottom-left radius */
    transform: scaleX(-1);
  }

  .title-arrow {
    padding-left: 13px !important;
  }
  /* ==========================================================================
     Responsive — tablet/mobile
     ========================================================================== */

  @media (max-width: 767px) {

    /* Large default: 70px circle centered on card background edge */
    .shtg-icon-gradient-card {
      min-height: auto;
      /* card bg inset 35px (half of 70px circle) so circle aligns to component edge */
      margin-left: 35px;
      padding: 15px 40px 15px 50px;
      border-radius: 16px;
      overflow: visible;
    }

    .shtg-icon-gradient-card__icon-wrap {
      top: 50%;
      bottom: auto;
      /* translate(-50%, -50%) centers circle on left card background edge */
      transform: translate(-50%, -50%);
    }

    .shtg-icon-gradient-card__circle-svg {
      height: 70px;
      width: auto;
    }

    /* Small: circle fills card height, contained within card */
    .shtg-icon-gradient-card--small {
      min-height: 103px;
      margin-left: 0;
      /* padding-left = circle width (≈104px at 103px height) + gap (13px) */
      padding: 16px 30px 16px 117px;
      /* border-radius left matches small circle radius (≈52px) */
      border-radius: 52px 16px 16px 52px;
      overflow: hidden;
    }

    .shtg-icon-gradient-card--small .shtg-icon-gradient-card__icon-wrap {
      top: 0;
      bottom: 0;
      transform: none;
    }

    .shtg-icon-gradient-card--small .shtg-icon-gradient-card__circle-svg {
      height: 100%;
      width: auto;
    }

    /* Large icon-right */
    .shtg-icon-gradient-card--icon-right {
      margin-left: 0;
      margin-right: 35px;
      padding: 20px 50px 20px 40px;
      border-radius: 16px;
      overflow: visible;
    }

    .shtg-icon-gradient-card--icon-right .shtg-icon-gradient-card__icon-wrap {
      left: auto;
      right: 0;
      top: 50%;
      bottom: auto;
      transform: translate(50%, -50%);
    }

    /* Small icon-right */
    .shtg-icon-gradient-card--small.shtg-icon-gradient-card--icon-right {
      margin-right: 0;
      padding: 16px 117px 16px 30px;
      border-radius: 16px 52px 52px 16px;
      overflow: hidden;
    }

    .shtg-icon-gradient-card--small.shtg-icon-gradient-card--icon-right .shtg-icon-gradient-card__icon-wrap {
      left: auto;
      right: 0;
      top: 0;
      bottom: 0;
      transform: none;
    }

    /* Large variant mobile typography */
    .shtg-icon-gradient-card__title {
      font-size: 14px;
      line-height: 18px;
    }

    .shtg-icon-gradient-card__body,
    .shtg-icon-gradient-card__body p {
      font-size: 12px;
      line-height: 16px;
    }

    /* Small variant — fixed typography, not scaled down on mobile */
    .shtg-icon-gradient-card--small .shtg-icon-gradient-card__title {
      font-size: 16px;
      line-height: 20px;
    }

    .shtg-icon-gradient-card--small .shtg-icon-gradient-card__body,
    .shtg-icon-gradient-card--small .shtg-icon-gradient-card__body p {
      font-size: 13px;
      line-height: 15.548px;
    }

    .shtg-icon-gradient-card__corner {
      width: 80px;
      height: 84px;
      border-bottom-right-radius: 16px;
    }

  }

  /* ==========================================================================
     Responsive — narrow container (desktop, but card itself <465px wide)
     Mirrors the @media (max-width: 767px) block above. Keep the two in sync.
     ========================================================================== */

  @container igc-card (max-width: 465px) {

    /* Large default: 70px circle centered on card background edge */
    .shtg-icon-gradient-card {
      min-height: 118px;
      margin-left: 35px;
      padding: 15px 40px 15px 50px;
      border-radius: 16px;
      overflow: visible;
    }

    .shtg-icon-gradient-card__icon-wrap {
      top: 50%;
      bottom: auto;
      transform: translate(-50%, -50%);
    }

    .shtg-icon-gradient-card__circle-svg {
      height: 70px;
      width: auto;
    }

    /* Small: circle fills card height, contained within card */
    .shtg-icon-gradient-card--small {
      min-height: 103px;
      margin-left: 0;
      padding: 16px 30px 16px 117px;
      border-radius: 52px 16px 16px 52px;
      overflow: hidden;
    }

    .shtg-icon-gradient-card--small .shtg-icon-gradient-card__icon-wrap {
      top: 0;
      bottom: 0;
      transform: none;
    }

    .shtg-icon-gradient-card--small .shtg-icon-gradient-card__circle-svg {
      height: 100%;
      width: auto;
    }

    /* Large icon-right */
    .shtg-icon-gradient-card--icon-right {
      margin-left: 0;
      margin-right: 35px;
      padding: 20px 50px 20px 40px;
      border-radius: 16px;
      overflow: visible;
    }

    .shtg-icon-gradient-card--icon-right .shtg-icon-gradient-card__icon-wrap {
      left: auto;
      right: 0;
      top: 50%;
      bottom: auto;
      transform: translate(50%, -50%);
    }

    /* Small icon-right */
    .shtg-icon-gradient-card--small.shtg-icon-gradient-card--icon-right {
      margin-right: 0;
      padding: 16px 117px 16px 30px;
      border-radius: 16px 52px 52px 16px;
      overflow: hidden;
    }

    .shtg-icon-gradient-card--small.shtg-icon-gradient-card--icon-right .shtg-icon-gradient-card__icon-wrap {
      left: auto;
      right: 0;
      top: 0;
      bottom: 0;
      transform: none;
    }

    /* Large variant narrow typography */
    .shtg-icon-gradient-card__title {
      font-size: 14px;
      line-height: 18px;
    }

    .shtg-icon-gradient-card__body,
    .shtg-icon-gradient-card__body p {
      font-size: 12px;
      line-height: 16px;
    }

    /* Small variant — fixed typography, not scaled down at narrow widths */
    .shtg-icon-gradient-card--small .shtg-icon-gradient-card__title {
      font-size: 16px;
      line-height: 20px;
    }

    .shtg-icon-gradient-card--small .shtg-icon-gradient-card__body,
    .shtg-icon-gradient-card--small .shtg-icon-gradient-card__body p {
      font-size: 13px;
      line-height: 15.548px;
    }

    .shtg-icon-gradient-card__corner {
      width: 80px;
      height: 84px;
      border-bottom-right-radius: 16px;
    }

  }
  
  @media (width> 1024px){
    a#gradiant-card-tele {
      text-decoration: none;
    }
  }
}
