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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1e1e1e;
  --border: #222;
  --text: #e0e0e0;
  --text-muted: #888;
  --accent: #c9a96e;
  --accent-hover: #dbb97e;
  --white: #fff;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-family: Inter, -apple-system, sans-serif;
  line-height: 1.6;
}

.header {
  position: sticky;
  z-index: 100;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  background: #0a0a0ae6;
  align-items:  center;
  height: 60px;
  top: 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: lowercase;
  font-family: Playfair Display, serif;
  font-size: 28px;
  font-weight: 700;
}

.header-count {
  color: var(--text-muted);
  letter-spacing: 1px;
  font-size: 13px;
}

.hero {
  text-align: center;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 80px 24px;
}

.hero h1 {
  color: var(--white);
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-family: Playfair Display, serif;
  font-size: 48px;
  font-weight: 600;
}

.hero p {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 16px;
  font-weight: 300;
}

.fetch-btn {
  background: var(--accent);
  color: var(--bg);
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  padding: 12px 32px;
  transition: all .2s;
  font-size: 14px;
  font-weight: 500;
}

.fetch-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.fetch-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.gallery {
  max-width: 1400px;
  min-height: 60vh;
  margin: 0 auto;
  padding: 48px 24px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  transition: all .3s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px #0006;
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  width: 100%;
  height: 300px;
}

.card-placeholder {
  position: absolute;
  animation: pulse 1.5s ease-in-out infinite;
  background: linear-gradient(135deg, #1a1a1a, #222);
  inset: 0;
}

@keyframes pulse {
  0%, 100% {
    opacity: .5;
  }

  50% {
    opacity: 1;
  }
}

.card-img-wrap img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: opacity .4s, transform .5s;
}

.card:hover .card-img-wrap img {
  transform: scale(1.05);
}

.card-info {
  padding: 16px;
}

.card-info h3 {
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
  font-family: Playfair Display, serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.card-info p {
  color: var(--text-muted);
  font-size: 13px;
}

.card-year {
  color: var(--accent);
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
}

.loading, .empty {
  text-align: center;
  color: var(--text-muted);
  padding: 80px 24px;
  font-size: 16px;
}

.empty p + p {
  margin-top: 8px;
  font-size: 14px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items:  center;
  gap: 24px;
  margin-top: 48px;
  padding: 24px 0;
}

.pagination button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: 8px 20px;
  transition: all .2s;
  font-size: 13px;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination button:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.pagination span {
  color: var(--text-muted);
  font-size: 13px;
}

.lightbox-overlay {
  position: fixed;
  z-index: 200;
  display: flex;
  animation: fadeIn .2s ease;
  background: #000000eb;
  justify-content: center;
  align-items:  center;
  padding: 24px;
  inset: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.lightbox {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: auto;
  position: relative;
  flex-direction: column;
  max-width: 900px;
  max-height: 90vh;
}

.lightbox-close {
  position: absolute;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 10;
  background: none;
  border: none;
  transition: color .2s;
  font-size: 20px;
  top: 12px;
  right: 16px;
}

.lightbox-close:hover {
  color: var(--white);
}

.lightbox img {
  object-fit: contain;
  background: #000;
  width: 100%;
  max-height: 60vh;
}

.lightbox-info {
  padding: 24px;
}

.lightbox-info h2 {
  color: var(--white);
  margin-bottom: 8px;
  font-family: Playfair Display, serif;
  font-size: 22px;
}

.lightbox-artist {
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 15px;
}

.lightbox-year {
  color: var(--text-muted);
  margin-bottom: 4px;
  font-size: 13px;
}

.lightbox-medium {
  color: var(--text-muted);
  margin-bottom: 8px;
  font-size: 13px;
  font-style: italic;
}

.lightbox-dept {
  display: inline-block;
  color: var(--accent);
  border: 1px solid var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding: 2px 8px;
  font-size: 11px;
}

.delete-btn {
  display: block;
  color: #e74c3c;
  cursor: pointer;
  background: none;
  border: 1px solid #c0392b;
  margin-top: 16px;
  padding: 8px 16px;
  transition: all .2s;
  font-size: 12px;
}

.delete-btn:hover {
  color: var(--white);
  background: #c0392b;
}

.footer {
  border-top: 1px solid var(--border);
  display: flex;
  color: var(--text-muted);
  justify-content: space-between;
  align-items:  center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  font-size: 12px;
}

@media (width <= 768px) {
  .hero h1 {
    font-size: 32px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }

  .card-img-wrap {
    height: 220px;
  }

  .footer {
    text-align: center;
    flex-direction: column;
    gap: 8px;
  }
}

@media (width <= 480px) {
  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .card-img-wrap {
    height: 180px;
  }

  .card-info {
    padding: 10px;
  }

  .card-info h3 {
    font-size: 13px;
  }
}
