/* ==========================================================================
   Blok „Oś obszarów (co sprawdzamy)” (.au-areas): oś obszarów jako zakładki i karta
   otwartego obszaru. Kartki pod kartą to obszary, które są jeszcze przed czytelnikiem.
   Źródło (prototyp): assets/css/podstrony/audyt.css („Co sprawdzamy”). Liczba obszarów
   jest dowolna: kolumny osi i jej linia liczą się z --n, opóźnienia wejścia z --k.
   ========================================================================== */

/* the eyebrow takes its own row, so the copy on the right starts level with the title (wspólne w blokach Audytu) */
.au-head {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem clamp(2rem, 6vw, 6rem); align-items: start; margin-bottom: clamp(2.25rem, 4.5vw, 3.25rem);
}
.au-head > .eyebrow.eyebrow { grid-column: 1 / -1; margin: 0; }
.au-head h2 { margin: 0; max-width: 16ch; }
.au-head__lead, .au-head__lead p { margin: 0; color: var(--muted); font-size: 1.0625rem; line-height: 1.6; max-width: 58ch; }
.au-head__lead p + p { margin-top: .7rem; }

.au-areas { padding: var(--section-y) 0; background: var(--paper-2); }
.au-axis { position: relative; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); margin: 0 0 clamp(1.25rem, 2.5vw, 1.75rem); }
/* from the centre of the first column to the centre of the last */
.au-axis__line {
  position: absolute; left: calc(50% / var(--n, 5)); right: calc(50% / var(--n, 5)); top: 27px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 3px, transparent 3px 9px);
}
.au-axis__line i {
  position: absolute; left: 0; top: -.25px; height: 2.5px; width: 100%; border-radius: 2px; background: var(--orange);
  transform-origin: left center; transform: scaleX(var(--p, 0)); transition: transform .8s var(--ease);
}
.au-axis__node {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .5rem;
  margin: 0; padding: 0 .5rem .25rem; border: 0; border-radius: 18px; background: none; cursor: pointer;
  font: inherit; color: var(--navy-900); text-align: center;
}
.au-axis__node:focus-visible { outline-offset: 4px; }
.au-axis__disc {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 0 6px var(--paper-2);
  transition: background-color .35s, color .35s, box-shadow .35s, transform .45s var(--ease);
}
.au-axis__disc .icon { width: 1.35rem; height: 1.35rem; }
.au-axis__num { margin-top: .2rem; font-family: var(--font-ui); font-size: .75rem; font-weight: 500; letter-spacing: .04em; color: var(--muted); font-variant-numeric: tabular-nums; }
.au-axis__name { max-width: 14ch; font-size: 1.0625rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.au-axis__node:hover .au-axis__disc { box-shadow: inset 0 0 0 1.5px var(--navy), 0 0 0 6px var(--paper-2); transform: translateY(-2px); }
.au-axis__node.is-done .au-axis__disc { color: var(--orange-ink); box-shadow: inset 0 0 0 2px var(--orange), 0 0 0 6px var(--paper-2); }
.au-axis__node.is-active .au-axis__disc {
  background: var(--orange); color: #fff;
  box-shadow: 0 0 0 6px var(--paper-2), 0 0 0 11px var(--orange-50), 0 14px 24px -10px rgba(236, 110, 40, .85);
}
.au-axis__node.is-active .au-axis__num { color: var(--navy-900); }

.au-axis__panels { display: grid; padding-bottom: 18px; }
.au-area {
  grid-area: 1 / 1; position: relative;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.5rem, 3.5vw, 3rem); align-items: start;
  padding: clamp(1.6rem, 3.2vw, 2.75rem); border-radius: var(--radius-xl); color: var(--text);
  background: radial-gradient(55% 60% at 100% 0%, rgba(248, 120, 49, .07), rgba(248, 120, 49, 0) 70%), #fff;
  --sheet: var(--line-strong);
  box-shadow:
    inset 0 0 0 1px var(--sheet),
    0 9px 0 -5px var(--paper-2), 0 9px 0 -4px var(--sheet),
    0 18px 0 -10px var(--paper-2), 0 18px 0 -9px var(--sheet);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .45s var(--ease), transform .6s var(--ease), visibility 0s .6s;
}
/* fewer areas ahead, fewer sheets under the card */
.au-area:nth-last-child(2) { box-shadow: inset 0 0 0 1px var(--sheet), 0 9px 0 -5px var(--paper-2), 0 9px 0 -4px var(--sheet); }
.au-area:last-child { box-shadow: inset 0 0 0 1px var(--sheet); }
.au-area.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.au-area__main:only-child { grid-column: 1 / -1; }
.au-area__meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: clamp(1rem, 2vw, 1.5rem); }
.au-area__count { margin: 0; font-family: var(--font-ui); font-size: .8125rem; font-weight: 500; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.au-area__count b { font-weight: 600; color: var(--navy-900); }
.au-area__nav { display: flex; gap: 8px; margin: 0; }
.au-area__nav button {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 0; background: #fff; color: var(--navy-900); box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color .25s, color .25s, box-shadow .25s, transform .3s var(--ease);
}
.au-area__nav button:hover { background: var(--navy-900); color: #fff; box-shadow: inset 0 0 0 1px var(--navy-900); }
.au-area__nav button:active { transform: scale(.94); }
.au-area__nav .icon { width: 1.1rem; height: 1.1rem; }
.au-area__nav button:first-child .icon { transform: rotate(180deg); }
.au-area__title {
  margin: 0 0 1rem; font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.125rem); font-weight: 600; line-height: 1.15; letter-spacing: -.028em;
}
.au-area__label { margin: 0 0 .4rem; font-family: var(--font-ui); font-size: .8125rem; font-weight: 500; color: var(--muted); }
.au-area__text { margin: 0; max-width: 56ch; font-size: 1.0625rem; line-height: 1.65; }
/* the finding is the card's second column, set off by a rule rather than a box (no card in a card) */
.au-area__found {
  align-self: stretch; display: flex; flex-direction: column; gap: .9rem;
  padding: .25rem 0 .25rem clamp(1.5rem, 3vw, 2.5rem); border-left: 1px solid var(--line);
}
.au-area__flabel { display: flex; align-items: center; gap: .65rem; margin: 0; font-family: var(--font-ui); font-size: .875rem; font-weight: 500; color: var(--navy-900); }
.au-area__flabel span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #fff; }
.au-area__flabel .icon { width: 1.05rem; height: 1.05rem; stroke-width: 2; }
.au-area__ftext { margin: 0; font-size: 1.125rem; font-weight: 500; line-height: 1.5; letter-spacing: -.01em; color: var(--navy-900); text-wrap: pretty; }

/* entrance: the nodes rise along the axis, then the dashed track draws (view.js adds is-armed only without reduced motion) */
.au-areas.is-armed .au-axis__node { opacity: 0; transform: translateY(12px); }
.au-areas.is-armed .au-axis__line { clip-path: inset(0 100% 0 0); }
.au-areas.is-armed.is-on .au-axis__node {
  opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .6s var(--ease);
  transition-delay: calc(var(--k, 0) * .08s);
}
.au-areas.is-armed.is-on .au-axis__line { clip-path: inset(0 0 0 0); transition: clip-path 1.1s var(--ease) .1s; }

.no-js .au-axis { display: none; }
.no-js .au-axis__panels { gap: 1rem; padding-bottom: 0; }
.no-js .au-area { grid-area: auto; opacity: 1; visibility: visible; transform: none; box-shadow: inset 0 0 0 1px var(--line-strong); }
.no-js .au-area__nav { display: none; }

/* --------------------------------------------------------------------------
   Responsywność
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .au-head { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .au-head h2 { max-width: 18ch; }
  /* one column: only the open card takes room, so a short area leaves no gap */
  .au-area { grid-template-columns: minmax(0, 1fr); }
  .au-area:not(.is-active) { display: none; }
  .au-area__found { padding: 1.25rem 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .no-js .au-area:not(.is-active) { display: grid; }
}
@media (max-width: 767px) {
  .au-axis__line { top: 23px; }
  .au-axis__disc { width: 46px; height: 46px; }
  .au-axis__disc .icon { width: 1.15rem; height: 1.15rem; }
  .au-axis__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .au-axis__node { padding: 0 0 .25rem; }
  .au-area { padding: 1.4rem 1.25rem 1.5rem; border-radius: 22px; }
  .au-area__ftext { font-size: 1.0625rem; }
}

@media (prefers-reduced-motion: reduce) {
  .au-area, .au-axis__disc, .au-axis__line i { transition: none; }
  .au-axis__node:hover .au-axis__disc { transform: none; }
}
