/* Scoped styles for portfolio gallery (view_projects.php) */
.items.page-container {
  display: grid;
  grid-template-columns: 1fr; /* mobile-first: single column */
  gap: 16px;
  align-items: stretch;
  grid-auto-flow: row;
}

/* At 600px and up, use two columns */
@media (min-width: 600px) {
  .items.page-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* At 900px and up, use three columns */
@media (min-width: 900px) {
  .items.page-container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.items.page-container article { margin: 0; }
.gallery {
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.gallery:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.10);
}
.gallery-image { position: relative; }
.gallery-image a { display: block; }
.gallery-img img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform .3s ease;
}
.gallery-img img[src$=".svg"] {
  object-fit: contain;
  background: #fff;
  padding: 8px;
}
.gallery:hover .gallery-img img { transform: scale(1.03); }
.gallery-img-title {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
  color: #fff;
}
.gallery-img-title h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.gallery-desc { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.gallery-desc-text { margin: 0; color: #42484f; line-height: 1.5; }
.gallery-desc-link { margin-top: auto; }
.gallery-desc-link-btn { display: inline-block; padding: 10px 14px; border-radius: 10px; font-weight: 600; color: #fff; text-decoration: none; }
.gallery-desc-wrapper { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-desc-tag { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: .85rem; text-decoration: none; color: #0a402e; background: #d8f3dc; }

/* Pagination */
#wrapper { margin-top: 16px; }
#pagination { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; }
#pagination li a { display: inline-block; min-width: 36px; text-align: center; padding: 8px 10px; border-radius: 10px; text-decoration: none; border: 1px solid #e6e8ec; color: #334; background: #fff; }
#pagination li.active a { background: #03989e; color: #fff; border-color: #03989e; }
#pagination li a:hover { border-color: #b9c0c7; }

@media (prefers-color-scheme: dark) {
  .gallery { background: #111; border-color: #2a2a2a; box-shadow: 0 6px 14px rgba(0,0,0,0.35); }
  .gallery-desc-text { color: #cfd3d7; }
  #pagination li a { background: #141414; border-color: #2a2a2a; color: #d8dde3; }
  #pagination li a:hover { border-color: #3a3f45; }
  .gallery-desc-tag { background: #133b3f; color: #d0f3f5; }
}
