:root {
  --hex-height: calc(25vh);
  --hex-width: calc(var(--hex-height) / 1.155);
  --hex-logo-height: calc(40vh);
  --hex-logo-width: calc(var(--hex-logo-height) / 1.155);
  
  --hex-margin-lato: 10px; /* stacca di tot pixel gli esagoni dai due lati del centrale */
  --hex-margin-angolo: 30px; /* stacca di tot pixel gli esagoni nell'angolo dall'esagono in basso/alto */
}

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

html {
  height: 100%;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Garantisce che l'altezza della pagina sia almeno quella dello schermo */
  margin: 0; /* Rimuove margini indesiderati */
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  justify-content: center;
	align-items: center;

  display: flex;
  flex-direction: column;
  flex:1;
}

/* Sfondo */
#backgroundImg {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height:100%;
  width:100%;
}

#backgroundImg::before {
  background-image: url("img/sfondo.jpeg");
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0.5;
}

/* Creazione degli esagoni */
.hex-circle {
  padding-top: 2%;
  padding-bottom: 2%;
  margin-bottom: 1%;
  margin-top: 5%;
  position: relative;
  height: calc(var(--hex-height)*2 + var(--hex-logo-height));
  display:flex;
  justify-content: center;
  align-items: center;
  align-self: center;
}

.hex {
  position: absolute;
  width: var(--hex-width);
  height: var(--hex-height);
  background-color: #ccc;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: transform 0.3s, background-color 0.3s;
  border-radius: 20px;
  background-image: center center;
}

#logo{
  width: var(--hex-logo-width);
  height: var(--hex-logo-height);
  background-color: #999;
}





.hex:nth-child(1) { transform: translate(0, calc(-1*(var(--hex-logo-height)/2 + var(--hex-height)/2))); } /* hex sopra */
.hex:nth-child(2) { transform: translate(calc(var(--hex-width) + var(--hex-margin-angolo)), calc(var(--hex-height)*(-1))); } /* hex in alto a destra */
.hex:nth-child(3) { transform: translate(calc((var(--hex-logo-width)/2 + var(--hex-width)/2) + var(--hex-margin-lato)), 0); } /* hex a destra */
.hex:nth-child(4) { transform: translate(calc(var(--hex-width) + var(--hex-margin-angolo)), var(--hex-height)); } /* hex in basso a destra */
.hex:nth-child(5) { transform: translate(0, calc(var(--hex-logo-height)/2 + var(--hex-height)/2)); } /* hex sotto */
.hex:nth-child(6) { transform: translate(calc((var(--hex-width) + var(--hex-margin-angolo))*(-1)), var(--hex-height)); } /* hex in basso a sinistra */
.hex:nth-child(7) { transform: translate(calc(((var(--hex-logo-width)/2 + var(--hex-width)/2) + var(--hex-margin-lato))*(-1)), 0); } /* hex a sinistra */
.hex:nth-child(8) { transform: translate(calc((var(--hex-width) + var(--hex-margin-angolo))*(-1)), calc(var(--hex-height)*(-1))); } /* hex in alto a sinistra */

/* Contenuto degli esagoni */
.hexIn{
  position: relative;
  display: flex;
  justify-content: center; /* Centra orizzontalmente */
  align-items: center; /* Centra verticalmente */
  width: 96%;
  height: 96%;
  margin: 2%;
  transform: rotate3d(0, 0, 1, -60deg) skewY(30deg);
  background-color: transparent; /* Mantieni trasparente */
  overflow: hidden;
}


.hexLink {
  display:flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  justify-content: center; /* Centra orizzontalmente */
  align-items: center; /* Centra verticalmente */
  text-align: center;
  background-color: transparent;
}

#logo .hexLink {
  -webkit-transform: skewY(-30deg) rotate3d(0,0,1,60deg);
      -ms-transform: skewY(-30deg) rotate3d(0,0,1,60deg);
          transform: skewY(-30deg) rotate3d(0,0,1,60deg);
}

.hexLink img {
  object-fit:cover;
  width: 95%;
  height: 95%;
  position:fixed;
  z-index: 1;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

#logo img {
  width: 100%;
  height: 100%;
  object-fit:cover;
  position:fixed;
  z-index: 1;
}

.img:before, .img:after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  content: '';
  opacity: 0;
  transition: opacity 0.5s;
}


.hex h1 {
  margin: 0; /* Rimuove margini predefiniti */
  line-height: 1.2; /* Regola l'interlinea */
  text-align: center; /* Centra il testo orizzontalmente */
  z-index: 2; /* Mantieni sopra gli altri elementi */
  color: #F5CE95; /* Colore del testo */
  font-size: 1.2vw; /* Dimensione del font */
  font-weight: bold;
  opacity: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  padding-left: 2%;
  padding-right: 2%;
  margin-left: 2%;
  margin-right: 2%;
  font-family: 'nobile', sans-serif;
}

#hexLavori h1 {
  opacity: 1;
  color: #F5CE95;
  font-size: 1.5rem;
  -webkit-text-stroke: 0.2px rgb(0, 0, 0);
  font-weight: bold;
  font-family: 'nobile', sans-serif;
  
  
}

#hexLavori {
  background-color: #c1c1c1;
}

/* Effetti hover */
.hex:hover {
  background-color: #666;
}

.hex a {
  text-decoration: none;
}

#logo:hover {
  transform: scale(1.2);
}

.hexLink:hover h1 {
  opacity:1;
  transition: 0.5s;
}

.hexLink:hover img {
  opacity: 0.4;
}

#logo:hover img {
  opacity: 1;
}

#hexLavori:hover {
  background-color: #666;
}
/* Responsiveness */
@media (max-width: 800px) {
  :root {
    --hex-width: calc(20vw);
    --hex-height: calc(var(--hex-width) * 1.155);
    --hex-logo-width: calc(35vw);
    --hex-logo-height: calc(var(--hex-logo-width) * 1.155);
  }

  .hexLink:hover h1 {
    opacity: 0;
  }

  #hexLavori h1 {
    font-size: 1rem;
  }
}

/* Footer */
.footer {
  position: relative;
  bottom: 0;
  left: 0;
  padding: 1rem 0;
  background: #222;
  color: white;
  text-align: center;
  z-index: 1;
  width: 100%;
}

