/* Pyrography Gallery Styles */

.pyrography-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
  padding: 0 0.4rem;
  box-sizing: border-box;
}

.gallery-item {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
  border: 0;
  text-align: left;
  padding: 0;
  transform-origin: center center;
}

.theme--dark .gallery-item {
  background: #1e2e38;
}

.gallery-item:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #f5f5f5;
  display: block;
}

.theme--dark .gallery-item img {
  background: #1e2e38;
}

.gallery-item h3 {
  margin: 0.75rem 0.75rem 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme--dark .gallery-item h3 {
  color: #eeeeee;
}

.gallery-date {
  margin: 0 0.75rem 0.75rem;
  font-size: 0.9rem;
  color: #888;
}

.theme--dark .gallery-date {
  color: #9f9f9f;
}

/* Modal Styles */

.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.image-modal.is-open {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.6rem 0.75rem;
  box-sizing: border-box;
}

.theme--dark .modal-content {
  background: #1e2e38;
  color: #eeeeee;
}

.modal-content img {
  max-width: calc(90vw - 1.2rem);
  max-height: calc(90vh - 4.6rem);
  width: auto;
  height: auto;
  display: block;
  margin: 0;
  object-fit: contain;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

.modal-page-wrap {
  margin: 0;
  text-align: center;
}

.modal-page-wrap a {
  font-size: 0.9rem;
  text-decoration: underline;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.6);
  padding: 5px 12px;
  border-radius: 4px;
  transition: background 0.2s;
  border: 0;
  z-index: 1;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .pyrography-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .gallery-item img {
    height: 150px;
    object-fit: contain;
  }

  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
  }

  .modal-content img {
    max-width: calc(95vw - 1rem);
    max-height: calc(95vh - 4.4rem);
  }
}

.pyrography-single-image {
  margin: 1.25rem 0;
}

.pyrography-single-image img {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}
