/* ==========================================================================
   1. Reset & Podstawowe Stylizacje Strony
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #fcfcfc;
  color: #1a1a1a;
  line-height: 1.6;
  padding: 2rem 1.5rem;
  
  /* Kluczowe: wyśrodkowany kontener ograniczający szerokość strony */
  max-width: 1400px;
  margin: 0 auto;
}

/* ==========================================================================
   2. Nagłówek (Header)
   ========================================================================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 2rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid #e5e5e5;
  width: 100%;
}

/* Lewa strona nagłówka (Tytuł i stanowisko) */
header > div:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

header p {
  font-size: 0.95rem;
  color: #666;
  margin: 0.25rem 0 0 0;
  padding: 0;
}

/* Prawa strona nagłówka (Języki i kontakt w dwóch liniach) */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 0.4rem;
}

/* Przełącznik językowy PL | EN */
.lang-switch {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.lang-switch a {
  color: #999;
  text-decoration: none;
  transition: color 0.2s ease;
}

.lang-switch a:hover {
  color: #1a1a1a;
}

.lang-switch .active {
  color: #1a1a1a;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 1px;
}

/* Linki kontaktowe Email & LinkedIn */
.contact {
  display: flex;
  gap: 1.25rem;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.contact a {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.contact a:hover {
  opacity: 0.6;
}

/* ==========================================================================
   3. Galeria Zdjęć (Grid)
   ========================================================================== */
.gallery {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;    /* Zmiana z kwadratu na proporcje 16:9 */
  object-fit: contain;     /* Cały obrazek widoczny bez ucinań */
  border-radius: 4px;
  cursor: pointer;
  background-color: #f4f4f4;
  transition: transform 0.25s ease, opacity 0.25s ease;

.gallery img:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* ==========================================================================
   4. Lightbox (Powiększanie Zdjęć)
   ========================================================================== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Klasa dodawana przez script.js przy otwarciu */
.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox button {
  position: absolute;
  background: transparent;
  color: #ffffff;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 1rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.lightbox button:hover {
  opacity: 1;
}

.lightbox .prev {
  left: 1.5rem;
}

.lightbox .next {
  right: 1.5rem;
}

.lightbox .close {
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2.5rem;
}

/* ==========================================================================
   5. Responsywność (Mobilki)
   ========================================================================== */
@media (max-width: 600px) {
  body {
    padding: 1.25rem 1rem;
  }

  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
  }

  header h1 {
    font-size: 1.25rem;
  }

  header p {
    font-size: 0.8rem;
  }

  .header-right {
    gap: 0.25rem;
  }

  .lang-switch {
    font-size: 0.75rem;
  }

  .contact {
    gap: 0.75rem;
  }

  .contact a {
    font-size: 0.8rem;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    gap: 1rem;
  }

  .gallery img {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .lightbox .prev {
    left: 0.5rem;
  }

  .lightbox .next {
    right: 0.5rem;
  }

  .lightbox .close {
    top: 0.5rem;
    right: 0.5rem;
  }
}