/* ─── RESET & VARIABLES ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --accent: #e8c97e;
  --text: #f0f0f0;
  --muted: #888;
  --card: #161616;
  --overlay: rgba(0, 0, 0, 0.72);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── HEADER ─── */
header {
  padding: 3rem 5% 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-title h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}

.header-title h1 span {
  color: var(--accent);
}

.header-title p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
  font-weight: 300;
}

.header-meta {
  text-align: right;
}

.image-count {
  font-family: "Playfair Display", serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.image-count span {
  display: block;
  font-family: "DM Sans", sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ─── FILTER TABS ─── */
.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.45rem 1.1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f0f0f;
}

/* ─── GALLERY GRID ─── */
main {
  padding: 2.5rem 5%;
}

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

/* ─── GALLERY ITEM ─── */
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

/* Image */
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition:
    transform 0.5s ease,
    filter 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
  filter: brightness(0.55);
}

/* Caption overlay */
.caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.4rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 60%);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.gallery-item:hover .caption {
  opacity: 1;
  transform: translateY(0);
}

.caption-title {
  font-family: "Playfair Display", serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.caption-sub {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Category badge */
.badge {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
}

/* ─── FEATURED ITEM (first one, larger) ─── */
.gallery-item.featured {
  grid-column: span 2;
  aspect-ratio: 16 / 7;
}

/* ─── LIGHTBOX ─── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  position: relative;
  max-width: 900px;
  width: 100%;
  transform: scale(0.92);
  transition: transform 0.3s ease;
}

.lightbox.open .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

.lightbox-info {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lightbox-info .caption-title {
  font-size: 1.2rem;
  color: var(--text);
}

.lightbox-info .caption-sub {
  margin-top: 0.2rem;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -1.2rem;
  right: -1.2rem;
  width: 36px;
  height: 36px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: #0f0f0f;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: transform 0.2s;
}

.lightbox-close:hover {
  transform: scale(1.1) rotate(90deg);
}

/* ─── EMPTY STATE ─── */
.empty-state {
  display: none;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}

.empty-state.show {
  display: block;
}
.empty-state p {
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* ─── FOOTER ─── */
footer {
  text-align: center;
  padding: 2rem 5%;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2rem;
}

footer span {
  color: var(--accent);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .gallery-item.featured {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
  }
  .header-meta {
    display: none;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  header {
    padding: 2rem 5% 1.2rem;
  }
}
