/* ==========================================================================
   PROGETTI ARCHIVE — one project category's index.
   Figma Residenziale 79:691, y=554–3591. Written as the template for all five
   categories (only Residenziale is drawn; see FIGMA-MAP "Known design gap"),
   so nothing here is Residenziale-specific.

   Opener is the usual inner-page rhythm, but neither half of it is here any
   more: the 64px hero→crumb and the 64px crumb→kicker are both padding on
   .page-breadcrumb--mobile-40 in common/page-hero.css, because the crumb is
   its own band now (template-parts/sections/page-breadcrumb.php, called from
   taxonomy-categoria_progetto.php). This section starts at its kicker, over the
   short 371px hero, which sits below the persistent .subnav exactly like the
   Servizi detail pages. .progetti-archive__kicker has no top margin, and that
   is now load-bearing: with no padding-top it would collapse straight out.

   The card grid reuses .grid-projects / .project-card verbatim from the
   homepage: same 413px track, same 22px column gap, same 413:287 image, same
   t-body-sm-med u-muted title. Only the row rhythm and a uniform card height
   are new.
   ========================================================================== */
.progetti-archive {
  padding-bottom: 71px;   /* measured: next-category link bottom (3520) → CTA top (3591) */
}

.progetti-archive__kicker { margin: 0 0 17px; }   /* kicker bottom (754) → intro top (771) */

/* Figma's node box reads 848x148, but the text node screenshots at 845x140 —
   five lines, longest line 845. Chrome needs a slightly wider cap than Figma's
   own box to break the same way: at 845 it spills to six lines, at 860 it
   gives five with a longest line of 846.6. Capped there rather than at the
   Progetti hub's 845, because matching the drawn *wrap* is what keeps the card
   grid on its y — see the intro note in FIGMA-MAP §6. */
.progetti-archive__intro {
  max-width: 860px;
  margin: 0 0 110px;   /* measured: intro bottom (916) → card row 1 top (1026) */
  color: var(--c-text);
}

/* Columns and column-gap come from .grid-projects; only the row pitch is
   page-specific. Figma's six rows step 412 / 408 / 412 / 411 / 412 apart — it
   is hand-placed, so no single value hits them all. 31px (a 411 pitch against
   the 380 card) is the best fit: every row lands within 2px, where 32 drifts
   to 5px by the last one. */
.progetti-archive__grid { row-gap: 31px; }

/* Every card is a uniform 380px tall in Figma, and since the arrow moved onto
   its own line that is now the *natural* height of an ordinary one-line card
   (287 image + 23 + 22 + 10 + 11 + 27) rather than the two-line case this used
   to be explained by. The pin stays: two of the sixteen titles do wrap, and
   there the arrow keeps its bottom-right anchor and sits level with the second
   line — exactly as drawn — instead of pushing the card to 402. */
.progetti-archive .project-card { height: 380px; }

/* "HEALTHCARE & HOSPITALITY →" — the next category in the sequence, pinned
   right. Same PULSANTE as .aec-btn at the 18/600/34 size already used by
   .gc-viewall / .si-viewall / .svi-viewall. */
.progetti-archive__next {
  display: flex;
  justify-content: flex-end;
  margin-top: 25px;   /* measured: grid bottom (3461) → link top (3486) */
}
/* `height` has to come with the size: .aec-btn pins its box to --lh-micro
   (22px), so setting only font-size/line-height leaves a 34px line rendering
   inside a 22px box and swallows 12px of the gap to the CTA below. */
.progetti-archive__next .aec-btn { font-size: 18px; line-height: 34px; height: 34px; }

@media (max-width: 1024px) {
  .progetti-archive { padding-bottom: 43px; }
  .progetti-archive__intro { margin-bottom: 66px; }
  /* Released with the 2-col grid: a narrower column wraps more titles onto a
     second line, and the fixed height is only correct at the 413px track. */
  .progetti-archive .project-card { height: auto; }
}
@media (max-width: 768px) {
  .progetti-archive { padding-bottom: 32px; }
  .progetti-archive__intro { margin-bottom: 50px; }
}

/* --- SHM 08/09/2026 - BugSmash #29 + #30 (richiesta cliente) ---------------
   #29 "questi testi devono finire allineati alla seconda card sottostante":
   l'intro chiude sul bordo destro della seconda colonna della griglia
   (2 colonne + 1 gap da 22px = 846px nel container da 1280) invece dei 860px
   fissi del dev. #30 "tra le card e il pulsante lasciare lo stesso spazio che
   c'e' sotto prima del footer": il link alla categoria successiva stava a 25px
   dalle card e a 71px dal footer, ora 71px sopra e sotto (43/32 nei
   breakpoint del dev). Vale per tutti gli archivi progetti (stesso template). */
.progetti-archive__intro { max-width: calc((100% - 44px) * 2 / 3 + 22px); }
.progetti-archive__next { margin-top: 71px; }
@media (max-width: 1024px) {
  .progetti-archive__intro { max-width: none; }
  .progetti-archive__next { margin-top: 43px; }
}
@media (max-width: 768px) {
  .progetti-archive__next { margin-top: 32px; }
}

/* --- SHM 08/09/2026 - conseguenza di BugSmash #28 ---------------------------
   Con la colonna testo ridotta a 300px tre titoli lunghi (archivio
   Riqualificazione) passano a 3 righe e non stanno piu' nei 380px fissi: la
   card diventa min-height 380 e puo' crescere, la riga titolo riempie lo
   spazio residuo cosi' la freccia resta a 26px dal fondo in tutte le card
   della stessa riga. Con titoli da 1-2 righe il risultato e' identico a prima. */
.progetti-archive .project-card { height: auto; min-height: 380px; display: flex; flex-direction: column; }
.progetti-archive .project-card .project-card__media { flex: 0 0 auto; }
.progetti-archive .project-card .project-card__row { flex: 1 0 auto; }

/* --- SHM 08/09/2026 - BugSmash #36 (richiesta cliente) ---------------------
   "rivedere il ridimensionamento delle card al stringere/allargare la finestra.
   Troppo spazio bianco alla base": con la min-height fissa a 380px, quando la
   finestra si stringe l'immagine si abbassa ma la card no e resta bianco sotto
   il titolo. Tolta la min-height: la card e' alta quanto immagine + riga titolo
   (a 1440 fa comunque 379px) e le card della stessa riga restano allineate
   grazie allo stretch della griglia. */
.progetti-archive .project-card { min-height: 0; }
