/* Metalprex — foglio di stile
   Palette Tegola: il rosso delle tegole come colore del marchio, ardesia per i testi,
   grigi zinco per i fondi. I colori hanno nomi di ruolo: per cambiare tono basta la radice.
   Un solo carattere, Archivo, in due larghezze: largo per i titoli, normale per il testo. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --marchio: #b8482e;
  --marchio-scuro: #8c3420;
  --marchio-chiaro: #e9a38b;
  --inchiostro: #23262b;
  --inchiostro-2: #383c43;
  --superficie: #eef0f2;
  --bordo: #c9ced3;
  --grigio: #575d66;
  --acqua: #2f9be0;
  --bianco: #fff;
  --w: 1160px;
  --gutter: clamp(20px, 4vw, 40px);
  --sez: clamp(64px, 9vw, 112px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bianco);
  color: var(--inchiostro);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2 {
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.35rem, 5.4vw, 4.25rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  line-height: 1.08;
}

h3 {
  font-size: 1.1875rem;
  line-height: 1.25;
  font-weight: 700;
}

:focus-visible {
  outline: 3px solid var(--acqua);
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--w));
  margin-inline: auto;
}

.salta {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--inchiostro);
  color: var(--bianco);
  padding: 12px 16px;
  z-index: 100;
}

.salta:focus {
  left: 8px;
  top: 8px;
}

/* Testata */
.testata {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bianco);
  border-bottom: 1px solid var(--bordo);
}

.testata .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
}

.marchio {
  display: block;
  flex: none;
}

.marchio img {
  height: 50px;
  width: auto;
}

.menu {
  margin-left: auto;
}

.menu ul {
  display: flex;
  gap: clamp(16px, 2.4vw, 34px);
}

.menu a {
  text-decoration: none;
  font-weight: 600;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.menu a:hover {
  border-bottom-color: var(--marchio);
}

.menu-apri {
  display: none;
  margin-left: auto;
  background: none;
  border: 1.5px solid var(--inchiostro);
  border-radius: 2px;
  color: var(--inchiostro);
  font: inherit;
  font-weight: 600;
  padding: 9px 14px;
  cursor: pointer;
}

/* Pulsanti */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: 2px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn-pieno {
  background: var(--marchio);
  color: var(--bianco);
}

.btn-pieno:hover {
  background: var(--marchio-scuro);
}

.btn-scuro {
  background: var(--inchiostro);
  color: var(--bianco);
}

.btn-scuro:hover {
  background: var(--inchiostro-2);
}

.btn-linea {
  border-color: var(--inchiostro);
  color: var(--inchiostro);
  background: transparent;
}

.btn-linea:hover {
  background: var(--inchiostro);
  color: var(--bianco);
}

.btn-chiaro {
  background: var(--bianco);
  color: var(--inchiostro);
}

.btn-chiaro:hover {
  background: var(--superficie);
}

.btn-linea-chiara {
  border-color: var(--bianco);
  color: var(--bianco);
  background: transparent;
}

.btn-linea-chiara:hover {
  background: var(--bianco);
  color: var(--marchio-scuro);
}

.btn-tel {
  min-height: 44px;
  padding: 8px 18px;
  white-space: nowrap;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Apertura */
.apertura {
  background: var(--marchio);
  color: var(--bianco);
  overflow: hidden;
}

.apertura :focus-visible {
  outline-color: var(--bianco);
}

.apertura .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(40px, 6vw, 80px);
}

.apertura p {
  margin-top: 24px;
  max-width: 34em;
  font-size: 1.1875rem;
}

.azioni {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* Disegno del tetto: linee bianche sul fondo tegola, lamiera in ardesia */
.tt-hatch {
  stroke: var(--bianco);
  stroke-width: 1;
  opacity: 0.22;
}

.tt-line {
  fill: none;
  stroke: var(--bianco);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tt-falda {
  fill: var(--bianco);
  stroke: var(--bianco);
  stroke-width: 2;
  stroke-linejoin: round;
}

.tt-lamiera {
  fill: none;
  stroke: var(--inchiostro);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tt-guaina {
  fill: none;
  stroke: var(--bianco);
  stroke-width: 5;
  stroke-linejoin: round;
}

.tt-tubo {
  fill: none;
  stroke: var(--inchiostro);
  stroke-width: 13;
  stroke-linejoin: round;
}

.tt-tubo-in {
  fill: none;
  stroke: var(--marchio);
  stroke-width: 5;
  stroke-linejoin: round;
}

.tt-pioggia {
  fill: none;
  stroke: var(--bianco);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.tt-acqua {
  fill: none;
  stroke: var(--bianco);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
}

.tt-label path {
  fill: none;
  stroke: var(--bianco);
  stroke-width: 1.2;
}

.tt-label text {
  font-size: 17px;
  font-weight: 600;
  fill: var(--bianco);
}

/* Unico movimento della pagina: piove, poi l'acqua percorre falda, grondaia e pluviale */
@media (prefers-reduced-motion: no-preference) {
  .tt-pioggia {
    animation: piove 0.7s ease-out both;
  }

  .tt-acqua.a1 {
    animation: scorre 0.3s linear 0.6s both;
  }

  .tt-acqua.a2 {
    animation: scorre 2.2s cubic-bezier(0.45, 0, 0.35, 1) 0.9s both;
  }

  .tt-label {
    animation: compare 0.5s ease-out 2.9s both;
  }
}

@keyframes piove {
  from {
    opacity: 0;
    transform: translate(10px, -26px);
  }
}

@keyframes scorre {
  from {
    stroke-dashoffset: 100;
  }
}

@keyframes compare {
  from {
    opacity: 0;
  }
}

/* Sezioni */
.sez {
  padding-block: var(--sez);
}

.sez-chiara {
  background: var(--superficie);
}

.sez-scura {
  background: var(--inchiostro);
  color: var(--bianco);
}

.intro {
  max-width: 40em;
  margin-top: 20px;
  font-size: 1.1875rem;
}

/* Interventi: la nuova costruzione è il lavoro principale, quindi ha la fascia larga in alto */
.interventi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin-top: 56px;
}

.intervento {
  padding: clamp(24px, 3vw, 40px);
  background: var(--superficie);
}

.intervento h3 {
  font-stretch: 112%;
  font-weight: 800;
  font-size: 1.4375rem;
}

.intervento p {
  margin-top: 12px;
}

.intervento ul {
  margin-top: 20px;
  border-top: 1px solid var(--bordo);
}

.intervento li {
  padding: 10px 0;
  border-bottom: 1px solid var(--bordo);
  font-weight: 600;
}

.intervento.principale {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 24px clamp(32px, 5vw, 72px);
  align-items: end;
  padding: clamp(32px, 4vw, 56px) clamp(24px, 3vw, 40px);
  background: var(--inchiostro);
  color: var(--bianco);
  border-top: 6px solid var(--marchio);
}

.intervento.principale h3 {
  font-stretch: 125%;
  font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
}

.intervento.principale p {
  margin-top: 20px;
  max-width: 30em;
  font-size: 1.1875rem;
  color: #d5d9de;
}

.intervento.principale ul {
  margin-top: 0;
  border-top-color: #41454c;
}

.intervento.principale li {
  border-bottom-color: #41454c;
}

/* Servizi: un gruppo per riga, nome del mestiere a sinistra, voci a destra */
.gruppo {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 24px clamp(24px, 4vw, 56px);
  padding-block: 40px;
  border-top: 2px solid var(--inchiostro);
}

.gruppi {
  margin-top: 56px;
}

.gruppo:last-child {
  padding-bottom: 0;
}

.gruppo h3 {
  font-stretch: 112%;
  font-weight: 800;
  font-size: 1.4375rem;
  color: var(--marchio);
  overflow-wrap: anywhere;
}

.voci {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px clamp(24px, 3vw, 48px);
}

.voci dt {
  font-weight: 700;
  font-size: 1.125rem;
}

.voci dd {
  margin-top: 6px;
  color: var(--grigio);
}

/* Metalli */
.metalli {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
  margin-top: 56px;
}

.lamiera {
  height: 96px;
  margin-bottom: 20px;
  background: linear-gradient(112deg, var(--chiaro) 0 57%, var(--scuro) 57% 100%);
}

.metallo p {
  margin-top: 8px;
  color: var(--grigio);
}

.rame {
  --chiaro: #c47a45;
  --scuro: #9a5528;
}

.zinco-titanio {
  --chiaro: #8e9aa6;
  --scuro: #6f7b87;
}

.alluminio {
  --chiaro: #e1e3e5;
  --scuro: #c2c5c9;
}

.inox {
  --chiaro: #c9d3db;
  --scuro: #98a6b2;
}

/* Come lavoriamo: è una sequenza vera, quindi è numerata */
.passi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 40px);
  margin-top: 56px;
  counter-reset: passo;
}

.passi li {
  counter-increment: passo;
  border-top: 2px solid var(--marchio-chiaro);
  padding-top: 20px;
}

.passi li::before {
  content: counter(passo);
  display: block;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 2.75rem;
  line-height: 1;
  color: var(--marchio-chiaro);
  margin-bottom: 16px;
}

.passi p {
  margin-top: 8px;
  color: #d5d9de;
}

/* Lavori: griglia pronta per quando arrivano le fotografie dei cantieri */
.lavori {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin-top: 56px;
}

.lavori figure {
  display: grid;
  gap: 10px;
}

.lavori img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
}

/* Domande */
.domande {
  margin-top: 48px;
  max-width: 52rem;
  border-bottom: 1px solid var(--bordo);
}

.domande details {
  border-top: 1px solid var(--bordo);
}

.domande summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  font-weight: 700;
  font-size: 1.125rem;
  cursor: pointer;
  list-style: none;
}

.domande summary::-webkit-details-marker {
  display: none;
}

.domande summary::after {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border-right: 2.5px solid var(--marchio);
  border-bottom: 2.5px solid var(--marchio);
  transform: translateY(-3px) rotate(45deg);
}

.domande details[open] summary::after {
  transform: translateY(3px) rotate(225deg);
}

.domande details p {
  padding: 0 40px 24px 0;
  max-width: 44rem;
}

/* Contatti */
.contatti {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  margin-top: 56px;
}

.recapiti {
  display: grid;
  gap: 28px;
  align-content: start;
}

.recapiti dt {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--grigio);
}

.recapiti dd {
  margin-top: 4px;
  font-size: 1.1875rem;
  font-weight: 600;
}

.recapiti .grande {
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.1;
}

.recapiti a {
  text-decoration-color: var(--marchio);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.modulo {
  background: var(--bianco);
  padding: clamp(24px, 3vw, 40px);
  border-top: 4px solid var(--marchio);
}

.campi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.campo {
  display: grid;
  gap: 6px;
}

.campo.largo {
  grid-column: 1 / -1;
}

.campo label {
  font-weight: 600;
  font-size: 0.9375rem;
}

.campo input,
.campo select,
.campo textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid #868c95;
  border-radius: 2px;
  background: var(--bianco);
  color: var(--inchiostro);
  font: inherit;
}

.campo textarea {
  min-height: 132px;
  resize: vertical;
}

.campo input:focus-visible,
.campo select:focus-visible,
.campo textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--inchiostro);
}

.modulo .azioni {
  margin-top: 24px;
}

.nota {
  margin-top: 16px;
  font-size: 0.9375rem;
  color: var(--grigio);
}

.errore {
  margin-top: 16px;
  font-weight: 600;
  color: #a3241b;
}

.errore:empty {
  display: none;
}

/* Piede */
.piede {
  background: var(--inchiostro);
  color: #d5d9de;
  padding-block: 56px 40px;
  font-size: 0.9375rem;
}

.piede .wrap {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr);
  gap: 32px clamp(24px, 4vw, 56px);
}

.piede img {
  height: 58px;
  width: auto;
  margin-left: -8px;
}

.piede p + p {
  margin-top: 8px;
}

.piede h2 {
  font-stretch: 100%;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--bianco);
  margin-bottom: 12px;
}

.piede li + li {
  margin-top: 8px;
}

.piede a {
  text-underline-offset: 3px;
}

.piede .diritti {
  grid-column: 1 / -1;
  border-top: 1px solid #41454c;
  padding-top: 24px;
}

/* Pagine di testo (privacy, note legali) */
.testo {
  max-width: 46rem;
}

.testo h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.testo h2 {
  font-size: 1.5rem;
  font-stretch: 112%;
  margin-top: 48px;
}

.testo p,
.testo ul {
  margin-top: 16px;
}

.testo ul {
  list-style: disc;
  padding-left: 1.2em;
}

.testo li + li {
  margin-top: 6px;
}

@media (max-width: 960px) {
  .menu-apri {
    display: inline-block;
  }

  .testata .wrap {
    flex-wrap: wrap;
    gap: 0 16px;
  }

  .menu {
    display: none;
    order: 3;
    flex-basis: 100%;
    margin: 0;
    padding-bottom: 16px;
  }

  .menu.aperto {
    display: block;
  }

  .menu ul {
    flex-direction: column;
    gap: 0;
  }

  .menu a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--bordo);
  }

  .btn-tel {
    display: none;
  }

  .apertura .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .metalli,
  .passi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contatti,
  .gruppo,
  .interventi,
  .intervento.principale {
    grid-template-columns: minmax(0, 1fr);
  }

  .piede .wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .piede .wrap > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .marchio img {
    height: 42px;
  }

  .voci,
  .campi,
  .lavori {
    grid-template-columns: minmax(0, 1fr);
  }

  .lavori {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .azioni .btn {
    flex: 1 1 100%;
  }

  /* Sul telefono le etichette del disegno sarebbero illeggibili: i nomi stanno nei servizi */
  .tt-label {
    display: none;
  }

  .piede .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .metalli,
  .passi {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .testata,
  .modulo .azioni {
    display: none;
  }
}
