/* ==========================================================================
   Goldwood Portfolio – Frontend Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section wrapper
   -------------------------------------------------------------------------- */
.gw-portfolio {
  padding: 40px 0;
}

/* --------------------------------------------------------------------------
   Filter buttons
   -------------------------------------------------------------------------- */
.gw-portfolio__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
}

.gw-filter-btn {
  background: transparent;
  border: 2px solid #b8965a;
  color: #b8965a;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 8px 24px;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.25s, color 0.25s;
}

.gw-filter-btn:hover,
.gw-filter-btn.active {
  background: #b8965a;
  color: #fff;
}

/* --------------------------------------------------------------------------
   Grid
   -------------------------------------------------------------------------- */
.gw-portfolio__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

@media (max-width: 576px) {
  .gw-portfolio__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.gw-portfolio__item {
  /* items hidden by filter JS get display:none */
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.gw-portfolio__card {
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  background: #fff;
  outline: none;
}

.gw-portfolio__card:hover,
.gw-portfolio__card:focus {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   Cover image
   -------------------------------------------------------------------------- */
.gw-portfolio__cover {
  position: relative;
  width: 100%;
  padding-top: 66.66%;   /* 3:2 aspect ratio */
  overflow: hidden;
  background: #f0ece6;
}

.gw-portfolio__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gw-portfolio__card:hover .gw-portfolio__cover img {
  transform: scale(1.05);
}

.gw-portfolio__no-image {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 48px;
}

/* Overlay on hover */
.gw-portfolio__overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 20, 10, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.gw-portfolio__card:hover .gw-portfolio__overlay,
.gw-portfolio__card:focus .gw-portfolio__overlay {
  opacity: 1;
}

.gw-portfolio__zoom {
  color: #fff;
  font-size: 32px;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Card label
   -------------------------------------------------------------------------- */
.gw-portfolio__label {
  padding: 12px 14px;
  background: #fff;
}

.gw-portfolio__name {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #2c2018;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gw-portfolio__category {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  color: #fff;
  display: inline-block;
}

.gw-portfolio__category--domestico    { background: #5b8c5a; }
.gw-portfolio__category--profissional { background: #3a6186; }

/* Empty state */
.gw-portfolio__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #999;
  font-size: 1rem;
  padding: 40px 0;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.gw-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;           /* toggled by JS */
  align-items: center;
  justify-content: center;
}

.gw-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 7, 4, 0.88);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Lightbox box
   -------------------------------------------------------------------------- */
.gw-lightbox__box {
  position: relative;
  z-index: 1;
  width: 92vw;
  max-width: 1000px;
  background: #1a1208;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 95vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

/* Close button */
.gw-lightbox__close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 10;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.gw-lightbox__close:hover { opacity: 1; }

/* --------------------------------------------------------------------------
   Main image area
   -------------------------------------------------------------------------- */
.gw-lightbox__main {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

.gw-lightbox__img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 16px 60px;
  box-sizing: border-box;
}

.gw-lightbox__img-wrap img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 2px;
  display: block;
  margin: 0 auto;
}

/* Navigation arrows */
.gw-lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  padding: 12px 16px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s;
  z-index: 5;
  line-height: 1;
}

.gw-lightbox__arrow:hover { background: rgba(184, 150, 90, 0.5); }

.gw-lightbox__arrow--prev { left: 8px; }
.gw-lightbox__arrow--next { right: 8px; }

/* --------------------------------------------------------------------------
   Caption
   -------------------------------------------------------------------------- */
.gw-lightbox__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.4);
  color: #e8d8b8;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.gw-lightbox__counter {
  font-size: 0.75rem;
  color: #a89070;
}

/* --------------------------------------------------------------------------
   Thumbnails strip
   -------------------------------------------------------------------------- */
.gw-lightbox__thumbs {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.55);
  scrollbar-width: thin;
  scrollbar-color: #b8965a #1a1208;
}

.gw-lightbox__thumbs::-webkit-scrollbar        { height: 4px; }
.gw-lightbox__thumbs::-webkit-scrollbar-track  { background: #1a1208; }
.gw-lightbox__thumbs::-webkit-scrollbar-thumb  { background: #b8965a; border-radius: 2px; }

.gw-lightbox__thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 2px;
  cursor: pointer;
  opacity: 0.55;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: opacity 0.2s, border-color 0.2s;
}

.gw-lightbox__thumb:hover,
.gw-lightbox__thumb.active {
  opacity: 1;
  border-color: #b8965a;
}

/* --------------------------------------------------------------------------
   Responsive tweaks
   -------------------------------------------------------------------------- */
/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet – 2 colunas */
@media (max-width: 992px) {
  .gw-portfolio {
    padding: 24px 0;
  }

  .gw-portfolio__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .gw-filter-btn {
    font-size: 0.78rem;
    padding: 7px 18px;
  }
}

/* Mobile grande – 2 colunas pequenas */
@media (max-width: 768px) {
  .gw-portfolio__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .gw-portfolio__filters {
    gap: 8px;
    margin-bottom: 24px;
  }

  .gw-portfolio__name {
    font-size: 0.85rem;
  }

  /* Lightbox */
  .gw-lightbox__img-wrap {
    padding: 12px 48px;
  }

  .gw-lightbox__arrow {
    font-size: 1.2rem;
    padding: 8px 10px;
  }

  .gw-lightbox__thumb {
    width: 48px;
    height: 36px;
  }
}

/* Mobile pequeno – 1 coluna */
@media (max-width: 480px) {
  .gw-portfolio__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gw-portfolio__filters {
    flex-direction: column;
    align-items: center;
  }

  .gw-filter-btn {
    width: 100%;
    max-width: 220px;
    text-align: center;
  }

  .gw-portfolio__label {
    padding: 8px 10px;
  }

  /* Lightbox fullscreen */
  .gw-lightbox__box {
    width: 100vw;
    border-radius: 0;
    max-height: 100vh;
  }

  .gw-lightbox__img-wrap {
    padding: 8px 40px;
  }

  .gw-lightbox__caption {
    font-size: 0.75rem;
    padding: 6px 10px;
  }
}
