/* =========================================================
   Cipolletta Consulenze S.r.l. — stylesheet
   ========================================================= */

:root{
  --navy: #006699;
  --navy-dark: #004766;
  --blue: #006699;
  --accent: #e0602a;
  --accent-dark: #b8481c;
  --bg: #ffffff;
  --bg-alt: #f4f6f9;
  --text: #1b2430;
  --text-muted: #5b6675;
  --border: #e2e6ec;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(11,31,58,0.08);
  --shadow-sm: 0 2px 10px rgba(11,31,58,0.06);
  --maxw: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; scroll-padding-top: 88px; }

body{
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.skip-link{
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
}
.skip-link:focus{ left: 12px; top: 12px; }

h1, h2, h3, h4{
  font-family: var(--font);
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 .6em;
}

p{ margin: 0 0 1em; color: var(--text); }

a{ color: var(--blue); text-decoration: none; }
a:hover{ text-decoration: underline; }

ul{ margin: 0; padding: 0; list-style: none; }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
  text-decoration: none;
}
.btn:hover{ transform: translateY(-2px); text-decoration: none; }

.btn-accent{ background: var(--accent); color: #fff; }
.btn-accent:hover{ background: var(--accent-dark); }

.btn-outline-light{ border-color: rgba(255,255,255,.55); color: #fff; }
.btn-outline-light:hover{ border-color: #fff; background: rgba(255,255,255,.08); }

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

.btn-sm{ padding: 9px 18px; font-size: .85rem; white-space: nowrap; }

/* ---------- Header ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 76px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
}
.brand:hover{ text-decoration: none; }

.brand-mark{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: var(--navy);
  color: var(--accent);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .5px;
  flex: none;
  object-fit: cover;
}

.brand-text{ display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong,
.brand-text em{ font-style: normal; font-size: 1.02rem; font-weight: 700; letter-spacing: .3px; color: var(--navy); }

.main-nav{
  display: flex;
  gap: 20px;
}
.main-nav a{
  color: var(--text);
  font-weight: 600;
  font-size: .89rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.main-nav a:hover{
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom-color: var(--accent);
}

.header-actions{ display: flex; align-items: center; gap: 14px; }

.brochure-download{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  color: var(--navy);
  font-weight: 700;
  font-size: .85rem;
  white-space: nowrap;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.brochure-download:hover{
  border-color: var(--accent);
  color: var(--accent-dark);
  background: rgba(224,96,42,.06);
  text-decoration: none;
}

.phone-quick{
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-weight: 700;
  font-size: .92rem;
  white-space: nowrap;
}
.phone-quick:hover{ color: var(--accent-dark); text-decoration: none; }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span{
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: var(--navy);
  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); }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  overflow: hidden;
  background-color: var(--navy-dark);
  color: var(--navy);
  padding: 96px 0 84px;
}
.hero::before{
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../assets/hero-tracks.jpg");
  background-size: cover;
  background-position: 38% 35%;
  filter: saturate(.3) brightness(1.12) contrast(.95);
  pointer-events: none;
}
/* Striscia verticale navy a sinistra, come nella brochure originale */
.hero::after{
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 192px;
  background: var(--navy);
  pointer-events: none;
}
.hero-inner{ position: relative; z-index: 1; max-width: 820px; }

.eyebrow{
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
  text-shadow: 0 1px 6px rgba(255,255,255,.4);
}

.hero h1{
  color: #111;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  margin-bottom: .55em;
  text-shadow: 0 1px 3px rgba(255,255,255,.6);
}

.hero-lead{
  color: #111;
  font-size: 1.18rem;
  font-weight: 700;
  max-width: 640px;
  text-shadow: 0 1px 4px rgba(255,255,255,.5);
}

.hero-cta{ display: flex; gap: 14px; flex-wrap: wrap; margin: 28px 0 20px; }

.hero-tagline{
  color: #111;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .3px;
  border-top: 1px solid rgba(0,0,0,.2);
  padding-top: 18px;
  margin-top: 10px;
  margin-bottom: 0;
  text-shadow: 0 1px 4px rgba(255,255,255,.5);
}

@media (min-width: 981px){
  .hero-inner{ padding-left: 220px; }
}
@media (max-width: 980px){
  .hero::after{ display: none; }
}

/* ---------- Stats ---------- */
.stats{
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.stats-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  max-width: 640px;
  margin: 0 auto;
  gap: 24px;
  padding: 40px 24px;
}
.stat{ text-align: center; }
.stat-num{
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: .3px;
  text-wrap: balance;
}
.stat-label{
  display: block;
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ---------- Sections ---------- */
.section{ padding: 88px 0; }
.section-alt{ background: var(--bg-alt); }

.section-eyebrow{
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 10px;
}

.section-title{
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  max-width: 760px;
  margin-bottom: 44px;
}

.subsection-title{
  font-size: 1.15rem;
  color: var(--navy);
  margin: 56px 0 20px;
}

/* ---------- About ---------- */
.about-grid{
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 56px;
  align-items: start;
}
.about-text p{ color: var(--text); }

.about-side{ display: flex; flex-direction: column; gap: 20px; position: sticky; top: 100px; }

.side-card{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.side-card h3{ font-size: 1rem; margin-bottom: 14px; }

.tag-list li{
  display: inline-block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--navy);
  font-size: .82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  margin: 0 6px 6px 0;
}

.fact-list div{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: .86rem;
}
.fact-list div:last-child{ border-bottom: none; }
.fact-list dt{ color: var(--text-muted); font-weight: 600; }
.fact-list dd{ margin: 0; text-align: right; color: var(--navy); font-weight: 600; }

/* ---------- Services ---------- */
.services-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.service-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow); }

.service-image{
  display: block;
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: var(--bg-alt);
  padding: 10px;
  box-sizing: border-box;
}

.service-card-body{ padding: 26px 30px 30px; }

.service-card h3{ font-size: 1.08rem; margin-bottom: 14px; }

.service-card ul{ display: flex; flex-direction: column; gap: 9px; }
.service-card li{
  position: relative;
  padding-left: 18px;
  font-size: .89rem;
  color: var(--text-muted);
}
.service-card li::before{
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Project / commesse cards ---------- */
.cards-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.project-card{
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.project-card-new{ border-left-color: var(--blue); }
.project-tag{
  display: inline-block;
  background: rgba(29,78,121,.1);
  color: var(--blue);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.project-client{
  font-weight: 700;
  color: var(--navy);
  font-size: .88rem;
  margin-bottom: 6px;
}
.project-desc{
  font-size: .87rem;
  color: var(--text-muted);
  margin: 0;
}
.project-desc strong{
  color: var(--navy);
  font-weight: 700;
  display: inline-block;
  margin-top: 8px;
}

/* ---------- History table ---------- */
.table-wrap{
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.history-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: var(--bg);
  font-size: .86rem;
}
.history-table th{
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: 14px 16px;
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.history-table td{
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
}
.history-table tr:nth-child(even) td{ background: var(--bg-alt); }
.history-table td:first-child, .history-table td:nth-child(2){ color: var(--navy); font-weight: 600; }

/* ---------- Gallery ---------- */
.gallery-intro{
  max-width: 640px;
  color: var(--text-muted);
  margin-bottom: 36px;
}
.gallery-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.gallery-tile{
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
}
.gallery-tile svg{ color: var(--accent); opacity: .8; }
.gallery-tile span{
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 0 12px;
}

/* ---------- News ---------- */
.news-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}
.news-grid-single{
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
}
.news-card{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.news-tag{
  display: inline-block;
  background: rgba(224,96,42,.12);
  color: var(--accent-dark);
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.news-card h3{ font-size: 1.05rem; margin-bottom: 12px; }
.news-card p{ font-size: .9rem; color: var(--text-muted); }
.news-link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: .85rem;
  color: var(--blue);
}

.linkedin-follow{
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 28px;
}
.linkedin-follow svg{ flex: none; color: var(--accent); }
.linkedin-follow span{ flex: 1; min-width: 220px; font-size: .92rem; color: rgba(255,255,255,.9); }
.linkedin-follow .btn-outline-dark{ border-color: #fff; color: #fff; }
.linkedin-follow .btn-outline-dark:hover{ background: #fff; color: var(--navy); }

/* ---------- Certifications ---------- */
.cert-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 20px;
}
.cert-badge{
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cert-badge:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
  text-decoration: none;
}
.cert-icon{
  width: 68px;
  height: auto;
  flex: none;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.cert-badge h3{ font-size: 1rem; margin-bottom: 6px; }
.cert-badge p{ font-size: .85rem; color: var(--text-muted); margin: 0 0 10px; }
.cert-link{
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--blue);
}
.cert-badge:hover .cert-link{ color: var(--accent-dark); }
.cert-description{ max-width: 760px; color: var(--text-muted); margin-bottom: 44px; }
.cert-note{ font-size: .82rem; color: var(--text-muted); font-style: italic; }

/* ---------- Contact ---------- */
.contact-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.contact-block{ margin-bottom: 26px; }
.contact-block h3{ font-size: .95rem; color: var(--navy); margin-bottom: 8px; }
.contact-block p{ font-size: .92rem; color: var(--text-muted); }
.contact-block a{ color: var(--blue); font-weight: 600; }
.fine-print{ font-size: .8rem; line-height: 1.7; }

.contact-social{ display: flex; gap: 14px; }
.contact-social a{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .85rem;
}
.contact-social a:hover{ background: var(--accent-dark); text-decoration: none; }

.contact-map{
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  min-height: 380px;
}
.contact-map iframe{
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: 0;
}

/* ---------- Footer ---------- */
.site-footer{
  background: var(--navy-dark);
  color: rgba(255,255,255,.75);
  padding: 48px 0 28px;
}
.footer-inner{
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-brand{ display: flex; gap: 14px; align-items: flex-start; }
.footer-brand strong{ color: #fff; display: block; margin-bottom: 6px; }
.footer-brand p{ font-size: .85rem; color: rgba(255,255,255,.6); margin: 0; max-width: 320px; }

.footer-nav{
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-end;
  align-content: start;
}
.footer-nav a{ color: rgba(255,255,255,.75); font-size: .88rem; font-weight: 600; }
.footer-nav a:hover{ color: var(--accent); text-decoration: none; }

.footer-legal{
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  margin: 20px 0 0;
  text-align: center;
}

/* ---------- Back to top ---------- */
.back-to-top{
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, background .2s ease;
  z-index: 400;
}
.back-to-top.visible{ opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover{ background: var(--accent); }

/* ---------- Reveal on scroll ---------- */
.reveal{ opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible{ opacity: 1; transform: translateY(0); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px){
  .about-grid{ grid-template-columns: 1fr; }
  .about-side{ position: static; }
  .services-grid{ grid-template-columns: 1fr 1fr; }
  .cards-grid{ grid-template-columns: 1fr; }
  .gallery-grid{ grid-template-columns: repeat(2, 1fr); }
  .news-grid{ grid-template-columns: 1fr; }
  .cert-grid{ grid-template-columns: 1fr; }
  .contact-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 1260px){
  .brochure-download span{ display: none; }
  .brochure-download{ padding: 9px 11px; }
}

/* La riga di navigazione completa (7 voci + pulsante brochure + telefono) non
   ha spazio sufficiente sotto ~1020px: sotto questa soglia passa al menu ad hamburger
   invece di andare a capo o in overflow. */
@media (max-width: 1020px){
  .main-nav{
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 12px 24px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .main-nav.open{ display: flex; }
  .main-nav a{ padding: 12px 0; border-bottom: 1px solid var(--border); white-space: normal; }
  .nav-toggle{ display: flex; }
}

@media (max-width: 760px){
  .phone-quick span{ display: none; }
  .services-grid{ grid-template-columns: 1fr; }
  .footer-inner{ grid-template-columns: 1fr; }
  .footer-nav{ justify-content: flex-start; }
  .hero{ padding: 64px 0 56px; }
  .section{ padding: 64px 0; }
}

@media (max-width: 560px){
  .stats-grid{ grid-template-columns: 1fr; padding: 32px 20px; }
}

@media (max-width: 480px){
  .hero-cta{ flex-direction: column; align-items: stretch; }
  .hero-cta .btn{ justify-content: center; }
}
