/* ==========================================================================
   ILLUSTRATORANDCOFFEE.COM — MINIMAL GALLERY
   Theme: Crisp Clean White & #00a651 Green Accent
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-subtle: #f7f9f8;
  --bg-card: #f2f4f3;
  --green: #00a651;
  --green-hover: #008f45;
  --green-subtle: rgba(0, 166, 81, 0.08);
  --green-border: rgba(0, 166, 81, 0.25);
  --text-main: #111412;
  --text-muted: #5e6b62;
  --border: #e2e8e4;
  --border-card: #e8ede9;
  --header-height: 56px;
}

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

html {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================================================
   Minimal Top Header
   ========================================================================== */
.gallery-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1rem;
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-domain {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-main);
}

.count-badge {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-subtle);
  border: 1px solid var(--green-border);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Categories */
.category-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cat-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.cat-btn.active {
  background: var(--green);
  color: #ffffff;
  font-weight: 700;
}

/* Shuffle Button */
.shuffle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  border: 1px solid var(--green-border);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shuffle-btn:hover {
  background: var(--green-subtle);
  border-color: var(--green);
}

.shuffle-btn svg {
  width: 14px;
  height: 14px;
}

.spinning {
  animation: spinReel 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes spinReel {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Gallery Grid (Clean Masonry)
   ========================================================================== */
.gallery-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem 0.75rem 3rem;
}

@media (min-width: 768px) {
  .gallery-main {
    padding: 1.5rem 1.25rem 4rem;
  }
}

.gallery-grid {
  column-count: 2;
  column-gap: 0.75rem;
}

@media (min-width: 600px) {
  .gallery-grid {
    column-count: 3;
    column-gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    column-count: 4;
    column-gap: 1.15rem;
  }
}

@media (min-width: 1440px) {
  .gallery-grid {
    column-count: 5;
    column-gap: 1.25rem;
  }
}

/* Gallery Card */
.gallery-item {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 768px) {
  .gallery-item {
    margin-bottom: 1.15rem;
    border-radius: 8px;
  }
}

.gallery-item:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  background: #ebeeed;
  transition: opacity 0.2s ease;
}

/* Hover overlay: title & category */
.item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 0.75rem 0.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.gallery-item:hover .item-overlay {
  opacity: 1;
}

.item-category {
  display: block;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #00ff88; /* high-contrast bright green on black overlay */
  letter-spacing: 0.04em;
  margin-bottom: 1px;
}

.item-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Fullscreen Lightbox Modal
   ========================================================================== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 12, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox-view {
  position: relative;
  z-index: 10;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 90vh;
}

.lightbox-img-wrap img {
  max-width: 92vw;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  margin-top: 0.65rem;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.82rem;
  color: #c0ccc4;
  text-align: center;
}

.lightbox-caption strong {
  color: #00ff88;
}

.lightbox-close {
  position: fixed;
  top: 15px;
  right: 18px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1.8rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
  z-index: 20;
}

.lightbox-close:hover {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1.3rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 20;
}

.lightbox-nav:hover {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.lightbox-nav.prev {
  left: 15px;
}

.lightbox-nav.next {
  right: 15px;
}

/* Mobile responsive adjustments */
@media (max-width: 600px) {
  .header-inner {
    justify-content: space-between;
  }

  .category-nav {
    order: 3;
    width: 100%;
    margin-top: 0.2rem;
  }

  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}
