/* ==========================================================================
   F.lli Quaresima Costruzioni — stylesheet
   ========================================================================== */

:root {
  --navy: #1b2733;
  --navy-2: #24323f;
  --navy-3: #2e3f4f;
  --terracotta: #c1662e;
  --terracotta-dark: #9c4f22;
  --cream: #f6f2ec;
  --white: #ffffff;
  --text: #232b32;
  --text-light: #64707b;
  --border: #e3ddd0;
  --shadow: 0 10px 30px rgba(27, 39, 51, 0.12);
  --radius: 6px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.6em;
  color: var(--navy);
}

p {
  margin: 0 0 1em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 0.8em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85em 1.8em;
  border-radius: var(--radius);
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--terracotta);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--terracotta-dark);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.6);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--white);
}

.btn-outline-dark {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline-dark:hover {
  background: var(--navy);
  color: var(--white);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 46px;
  width: auto;
  filter: brightness(0) invert(1);
}

.brand-text {
  color: var(--white);
  line-height: 1.15;
}
.brand-text strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.brand-text span {
  display: block;
  font-size: 0.72rem;
  color: #a9b6c1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--white);
  margin: 6px 0;
  transition: 0.2s;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: block;
  color: #d7dee4;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.94rem;
  border-radius: var(--radius);
  transition: 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--white);
  background: var(--navy-3);
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  background: #10171f;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16,23,31,0.55) 0%, rgba(16,23,31,0.85) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  max-width: 720px;
}

.hero-content h1 {
  color: var(--white);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  margin-bottom: 0.4em;
}

.hero-content p {
  font-size: 1.15rem;
  color: #dbe2e8;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 1.6em;
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  background: var(--navy);
  padding: 90px 0 60px;
  color: var(--white);
  overflow: hidden;
}
.page-hero .container {
  position: relative;
  z-index: 2;
}
.page-hero h1 {
  color: var(--white);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 0.3em;
}
.page-hero p {
  color: #c3ccd4;
  max-width: 620px;
  font-size: 1.05rem;
  margin-bottom: 0;
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
}

/* ---------- Sections ---------- */
.section {
  padding: 88px 0;
}
.section-cream {
  background: var(--cream);
}
.section-navy {
  background: var(--navy);
  color: #dfe5ea;
}
.section-navy h2 {
  color: var(--white);
}

.section-head {
  max-width: 640px;
  margin-bottom: 3em;
}
.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  gap: 28px;
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 26px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-icon {
  width: 52px;
  height: 52px;
  color: var(--terracotta);
  margin-bottom: 18px;
}
.card-icon svg {
  width: 100%;
  height: 100%;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5em;
}
.card p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 0.4em;
}
.card .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--terracotta);
  background: rgba(193, 102, 46, 0.1);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat strong {
  display: block;
  font-size: clamp(2rem, 4vw, 2.6rem);
  color: var(--terracotta);
  font-weight: 800;
}
.stat span {
  color: #aeb9c2;
  font-size: 0.9rem;
}

/* ---------- Two-column with image ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.split.reverse .split-text {
  order: 2;
}
.split.reverse .split-media {
  order: 1;
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.gallery figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  aspect-ratio: 4 / 3;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.gallery figure:hover img {
  transform: scale(1.08);
}
.gallery figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  background: linear-gradient(180deg, transparent, rgba(16,23,31,0.85));
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.25s ease;
}
.gallery figure:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12, 17, 22, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 4px;
}
.lightbox-caption {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  text-align: center;
  color: #dfe5ea;
  font-size: 0.95rem;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--white);
  cursor: pointer;
  font-size: 1.4rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255,255,255,0.18);
}
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* ---------- Vintage / storia ---------- */
.vintage-frame {
  padding: 10px;
  background: var(--white);
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
  max-width: 420px;
}
.vintage-frame img {
  filter: sepia(0.35) contrast(1.02);
}
.vintage-frame figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
  padding-top: 8px;
  font-style: italic;
}

/* ---------- Timeline (chi siamo) ---------- */
.timeline {
  border-left: 3px solid var(--border);
  margin-left: 8px;
  padding-left: 28px;
}
.timeline-item {
  position: relative;
  padding-bottom: 32px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -35px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--terracotta);
  border: 3px solid var(--cream);
}
.timeline-item strong {
  display: block;
  color: var(--navy);
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.timeline-item span {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ---------- Certifications ---------- */
.soa-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}
.soa-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
.soa-table th, .soa-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.soa-table th {
  color: var(--text-light);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}
.soa-table td strong {
  color: var(--navy);
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.info-list li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.info-list li span:first-child {
  color: var(--text-light);
}
.info-list li span:last-child {
  font-weight: 600;
  color: var(--navy);
  text-align: right;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
}
.contact-item {
  display: flex;
  gap: 16px;
  margin-bottom: 26px;
}
.contact-item .card-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.contact-item h4 {
  margin-bottom: 4px;
  font-size: 1rem;
}
.contact-item p {
  color: var(--text-light);
  margin-bottom: 0;
  font-size: 0.95rem;
}

form.contact-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.form-row {
  margin-bottom: 18px;
}
.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--navy);
}
.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--cream);
}
.form-row input:focus,
.form-row textarea:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: 1px;
}

.map-embed {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.map-embed iframe {
  width: 100%;
  height: 320px;
  border: 0;
  display: block;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #131b23;
  color: #93a0aa;
  padding: 56px 0 26px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-grid h4 {
  color: var(--white);
  font-size: 0.95rem;
  margin-bottom: 1em;
}
.footer-brand img {
  height: 40px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  margin-bottom: 14px;
}
.footer-brand p {
  font-size: 0.9rem;
  max-width: 320px;
}
.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links li {
  margin-bottom: 10px;
}
.footer-links a:hover {
  color: var(--white);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
}
.footer-bottom a {
  color: #c3ccd4;
  text-decoration: underline;
}
.footer-bottom a:hover {
  color: var(--white);
}

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split.reverse .split-text,
  .split.reverse .split-media { order: initial; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed;
    top: 78px;
    left: 0;
    right: 0;
    background: var(--navy-2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .main-nav.open {
    max-height: 400px;
  }
  .main-nav ul {
    flex-direction: column;
    padding: 10px 20px 20px;
  }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
