﻿
#hexGrid {
  display: flex;
  flex-wrap: wrap;
  width: 65%;
  margin: 2% auto;
  overflow: hidden;
  font-size: 15px;
  list-style-type: none;
}

.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;
    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);
}

/***JF***/
.overlay-fade {
  position: absolute;
  overflow: hidden;
  opacity: 0;
  transition: .5s ease;
  background-color: #009fe3; 
}
.overlay-fade-pink {
  position: absolute;
  overflow: hidden;
  opacity: 0;
  transition: .5s ease;
  background-color: #e6007e; 
}

.hexIn:hover .overlay-fade {
  opacity: 1;
}
.hexIn:hover .overlay-fade-pink {
  opacity: 1;
}

/*** HEX CONTENT **********************************************************************/
.hex img {
  left: -100%;
  right: -100%;
  margin: 0 auto;
 }

.hex p {
  width: 100%;
  padding: 5%;
  box-sizing:border-box;
  -webkit-transition:  -webkit-transform .2s ease-out, opacity .3s ease-out;
          transition:          transform .2s ease-out, opacity .3s ease-out;
	position: relative;
	top: 50%;
	transform: translateY(-50%);
	margin:0 auto;
	color: #fff;
	font-size:20pt;
}

@media (min-width:768px) and (max-width:1399px) {
.hex p {
		font-size: 16px
		}
	}

/*** HEXAGON SIZING AND EVEN ROW INDENTATION *****************************************************************/

@media (min-width:601px) { /* <- 3-2  hexagons per row */
  #hexGrid{
    padding-bottom: 5.5%
  }
  .hex {
    width: 33.333%; /* = 100 / 3 */
  }
  .hex:nth-child(6){ /* first hexagon of even rows */
    margin-left:16.666%;  /* = width of .hex / 2  to indent even rows */
  }
  .hex:nth-child(1){ /* first hexagon*/
    margin-left:16.666%;  /* = width of .hex / 2  to indent*/
  }
}

/*@media (max-width: 900px) and (min-width:601px) { /* <- 3-2  hexagons per row 
  #hexGrid{
    padding-bottom: 7.4%
  }
  .hex {
    width: 33.333%; /* = 100 / 3 
  }
  .hex:nth-child(5n+4){ /* first hexagon of even rows 
    margin-left:16.666%;  /* = width of .hex / 2  to indent even rows 
  }
}*/

@media (max-width: 600px) { /* <- 2-1  hexagons per row */
  #hexGrid{
    padding-bottom: 11.2%
  }
  .hex {
    width: 50%; /* = 100 / 3 */
  }
  .hex:nth-child(6){ /* first hexagon of even rows */
    margin-left:25%;  /* = width of .hex / 2  to indent even rows */
  }
  .hex:nth-child(1){ /* first hexagon of even rows */
    margin-left:25%;  /* = width of .hex / 2  to indent even rows */
  }
}

@media (max-width: 400px) {
    #hexGrid {
        font-size: 13px;
    }
}

