html{
    height: 100%;
}
body {
    height: 100%;
    background-color:  rgb(151, 192, 221);
    text-align: center;
    background-size: cover;
}

.container {
  display: grid;
  grid-template-columns: repeat(3, 30%);
  grid-template-rows: repeat(4, 25%);
  gap: 2%;
  justify-content: center;
  align-content: center;
  height: 100vh;
}

.My-projects {
  grid-column: 2/3;
  grid-row: 1;
  font-size: 5vw;
  color: white;
  align-self: center;
  justify-self: center;
  font-family: 'tilt warp';
}

/* Tillbaka-knapp */
.back-button {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: start;
  text-decoration: none;
  background-color: rgba(255, 255, 255, 0.4);
  color: white;
  font-size: 2vw;
  padding: 1vw 2vw;
  border-radius: 1vw;
}

/* Gemensam stil för alla boxar */
.box {
  position: relative;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 2vw;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  height: 100%;
}

.box:hover {
  transform: scale(0.95);
  background-blend-mode: multiply;
  background-color: rgba(0, 0, 0, 0.7);
}

/* Text via data-text */
.box::after {
  content: attr(data-text);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.5vw;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  padding: 1vw;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 2vw;
  width: 95%;
  height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.box:hover::after {
  opacity: 1;
}

/* box placering*/
.box1 { grid-column: 1; grid-row: 2/3; background-image: url(figma.png); }
.box2 { grid-column: 2; grid-row: 2; background-image: url(XO-logo.jpg); }
.box3 { grid-column: 3; grid-row: 2; background-image: url(hemsida.png);}
.box4 { grid-column: 1; grid-row: 3/4; background-image: url(Cardata.jpg); }
.box5 { grid-column: 2; grid-row: 3; }
.box6 { grid-column: 3; grid-row: 3; }

/*mobil media query*/

/* ===== Mobil + liten iPad (≤ 700px) ===== */
@media (max-width: 700px) {
  html, body {
    height: auto;
  }

  .container {
    grid-template-columns: 90%;
    grid-template-rows: auto;
    justify-content: center;
    align-content: start;
    gap: 20px;
    padding: 20px 0;
    height: auto;
  }

  .My-projects {
    grid-column: 1;
    font-size: 2.5rem; /* lagom för iPhone/iPad mini */
    margin-bottom: 10px;
  }

  .back-button {
    grid-column: 1;
    font-size: 1.2rem;
    padding: 10px 20px;
    border-radius: 12px;
    justify-self: start;
  }

  .box1, .box2, .box3, .box4, .box5, .box6 {
    grid-column: 1;
    width: 100%;
    height: 200px;
  }

  .box::after {
    font-size: 1.2rem;
    padding: 12px;
    width: 90%;
    height: 80%;
    border-radius: 12px;
  }
}
