/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base body styles */
body {
  font-family: Helvetica, Arial, sans-serif;
  background-image: url('./gwiazdki.jpg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed; /* Works well on desktop */
  color: #000;
  min-height: 100vh;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Grid container for the magazines */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  padding-bottom: 40px;
}

/* Individual magazine item */
.magazine {
  border-radius: 10px;
  overflow: hidden;
  padding: 10px;
  background-color: transparent;
}

.magazine h2 {
  font-size: 40px;
  margin-bottom: 10px;
  color: #000;
}

/* Images inside the magazines */
.magazine img {
  width: 85%;
  height: auto;
  object-fit: cover;
  border-radius: 5px;
  transition: opacity 0.3s ease;
}

/* --- Responsive Fixes --- */

/* --- MOBILE FIXES --- */
@media (max-width: 768px) {
  body {
    background-attachment: scroll; /* Prevent buggy parallax on mobile */
    background-size: contain;      /* Fit image inside screen */
    background-repeat: repeat;     /* Let it repeat if needed */
    background-position: top center;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .magazine img {
    max-height: 400px;
  }
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .magazine h2 {
    font-size: 24px;
  }

  body {
    background-size: contain;
    background-position: top center;
    background-repeat: repeat;
    background-attachment: scroll;
  }
}