/* ========================================
   Gallery & Visual Archive Page (/gallery)
   Uses Portfolio Design System Variables
   ======================================== */

.gallery-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.gallery-page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 6.5rem 1.25rem 4rem;
  flex: 1;
}

/* ---------- Page Hero Header ---------- */
.gallery-header {
  text-align: center;
  margin-bottom: 2.35rem;
  animation: fadeInUp 0.55s ease forwards;
}

.gallery-breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding: 0.3rem 0.85rem;
  background: rgba(18, 22, 31, 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.gallery-breadcrumb-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.gallery-breadcrumb-link:hover {
  color: var(--accent);
}

.gallery-breadcrumb-sep {
  color: var(--text-muted);
  opacity: 0.6;
}

.gallery-breadcrumb-current {
  color: var(--accent);
  font-weight: 600;
}

.gallery-header .section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  background: hsla(160, 100%, 50%, 0.08);
  border: 1px solid hsla(160, 100%, 50%, 0.25);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.gallery-title {
  font-size: clamp(1.85rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.55rem;
  word-break: break-word;
}

.gallery-subtitle {
  color: var(--text-secondary);
  font-size: 0.98rem;
  max-width: 650px;
  margin: 0 auto 1.25rem;
  line-height: 1.6;
}

.gallery-stats-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.gallery-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.85rem;
  background: rgba(18, 22, 31, 0.78);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.gallery-stat-pill i {
  color: var(--accent);
  font-size: 0.78rem;
}

.gallery-stat-pill strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ---------- Album Folder Cards Shelf ---------- */
.album-shelf-section {
  margin-bottom: 2.1rem;
  animation: fadeInUp 0.6s ease 0.06s backwards;
}

.album-shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding: 0 0.2rem;
}

.album-shelf-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.album-shelf-label i {
  color: var(--accent);
}

.album-shelf-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
}

.album-folder-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.05rem 1.1rem;
  background: rgba(18, 22, 31, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
  font-family: inherit;
}

.album-folder-card:hover {
  transform: translateY(-3px);
  background: rgba(24, 30, 42, 0.92);
  border-color: hsla(160, 100%, 50%, 0.42);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.album-folder-card.active {
  background: linear-gradient(145deg, hsla(160, 100%, 50%, 0.14) 0%, rgba(18, 22, 31, 0.94) 100%);
  border-color: var(--accent);
  box-shadow: 0 8px 24px hsla(160, 100%, 50%, 0.15);
}

.album-folder-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.album-folder-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(160, 100%, 50%, 0.1);
  border: 1px solid hsla(160, 100%, 50%, 0.26);
  color: var(--accent);
  font-size: 0.98rem;
  transition: transform 0.25s ease;
}

.album-folder-card:hover .album-folder-icon {
  transform: scale(1.06);
}

.album-folder-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
}

.album-folder-card.active .album-folder-count {
  color: var(--accent);
  border-color: hsla(160, 100%, 50%, 0.38);
  background: hsla(160, 100%, 50%, 0.1);
}

.album-folder-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.album-folder-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.42;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Search & Filter Controls ---------- */
.gallery-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 2.2rem;
  padding: 1.1rem 1.25rem;
  background: rgba(18, 22, 31, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
  animation: fadeInUp 0.6s ease 0.1s backwards;
}

.gallery-toolbar-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.gallery-search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.gallery-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.88rem;
  pointer-events: none;
}

.gallery-search-input {
  width: 100%;
  padding: 0.72rem 2.6rem 0.72rem 2.55rem;
  background: rgba(10, 13, 18, 0.88);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: all 0.22s ease;
}

.gallery-search-input::placeholder {
  color: var(--text-muted);
}

.gallery-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px hsla(160, 100%, 50%, 0.12);
}

.gallery-search-clear {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  font-size: 0.85rem;
  display: none;
}

.gallery-search-clear:hover {
  color: var(--text-primary);
}

.gallery-view-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(10, 13, 18, 0.88);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.22rem;
  gap: 0.2rem;
}

.view-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.78rem;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-mode-btn:hover {
  color: var(--text-primary);
}

.view-mode-btn.active {
  background: hsla(160, 100%, 50%, 0.15);
  color: var(--accent);
  font-weight: 600;
}

/* Filter Chip Tabs */
.gallery-filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.15rem;
}

.gallery-filter-tabs::-webkit-scrollbar {
  display: none;
}

.gallery-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.42rem 0.88rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.gallery-filter-chip:hover {
  color: var(--text-primary);
  border-color: hsla(160, 100%, 50%, 0.35);
}

.gallery-filter-chip.active {
  background: hsla(160, 100%, 50%, 0.14);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Album Sections & Photo Grid ---------- */
.gallery-album-section {
  margin-bottom: 2.8rem;
  animation: fadeInUp 0.55s ease backwards;
}

.gallery-album-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.gallery-album-heading-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.gallery-album-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(160, 100%, 50%, 0.1);
  border: 1px solid hsla(160, 100%, 50%, 0.28);
  color: var(--accent);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.gallery-album-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.18rem;
}

.gallery-album-subtitle {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin: 0;
}

.gallery-album-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.gallery-album-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

.gallery-album-view-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.25rem 0.72rem;
  border-radius: 999px;
  background: hsla(160, 100%, 50%, 0.08);
  border: 1px solid hsla(160, 100%, 50%, 0.22);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.gallery-album-view-link:hover {
  background: hsla(160, 100%, 50%, 0.16);
  border-color: var(--accent);
  transform: translateX(2px);
  color: var(--accent);
}

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

/* ---------- Individual Photo / Credential Card ---------- */
.gallery-card {
  display: flex;
  flex-direction: column;
  background: rgba(18, 22, 31, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: hsla(160, 100%, 50%, 0.45);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.45),
    0 0 22px hsla(160, 100%, 50%, 0.08);
}

.gallery-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #080c14;
  overflow: hidden;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover .gallery-card-img {
  transform: scale(1.045);
}

.gallery-card-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  pointer-events: none;
  z-index: 2;
}

.gallery-card-album-pill,
.gallery-card-date-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gallery-card-album-pill {
  background: rgba(10, 14, 20, 0.86);
  color: var(--accent);
  border: 1px solid hsla(160, 100%, 50%, 0.35);
}

.gallery-card-date-pill {
  background: rgba(10, 14, 20, 0.86);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gallery-card-zoom-hint {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 18, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery-card-media:hover .gallery-card-zoom-hint {
  opacity: 1;
}

.gallery-card-zoom-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(18, 24, 34, 0.92);
  border: 1px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.gallery-card-body {
  padding: 1.15rem 1.25rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.gallery-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.38;
  margin: 0 0 0.28rem;
}

.gallery-card-issuer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.55rem;
}

.gallery-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 1rem;
  flex: 1;
}

.gallery-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.gallery-card-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gallery-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 0.14rem 0.48rem;
  border-radius: 6px;
}

.gallery-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.gallery-btn-preview,
.gallery-btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.68rem;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-btn-preview {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.gallery-btn-preview:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gallery-btn-link {
  background: hsla(160, 100%, 50%, 0.1);
  border: 1px solid hsla(160, 100%, 50%, 0.3);
  color: var(--accent);
}

.gallery-btn-link:hover {
  background: hsla(160, 100%, 50%, 0.2);
}

/* ---------- Empty Search State ---------- */
.gallery-empty-state {
  display: none;
  text-align: center;
  padding: 3.2rem 1.5rem;
  background: rgba(18, 22, 31, 0.65);
  border: 1px dashed var(--border);
  border-radius: 16px;
  margin: 1rem 0 2.5rem;
}

.gallery-empty-state i {
  font-size: 2.2rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.gallery-empty-state h3 {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.gallery-empty-state p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
}

.gallery-reset-btn {
  padding: 0.55rem 1.15rem;
  background: hsla(160, 100%, 50%, 0.12);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
}

/* ---------- Lightbox Modal ---------- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 13, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.gallery-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-dialog {
  position: relative;
  width: 100%;
  max-width: 1020px;
  max-height: 90vh;
  background: #0d121b;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.lightbox-media-pane {
  position: relative;
  background: #06090f;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  max-height: 85vh;
  padding: 1.5rem;
  border-right: 1px solid var(--border);
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 10px;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 21, 32, 0.88);
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-prev {
  left: 0.85rem;
}

.lightbox-next {
  right: 0.85rem;
}

.lightbox-info-pane {
  padding: 1.75rem 1.6rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.lightbox-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.lightbox-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-close-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-meta-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.lightbox-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0 0 0.35rem;
}

.lightbox-issuer {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.lightbox-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 1.25rem;
}

.lightbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.lightbox-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.lightbox-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  flex: 1;
}

.lightbox-action-primary {
  background: var(--accent);
  color: #06120c;
}

.lightbox-action-primary:hover {
  filter: brightness(1.08);
}

.lightbox-action-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.lightbox-action-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Responsive Design ---------- */
@media (max-width: 980px) {
  .album-shelf-grid {
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  }
}

@media (max-width: 860px) {
  .lightbox-dialog {
    grid-template-columns: 1fr;
    max-height: 92vh;
    overflow-y: auto;
  }

  .lightbox-media-pane {
    min-height: 240px;
    max-height: 46vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 640px) {
  .gallery-page-wrapper {
    padding: 5.8rem 1rem 3rem;
  }

  .album-shelf-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-album-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
