turbo-frame#lightbox:empty {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1050;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  animation: lightbox-fade-in 0.2s ease-out;
}

.lightbox__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  animation: lightbox-fade-in 0.2s ease-out;
}

.lightbox__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5rem 0 1rem;
  color: white;
}

.lightbox__title {
  font-size: 1.25rem;
  font-weight: 500;
}

.lightbox__meta {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);

  a {
    color: rgba(255, 255, 255, 0.9);

    &:hover {
      color: white;
    }
  }
}

.lightbox__close {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  line-height: 1;
  padding: 0 0.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;

  &:hover {
    opacity: 1;
  }
}

.lightbox__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

.lightbox__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox__pdf {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.lightbox__audio {
  width: 100%;
  max-width: 500px;
}

.lightbox__file {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);

  &-icon {
    margin-bottom: 1rem;
  }
}

/* Thumbnail link styles */
.attachment-thumb-link {
  display: block;
  cursor: pointer;

  &:hover {
    opacity: 0.9;
  }
}

.attachment-thumb {
  display: block;
  max-width: 150px;
  max-height: 150px;
  object-fit: cover;

  &--audio,
  &--file {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #666;
    font-size: 0.875rem;
  }
}

@keyframes lightbox-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
