/* ============================================================
   GALLERY.CSS — SkillShowcase Gallery Page
   ============================================================ */

/* ── Page Hero ──────────────────────────────────────────────── */
.gallery-hero {
  background: linear-gradient(135deg, #0a1020 0%, #1a2744 55%, #0f3460 100%);
  padding: 48px 0 52px;
  position: relative;
  overflow: hidden;
}

.gallery-hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--gray-100, #f8fafc);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.gallery-hero__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gallery-hero__breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .5);
}

.gallery-hero__breadcrumb a {
  color: rgba(255, 255, 255, .6);
  text-decoration: none;
  transition: color .2s;
}

.gallery-hero__breadcrumb a:hover {
  color: #fff;
}

.gallery-hero__breadcrumb span:last-child {
  color: rgba(255, 255, 255, .8);
}

.gallery-hero__title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  color: #fff;
  letter-spacing: -1.5px;
  line-height: 1.05;
}

.gallery-hero__sub {
  font-size: 16px;
  color: rgba(255, 255, 255, .65);
}

.gallery-hero__sub strong {
  color: #60a5fa;
}

/* Search bar */
.gallery-hero__search {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
  max-width: 640px;
  padding: 4px 4px 4px 16px;
  gap: 8px;
}

.gallery-hero__search-icon {
  font-size: 16px;
  color: #94a3b8;
}

.gallery-hero__search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14.5px;
  font-family: inherit;
  color: #1a2744;
  background: transparent;
  padding: 8px 0;
}

.gallery-hero__search-input::placeholder {
  color: #94a3b8;
}

/* Quick stats */
.gallery-hero__stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gstat {
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
}

.gstat strong {
  color: #60a5fa;
  font-weight: 700;
}

.gstat-sep {
  color: rgba(255, 255, 255, .3);
}

/* ── Main layout ────────────────────────────────────────────── */
.gallery-main {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  padding-top: 32px;
  padding-bottom: 64px;
  align-items: start;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.gallery-sidebar-overlay {
  display: none;
}

.gallery-sidebar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  position: sticky;
  top: 80px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .05);
}

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sidebar__title {
  font-size: 15px;
  font-weight: 800;
  color: #1a2744;
}

.sidebar__clear {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color .2s;
}

.sidebar__clear:hover {
  color: #1e40af;
}

.filter-group {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
}

.filter-group:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.filter-group__title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin-bottom: 10px;
}

.filter-check-list,
.filter-rating-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  padding: 3px 0;
  border-radius: 4px;
  transition: color .15s;
}

.filter-check:hover {
  color: #1a2744;
}

.filter-check input[type="checkbox"],
.filter-check input[type="radio"] {
  accent-color: #1a2744;
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar__apply-btn {
  display: none;
  /* shown only on mobile */
  width: 100%;
  margin-top: 16px;
  padding: 11px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
}

/* ── Gallery Content ────────────────────────────────────────── */
.gallery-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Toolbar */
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
}

.gallery-toolbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gallery-toolbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gallery-count {
  font-size: 13px;
  color: #64748b;
}

.gallery-count strong {
  color: #1a2744;
}

.btn--outline-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  display: none;
  /* shown only on mobile */
}

.btn--outline-sm:hover {
  border-color: #1a2744;
}

/* Filter chips */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
  cursor: default;
}

.filter-chip__remove {
  cursor: pointer;
  color: #93c5fd;
  font-size: 14px;
  line-height: 1;
  transition: color .15s;
}

.filter-chip__remove:hover {
  color: #1d4ed8;
}

/* Card thumbnail bg variants */
.video-card__bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.video-card__bg--welding {
  background: linear-gradient(135deg, #1e3a5f 0%, #f97316 100%);
}

.video-card__bg--gypsum {
  background: linear-gradient(135deg, #1a3a2a 0%, #4ade80 100%);
}

.video-card__bg--formwork {
  background: linear-gradient(135deg, #1a1a2e 0%, #6366f1 100%);
}

.video-card__bg--tiling {
  background: linear-gradient(135deg, #1e2d3d 0%, #06b6d4 100%);
}

.video-card__bg--masonry {
  background: linear-gradient(135deg, #2d1a00 0%, #d97706 100%);
}

.video-card__bg--plumbing {
  background: linear-gradient(135deg, #0f1f33 0%, #3b82f6 100%);
}

.video-card__bg--painting {
  background: linear-gradient(135deg, #2d001f 0%, #ec4899 100%);
}

.video-card__bg--electrical {
  background: linear-gradient(135deg, #1a1a00 0%, #eab308 100%);
}

/* Ensure card thumbs are relative */
.video-card__thumb {
  position: relative;
}

/* Empty state */
.gallery-empty {
  text-align: center;
  padding: 64px 32px;
  background: #fff;
  border: 1px dashed #e2e8f0;
  border-radius: 14px;
}

.gallery-empty__icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.gallery-empty h3 {
  font-size: 18px;
  font-weight: 800;
  color: #1a2744;
  margin-bottom: 8px;
}

.gallery-empty p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 20px;
}

/* Load more */
.gallery-load-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.btn--load-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #1a2744;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}

.btn--load-more:hover {
  border-color: #1a2744;
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.gallery-load-more__hint {
  font-size: 12px;
  color: #94a3b8;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .gallery-main {
    grid-template-columns: 220px 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .gallery-main {
    grid-template-columns: 1fr;
  }

  .gallery-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    z-index: 100;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform .3s ease;
    overflow-y: auto;
    display: block !important;
    /* override inline hide */
  }

  .gallery-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
  }

  .gallery-sidebar-overlay {
    display: none;
  }

  .gallery-sidebar-overlay.is-active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 99;
    backdrop-filter: blur(2px);
    animation: fadeIn .2s ease;
  }

  .sidebar__apply-btn {
    display: block;
  }

  .gallery-filter-toggle {
    display: inline-flex !important;
  }
}

@media (max-width: 500px) {
  .gallery-hero {
    padding: 36px 0 44px;
  }

  .gallery-hero__title {
    letter-spacing: -1px;
  }

  .gallery-hero__search {
    flex-wrap: wrap;
    background: transparent;
    box-shadow: none;
    padding: 0;
    gap: 12px;
  }

  .gallery-hero__search-icon {
    display: none;
  }

  .gallery-hero__search-input {
    background: #fff;
    padding: 14px 16px;
    border-radius: 8px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  #gallerySearchBtn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
  }
}

@media (min-width: 1025px) {
  .gallery-main .videos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}