@charset "UTF-8";

/* ??????????????????????????????????????????
   GALLERY ? Category Cards & Filter System
   ?????????????????????????????????????????? */

/* ?? Category cards row ????????????????????? */
.gallery-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.gallery-cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.4rem 0.75rem 1.2rem;
  background: #2a2318;
  border: 1px solid rgba(196, 154, 108, 0.12);
  border-radius: 2px;
  cursor: pointer;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.gallery-cat-card:hover {
  background: #332a1e;
  border-color: rgba(196, 154, 108, 0.3);
  transform: translateY(-2px);
}

.gallery-cat-card.active {
  background: #1a1612;
  border-color: var(--accent);
}

.gallery-cat-card.active:hover {
  transform: translateY(-2px);
}

.gallery-cat-card:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

/* Icon */
.cat-icon {
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.25s ease;
  display: block;
  color: #a08060;
}

.gallery-cat-card:hover .cat-icon,
.gallery-cat-card.active .cat-icon {
  transform: scale(1.15);
  color: #d4a870;
}

/* Label */
.cat-name {
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9e9080;
  transition: color 0.25s ease;
  text-align: center;
  line-height: 1.3;
}

.gallery-cat-card.active .cat-name {
  color: var(--accent);
  font-weight: 500;
}

.gallery-cat-card:hover .cat-name {
  color: #c8b89a;
}

/* Accent line (slides in from left on active) */
.cat-line {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}

.gallery-cat-card.active .cat-line,
.gallery-cat-card:hover .cat-line {
  width: 100%;
}

/* ?? Active category label ?????????????????? */
.gallery-active-label {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 1.75rem 0 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(196, 154, 108, 0.15);
}

#active-cat-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: #c8b89a;
  transition: opacity 0.25s ease;
}

.gallery-count {
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(196, 154, 108, 0.45);
}

/* ?? Gallery grid ??????????????????????????? */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
  transition: opacity 0.28s ease;
}

/* Override the first/last span rules from style.css only when they're visible */
/* .gallery-grid > *:first-child:not(.hidden) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-grid > *:nth-last-child(2):not(.hidden) {
  grid-column: span 2;
  grid-row: span 2;
} */

/* ?? Cell hidden/visible state ?????????????? */
.gallery-cell {
  background: #2a2318;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

/* .gallery-cell:first-child {
  aspect-ratio: unset;
} */

.gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: opacity 0.3s, transform 0.4s;
  cursor: zoom-in;
}

.gallery-cell:hover img {
  opacity: 1;
  transform: scale(1.04);
}

/* Hidden cells: fade + slight scale out */
.gallery-cell.hidden {
  display: none;
}

/* ?? Transition states ?????????????????????? */
.gallery-grid.gallery-transitioning {
  opacity: 0;
  transform: translateY(6px);
}

.gallery-grid.gallery-revealing {
  opacity: 1;
  transform: translateY(0);
  animation: galleryFadeIn 0.38s ease forwards;
}

@keyframes galleryFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ?? Empty state ???????????????????????????? */
.gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
  border: 1px dashed rgba(196, 154, 108, 0.2);
  margin-top: 1.5rem;
  text-align: center;
}

.gallery-empty span {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-style: italic;
  color: #9e9080;
}

.gallery-empty small {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(196, 154, 108, 0.4);
}

/* ?? Responsive ????????????????????????????? */
@media (max-width: 991px) {
  .gallery-categories {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 0.5rem;
  }

  .gallery-cat-card {
    padding: 1.1rem 0.5rem 1rem;
  }

  .cat-icon {
    font-size: 1.25rem;
  }

  .cat-name {
    font-size: 0.58rem;
  }
}

@media (max-width: 576px) {
  .gallery-categories {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

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

  /* .gallery-grid > *:first-child:not(.hidden) {
    grid-column: span 2;
    grid-row: span 1;
  } */

  /* .gallery-grid > *:nth-last-child(2):not(.hidden) {
    grid-column: span 2;
    grid-row: span 1;
  } */

  .gallery-active-label {
    flex-direction: column;
    gap: 0.25rem;
  }
}