/* OakenGallery — Gallery Viewer CSS */

:root {
  --sidebar-bg:    #111009;
  --sidebar-w:     260px;
  --gold:          #b8965a;
  --gold-light:    #d4b483;
  --nav-h:         57px;
}

/* ── Layout ─────────────────────────────────────────────────────────── */
.gallery-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
  background: #f7f5f1;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.gallery-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.gallery-project-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 1.75rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.gallery-list { list-style: none; flex: 1; padding: .5rem 0; }

.gallery-list-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem 1.25rem;
  text-decoration: none;
  color: rgba(255,255,255,.55);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .02em;
  border-left: 2px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}

.gallery-list-item:hover {
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.04);
}

.gallery-list-item.active {
  color: var(--gold-light);
  background: rgba(184,150,90,.08);
  border-left-color: var(--gold);
}

.gallery-list-thumb {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  opacity: .8;
}

/* ── Share meta (bottom of sidebar) ─────────────────────────────────── */
.share-meta {
  padding: 1rem 1.25rem;
  font-size: 11px;
  color: rgba(255,255,255,.28);
  border-top: 1px solid rgba(255,255,255,.06);
  letter-spacing: .02em;
}
.share-meta .muted { color: rgba(255,255,255,.2); font-size: 11px; }

/* ── Main content ────────────────────────────────────────────────────── */
.gallery-main {
  flex: 1;
  padding: 2rem 2.25rem;
  min-width: 0;
  background: #f7f5f1;
}

/* ── Title row ───────────────────────────────────────────────────────── */
.gallery-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}

.gallery-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: .02em;
  color: #1a1a16;
  margin-bottom: 0;
}

.gallery-desc {
  font-size: 13px;
  color: #888;
  margin-bottom: 1.75rem;
  letter-spacing: .01em;
}

/* ── Download All button ─────────────────────────────────────────────── */
.btn-dl-all {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1.1rem;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.btn-dl-all:hover { background: var(--gold); color: #fff; }

/* ── Media grid ─────────────────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px;
}

.media-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 3px;
  cursor: pointer;
  background: #ddd;
  position: relative;
}

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease, filter .3s ease;
}

.media-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background .25s ease;
  pointer-events: none;
}

.media-item:hover img { transform: scale(1.05); filter: brightness(.92); }
.media-item:hover::after { background: rgba(0,0,0,.08); }

/* ── Lightbox ─────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,10,8,.96);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lb-stage {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lb-stage img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 2px;
  display: block;
}

.lb-caption {
  color: rgba(255,255,255,.45);
  font-size: 12px;
  margin-top: .75rem;
  text-align: center;
  min-height: 1.2em;
  letter-spacing: .04em;
}

.lb-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  transition: color .15s;
}
.lb-close:hover { color: #fff; }

.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  font-size: 1.75rem;
  cursor: pointer;
  padding: 1rem;
  transition: color .15s;
}
.lb-prev { left: .75rem; }
.lb-next { right: .75rem; }
.lb-prev:hover, .lb-next:hover { color: #fff; }

.lb-download { margin-top: 1rem; }
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1.1rem;
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(184,150,90,.5);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn-download:hover { background: rgba(184,150,90,.12); border-color: var(--gold); }

/* ── Heart / favourite button ────────────────────────────────────────── */
.heart-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,.45);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, background .15s, transform .15s;
  color: #fff;
  z-index: 2;
}
.media-item:hover .heart-btn { opacity: 1; }
.heart-btn.hearted { opacity: 1; color: #ef4444; background: rgba(0,0,0,.5); }
.heart-btn.hearted svg { fill: #ef4444; stroke: #ef4444; }
.heart-btn:hover { transform: scale(1.12); background: rgba(0,0,0,.65); }

/* Lightbox heart button */
.lb-heart { margin-right: .5rem; }
.lb-heart.hearted { color: #ef4444; border-color: rgba(239,68,68,.5); }
.lb-heart.hearted svg { fill: #ef4444; stroke: #ef4444; }

/* ── Selections filter button ────────────────────────────────────────── */
.btn-selections {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239,68,68,.4);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.btn-selections:hover, .btn-selections.active { background: #ef4444; color: #fff; }
.btn-selections.active svg { fill: #fff; }

.btn-approve {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  background: #1a1a16;
  color: #fff;
  border: 1px solid #1a1a16;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.btn-approve:hover { background: var(--gold); border-color: var(--gold); }
.btn-approve.approved { background: #16a34a; border-color: #16a34a; }

.lb-comments {
  width: min(92vw, 520px);
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  background: rgba(0,0,0,.28);
  color: rgba(255,255,255,.75);
}
.lb-comments-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: .625rem;
}
.lb-comments-list {
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: .75rem;
  font-size: 12px;
}
.lb-comment {
  padding: .5rem .625rem;
  border-radius: 5px;
  background: rgba(255,255,255,.06);
  line-height: 1.5;
}
.lb-comment time {
  display: block;
  margin-top: .25rem;
  color: rgba(255,255,255,.35);
  font-size: 10px;
}
.lb-comments textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  padding: .625rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 5px;
  background: rgba(255,255,255,.08);
  color: #fff;
  box-sizing: border-box;
}
.lb-comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .625rem;
  font-size: 12px;
  color: rgba(255,255,255,.45);
}

/* ── Zip modal backdrop ──────────────────────────────────────────────── */
.zip-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* ── Zip modal card ──────────────────────────────────────────────────── */
.zip-modal {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 12px 48px rgba(0,0,0,.25);
}
.zip-modal-close {
  position: absolute;
  top: .875rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #bbb;
  cursor: pointer;
}
.zip-modal-close:hover { color: #333; }
.zip-modal-icon { text-align: center; color: var(--gold); margin-bottom: .75rem; }
.zip-modal-title {
  text-align: center;
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: .04em;
  color: #1a1a16;
  margin: 0 0 .5rem;
}
.zip-modal-desc { text-align: center; font-size: 13px; color: #777; margin: 0 0 1.5rem; line-height: 1.6; }

/* ── Zip form ─────────────────────────────────────────────────────────── */
.zip-field { margin-bottom: 1rem; }
.zip-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .375rem;
}
.zip-field input {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  color: #1a1a16;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.zip-field input:focus { border-color: var(--gold); }
.zip-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: .5rem .75rem;
  font-size: 12px;
  color: #b91c1c;
  margin-bottom: .875rem;
}
.zip-submit {
  width: 100%;
  padding: .75rem;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: background .15s;
}
.zip-submit:hover:not(:disabled) { background: #a07a44; }
.zip-submit:disabled { opacity: .6; cursor: not-allowed; }
.zip-success { text-align: center; padding: 1rem 0; }
.zip-success svg { color: #16a34a; margin-bottom: 1rem; }
.zip-success p { font-size: 14px; color: #555; line-height: 1.7; }
@keyframes zip-spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .gallery-layout  { flex-direction: column; }
  .gallery-sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding: 0;
  }
  .gallery-project-title { display: none; }
  .gallery-list { display: flex; flex-direction: row; padding: 0 .5rem; }
  .gallery-list-item {
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: .75rem 1rem;
  }
  .gallery-list-item.active { border-bottom-color: var(--gold); border-left: none; }
  .gallery-list-thumb { display: none; }
  .share-meta { display: none; }
  .gallery-main { padding: 1.25rem 1rem; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
  .lb-prev, .lb-next { font-size: 1.25rem; padding: .5rem; }
}
