/* ============================================================
   LUME — impaginazione condivisa delle tre pagine
   Griglia, nav, sezioni, tabelle, form. L'aspetto della brochure
   (serif, sezioni avorio e terracotta, marchio) è in classica.css,
   caricato dopo.
   ============================================================ */

/* —————————————————————————— Nav —————————————————————————— */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}
.nav.scrolled, .nav.menu-open { background: var(--ground); border-bottom-color: var(--rule); }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
/* il logo (variante 4a "Imposta"): LUME con la M ad archi; nel footer anche HOME LAB */
.wordmark { display: block; }
.wordmark img { width: auto; height: 20px; }
.nav-links { display: flex; gap: clamp(16px, 2.2vw, 34px); }
.nav-links a { font-size: 0.9375rem; color: var(--ink-2); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }

.nav-burger { display: none; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; cursor: pointer; }
.burger-lines, .burger-lines::before, .burger-lines::after {
  display: block; width: 24px; height: 2px; margin: 0 auto; background: currentColor;
  transition: transform 0.25s var(--ease), background-color 0.25s;
}
.burger-lines { position: relative; }
.burger-lines::before, .burger-lines::after { content: ""; position: absolute; left: 0; }
.burger-lines::before { top: -7px; }
.burger-lines::after  { top: 7px; }
.nav-burger[aria-expanded="true"] .burger-lines { background: transparent; }
.nav-burger[aria-expanded="true"] .burger-lines::before { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] .burger-lines::after  { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0; z-index: 45;
  display: flex; flex-direction: column; padding: 24px var(--gutter);
  background: var(--ground); color: var(--ink);
  visibility: hidden; opacity: 0; transition: opacity 0.2s, visibility 0.2s;
}
.mobile-menu.open { visibility: visible; opacity: 1; }
.mobile-menu a {
  padding: 14px 0; border-bottom: 1px solid var(--rule);
  font-size: 2rem; font-weight: 500; font-stretch: 72%; line-height: 1.1; text-decoration: none;
}

/* —————————————————————————— Hero —————————————————————————— */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(32px, 6vw, 96px));
  padding-bottom: var(--section);
}
.hero-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.hero-text { grid-column: 1 / span 5; }
.hero-lead { margin-top: 28px; }
.hero-actions { margin-top: 36px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.hero-art { grid-column: 6 / -1; margin: 0; }

/* Foto di concept in apertura: tre lastre sovrapposte, come nella prima Moodlab (tutte le versioni) */
.lastre { position: relative; justify-self: end; width: min(100%, 680px, 78svh); aspect-ratio: 1; }
.lastra {
  position: absolute; display: block; margin: 0; object-fit: cover;
  background: var(--rule); border: 1px solid var(--rule);
}
.lastra--1 { left: 30%; top: 0; width: 60%; height: 72%; object-position: 42% 50%; }
.lastra--2 { left: 0; top: 36%; width: 46%; height: 55%; z-index: 2; border-color: var(--accent); }
.lastra--3 { left: 68%; top: 66%; width: 32%; height: 34%; }
.foto-nota { margin: 0; font-size: 0.75rem; color: var(--ink-3); }
.lastre .foto-nota { position: absolute; left: 0; bottom: 0; }

/* un solo momento: le lastre salgono una dopo l'altra */
@media (prefers-reduced-motion: no-preference) {
  .lastra { opacity: 0; transform: translateY(46px) scale(0.97); animation: lastra-in 1.4s var(--ease) forwards; }
  .lastra--1 { animation-delay: 0.25s; }
  .lastra--2 { animation-delay: 0.46s; }
  .lastra--3 { animation-delay: 0.64s; }
}
@keyframes lastra-in { to { opacity: 1; transform: none; } }

/* —————————————————————————— Testate e righe di sezione —————————————————————————— */
.sec-head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.sec-head h2 { grid-column: 1 / span 6; }
.sec-head p { grid-column: 8 / -1; color: var(--ink-2); max-width: 46ch; }
.sec-link { margin-top: clamp(36px, 4vw, 56px); }
.num { display: block; margin-bottom: 12px; font-size: 0.875rem; font-weight: 500; color: var(--accent-text); font-variant-numeric: tabular-nums; }

/* una riga etichetta + elenco (materiali, servizi a parte) */
.riga {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: baseline;
  padding-block: 18px; border-block: 1px solid var(--rule);
}
.riga h2, .riga h3 { grid-column: 1 / span 3; font-family: var(--font); font-size: 0.9375rem; font-weight: 500; font-stretch: 100%; letter-spacing: 0; color: var(--ink-3); }
.riga ul { grid-column: 4 / -1; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 40px; }
.riga li { font-weight: 500; }
.riga li span { font-weight: 400; color: var(--ink-3); }

/* —————————————————————————— Chi siamo —————————————————————————— */
.chi { padding-block: var(--section); }
.chi-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: clamp(40px, 5vw, 72px); }
.chi-intro { grid-column: 1 / span 8; }
.chi-intro .lead { margin-top: 24px; max-width: 52ch; }
.pubblici {
  grid-column: 1 / -1; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px;
}
.pubblici li { padding-top: 18px; border-top: 1px solid var(--rule-strong); }
.pubblici h3 { font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem); font-weight: 450; font-stretch: 74%; line-height: 1.1; }
.pubblici p { margin-top: 10px; color: var(--ink-2); }
.materiali { grid-column: 1 / -1; }
.materiali li { font-family: var(--font-display); font-size: 1.125rem; font-weight: 450; }

/* —————————————————————————— Servizi (riassunto in home) —————————————————————————— */
.servizi { padding-bottom: var(--section); }
.comp-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(36px, 4.5vw, 64px) clamp(24px, 4vw, 72px);
}
.comp-grid li { padding-top: 20px; border-top: 1px solid var(--rule-strong); }
.comp-grid h3 { font-size: clamp(1.625rem, 1.1rem + 1.3vw, 2.375rem); font-weight: 450; font-stretch: 72%; line-height: 1.04; letter-spacing: -0.01em; }
.comp-grid p { margin-top: 14px; max-width: 44ch; color: var(--ink-2); }

/* —————————————————————————— Percorso: una catena di quote —————————————————————————— */
.percorso { padding-bottom: var(--section); }
.tappe {
  position: relative; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; row-gap: 48px;
}
.tappe li { position: relative; padding-top: 30px; }
.tappe li::before { content: ""; position: absolute; top: 0; left: 0; right: -24px; height: 1px; background: var(--accent); }
.tappe li:last-child::before { right: 0; }
.tappe li::after,
.tappe::after { content: ""; position: absolute; top: -6px; width: 1px; height: 13px; background: var(--accent); }
.tappe li::after { left: 0; }
.tappe::after { right: 0; }
.tappe h3 { font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem); font-weight: 450; font-stretch: 74%; line-height: 1.1; }
.tappe p { margin-top: 10px; max-width: 34ch; color: var(--ink-2); }

/* —————————————————————————— Tabelle: pacchetti e professionisti —————————————————————————— */
.pacchetti { padding-bottom: var(--section); }
.table-wrap { overflow-x: auto; }
.matrix { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.matrix th, .matrix td { padding: 14px 12px; border-bottom: 1px solid var(--rule); text-align: center; vertical-align: middle; font-weight: 400; }
.matrix tbody th[scope="row"], .matrix thead th:first-child { text-align: left; padding-left: 0; }
.matrix thead th, .matrix thead td { padding-bottom: 18px; border-bottom: 1px solid var(--rule-strong); vertical-align: bottom; }
.pk-table th:first-child, .pk-table td:first-child { width: 40%; }
.pk-name { display: block; font-family: var(--font-display); font-size: clamp(1.375rem, 1rem + 1vw, 2rem); font-weight: 450; font-stretch: 74%; line-height: 1.05; }
.pk-sub { display: block; margin-top: 6px; font-size: 0.875rem; color: var(--ink-2); }
.m-group th {
  padding: 30px 0 10px; text-align: left; border-bottom: 1px solid var(--rule-strong);
  font-family: var(--font-display); font-size: 1.125rem; font-weight: 550; font-stretch: 85%; color: var(--accent-text);
}
.m-group th svg { display: inline-block; vertical-align: -5px; margin-right: 10px; }
.m-yes, .m-no { display: inline-block; vertical-align: middle; }
.m-yes { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.m-no { width: 14px; height: 1.5px; background: var(--rule-strong); }
.m-focus { background: var(--focus-bg); }
.matrix tfoot td { padding-top: 22px; border-bottom: 0; }
.pk-note { margin-top: 24px; max-width: 70ch; color: var(--ink-2); }
.aparte { margin-top: clamp(40px, 5vw, 64px); }

/* —————————————————————————— Staff —————————————————————————— */
.staff { padding-bottom: var(--section); }
.staff-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px;
}
.staff-grid li { padding-top: 16px; border-top: 1px solid var(--rule-strong); }
.staff-grid h3 { font-size: clamp(1.25rem, 1rem + 0.6vw, 1.5rem); font-weight: 500; font-stretch: 80%; line-height: 1.15; }
.staff-grid p { margin-top: 8px; color: var(--ink-2); }
.staff-note { margin-top: clamp(36px, 4vw, 56px); max-width: 72ch; color: var(--ink-2); }
.staff-note strong { color: var(--ink); font-weight: 600; }

/* —————————————————————————— Pagine interne: servizi e professionisti —————————————————————————— */
.page-head {
  padding-top: calc(var(--nav-h) + clamp(40px, 7vw, 112px));
  padding-bottom: clamp(48px, 6vw, 96px);
}
.page-head .lead { margin-top: 24px; max-width: 52ch; }

.srv-fase { padding-bottom: clamp(56px, 7vw, 104px); }
.fase-titolo {
  display: flex; align-items: center; gap: 0; margin-bottom: 8px; padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-strong);
  font-family: var(--font-display); font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem); font-weight: 450; font-stretch: 72%; line-height: 1.05;
}
.fase-titolo .num { display: inline; margin: 0 0.6em 0 0; font-family: var(--font); font-size: 1rem; }
.srv-list { list-style: none; margin: 0; padding: 0; }
.srv-list li {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: baseline;
  padding-block: 22px; border-bottom: 1px solid var(--rule);
}
.srv-list h3 { grid-column: 1 / span 5; font-size: clamp(1.25rem, 1rem + 0.7vw, 1.625rem); font-weight: 500; font-stretch: 80%; line-height: 1.15; }
.srv-body { grid-column: 6 / -1; }
.srv-body p { max-width: 60ch; color: var(--ink-2); }
.srv-body .srv-pk { margin-top: 8px; font-size: 0.875rem; color: var(--accent-text); }

.ruoli { padding-bottom: var(--section); }
.ruoli-table th:first-child { width: 55%; }
.r-name { display: block; font-family: var(--font-display); font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem); font-weight: 500; font-stretch: 80%; color: var(--ink); }
.r-desc { display: block; margin-top: 4px; font-size: 0.9375rem; color: var(--ink-2); }
.r-mod { display: block; margin-top: 6px; font-size: 0.8125rem; color: var(--ink-3); }
.ph-n { font-weight: 600; color: var(--accent-text); }
.ph-legend { display: none; list-style: none; margin: 0 0 16px; padding: 0; gap: 6px 20px; flex-wrap: wrap; font-size: 0.875rem; color: var(--ink-2); }
.ph-legend b { color: var(--accent-text); }

.page-cta { padding-block: var(--section); border-top: 1px solid var(--rule); }
.page-cta-inner h2 { max-width: 18ch; }

/* —————————————————————————— Contatti —————————————————————————— */
.contatti { padding-block: var(--section); border-top: 1px solid var(--rule); }
.contatti-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 56px; }
.contatti-info { grid-column: 1 / span 5; }
.contatti-info .lead { margin-top: 20px; }
.cartiglio { width: 100%; margin-top: 40px; border-collapse: collapse; }
.cartiglio th, .cartiglio td { padding: 12px 16px; border: 1px solid var(--rule-strong); text-align: left; vertical-align: baseline; }
.cartiglio th { width: 7.5rem; font-size: 0.8125rem; font-weight: 500; color: var(--ink-3); }
.cartiglio a { text-decoration: none; }
.cartiglio a:hover { color: var(--accent-text); text-decoration: underline; }

.form { grid-column: 7 / -1; display: grid; gap: 22px; align-content: start; }
.field label { display: block; margin-bottom: 8px; font-size: 0.9375rem; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--rule-strong); border-radius: 2px;
  background: var(--sheet); color: var(--ink); caret-color: var(--accent);
  transition: border-color 0.2s;
}
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--ink-3); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { min-height: 128px; resize: vertical; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.form-status { flex: 1 1 220px; font-size: 0.9375rem; color: var(--ink-2); }
.form-status[data-state="error"] { color: var(--error); }

/* —————————————————————————— Footer —————————————————————————— */
.footer { padding-block: 48px 40px; border-top: 1px solid var(--rule); font-size: 0.9375rem; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 20px; align-items: start; }
.footer-name { grid-column: 1 / span 3; margin-top: 4px; }
.footer-name img { width: min(240px, 100%); height: auto; }
.footer-what { grid-column: 4 / span 3; }
.footer-nav { grid-column: 7 / span 4; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover, .footer-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.footer-legal { grid-column: 11 / -1; justify-self: end; color: var(--ink-3); }

/* —————————————————————————— Responsive —————————————————————————— */
@media (max-width: 1024px) {
  .hero-text { grid-column: 1 / span 7; }
  .hero-art { grid-column: 1 / -1; margin-top: 56px; }
  .lastre { justify-self: start; width: min(100%, 560px); }
  .staff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contatti-info, .form { grid-column: 1 / -1; }
  .footer-name, .footer-what, .footer-nav, .footer-legal { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 860px) {
  .sec-head h2, .sec-head p { grid-column: 1 / -1; }
  .sec-head p { margin-top: 20px; }
  .hero-text, .chi-intro { grid-column: 1 / -1; }
  .tappe { grid-template-columns: 1fr; }
  .tappe li::before { right: 0; }
  .srv-list h3, .srv-body { grid-column: 1 / -1; }
  .srv-body { margin-top: 8px; }
}

@media (max-width: 720px) {
  :root { --nav-h: 60px; }
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .wordmark img { height: 18px; }

  .comp-grid, .pubblici, .staff-grid { grid-template-columns: 1fr; }
  .riga h2, .riga h3, .riga ul { grid-column: 1 / -1; }
  .riga ul { margin-top: 8px; gap: 6px 28px; }

  .matrix th, .matrix td { padding: 12px 4px; }
  .matrix tbody th[scope="row"] { font-size: 0.9375rem; hyphens: auto; }
  .pk-name { font-size: 1rem; }
  .pk-sub { display: none; }
  .pk-table th:first-child, .pk-table td:first-child { width: auto; }
  .ruoli-table th:first-child { width: auto; }
  .ph-name { display: none; }
  .ph-legend { display: flex; }
}
