/* Cantiere v2 (/v2/<lingua>/nuova-costruzione/<slug>/): linguaggio della scheda immobile.
   Foto in alto, titolo; sotto due colonne: contenuti (8/12) e prezzi con le azioni (4/12, fissa allo scorrimento);
   poi a tutta larghezza unita' (card .listing), galleria (carosello) e documenti. */

@layer pages {
  /* La barra dei filtri non segue lo scorrimento, come nella scheda */
  .top + .filters.bar { position: relative; top: auto; }
  html { scroll-padding-top: calc(var(--top-h, 70px) + 16px); }

  .project { padding-top: 20px; padding-bottom: var(--section); }

  .project-hero { height: clamp(280px, 58vh, 600px); }
  .project-hero picture { display: contents; }

  .project-title {
    display: grid;
    gap: 12px;
    padding-top: 36px;

    & h1 { font-size: var(--step-head); }
    & .kicker { font-size: var(--step-small); font-weight: 600; color: var(--accent); }
  }

  /* ---------- Corpo a due colonne ---------- */
  .project-body {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gap);
    align-items: start;
    padding-top: 40px;
  }
  .project-content {
    grid-column: 1 / span 8;
    grid-row: 1;
    min-width: 0;
    display: grid;
    gap: var(--block);

    & h2 { font-size: var(--step-lead); margin-bottom: 18px; }
  }
  .project-aside {
    grid-column: 9 / span 4;
    grid-row: 1;
    position: sticky;
    top: calc(var(--top-h, 70px) + 16px);
  }

  .project-card {
    display: grid;
    gap: 14px;
    padding: 24px;
    border-radius: var(--r-lg);
    box-shadow: inset 0 0 0 1px var(--line);

    & .price { font-family: var(--display); font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
    & .figures { display: grid; gap: 8px; margin: 0 0 6px; padding: 0; list-style: none; }
    & .figures li { display: flex; align-items: center; gap: 10px; }
    & .figures .icon { width: 18px; height: 18px; color: var(--accent); }
  }

  .project-facts { padding: clamp(22px, 3vw, 36px); border-radius: var(--r-lg); background: var(--tint); }
  .project-facts .specs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 var(--gap);
    margin: 0;

    & > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; box-shadow: inset 0 -1px 0 var(--tint-2); }
    & dt { color: var(--ink-soft); }
    & dd { margin: 0; font-weight: 600; text-align: right; }
  }

  .project-text { max-width: 70ch; }

  /* ---------- Sezioni a tutta larghezza ---------- */
  .project-section { padding-top: var(--block); }
  .project-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 24px;

    & h2 { font-size: var(--step-lead); }
  }

  .project-unit .media picture { display: contents; }
  .project-unit .project-unit-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: var(--step-small);
    font-weight: 600;
    color: var(--accent);

    & .icon { width: 16px; height: 16px; transition: translate var(--dur-fast) var(--ease); }
  }
  .project-unit:hover .project-unit-cta .icon { translate: 4px 0; }

  .project-photo {
    display: grid;
    gap: 8px;
    margin: 0;

    & .pic { aspect-ratio: 4 / 3; }
    & .pic picture { display: contents; }
  }

  .project-docs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;

    & a { display: flex; align-items: center; gap: 12px; min-height: var(--control-h); padding: 12px 18px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; text-decoration: none; transition: box-shadow var(--dur-fast) var(--ease); }
    & a:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
    & .icon { flex: none; width: 18px; height: 18px; color: var(--accent); }
    & span { min-width: 0; overflow-wrap: anywhere; }
  }

  @media (max-width: 1080px) {
    .project-content, .project-aside { grid-column: 1 / -1; grid-row: auto; }
    .project-aside { position: static; margin-bottom: var(--gap); }
    .project-docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 640px) {
    .project-hero { height: clamp(220px, 40vh, 360px); }
    .project-facts .specs { grid-template-columns: minmax(0, 1fr); }
    .project-docs { grid-template-columns: minmax(0, 1fr); }
  }
}
