/* ===== BASIS ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 20px;
  font-family: Arial, Helvetica, sans-serif;
  background: #ffffff;
  color: #000;
  overflow-x: hidden;
}

/* ===== TEKST ===== */
p {
  font-size: 15px;
  margin-bottom: 1em;
  margin-left: 20px;
  margin-right: 20px;
}

/* ===== KOP ===== */
h2 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
}

@media (min-width: 768px) {
  h2 {
    font-size: 32px;
  }
}

/* ===== TERUG KNOP ===== */
.back-button {
  display: inline-block;
  margin-bottom: 30px;
  font-size: 14px;
  text-decoration: none;
  color: #3a2b2b;
  border: 1px solid #9e9b9b;
  padding: 6px 12px;
}

.back-button:hover {
  background: #eb1f1f;
  color: #f9f7f7;
}

/* ===== GRID ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
  max-width: 1400px; /* Voeg deze regel toe om de maximale breedte te beperken */
}

@media (max-width: 2000px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    max-width: 1400px; /* Voeg deze regel toe */
  }
}

@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 1000px; /* Voeg deze regel toe */
  }
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 10px;
  }
  p {
    margin-left: 10px;
    margin-right: 10px;
  }
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 5px;
  }
  p {
    margin-left: 5px;
    margin-right: 5px;
    font-size: 11px;
    margin-bottom: 1em;
  }
}

/* ===== FIGURE + CAPTION ===== */
.figure {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 10px;
}

.figure img {
  width: 100%;
  max-width: 100%;
  max-height: 220px;
  display: block;
  object-fit: contain;
  margin: 0 auto;
}

.caption {
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.4;
  text-align: center;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(216, 216, 213, 1);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 999;
  padding: 50px 20px 20px;
}

.lightbox.show {
  display: flex;
}

.lightbox-content {
  position: relative;
  text-align: center;
  width: 95%;
  max-width: 95%;
  max-height: 80vh;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
}

.lightbox-content img {
  width: auto;
  max-width: 100%;
  max-height: 65vh;
  display: block;
  margin: 0 auto 12px;
  object-fit: contain;
}

.lightbox-caption {
  font-size: 14px;
  line-height: 1.5;
  max-width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
  padding: 0 10px;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 30px;
  color: #000;
  cursor: pointer;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.7);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 767px) {
  .lightbox {
    padding: 30px 10px 10px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    font-size: 20px;
    width: 30px;
    height: 30px;
  }
}