* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Roboto', Helvetica, Arial, sans-serif;
  background: #fdfdfd;
  color: #2c2c2c;
  line-height: 1.6;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #ddd6c8;
  padding: 1.5rem 1.5rem 1.25rem;
  text-align: center;
}

header h1 {
  margin: 0 0 0.25rem;
  font-weight: 500;
  font-size: 1.6rem;
  color: #2c2c2c;
}

.subtitle {
  margin: 0 0 1rem;
  color: #7a6a50;
  font-size: 0.9rem;
}

.search-box {
  max-width: 560px;
  margin: 0 auto;
}

#search {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  border: 1px solid #ddd6c8;
  border-radius: 6px;
  font-family: inherit;
  color: #2c2c2c;
}

#search:focus {
  outline: none;
  border-color: #7a6a50;
}

.count {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #999;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.card {
  border: 1px solid #ebe6da;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f1ede4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.card-img.no-image {
  color: #c9c0a8;
  font-size: 0.75rem;
  text-align: center;
  padding: 0.5rem;
}

.card-body {
  padding: 0.75rem 0.9rem;
  flex: 1;
}

.card-date {
  font-size: 0.72rem;
  color: #7a6a50;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.card-place {
  font-size: 0.78rem;
  color: #999;
  margin-bottom: 0.35rem;
}

.card-desc {
  font-size: 0.85rem;
  color: #2c2c2c;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: #999;
  grid-column: 1 / -1;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 12, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.lightbox.hidden { display: none; }

.lightbox-inner {
  background: #fff;
  border-radius: 8px;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 700px) {
  .lightbox-inner { flex-direction: row; }
  #lightbox-img { max-width: 55%; }
}

#lightbox-img {
  display: block;
  max-height: 60vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
}

.lightbox-meta {
  padding: 1.25rem 1.5rem;
}

.lb-date {
  font-size: 0.78rem;
  color: #7a6a50;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.lb-place {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 0.75rem;
}

.lb-desc {
  font-size: 0.95rem;
  color: #2c2c2c;
}

.lb-photographer {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: #999;
  font-style: italic;
}

.lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #999;
  cursor: pointer;
  z-index: 1;
}

.lightbox-close:hover { color: #2c2c2c; }
