/* ==========================================================================
   Kisaka internal audit and training page
   Built on the audit and tax pages: css/kisaka-advisory.css, kisaka-it.css,
   kisaka-audit.css and kisaka-tax.css give the hero, the three icon columns,
   the sticky index with its services, the promo card and the closing panel
   whose line fills in letter by letter, so the type, buttons, panels and
   motion match the sister pages. This file adds the three parts of
   ventriloc.ca/fr/soutien-technique those pages have no piece for:
   - the tall drawing card with the copy beside it,
   - the centred process row,
   - the pinned strip that slides sideways while the page scrolls.
   Motion lives in js/kisaka-internal-audit.js; the drawings come from
   scripts/make_internal_audit_diagrams.py.
   ========================================================================== */

.kisaka-ia-page
   {
      --ia-card: min(874px, 64vw);
      --ia-gap: 20px;
      --ia-edge: max(var(--adv-gutter), calc((100vw - var(--adv-shell)) / 2));
   }


/* ===== Keyframes ===== */

/* Ventriloc's media settle: the figures come in from 1.2, slower than the
   1.15 of the audit panels. */
@keyframes ia-settle
   {
      0%
         {
            scale: 1.2;
         }
   }


/* ===== Intro: the tall drawing card left, the copy right ===== */

.ia-intro__grid
   {
      display: grid;
      grid-template-columns: repeat(12, minmax(0, 1fr));
      gap: var(--ia-gap);
      align-items: center;
   }

.ia-intro__media
   {
      grid-column: 1 / span 6;
      position: relative;
      display: grid;
      place-items: center;
      margin: 0;
      aspect-ratio: 650 / 700;
      max-height: 90svh;
      border-radius: 20px;
      background: var(--it-deep);
      overflow: clip;
   }

.ia-intro__screen
   {
      width: 86%;
   }

.ia-intro__screen .ia-diagram
   {
      display: block;
      width: 100%;
      height: auto;
   }

.ia-intro__copy
   {
      grid-column: 8 / span 5;
      max-width: 480px;
   }

.kisaka-adv .ia-intro__title
   {
      font-size: clamp(22px, 2vw, 28px);
      line-height: 1.2;
   }


/* ===== Process row: the title centred over the flow ===== */

.ia-flow
   {
      padding-bottom: clamp(40px, 6vw, 80px);
   }

.ia-flow__header
   {
      max-width: 650px;
      margin: 0 auto;
      text-align: center;
   }

.ia-flow__header .adv-lead
   {
      margin-top: 18px;
   }

.ia-flow__media
   {
      max-width: 873px;
      margin: clamp(32px, 4vw, 46px) auto 0;
   }

.ia-flow__media .ia-diagram
   {
      display: block;
      width: 100%;
      height: auto;
   }


/* ===== The four steps: a list everywhere, a pinned strip on wide screens ===== */

.ia-strip
   {
      padding-top: 0;
      overflow-x: clip;
   }

.ia-strip__list
   {
      display: flex;
      flex-direction: column;
      gap: 40px;
      margin: 0;
      padding: 0 var(--ia-edge);
      list-style: none;
   }

.ia-strip__item
   {
      display: grid;
      grid-template-columns: repeat(12, minmax(0, 1fr));
      gap: var(--ia-gap);
      align-items: end;
   }

.ia-strip__media
   {
      --au-radius: 20px;
      grid-column: 1 / span 6;
      position: relative;
      margin: 0;
      aspect-ratio: 427 / 462;
      border-radius: 20px;
      background: var(--ia-bg, var(--it-panel));
      overflow: clip;
   }

.ia-strip__item:nth-child(even) .ia-strip__media
   {
      grid-column: 7 / span 6;
      grid-row: 1;
   }

.ia-strip__item:nth-child(even) .ia-strip__content
   {
      grid-column: 1 / span 5;
      grid-row: 1;
   }

.ia-strip__media .ia-diagram
   {
      display: block;
      width: 100%;
      height: 100%;
   }

.ia-strip__content
   {
      grid-column: 8 / span 5;
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 20px 30px 20px 24px;
   }

.kisaka-adv .ia-strip__text
   {
      max-width: 420px;
   }

/* Pinned: the track is as tall as the strip has steps, the list holds in
   the middle of the screen and js/kisaka-internal-audit.js slides it by
   --ia-x. Only on wide screens with motion allowed. */
.ia-strip--pinned .ia-strip__track
   {
      height: calc(var(--ia-steps, 4) * 70lvh);
   }

.ia-strip--pinned .ia-strip__list
   {
      position: sticky;
      top: calc(50lvh - var(--ia-strip-h, 462px) / 2);
      flex-direction: row;
      gap: var(--ia-gap);
      width: max-content;
      translate: var(--ia-x, 0) 0;
      will-change: translate;
   }

.ia-strip--pinned .ia-strip__item
   {
      flex: 0 0 var(--ia-card);
      grid-template-columns: repeat(2, minmax(0, 1fr));
      opacity: 0.2;
      transition: opacity 450ms linear;
   }

.ia-strip--pinned .ia-strip__item.is-lit
   {
      opacity: 1;
   }

.ia-strip--pinned .ia-strip__item :is(.ia-strip__media, .ia-strip__content),
.ia-strip--pinned .ia-strip__item:nth-child(even) :is(.ia-strip__media, .ia-strip__content)
   {
      grid-row: 1;
   }

.ia-strip--pinned .ia-strip__item .ia-strip__media,
.ia-strip--pinned .ia-strip__item:nth-child(even) .ia-strip__media
   {
      grid-column: 1;
   }

.ia-strip--pinned .ia-strip__item .ia-strip__content,
.ia-strip--pinned .ia-strip__item:nth-child(even) .ia-strip__content
   {
      grid-column: 2;
   }


/* ==========================================================================
   Motion, only when js/kisaka-audit.js has set .au-motion. Same rules as
   the sister pages: hidden by opacity while waiting, never by a clip.
   ========================================================================== */

/* Intro card: fades in while its figures settle from 1.2; the copy follows
   one step behind, title then text. */
.au-motion .ia-intro__media[data-au]:not(.is-inview)
   {
      opacity: 0;
   }

.au-motion .ia-intro__media[data-au].is-inview
   {
      animation: au-fade 250ms linear backwards;
   }

.au-motion .ia-intro__media[data-au].is-inview .ia-intro__screen
   {
      animation: ia-settle 2150ms var(--au-ease-expo) backwards;
   }

.ia-intro__copy .it-media__title
   {
      --d: var(--au-step);
   }

.ia-intro__copy .it-media__text
   {
      --d: calc(var(--au-step) * 2);
   }

/* Process row: the title rises, the flow fades in a step later. */
.au-motion .ia-flow__media[data-au]:not(.is-inview)
   {
      opacity: 0;
   }

.au-motion .ia-flow__media[data-au].is-inview
   {
      animation: au-fade 250ms linear var(--au-step) backwards;
   }

/* Steps as a list: each drawing opens from the bottom with its figures
   settling, its copy rising after it. */
.au-motion .ia-strip:not(.ia-strip--pinned) .ia-strip__media[data-au]:not(.is-inview),
.au-motion .ia-strip__content[data-au]:not(.is-inview) > *
   {
      opacity: 0;
   }

.au-motion .ia-strip:not(.ia-strip--pinned) .ia-strip__media[data-au].is-inview
   {
      animation: au-fade 250ms linear backwards;
   }

.au-motion .ia-strip:not(.ia-strip--pinned) .ia-strip__media[data-au].is-inview .ia-diagram
   {
      animation: ia-settle 2150ms var(--au-ease-expo) backwards;
   }

.au-motion .ia-strip__content[data-au].is-inview > *
   {
      animation: au-rise var(--au-rise) var(--au-ease-out) var(--d, 0ms) backwards, au-fade 250ms linear var(--d, 0ms) backwards;
   }

.ia-strip__content > :nth-child(1)
   {
      --d: 250ms;
   }

.ia-strip__content > :nth-child(2)
   {
      --d: calc(250ms + var(--au-step));
   }

.ia-strip__content > :nth-child(3)
   {
      --d: calc(250ms + var(--au-step) * 2);
   }

/* Pinned, the strip's own fade does the work; the copy is simply there. */
.au-motion .ia-strip--pinned .ia-strip__content[data-au] > *
   {
      opacity: 1;
      animation: none;
   }


/* ===== Dark panels: the step drawings on wine and ink keep their labels light ===== */

.ia-strip__item[data-ia-dark] .ia-strip__media
   {
      color: var(--it-cream);
   }


/* ===== Responsive ===== */

@media (max-width: 1100px)
   {
      .ia-intro__media
         {
            grid-column: 1 / span 6;
         }

      .ia-intro__copy
         {
            grid-column: 7 / span 6;
         }
   }

@media (max-width: 900px)
   {
      .ia-intro__grid
         {
            grid-template-columns: minmax(0, 1fr);
            gap: 24px;
         }

      .ia-intro__media,
      .ia-intro__copy
         {
            grid-column: 1;
         }

      .ia-intro__media
         {
            --au-radius: 12px;
            border-radius: 12px;
         }

      .ia-strip__item,
      .ia-strip__item:nth-child(even)
         {
            grid-template-columns: minmax(0, 1fr);
            gap: 15px;
         }

      .ia-strip__item .ia-strip__media,
      .ia-strip__item:nth-child(even) .ia-strip__media,
      .ia-strip__item .ia-strip__content,
      .ia-strip__item:nth-child(even) .ia-strip__content
         {
            grid-column: 1;
            grid-row: auto;
         }

      .ia-strip__media
         {
            --au-radius: 12px;
            border-radius: 12px;
         }

      .ia-strip__content
         {
            padding: 0;
         }

      /* The flow runs edge to edge and swipes at a readable width, like the
         sister pages' wide drawings, instead of shrinking its labels away. */
      .ia-flow__media
         {
            margin-left: calc(var(--adv-gutter) * -1);
            margin-right: calc(var(--adv-gutter) * -1);
            padding: 0 var(--adv-gutter);
            overflow-x: auto;
            scrollbar-width: none;
         }

      .ia-flow__media::-webkit-scrollbar
         {
            display: none;
         }

      .ia-flow__media .ia-diagram
         {
            min-width: 640px;
         }
   }

@media (prefers-reduced-motion: reduce)
   {
      .ia-strip__item
         {
            opacity: 1;
            transition: none;
         }
   }
