/* ==========================================================================
   Patriot Lawn & Yard — Project Gallery + Lightbox
   Loaded after style.css. Uses the color tokens defined there.
   ========================================================================== */

/* ---------- Gallery grid ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.project-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--charcoal-3);
  border: 1px solid rgba(201, 162, 75, 0.25);
  cursor: zoom-in;
  text-align: left;
  color: var(--cream);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.project-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s ease;
}

.project-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 7, 0) 45%, rgba(10, 8, 7, 0.85) 100%);
  pointer-events: none;
}

.project-tile:hover,
.project-tile:focus-visible {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
  outline: none;
}

.project-tile:hover img,
.project-tile:focus-visible img {
  transform: scale(1.05);
}

.project-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #1a1210;
  background: var(--gold);
  padding: 2px 8px;
  border-radius: 3px;
}

.project-tag.in-progress {
  background: var(--red-bright);
  color: #fff;
}

.project-title {
  font-family: "Anton", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.2;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Tiles past the first nine stay hidden until "See all" is clicked */
.project-grid:not(.expanded) .project-tile.is-extra {
  display: none;
}

.gallery-actions {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 5, 0.94);
  padding: 70px 70px 90px;
}

.lightbox.open {
  display: flex;
}

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 190px);
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  text-align: center;
  font-family: "Anton", sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 1.05rem;
  color: var(--cream);
}

.lightbox-count {
  display: block;
  font-family: "Oswald", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: 4px;
}

.lightbox-btn {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(243, 237, 224, 0.1);
  border: 1px solid rgba(243, 237, 224, 0.3);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}

.lightbox-btn:hover,
.lightbox-btn:focus-visible {
  background: var(--red-bright);
  border-color: var(--red-bright);
  outline: none;
}

.lightbox-btn .icon {
  width: 24px;
  height: 24px;
}

.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }

body.lightbox-locked {
  overflow: hidden;
}

/* ---------- About section photo ---------- */
.about-visual.has-photo {
  background: var(--charcoal-3);
}

.about-visual.has-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-visual.has-photo .badge-star {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 64px;
  height: 64px;
}

.about-visual.has-photo .badge-star .icon {
  width: 32px;
  height: 32px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Two columns: show 8 first so the last row isn't a lone tile */
  .project-grid:not(.expanded) .project-tile:nth-child(9) {
    display: none;
  }
}

@media (max-width: 640px) {
  .project-grid {
    gap: 12px;
  }

  .project-caption {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .project-title {
    font-size: 0.85rem;
  }

  /* Keep small tiles clean: service tags only show for in-progress shots */
  .project-tag {
    display: none;
    font-size: 0.6rem;
    padding: 1px 6px;
  }

  .project-tag.in-progress {
    display: inline-block;
  }

  .lightbox {
    padding: 64px 12px 110px;
  }

  .lightbox-img {
    max-height: calc(100vh - 220px);
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 24px;
    transform: none;
  }

  .lightbox-prev { left: calc(50% - 66px); }
  .lightbox-next { right: calc(50% - 66px); }
}
