:root {
  --ink: #142033;
  --muted: #657083;
  --line: #d8dde5;
  --paper: #ffffff;
  --soft: #f3f5f7;
  --navy: #003366;
  --copper: #b9703a;
  --green: #637a68;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, Arial, sans-serif;
  line-height: 1.65;
}

a {
  color: var(--navy);
  text-decoration: none;
}

a:hover {
  color: var(--copper);
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  font-family: "EB Garamond", Georgia, serif;
  color: var(--ink);
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(3.2rem, 8vw, 6.8rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.navbar {
  min-height: 82px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
}

.brand img {
  width: 54px;
  height: 44px;
  object-fit: cover;
}

.nav-link {
  color: var(--ink);
  font-weight: 600;
  padding: 0.75rem 1rem;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: 0.9rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08rem;
}

.language-switch a {
  color: var(--muted);
}

.language-switch a.active {
  color: var(--navy);
}

.nav-cta,
.btn-primary-custom,
.btn-secondary-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--navy);
  font-weight: 700;
  text-decoration: none;
}

.nav-cta,
.btn-primary-custom {
  color: #fff;
  background: var(--navy);
}

.btn-secondary-custom {
  color: var(--navy);
  background: transparent;
}

.btn-primary-custom:hover,
.nav-cta:hover {
  color: #fff;
  background: #0b467f;
}

.btn-secondary-custom:hover {
  color: #fff;
  background: var(--copper);
  border-color: var(--copper);
}

.hero {
  min-height: calc(100vh - 82px);
  display: flex;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.97) 0%, rgba(255,255,255,0.88) 48%, rgba(255,255,255,0.62) 100%),
    url("/images/servizio-urbanistica.png") center right / cover no-repeat;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  color: var(--copper);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
}

.lead {
  color: #2d394c;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  max-width: 680px;
}

.hero-actions,
.contact-band-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

.hero-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  padding: clamp(1.2rem, 3vw, 2rem);
}

.hero-panel img {
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: contain;
}

.section,
.page-hero {
  padding: clamp(4rem, 7vw, 7rem) 0;
}

.page-hero {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.page-hero.compact {
  padding: 4rem 0;
}

.page-hero p {
  max-width: 820px;
  font-size: 1.15rem;
  color: var(--muted);
}

.narrow {
  max-width: 920px;
}

.intro p {
  color: #344154;
  font-size: 1.08rem;
}

.muted {
  background: var(--soft);
}

.section-heading {
  max-width: 850px;
  margin-bottom: 2rem;
}

.service-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #fff;
}

.service-strip a {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}

.service-strip a:last-child {
  border-right: 0;
}

.service-strip a:hover {
  color: #fff;
  background: var(--navy);
}

.home-service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.home-service-card {
  min-height: 100%;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}

.home-service-card a {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  min-height: 172px;
  height: 100%;
  color: var(--ink);
}

.home-service-card img {
  width: 118px;
  height: 100%;
  min-height: 172px;
  object-fit: cover;
  background: var(--soft);
}

.home-service-card div {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
}

.home-service-card span {
  color: var(--copper);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}

.home-service-card h3 {
  margin: 0;
  font-size: 1.45rem;
}

.home-service-card p {
  display: -webkit-box;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.home-service-card strong {
  margin-top: auto;
  color: var(--navy);
  font-size: 0.82rem;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
}

.home-service-card a:hover {
  background: #f8fafc;
}

.home-service-card a:hover h3 {
  color: var(--navy);
}

.contact-band {
  background: var(--green);
  color: #fff;
}

.contact-band h2,
.contact-band .section-kicker {
  color: #fff;
}

.contact-band-inner {
  justify-content: space-between;
}

.contact-band-inner > div {
  max-width: 780px;
}

.services-list {
  display: grid;
  gap: 4rem;
}

.service-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.service-card {
  border: 1px solid var(--line);
  background: #fff;
}

.service-card a {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  height: 100%;
  color: var(--ink);
}

.service-card img {
  width: 100%;
  aspect-ratio: 1.45;
  object-fit: cover;
  background: var(--soft);
}

.service-card span {
  margin: 1.2rem 1.2rem 0.5rem;
  color: var(--copper);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}

.service-card h2 {
  margin: 0 1.2rem 0.7rem;
  font-size: 1.7rem;
}

.service-card p {
  margin: 0 1.2rem 1.3rem;
  color: var(--muted);
}

.service-card a:hover h2 {
  color: var(--navy);
}

.service-feature {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  scroll-margin-top: 110px;
}

.service-feature.reverse .service-media {
  order: 2;
}

.service-media {
  background: var(--soft);
  border: 1px solid var(--line);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.service-media img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.service-content p {
  color: var(--muted);
  font-size: 1.06rem;
}

.service-detail-hero {
  padding: clamp(4rem, 7vw, 7rem) 0;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.service-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.service-detail-copy {
  max-width: 820px;
}

.service-detail-media {
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}

.service-detail-media img {
  width: 100%;
  aspect-ratio: 1.12;
  object-fit: cover;
}

.service-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.service-main-copy p {
  color: #344154;
  font-size: 1.16rem;
}

.service-side-panel {
  border: 1px solid var(--line);
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--soft);
}

.service-side-panel h2 {
  font-size: 2rem;
}

.detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 5rem);
}

.check-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 1.7rem;
  color: #344154;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68rem;
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--copper);
}

.related-services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.related-services a {
  display: grid;
  gap: 0.35rem;
  min-height: 150px;
  padding: 1.25rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  align-content: center;
}

.related-services span {
  color: var(--copper);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}

.related-services strong {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.55rem;
  line-height: 1.1;
}

.related-services a:hover {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.related-services a:hover span,
.related-services a:hover strong {
  color: #fff;
}

.contact-grid,
.split-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  background: #fff;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--ink);
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0.85rem 0.9rem;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(0, 51, 102, 0.18);
  border-color: var(--navy);
}

.form-status {
  margin: 0;
  padding: 0.85rem 0.95rem;
  color: #26452f;
  background: #eef7f0;
  border: 1px solid #bfd9c5;
  font-weight: 700;
}

.form-error {
  color: #842029;
  font-weight: 700;
}

.form-error ul {
  margin: 0;
  padding: 0.85rem 0.95rem 0.85rem 2rem;
  background: #f8d7da;
  border: 1px solid #f1aeb5;
}

.contact-details {
  background: var(--soft);
  border: 1px solid var(--line);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.contact-details img {
  width: 150px;
  margin-bottom: 1.25rem;
}

.contact-details dt {
  margin-top: 1rem;
  color: var(--copper);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08rem;
}

.contact-details dd {
  margin: 0.25rem 0 0;
}

.legal-content h2 {
  margin-top: 2rem;
  font-size: 1.75rem;
}

.site-footer {
  background: #101820;
  color: rgba(255,255,255,0.78);
  padding: 4rem 0 1.5rem;
}

.site-footer h2,
.site-footer h3,
.site-footer a {
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.1fr 1fr;
  gap: 2rem;
}

.footer-logo {
  width: 118px;
  margin-bottom: 1rem;
}

.footer-grid p {
  margin-bottom: 0.45rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.16);
  font-size: 0.92rem;
}

.powered {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.powered img {
  width: 92px;
  filter: brightness(0) invert(1);
}

@media (max-width: 991px) {
  .hero {
    min-height: auto;
  }

  .hero-grid,
  .service-feature,
  .service-detail-grid,
  .service-body-grid,
  .contact-grid,
  .split-content {
    grid-template-columns: 1fr;
  }

  .service-card-grid,
  .home-service-grid,
  .related-services,
  .detail-columns {
    grid-template-columns: 1fr;
  }

  .service-feature.reverse .service-media {
    order: 0;
  }

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

  .service-strip a {
    border-bottom: 1px solid var(--line);
  }

  .home-service-card a {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .home-service-card img {
    width: 104px;
  }

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

@media (max-width: 575px) {
  h1 {
    font-size: 3.1rem;
  }

  .brand span {
    font-size: 1.25rem;
  }

  .service-strip,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .service-strip a {
    border-right: 0;
  }

  .home-service-card a {
    grid-template-columns: 1fr;
  }

  .home-service-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1.8;
    min-height: 0;
  }

  .hero-actions .btn-primary-custom,
  .hero-actions .btn-secondary-custom,
  .contact-band-inner .btn-primary-custom {
    width: 100%;
  }
}
