/* ---------------- Base & Font ---------------- */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #111;
  color: #eee;
  font-family: 'Poppins', sans-serif;
}

/* ---------------- Main Container ---------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ---------------- Header Row ---------------- */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.header-row h1 {
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0;
  flex: 1 1 auto;
}
.header-row input {
  flex: 0 1 300px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #444;
  border-radius: 4px;
  background: #222;
  color: #eee;
  font-size: 1rem;
  transition: border-color 0.2s;
  margin-top: 1rem; /* stacks on very small screens */
}
.header-row input::placeholder {
  color: #777;
}
.header-row input:focus {
  outline: none;
  border-color: #007bff;
}

/* ---------------- Gallery Grid ---------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ---------------- Cards ---------------- */
.card {
  background: #1e1e1e;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}
.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: top center;
  cursor: pointer;
}
.card .body {
  padding: 1rem;
}
.card .body h2 {
  margin: 0.3rem 0;
  font-size: 1.2rem;
  font-weight: 500;
}
.card .body .description {
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 0.75rem;
  min-height: 2.5em; /* keep descriptions aligned */
}

/* Make Visit Site button span 100% */
.card .body a {
  display: block;
  width: 100%;
  padding: 0.5rem 0;
  background: #007bff;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  text-align: center;
}
.card .body a:hover {
  background: #0056b3;
}

/* ---------------- Pagination ---------------- */
.pagination {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.page-btn {
  background: #222;
  color: #ccc;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.page-btn:hover {
  background: #333;
}
.page-btn.active {
  background: #007bff;
  color: #fff;
}

/* ---------------- Lightbox ---------------- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 10000;
}
.lightbox.hidden {
  display: none;
}
.lightbox__img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 4px;
  margin: 1rem 0;
  object-fit: contain;
  object-position: top center;
}
.lightbox__caption {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  transition: color 0.2s;
}
.lightbox__close {
  top: 1rem;
  right: 1rem;
}
.lightbox__nav.prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox__nav.next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox__close:hover,
.lightbox__nav:hover {
  color: #bbb;
}

/* Ensure responsiveness for very small screens */
@media (max-width: 400px) {
  .header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .header-row input {
    margin-top: 1rem;
  }
}
