/*
 * KomenskyGalerieCSS
 * 
 * © 2024 eKultura, z.s. Všechna práva vyhrazena.
 * 
 * Tento soubor je součástí projektu eKultura a je chráněn autorskými právy. 
 * Jakékoli neautorizované kopírování, úpravy nebo distribuce tohoto souboru jsou zakázány.
 * 
 * Spolek eKultura, z.s. se věnuje digitalizaci kulturního dědictví a propagaci české kultury 
 * prostřednictvím moderních technologií.
 * 
 * Web: https://ekultura.eu
 * Email: media@ekultura.eu
 * Email: martin.kucera@ekultura.eu
 * 
 * Vytvořeno: 2024
 */
 
 /*.Sekce { // Vycentrování Galérie
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}*/

#HexMrizka {
  display: flex;
  flex-wrap: wrap;
  width: 90%;
  margin: 0 auto;
  overflow: hidden;
  font-family: sans-serif;
  list-style-type: none;
  padding-bottom: 10px;
  align-items: flex-start; // justify-content: center;
}

.Hex {
  position: relative;
  visibility: hidden;
  outline: 1px solid transparent;
  transition: all 0.5s;
  backface-visibility: hidden;
  will-change: transform;
  transition: all 0.5s;
}
.Hex::after {
  content: '';
  display: block;
  padding-bottom: 88%; //86.602%;
}
.HexVevnitr {
  position: absolute;
  width: 96%;
  padding-bottom: 110.851%;
  margin: 2%;
  overflow: hidden;
  visibility: hidden;
  outline: 1px solid transparent;
  -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);
  transition: all 0.5s;
}
.HexVevnitr * {
  position: absolute;
  visibility: visible;
  outline: 1px solid transparent;
}
.HexOdkaz {
  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 img {
  left: -100%;
  right: -100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0 auto;
}

.Hex h3, .Hex p {
  width: 90%;
  padding: 0;
  padding-left: 10px; 
  box-sizing: border-box;
  justify-content: center;
  font-weight: 300;
  opacity: 0;
}

#Nadpis1 {
  color: #eee;// #F5CE95
  text-transform: capitalize;
  text-align: center;
  bottom: 50%;
  padding-top: 50%;
  font-size: 1.5em;
  z-index: 1;
}
.Hex h3:before, .Hex h3:after {
  /*display: inline-block;
  margin: 0 0.5em;
  width: 0.25em;
  height: 0.03em;
  background: #ffffff;
  content: '';
  vertical-align: middle;
  transition: all 0.3s;
  text-align: center;*/
}

#Popis1 {
  top: 50%;
  text-align: center;
  /*text-transform: uppercase;*/
}

.ObrazekHex {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-position: center center;
  background-size: cover;
  overflow: hidden;
  -webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.ObrazekHex:before, .ObrazekHex:after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  content: '';
  opacity: 0;
  transition: opacity 0.5s;
}
.ObrazekHex:before {
  background: rgba(22, 103, 137, 0.3);
}
.ObrazekHex:after {
  background: linear-gradient(to top, transparent, rgba(0, 0, 0, 0.5), transparent);
}

/* HOVER EFEKT */
.HexOdkaz:hover h3, .HexOdkaz:focus h3,
.HexOdkaz:hover p, .HexOdkaz:focus p {
  opacity: 1;
  transition: 0.8s;
}

.HexVevnitr:hover .ObrazekHex:before,
.HexVevnitr:hover .ObrazekHex:after,
.HexVevnitr:hover .HexOdkaz {
  opacity: 1;
}

/* VELIKOST HEXAGONŮ A ODSAZENÍ SUDÝCH ŘÁDKŮ */
@media (min-width: 1201px) { /* <- 5-4 hexagons per row */
  #HexMrizka {
    padding-bottom: 4.4%;
  }
  .Hex {
    width: 20%; /* = 100 / 5 */
  }
  .Hex:nth-child(9n+6) { /* první hexagon sudých řádků */
    margin-left: 10%; /* = šířka .Hex / 2 pro odsazení sudých řádků */
  }
}

@media (max-width: 1200px) and (min-width: 901px) { /* <- 4-3 hexagons per row */
  #HexMrizka {
    padding-bottom: 5.5%;
    font-size: 13px;
  }
  .Hex {
    width: 25%; /* = 100 / 4 */
  }
  .Hex:nth-child(7n+5) { /* první hexagon sudých řádků */
    margin-left: 12.5%; /* = šířka .Hex / 2 pro odsazení sudých řádků */
  }
}

@media (max-width: 900px) and (min-width: 601px) { /* <- 3-2 hexagons per row */
  #HexMrizka {
    padding-bottom: 7.4%;
    font-size: 14px;
  }
  .Hex {
    width: 33.333%; /* = 100 / 3 */
  }
  .Hex:nth-child(5n+4) { /* první hexagon sudých řádků */
    margin-left: 16.666%; /* = šířka .Hex / 2 pro odsazení sudých řádků */
  }
}

@media (max-width: 600px) { /* <- 2-1 hexagons per row */
  #HexMrizka {
    padding-bottom: 11.2%;
    font-size: 12px;
  }
  .Hex {
    width: 50%; /* = 100 / 2 */
  }
  .Hex:nth-child(3n+3) { /* první hexagon sudých řádků */
    margin-left: 25%; /* = šířka .Hex / 2 pro odsazení sudých řádků */
  }
}

@media (max-width: 400px) {
  #HexMrizka {
    font-size: 8px;
  }
}

/* Modal CSS */
.ModalHex {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}

.ModalniObsahHex {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  height: auto;
  max-height: 70%; /* Změněno na 70%, aby bylo více místa pro popis */
  object-fit: contain;
  margin-top: 20px; 
}

.PopisHex {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.7); 
  color: #fff;
  padding: 10px 0;
  position: absolute;
  bottom: 30%; 
  left: 50%;
  transform: translateX(-50%);
  word-wrap: break-word; /* Přidáno pro správné zalomení textu */
}

.ZavritHex {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.ZavritHex:hover,
.ZavritHex:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

.PredchoziHex,
.DalsiHex {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: 0.3s;
  user-select: none;
  -webkit-user-select: none;
}

.PredchoziHex {
  left: 0;
}

.DalsiHex {
  right: 0;
}

.PredchoziHex:hover,
.DalsiHex:hover {
  background-color: rgba(0, 0, 0, 0.8);
}
