/* ── Gallery Page Content ── */
#gallery-content {
  width: 100%;
  min-height: calc(100vh - var(--page-pad) * 2);
  background: #000000;
  padding-left: var(--page-pad);
}

#gallery-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 12px;
}

#gallery-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

html.light #gallery-content                    { background: #fff; }
html.light #gallery-title                      { color: #111; background: #fff; }
html.light #gallery-hint                       { color: rgba(0,0,0,0.45); }
html.light #save-titles                        { background: #fff; }
html.light #save-titles:hover                  { color: #111; border-color: rgba(0,0,0,0.4); }
html.light .gallery-label                      { border-color: rgba(0,0,0,0.20); }
html.light .gallery-label .gallery-number      { border-right-color: rgba(0,0,0,0.20); }
html.light .gallery-label input                { background: #fff; color: #111; }
html.light .gallery-label input:focus          { color: #111; }

#gallery-title {
  font-size: 22px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: none;
  padding: 0 10px 6px 0;
  margin-top: -8px;
  background: #000;
  color: #fff;
}

#gallery-hint {
  color: rgba(255,255,255,0.55);
  font-size: 15px;
  font-family: var(--font-body);
  letter-spacing: 0.3px;
}

#save-titles {
  font-family: var(--font-body);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  background: #000;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
}

#save-titles:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

#gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(360px, calc(20% - 20px)), 1fr));
  gap: 24px;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.gallery-label {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.gallery-label .gallery-number {
  color: var(--text-tertiary);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 400;
  flex-shrink: 0;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.gallery-label input {
  font: inherit;
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: none;
  background: #000000;
  color: var(--text-secondary);
  font-size: 10px;
}

.gallery-label input::placeholder {
  color: var(--text-tertiary);
}

.gallery-label input:focus {
  outline: none;
  color: #fff;
}

.gallery-label:focus-within {
  border-color: var(--accent);
}

.gallery-label:focus-within .gallery-number {
  border-right-color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #gallery-grid {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  #gallery-grid {
    gap: 8px;
  }
}
