/* --- Base (Mobile First) --- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery img {
  flex-shrink: 1;
  flex-grow: 1;
  flex-basis: 90%;  /* flex-basis practice */
}

/* STUDENT CODE STARTS HERE */

.grid > div:nth-child(even) img {
  border: none;
  filter: none;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: 45% 45%;
    gap: 10px;
    justify-items: center;
  }
  
  .grid > div:nth-of-type(3n) {
    grid-column: 1 / 3;
    margin: auto;
  }

  .gallery {
    justify-content: space-around;
  }

  .gallery > img {
    flex: 1 1 30%;
  }

  .grid > div:nth-of-type(even) {
    background: lightyellow;
  }
}

@media (min-width: 1200px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
  }

  .grid > div:nth-of-type(3n) {
    grid-column: auto;
    margin: 0;
  }

  .gallery {
    justify-content: space-between;
  }

  .gallery > img {
    flex: 1 1 200px;
  }

  .grid > div {
    transition: 0.2s;
  }

  .grid > div:hover {
    box-shadow: 0 0 40px black;
  }
}

@media print {
  body {
    background: white;
    color: black;
  }

  .gallery {
    display: none;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .grid > div {
    border: 1px solid black;
    page-break-inside: avoid;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery img:hover, .grid > div:hover {
    transform: none;
    box-shadow: none;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background: #111;
    color: #eee;
  }

  section {
    background: #222;
  }

  .grid > div {
    background: #111;
    border: 1px solid #EB5B00;
  }


  .grid > div:nth-of-type(even) {
    background: #222;
  }

  .grid dt {
    color: #eee;
  }

  .grid dd {
    color: #eee;
  }
}
