/* ==========================================================================
   CMC - Consulting Makers Company
   Stile principale del sito
   ========================================================================== */

:root {
  /* Palette ispirata al logo / colori cavo di rete.
     Valori scuriti rispetto al logo originale (#28A73B/#24A0DB/#F07F30/#B97B58)
     per rispettare il contrasto minimo WCAG 2.1 AA (4.5:1) su testo e icone. */
  --color-green: #20862F;
  --color-blue: #1C7DAB;
  --color-orange: #C0570E;
  --color-brown: #A46745;

  --color-black: #1A1A1A;
  --color-white: #FFFFFF;
  --color-gray-100: #F5F5F5;
  --color-gray-300: #E0E0E0;
  --color-gray-600: #6B6B6B;

  --color-primary: var(--color-blue);
  --color-accent: var(--color-orange);
  --color-text: var(--color-black);
  --color-bg: var(--color-white);

  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --container-max: 1200px;
  --radius: 6px;
}

/* Reset di base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
}

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

/* ==========================================================================
   Accessibilita'
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  background-color: var(--color-black);
  color: var(--color-white);
  padding: 12px 20px;
  border-radius: var(--radius);
  z-index: 1000;
  font-weight: 700;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  border-bottom: 1px solid var(--color-gray-300);
  position: sticky;
  top: 0;
  background-color: var(--color-white);
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.site-logo img {
  height: 110px;
  width: auto;
}

.main-nav ul {
  display: flex;
  gap: 28px;
}

.main-nav a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 1.15rem;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-primary);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--color-text);
  border-radius: 2px;
}

/* ==========================================================================
   Hero / Sezioni comuni
   ========================================================================== */

.hero {
  background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-green) 100%);
  color: var(--color-white);
  padding: 70px 0;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 16px;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 700px;
  margin: 0 auto;
  opacity: 0.95;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px 56px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat-number {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.1;
}

.hero-stat-label {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-top: 4px;
}

.hero-stats-caption {
  margin-top: 20px;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ==========================================================================
   Mappa "Dove lavoriamo"
   ========================================================================== */

.italy-map-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.italy-map {
  width: 210px;
  height: auto;
  flex-shrink: 0;
}

.italy-map-dot {
  fill: var(--color-orange);
  stroke: var(--color-white);
  stroke-width: 5;
}

.italy-map-legend {
  max-width: 360px;
}

.italy-map-legend p {
  margin-bottom: 12px;
}

.italy-map-legend ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.italy-map-legend li {
  position: relative;
  padding-left: 18px;
  font-weight: 600;
}

.italy-map-legend li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-orange);
}

/* ==========================================================================
   CTA "Parla con noi"
   ========================================================================== */

.cta-section {
  background-color: var(--color-orange);
  color: var(--color-white);
  text-align: center;
  padding: 56px 0;
}

.cta-section h2 {
  margin-bottom: 12px;
}

.cta-section p {
  font-size: 1.1rem;
  margin-bottom: 28px;
  opacity: 0.95;
}

.cta-phone-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background-color: var(--color-white);
  color: var(--color-orange);
  font-weight: 700;
  font-size: 1.15rem;
  padding: 14px 32px;
  border-radius: var(--radius);
}

.cta-phone-btn:hover {
  background-color: var(--color-black);
  color: var(--color-white);
  text-decoration: none;
}

.cta-phone-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cta-phone-btn svg.icon-filled {
  stroke: none;
  fill: currentColor;
}

section {
  padding: 60px 0;
}

section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 24px;
}

.section-alt {
  background-color: var(--color-gray-100);
}

.text-placeholder {
  color: var(--color-gray-600);
  font-style: italic;
  border-left: 3px solid var(--color-orange);
  padding-left: 12px;
}

/* ==========================================================================
   Marchi/partner tecnologici (fascia a scorrimento)
   ========================================================================== */

.brands-section {
  padding-bottom: 20px;
}

.brands-marquee-wrap {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.brands-marquee-track {
  display: flex;
  align-items: center;
  gap: 64px;
  width: max-content;
  animation: brands-scroll 22s linear infinite;
}

.brands-marquee-track:hover {
  animation-play-state: paused;
}

.brand-item {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-gray-600);
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.brand-logo-img {
  height: 42px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

@keyframes brands-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .brands-marquee-track {
    animation: none;
  }
}

/* ==========================================================================
   Clienti
   ========================================================================== */

.clients-section {
  text-align: center;
}

.clients-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 28px;
}

.client-logo-placeholder {
  width: 160px;
  height: 80px;
  border: 2px dashed var(--color-gray-300);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-600);
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  padding: 8px;
}

.client-logo {
  width: 180px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

a.client-logo:hover {
  border-color: var(--color-blue);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.client-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Per loghi bianchi/chiari forniti su sfondo trasparente, altrimenti invisibili su sfondo chiaro */
.client-logo--dark {
  background-color: var(--color-black);
}

/* ==========================================================================
   Testimonianze
   ========================================================================== */

.testimonial-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
}

.testimonial-card::before {
  content: "\201C";
  font-size: 3rem;
  font-family: Georgia, serif;
  color: var(--color-orange);
  line-height: 1;
  display: block;
  margin-bottom: 8px;
}

.testimonial-quote {
  font-style: italic;
}

.testimonial-author {
  margin-top: 16px;
  font-weight: 700;
  color: var(--color-primary);
}

/* ==========================================================================
   Portfolio
   ========================================================================== */

.portfolio-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.portfolio-card {
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--color-white);
}

.portfolio-card-preview {
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--color-gray-300);
  background-color: var(--color-gray-100);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-gray-600);
  overflow: hidden;
}

.portfolio-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.portfolio-card-preview svg {
  width: 40px;
  height: 40px;
  stroke: var(--color-gray-300);
  fill: none;
  stroke-width: 1.5;
}

.portfolio-card-preview span {
  font-size: 0.85rem;
  font-style: italic;
}

.portfolio-card-body {
  padding: 20px;
}

.portfolio-card-body h3 {
  margin-bottom: 8px;
  color: var(--color-primary);
}

/* ==========================================================================
   I Nostri Lavori (pulsanti categorie + mosaico)
   ========================================================================== */

.lavori-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}

.lavori-tab {
  background-color: var(--color-white);
  border: 2px solid var(--color-gray-300);
  color: var(--color-gray-600);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  padding: 10px 26px;
  border-radius: 999px;
  cursor: pointer;
}

.lavori-tab:hover {
  border-color: var(--color-blue);
  color: var(--color-blue);
}

.lavori-tab:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

.lavori-tab.is-active {
  background-color: var(--color-blue);
  border-color: var(--color-blue);
  color: var(--color-white);
}

.lavori-masonry {
  columns: 3;
  column-gap: 14px;
}

.lavori-masonry-item {
  position: relative;
  break-inside: avoid;
  margin-bottom: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--color-gray-100);
}

.lavori-masonry-item img {
  width: 100%;
  height: auto;
  display: block;
}

.lavoro-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--color-gray-300);
  color: var(--color-gray-600);
  font-size: 0.8rem;
  font-style: italic;
  text-align: center;
  padding: 8px;
}

@media (max-width: 768px) {
  .lavori-masonry {
    columns: 2;
  }
}

@media (max-width: 480px) {
  .lavori-masonry {
    columns: 1;
  }
}

/* ==========================================================================
   In Evidenza (ex Offerte e Promozioni)
   ========================================================================== */

.offerte-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.offerta-card {
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--color-white);
}

.offerta-image {
  aspect-ratio: 3 / 4;
  background-color: var(--color-gray-100);
  overflow: hidden;
}

.offerta-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.offerta-image img.lightbox-trigger {
  cursor: zoom-in;
}

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  z-index: 1000;
  overflow: auto;
}

.lightbox-overlay.is-open {
  display: flex;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius);
  display: block;
  cursor: zoom-in;
  margin: auto;
}

.lightbox-img.is-zoomed {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  cursor: zoom-out;
  border-radius: 0;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--color-white);
  color: var(--color-black);
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background-color: var(--color-orange);
  color: var(--color-white);
}

.offerta-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--color-gray-300);
  color: var(--color-gray-600);
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  padding: 8px;
}

/* ==========================================================================
   Showcase servizi (righe alternate testo/riquadro)
   ========================================================================== */

.showcase-row {
  padding: 56px 0;
}

.showcase-row--green { background-color: #EAF7EC; }
.showcase-row--blue { background-color: #E8F5FC; }
.showcase-row--orange { background-color: #FDF1E6; }
.showcase-row--brown { background-color: #F6EEE8; }

.showcase-inner {
  display: flex;
  align-items: center;
  gap: 56px;
}

.showcase-inner.is-reverse {
  flex-direction: row-reverse;
}

.showcase-text {
  flex: 1 1 0;
  min-width: 0;
}

.showcase-text h3 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin-bottom: 14px;
}

.showcase-divider {
  width: 60px;
  height: 3px;
  border: none;
  margin: 20px 0;
  background-color: var(--color-gray-300);
}

.showcase-link {
  font-weight: 700;
}

.showcase-graphic {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.showcase-graphic--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-graphic svg {
  width: 34%;
  height: 34%;
  stroke: var(--color-white);
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.showcase-graphic--blue { background: linear-gradient(135deg, var(--color-blue), var(--color-green)); }
.showcase-graphic--orange { background: linear-gradient(135deg, var(--color-orange), var(--color-brown)); }
.showcase-graphic--brown { background: linear-gradient(135deg, var(--color-brown), var(--color-orange)); }
.showcase-graphic--green { background: linear-gradient(135deg, var(--color-green), var(--color-blue)); }

@media (max-width: 768px) {
  .showcase-inner,
  .showcase-inner.is-reverse {
    flex-direction: column;
  }

  .showcase-row {
    padding: 40px 0;
  }
}

/* Griglia servizi / target clienti */
.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius);
  padding: 24px;
}

.card h3 {
  color: var(--color-primary);
  margin-bottom: 10px;
}

.card--green { border-top: 4px solid var(--color-green); }
.card--blue { border-top: 4px solid var(--color-blue); }
.card--orange { border-top: 4px solid var(--color-orange); }
.card--brown { border-top: 4px solid var(--color-brown); }

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.card-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--color-white);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-icon-number {
  color: var(--color-white);
  font-size: 1.25rem;
  font-weight: 700;
}

.card--green .card-icon { background-color: var(--color-green); }
.card--blue .card-icon { background-color: var(--color-blue); }
.card--orange .card-icon { background-color: var(--color-orange); }
.card--brown .card-icon { background-color: var(--color-brown); }

/* Bottoni */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  background-color: var(--color-orange);
  color: var(--color-white);
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: var(--color-brown);
  text-decoration: none;
}

/* ==========================================================================
   Form di contatto
   ========================================================================== */

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: 2px solid var(--color-blue);
  outline-offset: 1px;
}

.form-msg {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.form-msg--success {
  background-color: #E6F6E9;
  color: #1E7E2C;
  border: 1px solid var(--color-green);
}

.form-msg--error {
  background-color: #FDECEA;
  color: #C0392B;
  border: 1px solid #C0392B;
}

/* ==========================================================================
   Mappa
   ========================================================================== */

.map-embed {
  margin-top: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-gray-300);
}

.map-placeholder {
  padding: 32px 24px;
  text-align: center;
  background-color: var(--color-gray-100);
}

.map-placeholder p {
  color: var(--color-gray-600);
  margin-bottom: 16px;
}

.map-embed iframe {
  display: block;
  width: 100%;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: var(--color-black);
  color: var(--color-gray-300);
  padding: 40px 0;
  margin-top: 40px;
}

.site-footer a {
  color: var(--color-white);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-blue);
  margin-top: 6px;
}

.social-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-white);
}

.social-icon:hover {
  background-color: var(--color-orange);
  text-decoration: none;
}

.social-icon--whatsapp {
  background-color: var(--color-green);
}

.social-icon--whatsapp:hover {
  background-color: var(--color-orange);
}

.social-icon--phone {
  background-color: var(--color-blue);
}

.social-icon--phone:hover {
  background-color: var(--color-orange);
}

.footer-contact-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.footer-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-line-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-gray-300);
}

.footer-bottom {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #333;
  font-size: 0.875rem;
  color: var(--color-gray-300);
}

.footer-bottom a {
  color: var(--color-gray-300);
}

/* ==========================================================================
   Torna su
   ========================================================================== */

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-blue);
  color: var(--color-white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  z-index: 150;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--color-orange);
}

.back-to-top svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 768px) {
  .back-to-top {
    right: 16px;
    bottom: 16px;
  }
}

/* ==========================================================================
   Cookie banner
   ========================================================================== */

.cookie-banner {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-black);
  color: var(--color-white);
  padding: 16px 0;
  z-index: 200;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-banner-inner p {
  margin: 0;
  font-size: 0.9rem;
}

.cookie-banner-inner a {
  color: var(--color-white);
  text-decoration: underline;
}

.cookie-banner-inner .btn {
  flex-shrink: 0;
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 12px 0;
  }

  .main-nav a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-gray-300);
  }

  .site-header .container {
    flex-wrap: wrap;
  }

  .site-logo img {
    height: 64px;
  }

  .hero {
    padding: 44px 0;
  }

  section {
    padding: 40px 0;
  }
}
