/* Simple gallery grid for docs */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  align-items: start;
  margin: 20px 0;
}
.gallery-item {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e6e6e6;
  padding: 8px;
  border-radius: 6px;
  background: #fff;
  transition: box-shadow .15s ease, transform .12s ease;
  position: relative;
  overflow: hidden;
}
.gallery-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}
.gallery-item .caption {
  margin-top: 8px;
  font-size: 0.95rem;
  text-align: center;
}
.gallery-item:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}
.gallery-item .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.5) 100%);
  color: #fff;
  padding: 12px;
  opacity: 0;
  transition: opacity .18s ease;
}
.gallery-item:hover .overlay,
.gallery-item:focus .overlay {
  opacity: 1;
}
.gallery-item .buttons {
  display: flex;
  gap: 8px;
}
.gallery-item .btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* filter bar */
.gallery-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.gallery-filters .filter-btn {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: #f7f7f7;
  cursor: pointer;
}
.gallery-filters .filter-btn.active {
  background: #007acc;
  color: white;
  border-color: #007acc;
}

/* modal */
.gallery-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.gallery-modal .content {
  background: #fff;
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow: auto;
  border-radius: 8px;
  padding: 16px;
}
.gallery-modal .hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.gallery-modal img {
  max-width: 400px;
  width: 40%;
  object-fit: contain;
  border-radius: 4px;
}
.gallery-modal .meta {
  flex: 1;
}
.gallery-modal .close-btn {
  float: right;
  background: #eee;
  border: 0;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* responsive tweaks */
@media (max-width: 600px) {
  .gallery-item img {
    height: 120px;
  }
  .gallery-modal .hero {
    flex-direction: column;
  }
  .gallery-modal img {
    width: 100%;
  }
}
