/* ================================================================
   gallery.css  --  Image grid / row view, image cards, captions
   ================================================================ */

/* ---------- Grid view ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--gap);
}

/* ---------- Row view ---------- */

.gallery.row-view {
  display: flex;
  flex-direction: column;
  gap: 0px !important;
}

/* ---------- Card (grid) ---------- */

.card {
  position: relative;
  overflow: clip;
  border-radius: 10px;
  border: 1px solid var(--ink);
  background: #0f1116;
  box-shadow: 0 1px 0 #202736 inset, 0 1px 8px rgba(0, 0, 0, 0.25);
}

.card button {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  background: #0f1116;
  cursor: zoom-in;
  display: block;
}

.card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  filter: saturate(1.05);
  transition: transform 0.15s ease;
}

.card:hover img {
  transform: scale(1.02);
}

/* ---------- Caption ---------- */

.caption {
  padding: 10px 12px;
  font-size: 13px;
  color: #cfd6e4;
  border-top: 1px solid var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

/* ---------- Card (row) ---------- */

.card.row-view {
  display: flex;
  align-items: center;
  padding: 1px 8px !important;
  border-radius: 1px;
  background: #0f1116;
  border: 1px solid var(--ink);
  transition: var(--btn-transition);
  margin: 0 !important;
  cursor: pointer;
}

.card.row-view:hover {
  background: #151a22;
  border-color: #2a2f3a;
}

.card.row-view button {
  flex-shrink: 0;
  width: 50px;
  height: 38px;
  margin-right: 8px;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer !important;
  pointer-events: none;
}

.card.row-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card.row-view .row-details {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.card.row-view .filename {
  font-size: 12px;
  font-weight: 500;
  color: #e8e8e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.card.row-view .dimensions {
  font-size: 10px;
  color: #a0a0a0;
  white-space: nowrap;
  font-family: monospace;
}

.card.row-view .file-size {
  font-size: 10px;
  color: #a0a0a0;
  white-space: nowrap;
  font-family: monospace;
  min-width: 50px;
  text-align: right;
}

.card.row-view .last-modified {
  font-size: 10px;
  color: #a0a0a0;
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}
