/* ===================================================
   Ben Franklin Print Co. - Gallery Stylesheet
   =================================================== */

/* ---- Color Tokens ---- */
:root {
  --gallery-brand-dark: #1B3B2B;
  --gallery-brand-primary: #284735;
  --gallery-brand-gold: #C89B3C;
  --gallery-gold-light: #e5b958;
  --gallery-card-bg: #ffffff;
}

/* ---- Gallery Hero ---- */
.gallery-hero {
  background: linear-gradient(135deg, #132b1f 0%, #1B3B2B 50%, #0d1e15 100%);
  overflow: hidden;
}

.gallery-hero-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(200, 155, 60, 0.15) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.6;
  z-index: 0;
}

.bg-dark-glass {
  background: rgba(19, 43, 31, 0.75);
  backdrop-filter: blur(10px);
}

.border-gold-subtle {
  border-color: rgba(200, 155, 60, 0.3) !important;
}

.tracking-wider {
  letter-spacing: 2px;
}

.tracking-tight {
  letter-spacing: -1px;
}

.max-w-700 {
  max-width: 700px;
}

.bg-gold {
  background-color: var(--gallery-brand-gold) !important;
  color: #1B3B2B !important;
}

.text-gold {
  color: var(--gallery-brand-gold) !important;
}

.bg-light-gradient {
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

/* ---- Main 4 Category Cards ---- */
.category-card {
  height: 320px;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.35s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.3s ease;
  border: 2px solid transparent !important;
  background-color: #111;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 36px rgba(27, 59, 43, 0.25) !important;
  border-color: var(--gallery-brand-gold) !important;
}

.category-card.active-cat {
  border-color: var(--gallery-brand-gold) !important;
  box-shadow: 0 0 0 4px rgba(200, 155, 60, 0.3), 0 12px 28px rgba(27, 59, 43, 0.3) !important;
}

.category-card-img-wrap {
  width: 100%;
  height: 100%;
  position: relative;
}

.category-card-img {
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.category-card:hover .category-card-img {
  transform: scale(1.08);
}

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(19, 43, 31, 0.92) 85%);
  z-index: 2;
}

.cat-active-indicator {
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.category-card.active-cat .cat-active-indicator {
  opacity: 1;
  transform: scale(1);
}

/* ---- Controls Toolbar ---- */
.gallery-controls-card {
  border-color: #e9ecef !important;
}

.cat-tab-btn {
  border-color: #dee2e6;
  color: #495057;
  letter-spacing: 1px;
  transition: all 0.25s ease;
}

.cat-tab-btn:hover {
  background-color: var(--gallery-brand-primary);
  border-color: var(--gallery-brand-primary);
  color: #ffffff;
}

.cat-tab-btn.active {
  background-color: var(--gallery-brand-dark) !important;
  border-color: var(--gallery-brand-dark) !important;
  color: var(--gallery-brand-gold) !important;
  box-shadow: 0 4px 12px rgba(27, 59, 43, 0.2);
}

/* Subcategory Pills */
.subcat-pill {
  border: 1px solid #ced4da;
  background-color: #f8f9fa;
  color: #333333;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 50rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.subcat-pill:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
}

.subcat-pill.active {
  background-color: var(--gallery-brand-dark) !important;
  border-color: var(--gallery-brand-dark) !important;
  color: var(--gallery-brand-gold) !important;
  box-shadow: 0 2px 8px rgba(27, 59, 43, 0.2);
}

.subcat-pill .badge {
  font-size: 0.75rem;
  background-color: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.subcat-pill.active .badge {
  background-color: rgba(200, 155, 60, 0.25);
  color: var(--gallery-brand-gold);
}

/* ---- Gallery Grid & Image Cards ---- */
.gallery-item-card {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  background-color: #f1f3f5;
  aspect-ratio: 4 / 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease;
}

.gallery-item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(27, 59, 43, 0.18);
}

/* Image Shimmer & Loading State */
.skeleton-card {
  height: 240px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.75rem;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.gallery-img-wrap {
  position: absolute;
  inset: 0;
  background-color: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-img.loaded {
  opacity: 1;
  transform: scale(1);
}

/* Hover Overlay */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(27, 59, 43, 0.85) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-column: column;
  justify-content: space-between;
  padding: 1rem;
  z-index: 3;
}

.gallery-item-card:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-zoom-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(200, 155, 60, 0.9);
  color: #1B3B2B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.gallery-item-card:hover .gallery-zoom-icon {
  transform: scale(1);
}

.subcat-tag-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 0.3rem 0.6rem;
  border-radius: 0.375rem;
  align-self: flex-start;
}

/* ---- Lightbox Modal ---- */
.gallery-lightbox-modal .modal-content {
  background-color: #0b1510 !important;
  border: 1px solid rgba(200, 155, 60, 0.3) !important;
}

.min-h-400 {
  min-height: 480px;
  max-height: 80vh;
}

.lightbox-img {
  max-height: 75vh;
  max-width: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(27, 59, 43, 0.75);
  border: 1px solid rgba(200, 155, 60, 0.5);
  color: #ffffff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.lightbox-nav-btn:hover {
  background: var(--gallery-brand-gold);
  color: #1B3B2B;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev-btn {
  left: 20px;
}

.lightbox-next-btn {
  right: 20px;
}

/* Responsive Tweaks */
@media (max-width: 767.98px) {
  .category-card {
    height: 240px;
  }
  .w-100-mobile {
    width: 100% !important;
  }
  .min-h-400 {
    min-height: 320px;
  }
  .lightbox-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  .lightbox-prev-btn {
    left: 8px;
  }
  .lightbox-next-btn {
    right: 8px;
  }
}
