/* ══════════════════════════════════════════════════════════════════════
   Gallery Feed — Community Gallery Browse, Cards, Lightbox
   Detail view styles in gallery-detail.css
   ══════════════════════════════════════════════════════════════════════ */

/* ── Content area (full-width, scrollable) ── */
.galfeed-content {
  flex: 1; overflow-y: auto; padding: 24px 28px;
}

/* ── Stats row ── */
.galfeed-stats-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.galfeed-stat-card {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 12px; padding: 14px 16px;
}
.galfeed-stat-val {
  font-family: var(--ff-display); font-size: 26px;
  font-weight: 300; color: var(--cream); line-height: 1;
}
.galfeed-stat-lbl { font-size: 11px; color: var(--muted); margin-top: 5px }

/* ── Controls row (companion filter + sort tabs) ── */
.galfeed-controls {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
}

/* ── Companion filter dropdown ── */
.galfeed-companion-select {
  padding: 6px 28px 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--cream);
  font-size: 12px;
  font-family: var(--ff-body);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  min-width: 160px;
  transition: border-color .15s;
}
.galfeed-companion-select:hover { border-color: var(--muted2); }
.galfeed-companion-select:focus {
  outline: none;
  border-color: var(--rose-20);
}
.galfeed-companion-select option {
  background: var(--bg2);
  color: var(--cream);
}

/* ── Sort tabs (inline) ── */
.galfeed-sort-row {
  display: flex; gap: 0;
}
.galfeed-sort-btn {
  padding: 6px 14px; border: none; background: none;
  font-size: 12px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  font-family: var(--ff-body);
}
.galfeed-sort-btn:hover { color: var(--cream) }
.galfeed-sort-btn.active { color: var(--rose); border-bottom-color: var(--rose) }

/* ── Feed grid ── */
.galfeed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ── Gallery card ── */
.galfeed-card {
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 12px;
  overflow: hidden; cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.galfeed-card:hover {
  border-color: var(--rose-20); transform: translateY(-2px);
}

/* ── Card preview images ── */
.galfeed-preview {
  position: relative; width: 100%; aspect-ratio: 4/3;
  overflow: hidden; background: var(--bg3);
}
.galfeed-preview-single img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.galfeed-preview-grid {
  display: grid; width: 100%; height: 100%;
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 2px;
}
.galfeed-preview-grid img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.galfeed-preview-grid.cols-2 {
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr;
}
.galfeed-preview-grid.cols-3 {
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
}
.galfeed-preview-grid.cols-3 img:first-child {
  grid-row: 1 / -1;
}
.galfeed-img-count {
  position: absolute; bottom: 6px; right: 6px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: .3px;
  background: var(--black-60); color: #fff;
  backdrop-filter: blur(4px);
}

/* ── Card body ── */
.galfeed-body { padding: 10px 12px 12px }
.galfeed-title {
  font-family: var(--ff-display); font-size: 14px; font-weight: 400;
  color: var(--cream); margin: 0 0 4px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.galfeed-companion {
  font-size: 11px; color: var(--dim); margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Card footer (owner + stats) ── */
.galfeed-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.galfeed-owner {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
  overflow: hidden; min-width: 0;
}
.galfeed-owner-avatar {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg3); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--dim);
}
.galfeed-owner-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.galfeed-owner-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.galfeed-stats {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--muted); flex-shrink: 0;
}
.galfeed-stat {
  display: flex; align-items: center; gap: 3px;
}
.galfeed-stat svg { width: 12px; height: 12px }

/* ── Feed empty / loading ── */
.galfeed-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 20px;
  color: var(--muted); font-size: 13px;
}
.galfeed-loading {
  grid-column: 1 / -1;
  text-align: center; padding: 40px 20px;
  color: var(--muted); font-size: 12px;
}

/* ── Load more button ── */
.galfeed-more {
  grid-column: 1 / -1;
  display: flex; justify-content: center; padding: 8px 0 16px;
}
.galfeed-more-btn {
  padding: 8px 28px; border-radius: 8px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--muted); font-size: 12px; cursor: pointer;
  transition: all .15s;
}
.galfeed-more-btn:hover { color: var(--cream); border-color: var(--muted2) }
.galfeed-more-btn:disabled { opacity: .4; cursor: default }

/* ══════════════════════════════════════════════════════════════════════
   Image Lightbox
   ══════════════════════════════════════════════════════════════════════ */

@keyframes galFadeIn { from { opacity: 0 } to { opacity: 1 } }

.gallb-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0, 0, 0, .92);
  display: flex; align-items: center; justify-content: center;
  animation: galFadeIn .15s ease;
  cursor: pointer;
}
.gallb-img {
  max-width: 90vw; max-height: 90vh;
  object-fit: contain; border-radius: 4px;
  cursor: default;
}
.gallb-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: rgba(255,255,255,.7);
  font-size: 28px; cursor: pointer; line-height: 1;
  transition: color .15s;
}
.gallb-close:hover { color: #fff }
.gallb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); border: none; color: rgba(255,255,255,.8);
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.gallb-nav:hover { background: rgba(255,255,255,.2) }
.gallb-prev { left: 16px }
.gallb-next { right: 16px }

/* ══════════════════════════════════════════════════════════════════════
   Image Reaction Bars (shared by feed & detail)
   ══════════════════════════════════════════════════════════════════════ */

.galreact-bar {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 4px 0 6px; grid-column: 1 / -1;
}
.galreact-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 12px;
  font-size: 12px; cursor: pointer; user-select: none;
  background: var(--bg3); color: var(--muted);
  border: 1px solid var(--border2);
  transition: all .15s;
}
.galreact-pill:hover { border-color: var(--rose-20); color: var(--cream) }
.galreact-pill.active {
  background: var(--rose-bg); color: var(--rose);
  border-color: var(--rose-20);
}

/* ══════════════════════════════════════════════════════════════════════
   Lightbox Emoji Picker
   ══════════════════════════════════════════════════════════════════════ */

.gallb-reactions {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 8px 14px;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(12px);
  border-radius: 24px; z-index: 10;
}
.gallb-emoji-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid transparent; background: rgba(255,255,255,.08);
  font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all .15s; position: relative;
}
.gallb-emoji-btn:hover { background: rgba(255,255,255,.15); transform: scale(1.1) }
.gallb-emoji-btn.active {
  border-color: var(--rose); background: var(--rose-bg);
}
.gallb-emoji-btn.locked {
  opacity: .35; cursor: not-allowed;
}
.gallb-emoji-btn.locked::after {
  content: '\1F512'; font-size: 8px;
  position: absolute; bottom: -2px; right: -2px;
}

/* ══════════════════════════════════════════════════════════════════════
   Share Modal
   ══════════════════════════════════════════════════════════════════════ */

.share-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: var(--black-60); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: galFadeIn .15s ease;
}
.share-modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 16px; padding: 24px; width: 320px; max-width: 90vw;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 16px 48px var(--shadow-lg);
}
.share-modal-title {
  font-family: var(--ff-display); font-size: 16px;
  color: var(--cream); text-align: center; margin-bottom: 4px;
}
.share-modal-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 10px; border: none;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .15s;
}
.share-modal-discord {
  background: #5865f2; color: #fff;
}
.share-modal-discord:hover { background: #4752c4 }
.share-modal-discord svg { width: 18px; height: 18px }
.share-modal-copy {
  background: var(--bg3); color: var(--cream);
  border: 1px solid var(--border2);
}
.share-modal-copy:hover { background: var(--bg4); border-color: var(--muted2) }
.share-modal-copy svg { width: 16px; height: 16px }
.share-modal-cancel {
  background: none; border: none; color: var(--muted);
  font-size: 12px; cursor: pointer; padding: 6px;
  text-align: center; transition: color .15s;
}
.share-modal-cancel:hover { color: var(--cream) }
