
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;700&display=swap');

#hexGrid {
  display: flex;
  flex-wrap: wrap;
  width: 80%;
  margin: 0 auto;
  overflow: hidden;
  font-family: 'Roboto', sans-serif;
  list-style-type: none;
  max-width: 1280px !important;
}

.hex {
  position: relative;
  visibility:hidden;
  outline:1px solid transparent; /* fix for jagged edges in FF on hover transition */
}

.hex::after{
  content:'';
  display:block;
  padding-bottom: 86.602%;  /* =  100 / tan(60) * 1.5 */
}

.hexIn{
  position: absolute;
  width:96%;
  padding-bottom: 110.851%; /* =  width / sin(60) */
  margin:0 2%;
  overflow: hidden;
  visibility: hidden;
  outline:1px solid transparent; /* fix for jagged edges in FF on hover transition */
  -webkit-transform: rotate3d(0,0,1,-60deg) skewY(30deg);
      -ms-transform: rotate3d(0,0,1,-60deg) skewY(30deg);
          transform: rotate3d(0,0,1,-60deg) skewY(30deg);
}

.hexIn * {
position: absolute;
visibility: visible;
outline:1px solid transparent; /* fix for jagged edges in FF on hover transition */
}

.hexLink {
  display:block;
  width: 100%;
  height: 100%;
  text-align: center;
  color: #fff;
  overflow: hidden;
  -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);
}

/*** HEX CONTENT **********************************************************************/

#hexagon-section {
  /*background-color: rgb(230,230,230, .6);*/
  background-color: rgb(231, 255, 253, 1);
  margin-top:0px;
}

.hex img {
  left: -100%;
  right: -100%;
  width: auto;
  height: 100%;
  margin: 0 auto;
  -webkit-transform: rotate3d(0,0,0,0deg);
      -ms-transform: rotate3d(0,0,0,0deg);
          transform: rotate3d(0,0,0,0deg);
}


/* ------------------- */                 
/*  wide screen
/* ------------------- */       
@media screen and (min-width: 1281px) {
  .hex h1 {
    color: #fff;
    width: 100%;
    height: 100%;
    background-color:rgba(73, 71, 71, 0.6);
    font-weight: 300;
    font-size: 22px !important;
    padding: 5%;
    -webkit-transition: -webkit-transform 1ms ease-out;
            transition: transform 1ms ease-out;
  }
  .hex h1 {
    bottom: -5.5%; /* this control the overlay text size */
    padding-top:28%;;
    z-index: 1;
    -webkit-transform:translate(0%,-100%);
        -ms-transform:translate(0%,-100%);
            transform:translate(0%,-100%);
  }
}
/* ------------------- */                  
/*  wide screen end
/* ------------------- */       


/* ------------------- */                     
/*  desktop
/* ------------------- */       
@media screen and (min-width: 861px) and (max-width: 1280px) {
  .hex h1 {
    color: #fff;
    width: 100%;
    height: 100%;
    background-color:rgba(73, 71, 71, 0.6);
    font-weight: 300;
    font-size: 18px !important;
    padding: 4%;
    -webkit-transition: -webkit-transform 1ms ease-out;
            transition: transform 1ms ease-out;
  }
  .hex h1 {
    bottom: -5.5%; /* this control the overlay text size */
    padding-top:32%;
    z-index: 1;
    -webkit-transform:translate(0%,-100%);
        -ms-transform:translate(0%,-100%);
            transform:translate(0%,-100%);
  }
}
/* ------------------- */                  
/*  desktop end
/* ------------------- */       

/* ------------------- */                  
/*  mobile
/* ------------------- */       
@media screen and (max-width: 860px) {
  .hex h1 {
    color: #fff;
    width: 100%;
    height: 100%;
    background-color:rgba(73, 71, 71, 0.6);
    font-weight: 300;
    font-size: 16px !important;
    padding: 4%;
    -webkit-transition: -webkit-transform 1ms ease-out;
            transition: transform 1ms ease-out;
  }
  .hex h1 {
    bottom: -5.5%; /* this control the overlay text size */
    padding-top:30%;
    z-index: 1;
    -webkit-transform:translate(0%,-100%);
        -ms-transform:translate(0%,-100%);
            transform:translate(0%,-100%);
  }
}
/* ------------------- */                   
/*  mobile end
/* ------------------- */       


.hex h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0%;
  width: 100%;
  text-align: center;
}

.hex p {
  width: 100%;
  height: 100%;
  padding-top: 46%;
  text-align: center;
  font-weight: 400;
  font-size: 20px;
  color: rgb(255, 255, 255, 1);
}

/*** HOVER EFFECT  **********************************************************************/
.hexLink:hover h1, .hexLink:focus h1 {
  -webkit-transform:translate(0%,0%);
      -ms-transform:translate(0%,0%);
          transform:translate(0%,0%);
}

/*** HEXAGON SIZING AND EVEN ROW INDENTATION *****************************************************************/
@media (min-width:1201px) { /* <- 5 hexagons per row */
  #hexGrid{
    padding-bottom: 15%;
  }
  .hex {
    width: 18.18%; /* = 100 / 5.5 */
  }
  .hex:nth-child(10n+6) { /* first and second row of hexagons is 5, total is 10, give margin-left at 6th position */
    margin-left: 9.09%; /* = width of .hex 18.18% / 2  to indent even rows */
  }
}

@media (max-width: 1200px) and (min-width:901px) { /* <- 4 hexagons per row */
  #hexGrid{
    padding-bottom: 15%;

  }
  .hex {
    width: 22.2%; /* = 100 / 4.5 */
  }
  .hex:nth-child(8n+5){ /* two rows is 8, add margin-left at 5th */
    margin-left: 11.1%;  /* = width of .hex 22.2% / 2  to indent even rows */
  }
}

@media (max-width: 900px) and (min-width:601px) { /* <-  3 hexagons per row */
  #hexGrid{
    padding-bottom: 15%
  }
  .hex {
    width: 28.57%; /* = 100 / 3.5 */
  }
  .hex:nth-child(6n+4){ /* first hexagon of even rows */
    margin-left: 14.285%;  /* = width of .hex / 2  to indent even rows */
  }
}

@media (max-width: 600px) { /* <- 2 hexagons per row */
  #hexGrid{
    padding-bottom: 15%;
  }
  .hex {
    width: 40%; /* = 100 / 2.5 */
  }
  .hex:nth-child(4n+3){ /* first hexagon of even rows */
    margin-left:20%;  /* = width of .hex / 2  to indent even rows */
  }

  /*
  .hex p {
    width: 100%;
    height: 100%;
    padding-top: 26%;
    text-align: center;
    font-weight: 800;
    font-size: 4.2em;
    font-family: 'Coda Caption', sans-serif;
  }
  */
  /*
  .hex p {
    width: 100%;
    height: 100%;
    padding-top: 45%;
    text-align: center;
    font-weight: 700;
    font-size: 28px;
    font-family: "Roboto Condensed", sans-serif;
  }
  */
}

@media (max-width: 400px) {
  #hexGrid {
      font-size: 12px;
  }
}


