/* ============================================================
   ARTWORKS PAGE — Chiara Daniele
   ============================================================ */

/* ---- PAGE HEADER ----------------------------------------- */

.artworks-header {
  padding: calc(var(--nav-h) + 80px) var(--side-pad) 40px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.artworks-heading {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 14px;
}

.artworks-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.artworks-sub a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(226, 221, 213, 0.35);
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.artworks-sub a:hover {
  color: var(--text);
  text-decoration-color: rgba(226, 221, 213, 0.7);
}

/* ---- FILTERS --------------------------------------------- */

.artworks-filters {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background-color: rgba(14, 14, 12, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 18px var(--side-pad);
}

.filters-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  gap: 48px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-label {
  font-family: var(--font-serif);
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 10px;
  white-space: nowrap;
}

.filter-btn {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

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

.filter-btn.active {
  color: var(--text);
  border-bottom-color: rgba(226, 221, 213, 0.28);
}

/* ---- GRID ------------------------------------------------- */

.artworks-section {
  padding: 56px var(--side-pad) 120px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.artworks-grid {
  columns: 3;
  column-gap: 10px;
}

.artwork-item {
  break-inside: avoid;
  margin-bottom: 10px;
  cursor: pointer;
  display: block; /* needed for transition when hidden */
}

.artwork-item.hidden {
  display: none;
}

.artwork-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
}

.artwork-thumb {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.artwork-info {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 8, 0.62);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 22px;
  opacity: 0;
  transition: opacity 0.38s ease;
}

.artwork-item:hover .artwork-thumb {
  transform: scale(1.04);
}

.artwork-item:hover .artwork-info {
  opacity: 1;
}

.artwork-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 4px;
}

.artwork-year {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* No results */
.no-results {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  padding: 64px 0;
  grid-column: 1 / -1;
}

/* ---- LIGHTBOX --------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 8, 6, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

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

.lb-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lb-img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}

.lb-caption {
  margin-top: 22px;
  text-align: center;
}

.lb-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 6px;
}

.lb-meta {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lb-price {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-top: 10px;
}

/* Close button */
.lb-close {
  position: fixed;
  top: 20px;
  right: 28px;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s ease;
  line-height: 1;
  padding: 8px;
}

.lb-close:hover { opacity: 1; }

/* Prev/Next arrows */
.lb-prev,
.lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: rgba(14, 14, 12, 0.55);
  border: 1px solid rgba(226, 221, 213, 0.18);
  border-radius: 0;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
  user-select: none;
}

.lb-prev:hover,
.lb-next:hover {
  opacity: 1;
  background: rgba(14, 14, 12, 0.85);
  border-color: rgba(226, 221, 213, 0.4);
}

.lb-prev { left: 20px; }
.lb-next { right: 20px; }

/* Lock scroll when lightbox is open */
body.lb-open { overflow: hidden; }

/* ============================================================
   AVAILABLE WORKS — price display
   ============================================================ */

.available-grid .artwork-item {
  flex-direction: column;
  align-items: center;
}

/* Caption width mirrors img-wrap size tiers */
.available-grid .artwork-item > .artwork-caption                  { width: 100%; }
.available-grid .artwork-item[data-size="m"]   > .artwork-caption { width: 83%; }
.available-grid .artwork-item[data-size="s"]   > .artwork-caption { width: 64%; }
.available-grid .artwork-item[data-size="xs"]  > .artwork-caption { width: 48%; }
.available-grid .artwork-item[data-size="xxs"] > .artwork-caption { width: 34%; }

.artwork-caption {
  padding: 11px 0 2px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.artwork-caption-title {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.04em;
}

.artwork-price {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.artwork-price-hover {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  color: rgba(226, 221, 213, 0.68);
  letter-spacing: 0.12em;
  margin-top: 6px;
}

/* ============================================================
   ARTWORKS RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .artworks-grid {
    columns: 2;
  }
}

@media (max-width: 768px) {
  .artworks-header {
    padding-top: calc(var(--nav-h) + 48px);
    padding-bottom: 28px;
  }

  .filters-inner {
    gap: 20px;
  }

  .filter-group {
    gap: 4px;
  }

  .filter-label {
    margin-right: 6px;
  }
}

@media (max-width: 560px) {
  .artworks-grid {
    columns: 1;
  }

  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }

  .lb-prev,
  .lb-next {
    width: 40px;
    height: 40px;
  }
}
