.thumb {
  max-height: 240px;
  object-fit: contain;
  cursor: pointer;
  border-radius: 5px;
  transition: transform 0.3s;
}

.thumb:hover {
  transform: scale(1.02);
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3050;
}

.lightbox a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lightbox:target {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
}

.lightbox_figure {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;

  max-width: 90vw;
  max-height: 90vh;
  z-index: 2000;
}

.lightbox_figure img {
  display: block;
  max-width: 75vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox_caption {
  color: #000000;

  max-width: 320px;

  background: rgb(255, 255, 255);
  padding: 12px 14px;
  border-radius: 8px;

  user-select: text;
  -webkit-user-select: text;
  z-index: 2000;

  max-height: 80vh;
  overflow-y: auto; 
}

.lightbox_x {
  position: fixed;
  top: 12px;
  right: 12px;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  background: rgba(0,0,0,0.65);
  padding: 6px 12px;
  border-radius: 8px;
  z-index: 3050;
  cursor: pointer;
  line-height: 1.3;
  transition: background 0.2s color 0.2s;
}

.lightbox_x:hover {
  color: #AA272F;
  background: rgba(0,0,0,0.85);
}

.lightbox_caption strong {
    color: #AA272F;
    font-size: 1rem;
    margin-bottom: 5px;
}

.lightbox_caption p {
    line-height: 1.3;
}

.lightbox_caption::-webkit-scrollbar {
    width: 6px;
}

.lightbox_caption::-webkit-scrollbar-thumb {
    background: #AA272F;
    border-radius: 6px;
}

@media screen and (max-width: 728px) {
    .lightbox_figure {
    flex-direction: column;
    align-items: center;
    max-height: 90vh;
  }

    .lightbox_figure img {
    max-width: 100%;
    max-height: 60vh;
  }

    .lightbox_caption {
    max-width: 100%;
    max-height: 30vh;
  }
}