/* ==============================
   GLOBAL STYLES – SQUARE ARCHITECTS
   ============================== */

/* Rimuovi le variabili CSS ridondanti */

html,
body {
  overflow-x: hidden;
}

body {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 300;
  line-height: 130%;
  background-color: #fff;
}

/* 1. Forza tutte le immagini del sito ad avere il cursore standard */
img {
    cursor: default;
}

/* 2. Se l'immagine è contenuta in un link (<a>), allora mostra la manina */
a img, 
a {
    cursor: pointer;
}

/* 3. Se usi librerie come GLightbox o simili che usano attributi specifici 
      ma magari non il tag <a> in certi casi (raro), aggiungiamo una sicurezza: */
[onclick] {
    cursor: pointer;
}

.hero-banner-404 {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.padding-sezione {
  padding: 0 20px;
}

.px-vw-5 {
  padding-left: 5vw !important;
  padding-right: 5vw !important;
}

:root {
  --bs-primary: #1f414f;
  --bs-secondary: #d1664e;
  --bs-neutral: #222222;
  --bs-font-primary: "Space Grotesk", sans-serif;
  --link-decoration: none;

  /* Font sizes */
  --font-h1: 90px;
  --font-h2: 75px;
  --font-h3: 50px;
  --font-h4: 31px;
  --font-caption: 23px;
  --font-body: 18px;

  /* Line heights */
  --line-h1: 110%;
  --line-h2: 90%;
  --line-h3: 108%;
  --line-h4: 120%;
  --line-caption: 120%;
  --line-body: 130%;
}

.margin-top-sezione {
  margin-top: 150px !important;
}

.border-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  border-top: none;
  border-bottom: none;
  pointer-events: none;
  z-index: 9999;
  box-sizing: border-box;
  background-color: transparent !important;
  /* ✅ MAX-WIDTH con centratura e padding rispettati */
  width: min(100%, 1920px);
  left: 50%;
  transform: translateX(-50%);
  padding-left: 5vw;
  padding-right: 5vw;
}

.border-overlay::before,
.border-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: black;
}

.border-overlay::before {
  left: 5vw;
}

.border-overlay::after {
  right: 5vw;
}

/* ✅ MAX-WIDTH PER MAIN */
main {
  max-width: 1920px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Banner - sfondo a tutta larghezza, contenuto centrato */
.hero-banner,
.hero-progetto {
  position: relative;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding-left: calc(50vw - 50%);
  padding-right: calc(50vw - 50%);
}

/* Assicurati che il container interno mantenga il padding corretto */
.hero-banner .container-fluid {
  padding-left: 5vw;
  padding-right: 5vw;
}

.hero-progetto .container-fluid {
  padding-left: 5vw;
  padding-right: 5vw;
}

/* ✅ MAX-WIDTH per contenitori principali */
main,
header .container-fluid,
footer .footer-top,
footer .footer-bottom-container,
footer .footer-section {
  max-width: 1920px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Hero section - sfondo video a tutta larghezza, contenuto centrato */
.hero-section {
  position: relative;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding-left: calc(50vw - 50%);
  padding-right: calc(50vw - 50%);
  width: auto !important;
}

/* Il background video deve compensare i padding */
.hero-section .hero-background {
  left: calc(-50vw + 50%);
  right: calc(-50vw + 50%);
}

/* Assicurati che il container interno mantenga il padding corretto */
.hero-section .container-fluid {
  padding-left: 5vw;
  padding-right: 5vw;
}

.h1-hero {
  font-size: 90px !important;
  margin-top: 4.5rem;
}

.h1 {
  font-size: var(--font-h1);
  line-height: var(--line-h1);
  color: var(--bs-primary);
  font-weight: 400;
}
.h2 {
  font-size: var(--font-h2);
  line-height: var(--line-h2);
  color: var(--bs-primary);
  text-transform: uppercase;
  font-weight: 400;
}
.h3 {
  font-size: var(--font-h3);
  line-height: var(--line-h3);
  color: var(--bs-neutral);
}
.h4 {
  font-size: var(--font-h4);
  line-height: var(--line-h4);
  color: var(--bs-neutral);
  text-align: justify;
  font-weight: 400;
}
.caption {
  font-size: var(--font-caption);
  line-height: var(--line-caption);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--bs-neutral);
  font-weight: 400;
}
.body {
  font-size: var(--font-body);
  line-height: var(--line-body);
  color: var(--bs-neutral);
  font-weight: 300;
}
a {
  color: var(--link-color);
  text-decoration: var(--link-decoration);
  font-weight: 300 !important;
}
a:hover {
  color: var(--bs-secondary);
  text-decoration: var(--link-decoration);
  font-weight: 300 !important;
}

.navbar-border {
  border-bottom: 1px solid var(--bs-neutral);
}

/* ==============================
   Footer Custom Styles
   ============================== */

.footer-top {
  padding-top: 50px;
}

.footer-legal-link-wrapper,
.credits-wrapper {
  height: 100%;
}

.contenitore-interno-bordo {
  border-top: 1px solid var(--bs-neutral);
}

.contenitore-credito-wider {
  display: flex;
  align-items: center; /* ✅ Fa crescere gli elementi all'altezza del contenitore */
  justify-content: flex-end;
  gap: 20px;
  min-height: 50px; /* ✅ Altezza minima per il separatore */
}

.menu-gap {
  gap: 70px !important;
}

/* ========================================
   FOOTER BOTTOM SECTION
   ======================================== */

.footer-bottom-container {
  width: 100%;
}

.footer-bottom-section .row {
  position: relative;
}

/* Links Legali */
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.footer-legal-link {
  color: var(--bs-text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-legal-link:hover {
  color: var(--bs-secondary);
}

.separator {
  color: var(--bs-neutral, #666);
  margin: 0 0.25rem;
}

/* ========================================
   CREDITS
   ======================================== */

.footer-credits {
  color: var(--bs-text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-credits:hover {
  color: var(--bs-secondary);
}

/* ========================================
   FOOTER SEPARATOR - Elemento Indipendente
   ======================================== */

.footer-separator {
  width: 1px;
  align-self: stretch; /* ✅ Si estende per tutta l'altezza */
  background-color: var(--bs-neutral);
  flex-shrink: 0;
}

/* Helpers */
.text-balance {
  text-wrap: balance;
}

/* STILE CURSORE PERSONALIZZATO */

#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 35px;
  height: 35px;
  border: 2px solid #2f6f73; /* colore petrolio */
  border-radius: 2px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease-out, width 0.2s ease, height 0.2s ease,
    border-color 0.2s ease;
  mix-blend-mode: difference; /* effetto difference su sfondi scuri */
  z-index: 9999;
  opacity: 0;
}

#custom-cursor.cursor-small {
  width: 18px;
  height: 18px;
}

.animated-text {
  cursor: pointer;
}

.link-hover-char {
  will-change: transform;
}

/* ========================================
   ANIMAZIONE WIPE UP - Rivelazione dal basso
   ======================================== */

.animate-wipe-up {
  overflow: hidden;
}

.animate-wipe-up-inner {
  display: block;
  transform: translateY(100%);
  opacity: 0;
}

/* Per mantenere il blocco su elementi block */
.animate-wipe-up.block-element {
  display: block;
}

/* ========================================
   STILE CTA LINK
   ======================================== */

.cta-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  background-color: transparent;
  color: var(--bs-primary);
  text-decoration: none;
  transition: color 0.25s ease;
  padding-right: 30px;
}

/* Stato iniziale per animazione wipe-up sui CTA */
.cta-link.animate-wipe-up {
  opacity: 0;
  transform: translateY(60px);
  overflow: visible; /* ✅ IMPORTANTE: override per i CTA */
}

/* Variante freccia bianca */
.cta-link--white::after {
  color: #fff;
}

/* Variante freccia nera */
.cta-link--black::after {
  color: var(--bs-primary);
}

/* testo */
.cta-link span {
  position: relative;
  z-index: 3;
  padding-right: 8px;
  color: var(--bs-primary);
}

/* QUADRATO (sfondo) */
.cta-link::before {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) scale(1);
  transform-origin: right center;
  width: 22px;
  height: 22px;
  background-color: var(--bs-secondary);
  border-radius: 0;
  z-index: 1;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    width 0.35s ease;
}

/* FRECCIA */
.cta-link::after {
  content: "➝";
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  z-index: 2;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

/* Hover */
.cta-link:hover::before {
  transform: translateY(-50%) scale(1.5);
}

.cta-link:hover::after {
  transform: translateY(-50%) translateX(4px);
}

/* STILE CTA PRIMARY */
.cta-primary {
  position: relative;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 90px;
  width: inherit !important;
  height: 80px;
  gap: 15.872px;
  border: 1px solid var(--bs-neutral);
  border-top: none;
  border-bottom: none;
  background: transparent;
  color: var(--bs-neutral);
  font-family: var(--bs-font-primary);
  font-size: var(--font-body);
  cursor: pointer;
  overflow: hidden;
  z-index: 1;
  transition: color 0.3s ease;
}

/* Stato iniziale per animazione wipe-up sui CTA Primary */
.cta-primary.animate-wipe-up {
  opacity: 0;
  transform: translateY(60px);
}

/* Quadrato arancione */
.cta-primary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 83.019px;
  height: 83.019px;
  background: var(--bs-secondary);
  z-index: -1;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover: il quadrato si allunga per coprire tutto il bottone */
.cta-primary:hover::before {
  width: 100%;
  height: 100%;
}

/* Testo diventa bianco al hover */
.cta-primary:hover {
  color: #fff;
}

/* Wrapper per animazione wipe-up delle card */
.card-wrapper {
  overflow: hidden;
  display: block;
  height: 100%;
}

.card-wrapper .card {
  transform: translateY(100%);
  opacity: 0;
}
.progetto-card.animating .progetto-overlay {
  pointer-events: none;
  opacity: 0 !important;
}

.progetto-card:not(.animating):hover .progetto-overlay {
  opacity: 1;
}

/* Wrapper per animazione wipe-up dell'accordion */
.accordion-wrapper {
  overflow: hidden;
  display: block;
}

.accordion-wrapper .gruppo-accordion {
  transform: translateY(100%);
  opacity: 0;
}

/* Animazione reveal team cards con clip-path */
.team-card-item {
  overflow: visible;
}

.team-foto-parallax {
  clip-path: inset(100% 0 0 0); /* ✅ Nascosta dal basso */
  will-change: clip-path;
}

.team-image-parallax {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-meta-parallax {
  transform: translateY(30px);
  opacity: 0;
  will-change: transform, opacity;
}

/* Animazione mosaico progetti - solo immagini */
.progetto-card-animate {
  overflow: hidden;
}

.progetto-image-wrapper {
  clip-path: inset(100% 0 0 0);
  width: 100%;
  height: 100%;
}

/* Animazione loghi partner */
.loghi-section-animate {
  overflow: hidden;
}

.logo-flip-box-animate {
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
}

/* Animazione sezione immagine e testo */
.immagine-testo-clip-animate {
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
  overflow: hidden;
}

/* Animazione sezione contatti */
.contatti-box-animate {
  opacity: 0;
  transform: translateY(80px);
}

.contatti-form-animate {
  opacity: 0;
  transform: translateX(100px);
}

/* LENIS JS LIBRERIA STILE */

html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

/* ========================================
   SCROLLBAR PERSONALIZZATA (solo desktop)
   ======================================== */

@media (min-width: 1200px) {
  /* Overscroll behavior solo su desktop */
  body {
    overscroll-behavior: none;
  }

  /* Firefox */
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--bs-primary) transparent;
  }

  /* Chrome, Edge, Safari */
  ::-webkit-scrollbar {
    width: 8px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background-color: var(--bs-primary);
    border-radius: 0;
    transition: background-color 0.3s ease;
  }

  ::-webkit-scrollbar-thumb:hover {
    background-color: var(--bs-secondary);
  }

  /* Scrollbar orizzontale (se necessaria) */
  ::-webkit-scrollbar:horizontal {
    height: 8px;
  }
}

/* ========================================
   SCROLL NATIVO SU MOBILE/TABLET
   ======================================== */

@media (max-width: 1199px) {
  html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }
  
  /* Rimuovi scrollbar personalizzata su mobile/tablet */
  ::-webkit-scrollbar {
    width: auto !important;
  }
  
  * {
    scrollbar-width: auto !important;
    scrollbar-color: auto !important;
  }
}


@media (min-width: 1200px) and (max-width: 1440px) {
  .footer-top .col-12.col-md-6.col-lg-4 {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Allinea all'inizio della colonna */
  }

  .footer-menu {
    padding-left: 0 !important; /* Rimuove padding automatico */
    margin-left: 0 !important;  /* Rimuove margine sinistro */
  }
}

/* ========================================
   RESPONSIVE - TABLET (768px - 1024px)
   BREAKPOINT UFFICIALE
   ======================================== */
@media (min-width: 768px) and (max-width: 1024px) {
  /* ========== TIPOGRAFIA ========== */
  .h1 {
    font-size: 70px;
  }
  .h2 {
    font-size: 55px;
  }
  .h3 {
    font-size: 40px;
  }
  .h4 {
    font-size: 26px;
  }
  .caption {
    font-size: 20px;
  }
  .body {
    font-size: 17px;
  }
  .h1-hero {
    font-size: 60px !important;
  }

  /* ========== PADDING E SPAZIATURA ========== */
  /* Riduci padding laterale per ottimizzare lo spazio */
  .px-vw-5 {
    padding-left: 3vw !important;
    padding-right: 3vw !important;
  }

  .margin-top-sezione {
    margin: 50px 0 !important;
  }

  .padding-sezione {
    padding: 0 3vw !important;
  }

  /* ========== BORDER OVERLAY ========== */
  .border-overlay {
    padding-left: 3vw;
    padding-right: 3vw;
  }

  .border-overlay::before {
    left: 3vw;
  }

  .border-overlay::after {
    right: 3vw;
  }

  #menu-menu-navbar-1,
  .social-icons {
    padding-left: 3.5rem !important;
  }

  /* ========== HERO SECTIONS ========== */
  .hero-banner .container-fluid,
  .hero-progetto .container-fluid,
  .hero-section .container-fluid {
    padding-left: 3vw !important;
    padding-right: 3vw !important;
  }

  /* ========== CTA BUTTONS ========== */
  .cta-primary {
    width: 100%;
    padding: 0 60px !important;
  }

  .cta-lavora-wide {
    border-bottom: 1px solid var(--bs-neutral) !important;
  }

  #mobileMenu .cta-primary {
    border-bottom: 1px solid var(--bs-neutral);
    border-top: 1px solid var(--bs-neutral);
  }

  /* ========== LAYOUT ========== */
  .paragrafo-full-width {
    width: 100% !important;
  }

  .contenitore-interno {
    border-bottom: 1px solid var(--bs-neutral) !important;
    border-left: none !important;
  }

  /* ========== FOOTER ========== */
  /* Footer padding */
  .footer-top .padding-sezione,
  .footer-bottom-section .padding-sezione {
    padding: 0 3vw !important;
  }

  /* Menu gap ridotto */
  .menu-gap {
    gap: 40px !important;
  }

  /* Logo footer */
  .logo-footer {
    height: 80px !important;
  }

  /* Allinea le colonne "Dove Siamo/Chiamaci" e "Link Veloci" in alto */
  .footer-top .row > [class*="col-"] {
    align-self: flex-start !important;
  }

  /* Rimuovi margin-top auto dalle colonne su tablet */
  .footer-top .row > [class*="col-"] > div {
    margin-top: 0 !important;
  }

  /* Aggiungi spacing tra le sezioni */
  .footer-top .col-12.col-md-12.col-lg-4 {
    margin-bottom: 3rem;
  }

  .footer-top .col-12.col-md-6.col-lg-4 {
    margin-bottom: 2rem;
  }

  /* Footer Bottom - Layout ottimizzato */
  .footer-bottom-section .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }

  .footer-bottom-section .col-12.col-md-6:first-child {
    flex: 0 1 auto;
    max-width: fit-content;
  }

  .footer-bottom-section .col-12.col-md-6:last-child {
    flex: 0 0 auto;
    margin-left: auto;
    text-align: right !important;
  }

  /* Links legali su una linea */
  .footer-legal-links {
    flex-wrap: nowrap !important;
    white-space: nowrap;
  }

  .footer-legal-link {
    flex-shrink: 0;
    font-size: 15px;
  }

  .separator {
    flex-shrink: 0;
    margin: 0 0.5rem;
  }

  /* Credits a destra */
  .contenitore-credito-wider {
    gap: 15px !important;
    white-space: nowrap;
    justify-content: flex-end !important;
  }

  .footer-credits {
    font-size: 15px;
  }
}

/* ========================================
   RESPONSIVE - MOBILE (max 767px)
   ======================================== */
@media (max-width: 767px) {
  /* Nascondi separatore su mobile */
  .footer-top .padding-sezione,
  .footer-bottom-section .padding-sezione {
    padding: 0 10px !important;
  }

  .footer-separator {
    display: none;
  }

  .footer-bottom-section .col-12 {
    text-align: center !important;
  }

  .footer-legal-links {
    justify-content: center;
  }

  .contenitore-credito-wider {
    justify-content: center;
  }

  .credits-wrapper {
    margin-top: 1rem;
  }
}

/* ========================================
   RESPONSIVE - MOBILE (max 640px)
   ======================================== */
@media (max-width: 640px) {
  .h1 {
    font-size: 60px;
  }
  .h2 {
    font-size: 37px;
  }
  .h3 {
    font-size: 32px;
  }
  .h4 {
    font-size: 26px;
  }
  .caption {
    font-size: 18px;
  }
  .body {
    font-size: 16px;
  }

  /* ✅ CTA PRIMARY - STILE MOBILE */
  .cta-primary {
    width: 100%;
    border-bottom: 1px solid var(--bs-neutral) !important;
    padding: 0 !important;
    justify-content: flex-start !important;
  }

  .contenitore-interno {
    border: none !important;
    border-top: 1px solid var(--bs-neutral) !important;
  }

  .cta-primary span {
    padding-left: 85px;
  }

  .margin-top-sezione {
    margin-top: 70px !important;
  }
  .padding-sezione {
    padding: 0 !important;
  }
  .h1-hero {
    font-size: 60px !important;
    margin-top: 5.5rem;
  }
}

/* ========================================
   RESPONSIVE - MOBILE PICCOLO (max 340px)
   ======================================== */
@media (max-width: 340px) {
  .h1 {
    font-size: 45px;
  }
  .h2 {
    font-size: 33px;
  }
  .h3 {
    font-size: 27px;
  }
  .h4 {
    font-size: 23px;
  }
  .caption {
    font-size: 18px;
  }
  .body {
    font-size: 16px;
  }
  .margin-top-sezione {
    margin-top: 70px !important;
  }
  .padding-sezione {
    padding: 0 !important;
  }
  .h1-hero {
    font-size: 50px !important;
    margin-top: 5.5rem;
  }
}
