/* =========================================================
   P'rabote — gallery.css
   Customer gallery / lookbook page (templates/page.gallery.json).
   ========================================================= */

:root {
  /* Figma tokens not yet in base.css */
  --color-text-secondary: #475569;
  --color-brand-secondary-default: #785930;
}

/* =========================================================
   PAGE HEADER  (sections/page-header.liquid)
   ========================================================= */
.gallery-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 56px var(--page-gutter) 48px;
  background: var(--color-bg-secondary);
}
.gallery-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-neutral-500);
  white-space: nowrap;
}
.gallery-breadcrumb a:hover {
  color: var(--color-text-primary);
}
.gallery-header h1 {
  color: var(--color-text-primary);
}
.gallery-header__text {
  font-size: 16px;
  line-height: 24px;
  color: var(--color-neutral-500);
}

/* =========================================================
   GALLERY GRID  (sections/main-gallery.liquid)
   ========================================================= */
.gallery-main {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 48px var(--page-gutter) 96px;
}

/* ---- Filters ---- */
.gallery-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.gallery-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}
.gallery-chip {
  padding: 7px 16px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.gallery-chip:hover {
  border-color: var(--color-text-primary);
  color: var(--color-text-primary);
}
.gallery-chip.is-active {
  padding: 10px 18px;
  border: 0;
  background: var(--color-brand-default);
  color: var(--color-text-inverse);
}
.gallery-filters__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.gallery-filters__count {
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.gallery-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 15px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
}
.gallery-share-btn:hover {
  border-color: var(--color-text-primary);
}
.gallery-share-btn img {
  width: 16px;
  height: 16px;
}

/* ---- Masonry ----
   Desktop: 4 columns in order 1-2-3-4 (pairs are "display: contents").
   Tablet/mobile: each pair becomes one column (1+3, 2+4). */
.gallery-masonry {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.gallery-masonry__pair {
  display: contents;
}
.gallery-masonry__col {
  flex: 1 1 0;
  min-width: 1px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.gallery-masonry__col--1 { order: 1; }
.gallery-masonry__col--2 { order: 2; }
.gallery-masonry__col--3 { order: 3; }
.gallery-masonry__col--4 { order: 4; }

.gallery-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gallery-item[hidden] {
  display: none;
}
.gallery-item__photo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  aspect-ratio: var(--ratio);
  padding: 16px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-bg-secondary);
}
.gallery-item__photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}
.gallery-item:hover .gallery-item__photo > img {
  transform: scale(1.03);
}
.gallery-save {
  position: relative;
  z-index: 1;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-bg-primary);
}
.gallery-save img {
  width: 20px;
  height: 20px;
}
.gallery-save.is-active img {
  filter: brightness(0) saturate(100%) invert(31%) sepia(28%) saturate(860%) hue-rotate(95deg) brightness(92%) contrast(88%);
}
.gallery-look {
  position: relative;
  z-index: 2; /* above the gradient */
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 12px;
  border-radius: var(--radius-full);
  background: var(--color-bg-primary);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
}
.gallery-look:hover {
  color: var(--color-brand-default);
}
.gallery-look img {
  width: 16px;
  height: 16px;
}
.gallery-item__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}
.gallery-item__handle {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.gallery-item__room {
  font-size: 12px;
  line-height: 16px;
  color: var(--color-text-secondary);
}

.gallery-empty {
  padding: 48px 0;
  text-align: center;
  font-size: 16px;
  line-height: 24px;
  color: var(--color-neutral-500);
}

/* ---- Load more ---- */
.gallery-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
}
.gallery-more__status {
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-secondary);
}
.gallery-more__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
}
.gallery-more__btn:hover {
  border-color: var(--color-text-primary);
}
.gallery-more__btn:disabled {
  opacity: 0.5;
  cursor: default;
  border-color: var(--color-border-default);
}
.gallery-more__btn img {
  width: 20px;
  height: 20px;
}

/* =========================================================
   SHARE CTA  (sections/gallery-share-cta.liquid)
   ========================================================= */
.gallery-cta {
  padding: 0 var(--page-gutter) 96px;
}
.gallery-cta__band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  padding: 56px 64px;
  border-radius: 24px;
  background: var(--color-brand-hover);
  color: var(--color-text-inverse);
}
.gallery-cta__text {
  flex: 1 1 0;
  min-width: 1px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gallery-cta__eyebrow {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}
.gallery-cta__desc {
  font-size: 16px;
  line-height: 24px;
}
.gallery-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 13px 28px;
  border-radius: var(--radius-full);
  background: var(--color-brand-secondary-default);
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  color: var(--color-text-inverse);
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.gallery-cta__btn:hover {
  filter: brightness(1.1);
}
.gallery-cta__btn img {
  width: 20px;
  height: 20px;
}

/* =========================================================
   TABLET (Figma: 768)
   ========================================================= */
@media (max-width: 1023px) {
  .gallery-filters {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .gallery-masonry__pair {
    flex: 1 1 0;
    min-width: 1px;
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .gallery-masonry__col {
    flex: none;
  }

  .gallery-cta__band {
    padding: 32px;
  }
}

/* =========================================================
   MOBILE (Figma: 390)
   ========================================================= */
@media (max-width: 767px) {
  .gallery-main {
    padding-bottom: 64px;
  }
  .gallery-item__photo {
    padding: 10px;
  }
  .gallery-save {
    width: 40px;
    height: 20px;
  }
  .gallery-look {
    padding: 8px 12px 8px 10px;
    gap: 6px;
  }
  .gallery-look__prefix {
    display: none;
  }
  .gallery-item__caption {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    white-space: normal;
  }

  .gallery-cta {
    padding-bottom: 64px;
  }
  .gallery-cta__band {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 24px;
  }
  .gallery-cta__text {
    flex: none;
    width: 100%;
  }
}
