* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: larger;
}

header {
  width: 100%;
  text-align: center;
  margin-top: 20px;
  margin-bottom: 10px;
}

.banner-image {
  max-width: 100%;
  height: auto;
}

nav {
background-color: #fdfda2;
display: flex;
flex-wrap: wrap; /* Pozwala łamać menu w małych ekranach */
justify-content: center;
padding: 10px 0;
}

nav a {
color: #000;
text-decoration: none;
padding: 10px 29px;
margin: 0 31px;
font-size: 18px;
font-weight: bold;
transition: background-color 0.3s;
}

nav a:hover {
  background-color: #ffffff;
  border-radius: 5px;
}

/* Kontener dla nagłówka i obrazu */
.header-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-container img {
  margin: 0px;
  margin-right: 275px; 
}

h1 {
  font-weight: 700;
  margin-right: 530px;
}

/* Galeria */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 kolumny */
  gap: 2%;
  max-width: 65%;
  margin: 2% auto;
  margin-bottom: 10%;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10%;
  box-shadow: 0 2% 4% rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease-in-out;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  aspect-ratio: 4 / 3; /* Stały współczynnik proporcji */
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Wypełnia kontener bez zniekształceń */
  display: block;
  transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}

.gallery-item:hover img {
  transform: scale(1.1); /* Powiększenie zdjęcia */
  filter: brightness(80%); /* Ciemniejszy obraz */
}

.caption {
  position: absolute;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  width: 100%;
  padding: 5%;
  text-align: center;
  font-size: 90%;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.gallery-item:hover .caption {
  opacity: 1;
}

@keyframes fadeIn {
  from {
      opacity: 0;
      transform: translateY(10%);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

@media (max-width: 768px) {
  nav a {
      font-size: 14px;
      padding: 6px 12px;
  }

  .header-container img {
      margin-right: 150px; /* Mniejsze marginesy dla obrazu na małych ekranach */
  }

  h1 {
      margin-right: 300px; /* Dopasowanie tekstu h1 na małych ekranach */
  }

  /* Zmiana liczby kolumn w galerii na małych ekranach */
  .gallery {
      grid-template-columns: repeat(2, 1fr); /* 2 kolumny */
      max-width: 90%;
  }

  .gallery-item {
      margin-bottom: 15px;
  }

  .caption {
      font-size: 80%;
  }
}

@media (max-width: 480px) {
  nav a {
      font-size: 12px;
      padding: 5px 10px;
  }

  h1 {
      font-size: 22px;
      margin-right: 150px; /* Dostosowanie nagłówka */
  }

  .gallery {
      grid-template-columns: 1fr; /* 1 kolumna */
      max-width: 100%;
  }

  .header-container img {
      margin-right: 50px; /* Jeszcze mniejsze marginesy dla obrazu */
  }

  .gallery-item {
      margin-bottom: 10px;
  }

  .caption {
      font-size: 70%;
  }
}
