/* Photos Page Styles */

.inner.photos {
  width: 66%;
}

.photo-grid {
  display: flex;
  flex-wrap: wrap;
}

.photo-row {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  height: 100%;
}

.photo-item {
  flex: 0 0 25%;
  max-width: 25%;
}

/* smaller screen */
@media (max-width: 600px) {
  .photo-item {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

.photo-thumb {
  max-width: 200px;
  max-height: 150px;
  border: 1px solid #3a3a3a;
  position: relative;
  overflow: hidden;
}

.photo-thumb:hover {
  border-color: #78dce8;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb a {
  display: block;
  width: 100%;
  height: 100%;
}

.photo-thumb .caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.4rem 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: #ccc;
  font-size: 0.75em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.photo-thumb:hover .caption {
  opacity: 1;
}

/* Category cards on index page */
.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.category-card {
  width: 220px;
  text-decoration: none;
  color: inherit;
}

.category-card:hover {
  text-decoration: none;
}

.category-card .thumb-stack {
  position: relative;
  width: 220px;
  height: 160px;
  margin-bottom: 0.5rem;
}

.category-card .thumb-stack img {
  position: absolute;
  width: 200px;
  height: 140px;
  object-fit: cover;
  border: 1px solid #3a3a3a;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.category-card .thumb-stack img:nth-child(1) { top: 0; left: 0; z-index: 3; }
.category-card .thumb-stack img:nth-child(2) { top: 8px; left: 8px; z-index: 2; }
.category-card .thumb-stack img:nth-child(3) { top: 16px; left: 16px; z-index: 1; }

.category-card:hover .thumb-stack img:nth-child(1) {
  border-color: #78dce8;
  transform: translate(-4px, -4px);
}

.category-card:hover .thumb-stack img:nth-child(2) {
  transform: translate(0, 0);
}

.category-card:hover .thumb-stack img:nth-child(3) {
  transform: translate(4px, 4px);
}

.category-card .category-title {
  margin: 0;
  color: #fff;
}

.category-card:hover .category-title {
  color: #78dce8;
}

.category-card .category-count {
  font-size: 0.8em;
  color: #666;
  margin-top: 0.2rem;
}

/* Lightbox */

.spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #78dce8;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  z-index: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
}

.lightbox:target {
  opacity: 1;
  visibility: visible;
}

.lightbox-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border: 1px solid #3a3a3a;
  position: relative;
  z-index: 1;
}

.lightbox .close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  color: #fff;
  font-size: 2rem;
  text-decoration: none;
  z-index: 2;
}

.lightbox .close:hover {
  color: #ff6188;
  text-decoration: none;
}

.lightbox .caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #888;
  z-index: 2;
  width: fit-content;
  white-space: nowrap;
  text-align: center;
}
