body {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  background-color: white;
  overflow-x: hidden;
}

.container {
  width: 70%;
  margin: 2% auto;
}

header {
  background-color: white;
  width: 100%;
  height: 10%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0;
  margin: 0 auto;
}

.logo {
  margin: 0;
}

.logo a {
  display: block;
}

.logo img {
  width: 20%;
  object-fit: contain;
}

nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  position: relative;
}

nav a {
  text-decoration: none;
  color: black;
  font-weight: bold;
  text-transform: lowercase;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: white;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
  min-width: 150px;
  z-index: 1;
}

.dropdown-content a {
  color: black;
  padding: 10px;
  display: block;
  text-decoration: none;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.projects {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.project {
  width: calc(33.333% - 13.33px);
  position: relative;
  overflow: hidden;
}



.project img {
  width: 100%;
  transition: opacity 0.5s ease-in-out;
}

.project:hover img:first-child {
  opacity: 0;
}

.project:hover img:last-child {
  opacity: 1;
}

.project img:last-child {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
}

footer {
  border-top: 1px solid black;
  margin-top: 20px;
  padding-top: 10px;
  text-align: left;
}

.social-icons img {
  height: 25px;
  object-fit: contain;
}


html {
  overflow-y: scroll;
}
h1 {
  font-size: 24px;
  text-transform: none;
  margin-top: 20px;
  margin-bottom: 20px;
}
.galerie {
  column-count: 2;
  column-gap: 10px;
  margin-top: 20px;
}
.galerie img {
  width: 100%;
  margin-bottom: 10px;
  cursor: pointer;
}


.overlay {
  position: absolute;
  top: 20%;
  right: 10%;
  width: 30%;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
}
.overlay-text {
  flex-grow: 1;
}
.overlay-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: black;
  text-align: center;
}
.more-link {
  align-self: flex-end;
  margin-top: 10px;
  font-size: 14px;
  color: black;
  text-decoration: none;
  font-weight: bold;
}
.more-link:hover {
  text-decoration: underline;
}

.project {
  position: relative;
}

.project-info {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.65);
  color: black;
  display: none;
  z-index: 2;
  font-size: 14px;
  text-align: center;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 0; /* ještě těsnější řádkování */
}

.project:hover > .project-info {
  display: flex;
}

.galerie-sloupce {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.sloupec {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 50%;
}

.sloupec img {
  width: 100%;
  height: auto;
  cursor: pointer;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
}

.lightbox.hidden {
  display: none;
}

.lightbox-content {
  max-width: 90%;
  max-height: 80%;
  
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 40px;
  color: white;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 20px;
}

.lightbox-nav .prev,
.lightbox-nav .next {
  font-size: 40px;
  color: white;
  cursor: pointer;
  user-select: none;
}

@media screen and (max-width: 600px) {
  html, body {
    overflow-x: hidden;
  }

  .container {
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
  }

  header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    flex-wrap: wrap;
  }

  .logo {
    flex: 0 0 auto;
  }

  .logo img {
    width: 25%;
    height: auto;
  }

  nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-top: 0;
    flex: 1;
  }

  nav a {
    font-size: 14px;
    white-space: nowrap;
  }

  .overlay {
    width: 90%;
    right: 5%;
    top: 5%;
  }

  .overlay-text {
    order: 2;
    width: 100%;
    text-align: left;
  }

  .more-link {
    align-self: flex-end;
    order: 1;
  }

  .image-container {
    height: auto;
  }

  .image-container img {
    height: auto;
  }

  .projekt-detail {
    flex-direction: column;
  }

  .projekt-info,
  .projekt-text {
    width: 100%;
    box-sizing: border-box;
  }

  .projekt-info {
    order: 1;
    margin-bottom: 10px;
    line-height: 0.1em;
    word-break: break-word;
    white-space: normal;
  }

  .projekt-text {
    order: 2;
  }

  /* Vypneme hover efekt project-info, ale zachováme klik */
  .project-info {
    display: none;
  }

  .project:hover > .project-info {
    display: none;
  }
}

@media screen and (max-width: 600px) {
  .container {
    width: 100%;
    padding: 0 16px;
    margin: 0 auto;
    box-sizing: border-box;
  }
}

/* Vypnutí hover efektu na dotykových zařízeních */
@media (hover: none) and (pointer: coarse) {
  .project:hover > .project-info {
    display: none !important;
  }
}

@media screen and (max-width: 600px) {
  .container {
    width: 100%;
    padding: 0 16px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .projekt-detail {
    flex-direction: column;
  }

  .projekt-info,
  .projekt-text {
    width: 100% !important;
    box-sizing: border-box;
  }

  .projekt-info {
    order: 1;
    margin-bottom: 10px;
    line-height: 0.1em;
    word-break: break-word;
    white-space: normal;
  }

  .projekt-text {
    order: 2;
  }

  .project-info {
    pointer-events: none;
    opacity: 0;
  }

  .project:hover > .project-info {
    pointer-events: none;
    opacity: 0;
  }
}

@media screen and (max-width: 600px) {
  .project-info {
    display: none !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    z-index: auto !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .project:hover > .project-info {
    display: none !important;
  }
}
