/* gallery.css — photo gallery styles (gal-* prefix) */

/* ── Root / section head ──────────────────────────────────────────────────── */

.gal-root {
  margin-top: 48px;
}

.gal-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gal-head-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

/* Upload trigger button */
.gal-upload-trigger {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 5px 14px;
  border: 0.5px solid var(--brass);
  background: transparent;
  color: var(--brass);
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}
.gal-upload-trigger:hover {
  background: var(--brass);
  color: var(--bg-deep);
}

/* ── Trip accordion ───────────────────────────────────────────────────────── */

.gal-trip-list {
  margin-top: 16px;
  border-top: 0.5px solid var(--rule);
}

.gal-trip-row {
  border-bottom: 0.5px solid var(--rule);
}

.gal-trip-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 4px;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  transition: background 0.12s;
}
.gal-trip-toggle:hover {
  background: rgba(245, 236, 214, 0.04);
}

.gal-trip-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
}
.gal-trip-year {
  font-size: 12px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}
.gal-trip-chevron {
  margin-left: auto;
  font-size: 10px;
  color: var(--ink-muted);
  transition: transform 0.2s;
}
.gal-trip-row.is-open .gal-trip-chevron {
  color: var(--brass);
}

.gal-trip-content {
  padding: 12px 4px 20px;
}

/* ── Photo grid ───────────────────────────────────────────────────────────── */

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

@media (max-width: 520px) {
  .gal-photo-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

.gal-photo-card {
  background: var(--bg-card);
  border: 0.5px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gal-photo-img-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-soft);
  flex-shrink: 0;
}
.gal-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s;
}
.gal-photo-img-wrap:hover .gal-photo-img {
  transform: scale(1.04);
}

.gal-photo-info {
  padding: 8px 10px;
  flex: 1;
}
.gal-photo-caption {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 4px;
  line-height: 1.4;
}
.gal-photo-byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}
.gal-photo-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.gal-photo-card:hover .gal-photo-actions {
  opacity: 1;
}
.gal-action {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 2px;
  transition: color 0.12s, background 0.12s;
}
.gal-action:hover           { color: var(--brass); background: rgba(201,161,74,.1); }
.gal-action-del:hover       { color: var(--terracotta); background: rgba(138,62,42,.12); }

.gal-photo-edit-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.gal-edit-save, .gal-edit-cancel {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 5px;
  color: var(--ink-muted);
  transition: color 0.12s;
}
.gal-edit-save:hover   { color: var(--brass); }
.gal-edit-cancel:hover { color: var(--terracotta); }

/* ── Empty / loading / error messages ────────────────────────────────────── */

.gal-msg {
  padding: 20px 0;
  font-size: 13px;
  color: var(--ink-muted);
}
.gal-empty {
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-muted);
}
.gal-empty-sub {
  font-size: 12px;
  color: var(--ink-faint);
}
.gal-err { color: var(--terracotta); }

/* ── Lightbox ─────────────────────────────────────────────────────────────── */

.gal-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.92);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gal-fade-in 0.15s ease;
}
@keyframes gal-fade-in { from { opacity: 0; } to { opacity: 1; } }

.gal-lb-close {
  position: absolute;
  top: 18px; right: 20px;
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 22px;
  cursor: pointer;
  z-index: 1;
  line-height: 1;
  padding: 6px;
  transition: color 0.12s;
}
.gal-lb-close:hover { color: var(--ink); }

.gal-lb-prev, .gal-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20,16,12,.7);
  border: 0.5px solid var(--rule);
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 2px;
  transition: background 0.12s, color 0.12s;
}
.gal-lb-prev { left: 16px; }
.gal-lb-next { right: 16px; }
.gal-lb-prev:hover, .gal-lb-next:hover { background: rgba(201,161,74,.15); color: var(--brass); }

.gal-lb-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(90vw, 1200px);
  max-height: 90vh;
}
.gal-lb-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.gal-lb-meta {
  margin-top: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gal-lb-caption { font-family: var(--font-serif); font-size: 16px; color: var(--ink-soft); }
.gal-lb-byline  { font-size: 12px; color: var(--ink-muted); font-family: var(--font-mono); }
.gal-lb-counter { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); }

/* ── Upload modal ─────────────────────────────────────────────────────────── */

.gal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.85);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: gal-fade-in 0.15s ease;
}

.gal-modal {
  background: var(--bg-card);
  border: 0.5px solid rgba(245,236,214,.18);
  border-radius: 4px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
}

.gal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 0.5px solid var(--rule);
  flex-shrink: 0;
}
.gal-modal-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  color: var(--ink);
}
.gal-modal-x {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.12s;
}
.gal-modal-x:hover { color: var(--ink); }

.gal-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gal-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
  display: block;
}

.gal-select {
  width: 100%;
  background: var(--bg-soft);
  border: 0.5px solid var(--rule);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 2px;
  cursor: pointer;
  -webkit-appearance: none;
}
.gal-select option, .gal-select optgroup {
  background: #2a201a;
  color: var(--ink);
}

/* Drop zone */
.gal-dropzone {
  border: 1.5px dashed rgba(201,161,74,.35);
  border-radius: 4px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: rgba(201,161,74,.03);
}
.gal-dropzone:hover {
  border-color: var(--brass);
  background: rgba(201,161,74,.07);
}
.gal-dropzone-icon { font-size: 32px; margin-bottom: 8px; }
.gal-dropzone-text { font-family: var(--font-serif); font-size: 16px; color: var(--ink-soft); }
.gal-dropzone-sub  { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

/* File list */
.gal-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gal-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 0.5px solid var(--rule);
  border-radius: 3px;
  padding: 8px 10px;
  transition: border-color 0.15s;
}
.gal-file-row.is-done     { border-color: rgba(90,106,62,.6); }
.gal-file-row.is-error    { border-color: rgba(138,62,42,.6); }
.gal-file-row.is-uploading { opacity: 0.7; }

.gal-file-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 2px;
  overflow: hidden;
  background: var(--bg);
}
.gal-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--ink-muted); font-family: var(--font-mono);
}

.gal-file-meta { flex: 1; min-width: 0; }
.gal-file-name {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}
.gal-file-status { margin-left: 6px; }
.gal-ok  { color: #7aad5e; }
.gal-err { color: var(--terracotta); }

.gal-file-remove {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.12s;
}
.gal-file-remove:hover { color: var(--terracotta); }

.gal-add-more {
  background: none;
  border: 0.5px dashed rgba(245,236,214,.2);
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 8px;
  border-radius: 2px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s, color 0.15s;
}
.gal-add-more:hover { border-color: var(--brass); color: var(--brass); }

/* Caption input */
.gal-caption-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 0.5px solid var(--rule);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 4px 0;
  outline: none;
  transition: border-color 0.15s;
}
.gal-caption-input:focus { border-bottom-color: var(--brass); }
.gal-caption-input::placeholder { color: var(--ink-faint); }
.gal-caption-inline { font-size: 12px; flex: 1; }

/* Storage bar */
.gal-storage {
  margin-top: 4px;
}
.gal-storage-track {
  height: 3px;
  background: rgba(245,236,214,.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}
.gal-storage-fill {
  height: 100%;
  background: var(--brass);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.gal-storage-label {
  font-size: 11px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

/* Modal footer */
.gal-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 0.5px solid var(--rule);
  flex-shrink: 0;
}
.gal-btn-cancel {
  background: none;
  border: 0.5px solid var(--rule);
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.gal-btn-cancel:hover { border-color: var(--ink-muted); color: var(--ink); }

.gal-btn-upload {
  background: var(--brass);
  border: none;
  color: var(--bg-deep);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 20px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.12s;
}
.gal-btn-upload:hover:not(:disabled) { background: #d4ab52; }
.gal-btn-upload:disabled { opacity: 0.4; cursor: default; }
