/* ==========================================================================
   SS & MS FABRICATOR — GALLERY MODULE STYLES
   Loaded only on gallery.index via @push('styles').
   ========================================================================== */

/* ---------------------------------------------------------------------- */
/* FILTER TABS                                                            */
/* ---------------------------------------------------------------------- */
.gallery-filter-tabs{
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}
.gallery-filter-tab{
  border: 1.5px solid var(--color-border);
  background-color: var(--color-white);
  color: var(--color-text-muted);
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.gallery-filter-tab:hover{ border-color: var(--color-secondary); color: var(--color-secondary-dark); }
.gallery-filter-tab.active{ background-color: var(--color-primary); border-color: var(--color-primary); color: var(--color-secondary); }

/* ---------------------------------------------------------------------- */
/* MASONRY GRID (CSS columns — no JS layout library needed)               */
/* ---------------------------------------------------------------------- */
.gallery-masonry{
  column-count: 3;
  column-gap: var(--space-4);
}
@media (max-width: 991.98px){ .gallery-masonry{ column-count: 2; } }
@media (max-width: 575.98px){ .gallery-masonry{ column-count: 1; } }

.gallery-masonry-item{
  break-inside: avoid;
  margin-bottom: var(--space-4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gallery-masonry-item.is-hidden{ display: none; }

.gallery-tile{
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  background: linear-gradient(150deg, var(--color-silver), #f1f3f6);
}
.gallery-tile img{
  width: 100%;
  display: block;
  transition: transform var(--transition-slow);
}
.gallery-tile:hover img{ transform: scale(1.08); }

.gallery-tile-placeholder{
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
}
.gallery-tile-placeholder i{ font-size: 2.6rem; color: var(--color-primary); opacity: 0.3; }

.gallery-tile-overlay{
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0) 40%, rgba(15,23,42,0.88) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  padding: var(--space-4);
}
.gallery-tile:hover .gallery-tile-overlay{ opacity: 1; }

.gallery-tile-zoom, .gallery-tile-play{
  font-size: 2.2rem;
  color: var(--color-secondary);
  margin-bottom: var(--space-3);
  transform: scale(0.7);
  transition: transform var(--transition);
}
.gallery-tile:hover .gallery-tile-zoom,
.gallery-tile:hover .gallery-tile-play{ transform: scale(1); }

.gallery-tile-info{
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  right: var(--space-3);
  text-align: left;
}
.gallery-tile-info h6{ color: var(--color-white); margin: 0 0 2px; font-size: 0.95rem; }
.gallery-tile-info span{ color: var(--color-secondary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }

.gallery-tile-video::before{
  content: '';
  position: absolute; inset: 0;
  background: rgba(15,23,42,0.25);
  z-index: 1;
}

/* ---------------------------------------------------------------------- */
/* LIGHTBOX                                                               */
/* ---------------------------------------------------------------------- */
.gallery-lightbox{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background-color: rgba(6,10,18,0.95);
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.gallery-lightbox.is-open{ display: flex; animation: lightbox-fade 0.3s ease; }
@keyframes lightbox-fade{ from{ opacity: 0; } to{ opacity: 1; } }

.gallery-lightbox-content{ max-width: 900px; width: 100%; text-align: center; }
.gallery-lightbox-content img{
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin-inline: auto;
}
.gallery-lightbox-video-wrap{ width: 100%; }
.gallery-lightbox-video-wrap video{
  width: 100%;
  max-height: 80vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background-color: #000;
}
.gallery-lightbox-caption{ color: var(--color-silver); margin-top: var(--space-4); font-size: 0.95rem; }

.gallery-lightbox-close{
  position: absolute;
  top: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255,255,255,0.1);
  color: var(--color-white);
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.gallery-lightbox-close:hover{ background-color: var(--color-secondary); color: var(--color-primary); }

.gallery-lightbox-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255,255,255,0.1);
  color: var(--color-white);
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 2;
}
.gallery-lightbox-nav:hover{ background-color: var(--color-secondary); color: var(--color-primary); transform: translateY(-50%) scale(1.08); }
.gallery-lightbox-prev{ left: 16px; }
.gallery-lightbox-next{ right: 16px; }

@media (max-width: 575.98px){
  .gallery-lightbox-close{ top: 12px; right: 12px; width: 38px; height: 38px; }
  .gallery-lightbox-nav{ width: 40px; height: 40px; font-size: 1.1rem; }
  .gallery-lightbox-prev{ left: 8px; }
  .gallery-lightbox-next{ right: 8px; }
}

/* ---------------------------------------------------------------------- */
/* FRAMED GRID — rows & columns in upload sequence (overrides masonry)    */
/* ---------------------------------------------------------------------- */
.gallery-masonry{
  column-count: initial;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}
@media (max-width: 1199.98px){ .gallery-masonry{ grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px){ .gallery-masonry{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); } }
@media (max-width: 379.98px){ .gallery-masonry{ grid-template-columns: minmax(0, 1fr); } }

.gallery-masonry-item{ margin-bottom: 0; }

/* The frame: white mat + thin border around every photo */
.gallery-masonry .gallery-tile{
  padding: 8px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.gallery-masonry .gallery-tile:hover{ box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.gallery-masonry .gallery-tile img,
.gallery-masonry .gallery-tile-placeholder{
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  background: linear-gradient(150deg, var(--color-silver), #f1f3f6);
}
.gallery-masonry .gallery-tile-overlay{
  inset: 8px;
  border-radius: calc(var(--radius) - 4px);
}

/* Video tiles: real first-frame thumbnail with an always-visible play badge */
.gallery-masonry .gallery-tile-video-thumb{
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  background: #0B1220;
  pointer-events: none;
}
.gallery-masonry .gallery-tile-video::after{
  content: '\F4F4'; /* bootstrap-icons play-circle-fill */
  font-family: 'bootstrap-icons';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: var(--color-secondary);
  text-shadow: 0 4px 18px rgba(0,0,0,0.45);
  z-index: 2;
  pointer-events: none;
}
.gallery-masonry .gallery-tile-video::before{ inset: 8px; border-radius: calc(var(--radius) - 4px); }
.gallery-masonry .gallery-tile-video:hover::after{ opacity: 0; }
