/* Paintings, Collections, Masonry & Lightbox: shelleymitchell.ca
   Component specs per docs/COMPONENTS.md §2.2, §2.3, §2.4 */

/* Home Hero */
.hero {
  max-width: var(--container-max-width);
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  position: relative;
  text-align: center;
}

.hero__figure {
  margin: 0;
}

.hero__figure img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  display: block;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  border-radius: 2px;
}

.hero__caption {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.hero__dimensions {
  margin-left: 0.5rem;
  color: var(--text-muted);
}

.hero__admin-notice {
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.hero__admin-notice .admin-notice-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent-cyan);
  text-decoration: underline;
}

/* Collection Archive */
.collection {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.collection__title {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: var(--font-weight-light);
  letter-spacing: -0.01em;
  margin: 0 0 2rem;
  text-align: center;
  color: var(--text-primary);
}

.collection__empty {
  text-align: center;
  color: var(--text-muted);
  padding: 4rem 1rem;
}

/* Painting Grid (Masonry columns) */
.painting-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 1;
  column-gap: var(--spacing-grid-gap);
}

@media (min-width: 600px) {
  .painting-grid {
    columns: 2;
  }
}

@media (min-width: 900px) {
  .painting-grid {
    columns: 3;
  }
}

.painting-grid__item {
  break-inside: avoid;
  margin-bottom: var(--spacing-grid-gap);
}

.painting-card {
  display: block;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-surface);
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.painting-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.painting-card__image {
  width: 100%;
  height: auto;
  display: block;
}

/* Native Dialog Lightbox */
.lightbox {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  max-width: 95vw;
  max-height: 95vh;
  margin: auto;
  overflow: visible;
  transition: opacity 0.25s ease, transform 0.25s ease, overlay 0.25s allow-discrete, display 0.25s allow-discrete;
  opacity: 0;
  transform: scale(0.96);
}

.lightbox[open] {
  opacity: 1;
  transform: scale(1);
}

@starting-style {
  .lightbox[open] {
    opacity: 0;
    transform: scale(0.96);
  }
}

.lightbox::backdrop {
  background-color: var(--bg-overlay);
  backdrop-filter: blur(4px);
  transition: opacity 0.25s ease, overlay 0.25s allow-discrete, display 0.25s allow-discrete;
  opacity: 0;
}

.lightbox[open]::backdrop {
  opacity: 1;
}

@starting-style {
  .lightbox[open]::backdrop {
    opacity: 0;
  }
}

.lightbox__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.lightbox__image {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.lightbox__caption {
  margin-top: 1rem;
  background-color: rgba(30, 30, 30, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}

/* Lightbox Close Form & Button */

.lightbox__button {
  background: rgba(34, 34, 34, 0.75);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  pointer-events: auto;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lightbox__button:hover,
.lightbox__button:focus-visible {
  background-color: var(--accent);
  color: var(--text-inverse);
}

.lightbox__close-form {
  position: absolute;
  top: -1rem;
  right: -1rem;
}

.lightbox__button--close {
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  line-height: 1;
}
