/* --- Globalne zmienne i box-sizing --- */
:root {
  --color-bg: #000;
  --color-text: #fff;
  --color-divider: #444;
  --font-primary: 'Montserrat', sans-serif;
  --font-accent: 'Cinzel Decorative', serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

/* Linki - kolor i dostępność */
a {
  color: var(--color-text);
  text-decoration: none;
}

a:focus {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 2rem;
  padding: 1rem;
  background: #000;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  max-height: 100px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin: 0;
  padding: 0;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-family: var(--font-accent);
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}

nav a:hover,
nav a:focus {
  color: #fff;
  text-decoration: underline;
}

h2 {
  margin: 2rem 1rem 1rem;
  border-bottom: 1px solid #444;
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.6rem;
}

.gallery {
  overflow: hidden;
}

/* Poziome zdjęcia */
.gallery.horizontal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

/* Kwadratowe zdjęcia */
.gallery.square {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 0;
}

.gallery.square img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.5);
  display: block;
  transition: transform 0.3s ease;
}

/* Pionowe zdjęcia */
.gallery.vertical {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 zdjęcia w rzędzie na dużych ekranach */
  gap: 1rem;
  padding: 1rem;
}

.gallery.vertical img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
  object-fit: cover;
}

/* Wspólne style obrazów */
.gallery.horizontal img,
.gallery.square img,
.gallery.vertical img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.6);
  object-fit: cover;
}

.gallery.horizontal img:hover,
.gallery.square img:hover,
.gallery.vertical img:hover {
  /* Zwiększone powiększenie i dodany origin */
  transform: scale(1.75); 
  /* Zmieniony punkt powiększenia na górę i środek, 
     aby powiększenie "zjeżdżało w dół" i nie ucinało góry */
  transform-origin: top center; 
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.8);
  z-index: 10;
  position: relative; 
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

/* Wymuszony kwadrat dla square */
.gallery.square img {
  aspect-ratio: 1 / 1;
}

section {
  padding: 1rem;
}

#about,
#my {
  padding: 40px 20px;
  max-width: 800px;
  margin: 0 auto;
  color: #eee;
  line-height: 1.5;
  font-size: 1.1rem;
  font-family: var(--font-primary);
  text-align: left;
}

.about-me .para-block p {
  margin-bottom: 1em;
  display: block;
  text-align: left;
  line-height: 1.5;
}

.divider {
  text-align: center;
  font-size: 1.4rem;
  color: var(--color-divider);  
  margin: 2em 0;
  letter-spacing: 0.3em;
  font-family: var(--font-accent);
}

#contact {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: center;
  font-family: var(--font-primary);
  color: var(--color-text);
}

#contact h2 {
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: 1rem;
  display: inline-block;
  padding-bottom: 0.3rem;
  font-family: var(--font-accent);
}

#contact a:hover,
#contact a:focus {
  color: #ccc;
  outline: none;
}

footer {
  text-align: center;
  padding: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  border-top: 1px solid var(--color-divider);
  margin-top: 2rem;
}

footer small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text);
  opacity: 0.6;
}

#contact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: var(--color-text);
  font-family: var(--font-primary);
  text-align: left;
}

.contact-photo {
  flex: 0 0 200px;
  max-width: 200px;
}

.contact-photo img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 8px rgba(0,0,0,0.6);
}

.contact-info {
  flex: 1;
  min-width: 240px;
}

/* Responsywność headera na mniejszych ekranach */
@media (max-width: 768px) {
  header {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  .logo {
    max-height: 60px;
    width: auto;
  }
  nav ul {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }
  nav a {
    font-size: 0.9rem;
  }
}

/* Rezerwujemy miejsce na sticky header przy scrollowaniu */
html {
  scroll-padding-top: 100px;
}

#about,
#my,
#contact {
  scroll-margin-top: 100px;
}

.gallery.square {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 0;
}

.gallery.square img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.5);
  display: block;
  transition: transform 0.3s ease;
}