/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
  color: #222;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: #222; }
.lang-switcher { display: flex; gap: 0.5rem; }
.lang-switcher a { text-decoration: none; color: #555; font-size: 0.9rem; padding: 0.2rem 0.4rem; }
.lang-switcher a.active { font-weight: 700; color: #000; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 1rem 1rem 3rem; }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  align-items: center;
}
.filter-bar select,
.filter-bar input[type="text"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
}
.filter-bar input[type="text"] { flex: 1; min-width: 160px; }
.filter-bar button {
  padding: 0.4rem 1rem;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}
.filter-bar button:hover { background: #111; }

/* Card grid */
#card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* Card */
.card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

/* Card photos */
.card-photos {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #eee;
}
.card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s;
}
.card-photo.active { opacity: 1; }
.card-no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #bbb;
}

/* Carousel controls */
.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.card-photos:hover .carousel-prev,
.card-photos:hover .carousel-next { opacity: 1; }
.carousel-prev { left: 6px; }
.carousel-next { right: 6px; }
.carousel-counter {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Card body */
.card-body { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.card-title { font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.card-meta { font-size: 0.85rem; color: #555; }
.card-category { font-size: 0.8rem; color: #777; }
.card-id { font-size: 0.75rem; color: #aaa; margin-top: auto; }

/* Load more */
#load-more-btn {
  display: block;
  margin: 1.5rem auto 0;
  padding: 0.6rem 2rem;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}
#load-more-btn:hover { background: #111; }

/* No results */
.no-results { color: #888; padding: 2rem; text-align: center; grid-column: 1/-1; }

/* Responsive */
@media (max-width: 600px) {
  #card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .filter-bar { flex-direction: column; align-items: stretch; }
}
