:root {
  --gallery-bg: #0b0b0c;
  --gallery-fg: #f5f5f5;
  --gallery-muted: #9a9a9a;
  --gallery-card-bg: #151515;
}

.gallery-page {
  margin: 0;
  background: var(--gallery-bg);
  color: var(--gallery-fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.gallery-header {
  padding: 48px 24px 24px;
  text-align: center;
}

.back-link {
  color: var(--gallery-muted);
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover {
  color: var(--gallery-fg);
}

.gallery-breadcrumb {
  font-size: 14px;
}

.gallery-breadcrumb a {
  color: var(--gallery-muted);
  text-decoration: none;
}

.gallery-breadcrumb a:hover {
  color: var(--gallery-fg);
}

.gallery-breadcrumb-sep {
  color: var(--gallery-muted);
  margin: 0 6px;
}

.gallery-header h1 {
  margin: 12px 0 4px;
  font-size: 28px;
  font-weight: 700;
}

.gallery-date {
  margin: 0;
  color: var(--gallery-muted);
  font-size: 14px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.gallery-item {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--gallery-card-bg);
  cursor: zoom-in;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 4px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-image {
  max-width: 92vw;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: transparent;
  border: 0;
  color: var(--gallery-fg);
  cursor: pointer;
  padding: 12px 16px;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--gallery-muted);
}

.lightbox-close {
  top: 12px;
  right: 16px;
  font-size: 28px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
}

.lightbox-prev {
  left: 8px;
}

.lightbox-next {
  right: 8px;
}

.lightbox-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 16px 18px;
  text-align: center;
  background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
  pointer-events: none;
}

.lightbox-info {
  margin-bottom: 8px;
}

.lightbox-info[hidden] {
  display: none;
}

.lightbox-info-device {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--gallery-fg);
}

.lightbox-info-settings {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.lightbox-info-chip {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  color: var(--gallery-fg);
  white-space: nowrap;
}

.lightbox-counter {
  color: var(--gallery-muted);
  font-size: 13px;
}

.gallery-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.gallery-card {
  display: block;
  text-decoration: none;
  color: var(--gallery-fg);
  background: var(--gallery-card-bg);
  border-radius: 6px;
  overflow: hidden;
}

.gallery-card-image {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #1c1c1c;
}

.gallery-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}

.gallery-card:hover .gallery-card-image img {
  transform: scale(1.05);
}

.gallery-card-body {
  padding: 12px 14px 16px;
}

.gallery-card-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.gallery-card-meta {
  margin: 0;
  color: var(--gallery-muted);
  font-size: 13px;
}

.gallery-empty {
  text-align: center;
  color: var(--gallery-muted);
  padding: 80px 24px;
}

@media (max-width: 480px) {

  .gallery-grid,
  .gallery-list-grid {
    padding: 12px;
    gap: 4px;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 32px;
    padding: 8px;
  }
}
