/* ==========================================================================
   CHI SIAMO — LA NOSTRA STORIA  (Figma 2001:2756, y=1284–2748, extended)
   Rosso band: kicker + intro paragraph (left, 413px rail) / year timeline
   (right, 628px) on the existing .grid-split track. The timeline outgrew
   Figma's original 3 static rows (5 rows once 2018/Oggi were added), so the
   right column is now a vertical, arrow-driven Splide carousel showing 3
   rows at a time — net-new interaction, not in the design. Closes with a
   full-bleed photo directly below, no bg of its own.
   ========================================================================== */
.storia {
  background: var(--aec-rosso);
  /* Top padding only, on the section itself — bottom spacing lives on
     .storia > .container instead so the red only wraps the text/timeline
     content. Padding on .storia including bottom would leak a solid red
     strip below .storia__photo, since the photo is a sibling inside this
     same section (caught in the 1440 screenshot verification pass). */
  padding-top: 80px;   /* measured: band top (1284) → kicker top (1364) */
}
.storia > .container { padding-bottom: 100px; }   /* measured: last row → band bottom, via the down chevron */

.storia__kicker {
  margin: 0 0 var(--space-40);   /* measured: kicker bottom (1402) → intro top (1442) = 40 */
  color: var(--c-text-invert);
}
.storia__intro { margin: 0; color: var(--c-text-invert); }

/* --- Timeline carousel -----------------------------------------------------
   The right column is a vertical (top-to-bottom) Splide carousel, three rows
   visible at once, arrow-driven (see initStoriaCarousel in main.js) — not
   the original static list. Was a plain stacked list with a decorative
   up/down chevron bookending it (checked the design via get_screenshot: no
   connecting line or "wheel" graphic, just colour carrying the
   active/inactive state); the chevrons are gone now that the arrows are
   functional, reusing the same "rotate the shared arrow-right glyph" idea. */
/* `order` only means anything inside a flex/grid container — the root needs
   to actually be one for it to split --prev/--next to either side of the
   track. Missing this the first time round left `order` a no-op: Splide
   inserts a single .splide__arrows wrapper (holding *both* buttons) as one
   block positioned wherever the DOM puts it (before .splide__track), so
   both chevrons rendered stacked together above row 1 instead of bookending
   the list — confirmed by comparing a screenshot against a live
   getBoundingClientRect dump, which is what caught it. */
.storia__carousel {
  position: relative;
  display: flex;
  flex-direction: column;
}
.storia__carousel .splide__track { order: 0; overflow: hidden; }
.storia__carousel .splide__list { display: flex; flex-direction: column; }
.storia__carousel .splide__slide { flex: none; }

.storia__carousel .splide__arrows { display: contents; }
.storia__carousel .splide__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  color: var(--c-text-invert);
  opacity: .6;
  transition: opacity var(--dur) var(--ease);
}
.storia__carousel .splide__arrow:hover:not(:disabled) { opacity: 1; }
.storia__carousel .splide__arrow:disabled { opacity: .2; cursor: default; }
/* Splide's built-in icon is the identical ">" path for both buttons —
   splide-core (no theme CSS) doesn't mirror --prev the way the themed
   default.css would (confirmed by inspecting both svgs: same "d" attribute).
   So the two just rotate in opposite directions rather than needing a flip:
   +90° points down (right), -90° points up. Tried scaleX(-1) rotate(90deg)
   first, expecting a mirror-then-turn to land on "up" — it doesn't, because
   CSS applies the rightmost function first, so that combination reflects
   across y=x and still ends up pointing down; verified against the actual
   computed matrix rather than assumed. */
.storia__carousel .splide__arrow svg { width: 16px; height: 16px; fill: currentColor; transform: rotate(90deg); }
.storia__carousel .splide__arrow--prev svg { transform: rotate(-90deg); }
.storia__carousel .splide__arrow--prev { order: -1; margin-bottom: 16px; }
.storia__carousel .splide__arrow--next { order: 1; margin-top: 16px; }

/* Row-to-row (year-top to year-top) measures a consistent ~134px in Figma
   regardless of how many lines a given row's description wraps to (row 2's
   3-line description is no taller a row than row 1's 1-line one) — proof
   each row is a fixed-height band with its content vertically centred, the
   same "fixed box, centred/pinned content" pattern already used for the
   servizi-card and featured-project link. min-height + centring reproduces
   that instead of letting flex `gap` follow variable content height; it
   also gives the carousel's fixed 402px (3x134) track height something
   exact to divide into. */
.storia__item {
  display: grid;
  grid-template-columns: 193px 1fr;
  align-items: center;
  gap: 16px;
  min-height: 134px;
  height: 100%;
  color: var(--aec-rosso-light);
}
.storia__item.is-active { color: var(--c-text-invert); }

.storia__year {
  margin: 0;
  font-weight: var(--fw-numeri-big);
  font-size: var(--fs-numeri-big);
  line-height: var(--lh-numeri-big);
  color: inherit;
}
.storia__era,
.storia__desc { margin: 0; color: inherit; }

/* --- Closing photo ---------------------------------------------------------
   Full-bleed, same "own background, no card chrome" treatment as the hero. */
.storia__photo { display: block; }
.storia__photo img { display: block; width: 100%; height: auto; }

@media (max-width: 1024px) {
  .storia__item { grid-template-columns: 110px 1fr; }
  .storia__year { font-size: 40px; line-height: 1.09; }
}
