/* =========================================================
   GIOBUILD Ristrutturazioni - Sito vetrina ristrutturazioni edili
   Mobile-first responsive CSS
   ========================================================= */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f3f1ec;
  --color-text: #1e1e1c;
  --color-text-muted: #6b665f;
  --color-primary: #8c5a2b;      /* bronzo */
  --color-primary-dark: #6e4620; /* bronzo scuro, hover */
  --color-primary-light: #c99a5e; /* bronzo chiaro, per testo su sfondo scuro */
  --color-secondary: #1e1e1c;    /* antracite "cantiere" */
  --color-secondary-alt: #2b2a26; /* antracite leggermente più chiaro */
  --color-border: #e2ddd0;
  --color-success: #2e7d32;
  --color-error: #c62828;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.10);
  --font-heading: 'Archivo', system-ui, sans-serif;
  --font-display: 'Archivo Black', 'Archivo', system-ui, sans-serif;
  --font-body: 'Work Sans', system-ui, sans-serif;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { padding-left: 0; list-style: none; margin: 0; }
h1, h2, h3 { font-family: var(--font-heading); margin: 0 0 .5em; line-height: 1.15; }
p { margin: 0 0 1em; color: var(--color-text-muted); }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: .5em;
}
.center { text-align: center; }
.section-lead { max-width: 560px; margin: 0 auto 2.5em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: .9rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,.7);
  color: #fff;
}
.btn-ghost:hover { background: rgba(255,255,255,.15); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: .5rem; font-family: var(--font-heading); font-weight: 800; font-size: 1.15rem; }
.logo-mark { height: 2.4rem; width: auto; display: block; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  z-index: 1100;
}
.nav-toggle span {
  display: block; height: 2px; width: 24px;
  background: var(--color-text);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
  position: fixed;
  top: var(--header-h);
  right: 0;
  height: calc(100vh - var(--header-h));
  width: min(78vw, 320px);
  background: #fff;
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem 1.5rem;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.primary-nav.open { transform: translateX(0); }
.primary-nav a { font-weight: 500; font-size: 1.05rem; padding: .25rem 0; }
.nav-cta {
  margin-top: .5rem;
  background: var(--color-primary);
  color: #fff !important;
  text-align: center;
  padding: .8rem 1rem;
  border-radius: var(--radius);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
}
.hero-media {
  position: absolute; inset: -10%;
  background:
    radial-gradient(55% 60% at 82% 15%, rgba(140,90,43,.4), transparent 60%),
    radial-gradient(45% 45% at 15% 85%, rgba(140,90,43,.18), transparent 65%),
    radial-gradient(90% 90% at 50% 50%, var(--color-secondary-alt), #141412 75%);
  filter: blur(40px);
}
.hero-texture {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 100% at 30% 20%, #000 40%, transparent 85%);
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,.6)); }
.hero-content {
  position: relative;
  z-index: 1;
  padding-top: 3rem;
  padding-bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-text { display: flex; flex-direction: column; align-items: center; }
.hero h1 { font-family: var(--font-display); font-weight: 400; letter-spacing: -.01em; font-size: clamp(1.9rem, 5vw, 3.2rem); }
.hero h1 .accent { color: var(--color-primary-light); }
.hero-lead { color: rgba(255,255,255,.9); max-width: 520px; font-size: 1.05rem; }
.hero .eyebrow { color: var(--color-primary-light); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 1.5rem; }

/* ---------- Sections ---------- */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--color-bg-alt); }

.split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
.split-reverse .split-media { order: -1; }

/* ---------- Foto (riempiono il riquadro senza deformarsi) ---------- */
.card-media,
.gallery-item,
.ba-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
}

/* ---------- Chi siamo ---------- */
.chi-siamo-text { max-width: 720px; margin: 0 auto; text-align: center; }
.chi-siamo-text .eyebrow { display: block; }
.chi-siamo-text .check-list {
  display: inline-block;
  text-align: left;
  margin-top: 1rem;
}
.check-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: .6rem;
  color: var(--color-text);
}
.check-list li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--color-primary);
  font-weight: 700;
}

/* ---------- Come lavoriamo ---------- */
.come-lavoriamo { background: var(--color-secondary); color: #fff; }
.come-lavoriamo .light.eyebrow { color: var(--color-primary-light); }
.come-lavoriamo h2.light { color: #fff; }
.come-lavoriamo .section-lead.light { color: #cfccc5; }
.stage-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
.stage-card {
  background: var(--color-secondary-alt);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.stage-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-primary);
  background: #33322c;
}
.stage-num {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: .85rem;
  letter-spacing: .08em;
  color: var(--color-primary-light);
  margin-bottom: 1rem;
}
.stage-card h3 { color: #fff; font-size: 1.1rem; margin: 0 0 .5rem; }
.stage-card p { color: #cfccc5; margin: 0; font-size: .93rem; }

/* ---------- Servizi ---------- */
.cards-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(30,20,10,.14);
  border-color: var(--color-primary);
}
.card-media { aspect-ratio: 4 / 3; }
.card h3 { font-size: 1.1rem; margin-top: 1rem; }
.card p { margin-bottom: 0; font-size: .93rem; }

/* ---------- Progetti / galleria (slider, un'immagine alla volta) ---------- */
.gallery-slider {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}
.gallery-slider-track-wrap { overflow: hidden; border-radius: var(--radius); }
.gallery-track {
  display: flex;
  transition: transform .35s ease;
}
.gallery-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
}
/* foto intera (niente ritaglio), con fasce antracite ai lati se serve */
.gallery-item { height: 420px; border-radius: 0; object-fit: contain; background: var(--color-secondary); }

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(31,45,61,.85);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.gallery-arrow:hover { background: var(--color-primary); }
.gallery-arrow-prev { left: -8px; }
.gallery-arrow-next { right: -8px; }

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 1rem;
}
.gallery-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--color-border);
  border: none;
  cursor: pointer;
  padding: 0;
}
.gallery-dot.active { background: var(--color-primary); }

/* Overlay "Vuoi vedere di più?" sull'ultima slide, visibile al passaggio del mouse/tocco */
.gallery-slide-last { cursor: pointer; }
.gallery-more-overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: rgba(31,45,61,.88);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .35rem;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity .2s ease;
}
.gallery-slide-last:hover .gallery-more-overlay,
.gallery-slide-last:focus-within .gallery-more-overlay,
.gallery-more-overlay.show {
  opacity: 1;
}
.gallery-more-icon {
  font-size: 1.8rem;
  line-height: 1;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .4rem;
}
.gallery-more-text { font-weight: 700; font-size: 1.05rem; }
.gallery-more-sub { font-size: .82rem; color: rgba(255,255,255,.75); }

/* ---------- Prima e dopo (slider, un progetto alla volta) ---------- */
.before-after { margin-top: 4rem; }
.ba-slider { max-width: 760px; }
.ba-card { padding: 0 .25rem; transition: transform .2s ease; }
.ba-card:hover { transform: translateY(-6px); }
.ba-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
}
.ba-image { position: relative; }
.ba-image img { aspect-ratio: 3 / 4; }
.ba-tag {
  position: absolute;
  top: .6rem;
  left: .6rem;
  background: var(--color-secondary);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .25rem .55rem;
  border-radius: 999px;
}

/* ---------- Contatti ---------- */
.contact-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
  max-width: 420px;
  margin: 0 auto 1.5rem;
}
.contact-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .5rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: .6rem 1.1rem;
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.contact-card:hover { transform: translateY(-2px); border-color: var(--color-primary); }
.contact-card-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: var(--color-primary);
  display: flex;
}
.contact-card-icon svg { width: 100%; height: 100%; }
.contact-card-label { display: none; }
.contact-card-value { font-size: .88rem; font-weight: 700; color: var(--color-text); white-space: nowrap; }

/* ---------- Privacy ---------- */
.privacy-section { background: var(--color-bg-alt); }
.privacy-content { max-width: 780px; }
.privacy-content h3 { margin-top: 1.75rem; font-size: 1.05rem; }
.privacy-updated { font-size: .85rem; color: var(--color-text-muted); margin-top: 2rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-secondary); color: #cfccc5; padding: 1.75rem 0; }
.footer-inner { display: flex; flex-direction: column; gap: .5rem; align-items: center; text-align: center; font-size: .85rem; }
.footer-inner a { color: var(--color-primary-light); }

/* ---------- Floating contact button ---------- */
.fab-contact {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .75rem;
}
.fab-main {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 10px 26px rgba(140,90,43,.5), 0 2px 6px rgba(0,0,0,.15);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.fab-main:hover { background: var(--color-primary-dark); transform: scale(1.06); box-shadow: 0 12px 30px rgba(140,90,43,.55), 0 2px 6px rgba(0,0,0,.15); }
.fab-main:active { transform: scale(.95); }
.fab-main-icon { width: 24px; height: 24px; display: flex; }
.fab-main-icon svg { width: 100%; height: 100%; }

.fab-menu {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  opacity: 0;
  transform: translateY(10px) scale(.95);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.fab-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.fab-option {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: #fff;
  color: var(--color-secondary);
  padding: .7rem 1.1rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.fab-option:hover { transform: translateX(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.16); }
.fab-icon { width: 18px; height: 18px; color: var(--color-primary); display: flex; flex-shrink: 0; }
.fab-icon svg { width: 100%; height: 100%; }

/* =========================================================
   Tablet (>= 768px)
   ========================================================= */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .primary-nav {
    position: static;
    height: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    padding: 0;
    border: none;
    transform: none;
    background: transparent;
  }
  .primary-nav a { font-size: .95rem; }
  .nav-cta { margin-top: 0; padding: .6rem 1.1rem; }

  .split { grid-template-columns: 1fr 1fr; gap: 3rem; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-arrow-prev { left: -52px; }
  .gallery-arrow-next { right: -52px; }
  .gallery-item { height: 600px; }
  .stage-grid { grid-template-columns: repeat(3, 1fr); }

  .hero-content { align-items: flex-start; text-align: left; }
  .hero-text { align-items: flex-start; }
  .hero-actions { justify-content: flex-start; }
}

/* =========================================================
   Desktop (>= 1024px)
   ========================================================= */
@media (min-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { max-width: 780px; }
  .section { padding: 6rem 0; }
}
