/*
 Theme Name:   GeneratePress Photo Grid
 Template:     generatepress
 Description:  Custom square-grid child theme for photo blog
 Version:      1.0
*/

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px;
}

.photo-grid-item {
  position: relative;
  display: block;
  text-decoration: none;
}

.photo-grid-thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.photo-grid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-grid-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
  color: #fff;
}

.photo-grid-item:hover .photo-grid-overlay,
.photo-grid-item:focus .photo-grid-overlay {
  opacity: 1;
}

.photo-grid-title {
  font-size: 1.1rem;
  font-weight: 600;
  order: 1;
}

.photo-grid-category {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 4px;
  order: 2;
}

/* Mobile: single-column stack (from Step 3's grid-template-columns), so replace the
   hover overlay with a plain caption below each photo — always visible, no darkening. */
@media (max-width: 600px) {
  .photo-grid-overlay {
    position: static;         /* sits below the thumb in normal flow instead of on top of it */
    opacity: 1 !important;    /* always visible, no hover/tap needed */
    background: none;         /* no darkening of the photo */
    color: inherit;           /* readable against the page background, not white-on-white */
    flex-direction: row;
    justify-content: flex-start;
    align-items: baseline;
    gap: 6px;
    text-align: left;
    padding: 8px 4px;
  }

  .photo-grid-category {
    margin-top: 0;
    opacity: 0.6;
  }

  .photo-grid-category::before {
    content: "· ";
  }
}

/* GeneratePress still treats #content as a flex row (for a content+sidebar layout)
   even with the sidebar turned off. Since we don't need that layout anymore,
   switch it to normal block stacking so everything sits full-width, one below the other. */
#content.site-content {
  display: block !important;
}

/* Pagination: centered below the grid */
.nav-links {
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0 0 !important;
}