/* ─── Reset minimo ─────────────────────────────────────────────── */
html { scroll-behavior: smooth }
img  { display: block; max-width: 100%; height: auto }
a    { color: inherit; text-decoration: none }
p    { margin: 0 }
h1,h2,h3 { margin: 0; font-weight: 400; letter-spacing: -.035em }

/* ─── Accessibilità: skip link e focus visibile ─────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 12px 20px; background: #1f1b17; color: #fff;
  font-size: .9rem; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0 }

a:focus-visible, button:focus-visible {
  outline: 2px solid #c98378;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── Rispetto delle preferenze di movimento ridotto ────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important }
}

/* ─── Elementi decorativi non stampabili ────────────────────────── */
@media print {
  .site-header, .menu-toggle, .site-nav, .skip-link { display: none !important }
  body { background: #fff; color: #000 }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em }
}

/* ─── Header: stato scrolled (gestito da JS) ────────────────────── */
.site-header.is-scrolled {
  background: rgba(31,27,23,.88);
  border-color: rgba(255,255,255,.08);
}

/* ─── Menu mobile ────────────────────────────────────────────────── */
body.menu-open { overflow: hidden }

/* Il pulsante hamburger esiste solo su mobile.
   Senza questa riga restava visibile anche su desktop in tutte le pagine
   che non caricano Tailwind (schede progetto e diagnostica). */
.menu-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  cursor: pointer;
}
.menu-toggle span {
  display: block; width: 18px; height: 1px; margin: 0 auto;
  background: #fff; transition: transform .2s, opacity .2s;
}
.menu-toggle span:nth-child(2) { margin: 5px auto }

@media (max-width: 767px) {
  .menu-toggle { display: block !important }
  .site-nav {
    position: fixed; inset: 0;
    display: none; flex-direction: column;
    justify-content: center; gap: 24px;
    background: rgba(31,27,23,.98);
    font-size: 1.25rem;
  }
  .site-nav.is-open { display: flex }
  .lang { border: 0 !important; padding: 0 !important }
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg) }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0 }
  .menu-open .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg) }
}

/* ─── Hero overlay (gradiente direzionale non riproducibile con Tailwind) */
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(31,27,23,.9) 0%, rgba(31,27,23,.62) 44%, rgba(31,27,23,.1) 100%),
    linear-gradient(0deg, #f3eee6 0%, rgba(243,238,230,0) 22%);
}

.trust-panel {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
  gap: 26px;
  padding: 28px;
  border: 1px solid rgba(31,27,23,.08);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,244,239,.96)),
    radial-gradient(circle at top right, rgba(201,131,120,.12), transparent 38%);
  box-shadow: 0 18px 48px rgba(31,27,23,.08);
}

.trust-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 18px 6px 0;
  border-right: 1px solid rgba(31,27,23,.08);
}

.trust-label {
  margin-bottom: 14px;
  color: #9b7567;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.trust-intro h2 {
  color: #1f1b17;
  font-size: clamp(1.25rem, 2vw, 1.95rem);
  line-height: 1.14;
  max-width: 10ch;
}

.trust-lead {
  margin-top: 16px;
  max-width: 30ch;
  color: #6a5f55;
  font-size: .92rem;
  line-height: 1.72;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-content: start;
}

.trust-card {
  min-height: 100%;
  padding: 20px;
  border: 1px solid #e0d3c4;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(249,245,240,.82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.trust-kicker {
  color: #9b7567;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.trust-value {
  margin-top: 8px;
  color: #1f1b17;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.32rem;
  line-height: 1.24;
}

.trust-copy {
  margin-top: 10px;
  color: #51483f;
  font-size: .88rem;
  line-height: 1.62;
}

/* ─── Decorazione sfondo sezione Azienda ────────────────────────── */
.intro-section::after {
  content: ""; pointer-events: none;
  position: absolute; top: 0; right: -80px;
  width: min(700px, 52vw); height: 100%;
  opacity: .055;
  background: url("images/placeholder-architecture.svg") center/cover no-repeat;
}

/* ─── Hover scala immagine card progetto ────────────────────────── */
.project-card:hover .project-image img { transform: scale(1.055) }

/* ─── Overlay sfumatura immagine card ───────────────────────────── */
.project-image::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.46), transparent 60%);
}

/* ─── Animazione reveal al scroll ─────────────────────────────────
   Lo stato "nascosto" si applica solo se il JavaScript è attivo
   (classe .js su <html>): senza JS il contenuto resta sempre visibile. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease }
.js .reveal.is-visible { opacity: 1; transform: translateY(0) }

/* ─── Classi schede progetto (project pages) ─────────────────────── */
.project-hero { position: relative; min-height: 68vh; overflow: hidden; background: #1f1b17; color: #fff }
.project-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.project-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(31,27,23,.9), rgba(31,27,23,.42)) }
/* Larghezza di colonna condivisa: senza questi limiti il contenuto di hero
   e schede andava a filo del bordo finestra, perché la classe .container
   è di Tailwind e le pagine progetto non lo caricano. */
.project-hero-content { position: relative; z-index: 1; min-height: 68vh; display: flex; flex-direction: column; justify-content: end; padding: 150px 20px 80px; width: 100%; max-width: 1180px; margin: 0 auto }
.project-hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05 }
.breadcrumb { margin-bottom: 24px; color: rgba(255,255,255,.7); font-size: .9rem }
.project-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px }
.project-meta span { padding: 9px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.84); font-size: .82rem; text-transform: uppercase; letter-spacing: .12em }
.project-detail-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 80px; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px }
.project-facts { position: sticky; top: 110px; padding: 28px; border: 1px solid #d6c8b8; border-radius: 22px; background: rgba(255,255,255,.45) }
.project-facts h2 { margin-bottom: 26px; font-size: 2.1rem }
.fact { padding: 18px 0; border-top: 1px solid #d6c8b8 }
.fact strong { display: block; margin-bottom: 5px; color: #9b7567; font-size: .76rem; letter-spacing: .18em; text-transform: uppercase }
.project-article { color: #51483f; font-size: 1.08rem; line-height: 1.9 }
.project-article h2 { margin: 0 0 22px; color: #1f1b17; font-size: clamp(2rem,4vw,3.5rem) }
.project-article p+h2 { margin-top: 70px }
.project-article p+p { margin-top: 22px }
.gallery-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; margin-top: 42px }
.gallery-grid img { width: 100%; min-height: 280px; object-fit: cover; border-radius: 22px }

@media (max-width: 1020px) {
  .project-detail-grid { grid-template-columns: 1fr }
  .project-facts { position: relative; top: auto }
}
@media (max-width: 760px) {
  .project-hero-content { padding: 130px 20px 64px }
  .gallery-grid { grid-template-columns: 1fr }
  .project-facts { padding: 22px }
  .project-facts h2 { font-size: 1.7rem }
  .project-article { font-size: 1rem }
  .footer-grid { grid-template-columns: 1fr; gap: 32px }
  .footer-bottom { flex-direction: column; gap: 10px }
  .trust-panel { grid-template-columns: 1fr; gap: 24px; padding: 24px }
  .trust-intro {
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(31,27,23,.08);
  }
  .trust-intro h2 {
    max-width: none;
    font-size: 1.7rem;
  }
  .trust-lead { max-width: none }
  .trust-grid { grid-template-columns: 1fr }
}

/* ─── Logo / Brand / Nav styling ────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand img {
  height: 46px;
  width: auto;
  object-fit: contain;
}
.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
  color: #ffffff;
}
.brand-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

/* ─── Header Layout for Project Pages ───────────────────────────── */
.site-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(31, 27, 23, 0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.3s, border-color 0.3s;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9rem;
}
.site-nav a {
  transition: color 0.2s;
}
.site-nav a:hover {
  color: #ffffff;
}
.lang {
  padding-left: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.26);
  color: rgba(255, 255, 255, 0.65);
}

/* ─── Footer Layout for Project Pages ───────────────────────────── */
.site-footer {
  background: #1f1b17;
  color: #ffffff;
  padding: 72px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr 0.8fr 0.8fr 0.8fr;
  gap: 42px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}
.footer-grid h3 {
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.footer-grid a {
  display: block;
  margin: 9px 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.93rem;
  line-height: 1.8;
  transition: color 0.2s;
}
.footer-grid a:hover {
  color: #ffffff;
}

.legality-icons {
  display: inline-flex;
  align-items: center;
  gap: .18rem;
  color: #c98378;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

.legality-icons--large {
  margin-left: .18em;
  font-size: .92em;
  vertical-align: baseline;
}
.footer-logo {
  height: 46px;
  width: auto;
  object-fit: contain;
  margin-bottom: 22px;
}
.site-footer p {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.93rem;
  line-height: 1.8;
  margin-top: 22px;
}
.site-footer address {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.93rem;
  line-height: 1.8;
  margin-top: 22px;
  font-style: normal;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  max-width: 1180px;
  margin: 40px auto 0;
  padding: 30px 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.85rem;
}
