/* ============================================================
   SANO | Steps — CSS panel
   ============================================================ */

.sano-steps {
  container-type: inline-size;
  container-name: sano-steps;

  /* ---- MOTION TOKENS — shared across every Sano module ---- */
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-out:  cubic-bezier(0.23, 1, 0.32, 1);
  --dur-reveal: 1000ms;
  --dur-hover: 300ms;
  --reveal-step: 120ms;

  /* ---- TYPOGRAPHY — replace "inherit" with the theme font ---- */
  --steps-font: inherit;

  /* ---- FALLBACKS ---- */
  --steps-label-color: #8A93A0;
  --steps-title-color: #0B1B2B;
  --steps-desc-color: #5A6472;
  --steps-image-zoom: 1.05;

  padding: 0;
  font-family: var(--steps-font);
}

.sano-steps__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--steps-gap, 32px);
  align-items: start;
  max-width: var(--steps-max, 1140px);
  margin-inline: auto;
}

.sano-steps__item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sano-steps__media {
  width: 100%;
  overflow: hidden;                /* clips the zoom */
  border-radius: var(--steps-radius, 16px);
  margin-bottom: 20px;
}

.sano-steps__media img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 500ms var(--ease-soft);
}

.sano-steps__label {
  display: block;
  margin-bottom: 6px;
  color: var(--steps-label-color);
  font-size: clamp(.6875rem, 1.1cqi, .75rem);
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.2;
}

/* Title size is printed by the require_css block in the HTML
   panel, driven by the Styles tab field. Flat, never a clamp:
   cqi is measured against the whole section, so a clamp shrank
   the title on narrow screens. The value below is the fallback
   and must stay in step with that default. */
.sano-steps__title {
  margin: 0 0 8px;
  color: var(--steps-title-color);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.sano-steps__desc {
  margin: 0;
  color: var(--steps-desc-color);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---- SCROLL REVEAL ----------------------------------------
   The hidden state only applies once JS adds .is-ready, so the
   content can never disappear if the script fails to run.
----------------------------------------------------------- */
.sano-steps.is-ready .sano-steps__item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-reveal) var(--ease-soft),
              transform var(--dur-reveal) var(--ease-soft);
  transition-delay: calc(var(--i, 0) * var(--reveal-step));
}

.sano-steps.is-ready .sano-steps__item.is-visible {
  opacity: 1;
  transform: none;
}

@container sano-steps (max-width: 520px) {
  .sano-steps.is-ready .sano-steps__item { transition-delay: 0s; }
}

/* ---- HOVER -------------------------------------------------
   The photo zooms inside its clipped frame while the whole card
   lifts. Gated behind a real pointer, and specific enough to
   outweigh the reveal rule that pins transform once revealed.
----------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .sano-steps__item {
    transition: transform var(--dur-hover) var(--ease-out);
  }

  .sano-steps__item:hover,
  .sano-steps.is-ready .sano-steps__item.is-visible:hover {
    transform: translateY(-6px);
    transition: transform var(--dur-hover) var(--ease-out);
    transition-delay: 0s;
  }

  .sano-steps__item:hover .sano-steps__media img {
    transform: scale(var(--steps-image-zoom, 1.05));
  }
}

@media (prefers-reduced-motion: reduce) {
  .sano-steps.is-ready .sano-steps__item {
    opacity: 1;
    transform: none;
    transition: opacity 400ms ease;
  }
  .sano-steps__media img { transition: none; }
  .sano-steps__item:hover { transform: none; }
  .sano-steps__item:hover .sano-steps__media img { transform: none; }
}

@supports not (container-type: inline-size) {
  @media (max-width: 900px) {
    .sano-steps__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 520px) {
    .sano-steps__grid { grid-template-columns: 1fr; }
    .sano-steps.is-ready .sano-steps__item { transition-delay: 0s; }
  }
}