/*
 * SHOWPLACE.ART — Layout: Masonry
 * ─────────────────────────────────────────────────────────────────────────────
 * Max 1000px column, centred. Horizontal nav at the top.
 * Images flow in a CSS-columns masonry grid, each maintaining its own aspect
 * ratio with minimal gaps. No text captions — images only. Infinite scroll.
 */

/* ── Page shell ─────────────────────────────────────────────────────────── */

.sp-preview {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
}
footer {
  padding: 20px;
  text-align: center;
}
.powered-by {
  font-size: 10px;
  text-transform: none;
}
.powered-by a {
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */

.sp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 52px;
  flex-shrink: 0;
}

.sp-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.sp-nav-link {
  font-size: 12px;
}

/* ── Masonry wrapper ─────────────────────────────────────────────────────── */

.sp-masonry-wrap {
  flex: 1;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ── Masonry grid (JS-managed flex columns) ──────────────────────────────── */

.sp-masonry-grid {
  display: flex;
  align-items: flex-start;
  column-gap: 8px;
}

.sp-masonry-col {
  flex: 1 1 0;
  min-width: 0;
}

.sp-masonry-item {
  break-inside: avoid;
  margin-bottom: 8px;
  display: block;
}

.sp-masonry-item a {
  display: block;
}

.sp-masonry-item img,
.sp-masonry-item .artwork-placeholder {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Infinite scroll sentinel ────────────────────────────────────────────── */

.sp-load-more {
  text-align: center;
  padding: 24px 0 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 20px;
}

/* ── Inner pages (contact / product) ────────────────────────────────────── */

.sp-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
}

.sp-page-content {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 64px;
}

.sp-page-title {
  margin-bottom: 8px;
}

.sp-page-subtitle {
  margin-bottom: 32px;
}

.sp-enquiry-subject {
  margin-bottom: 24px;
}

.sp-alert {
  padding: 14px 18px;
  margin-bottom: 28px;
}

.sp-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 4px;
}

.sp-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sp-form-input,
.sp-form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-width: 1px;
  border-style: solid;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.sp-form-textarea {
  min-height: 130px;
  resize: vertical;
}

.sp-form-btn {
  display: inline-block;
  padding: 12px 28px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  align-self: flex-start;
}

/* Multi-image gallery for the product page — theme-agnostic, works with
    whatever sizing/aspect-ratio each layout already applies to .sp-product-image img.
    !important below overrides each layout's `.sp-product-image img { display: block }`,
    which otherwise outranks the plain .sp-gallery-slide selector on specificity. */
.sp-product-gallery-main { position: relative; height: 550px; }
.sp-gallery-slide { display: none !important; width: 100%; }
.sp-gallery-slide.is-active { display: block !important; }
.sp-product-thumbs { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.sp-product-thumb { padding: 0; border: none; width: 150px; aspect-ratio:1; cursor: pointer; background: none; flex-shrink: 0; }
.sp-product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-product-thumb.is-active { opacity: 1; }
.sp-product-thumb:not(.is-active) { opacity: 0.55; }
.sp-product-thumb:hover { opacity: 0.85; }

.sp-product-image {
  margin-bottom: 24px;
}

.sp-product-image img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  margin-inline: auto;
  display: block;
}

.sp-product-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}

.sp-product-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-product-meta-row {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.sp-product-meta-label {
  min-width: 80px;
  flex-shrink: 0;
}

/* ── Collections: page header ───────────────────────────────────────────── */

.sp-collection-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 8px;
}

.sp-collection-header .sp-collection-title {
  margin-bottom: 12px;
}

.sp-collection-header .sp-collection-blurb {
  max-width: 68ch;
}

/* ── Collections: homepage preview strip ────────────────────────────────── */

.sp-collections-preview {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 16px;
}

.sp-collections-preview-title,
.sp-all-artworks-title {
  margin-bottom: 16px;
}

.sp-collections-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.sp-collection-card {
  display: block;
}

.sp-collection-card-thumb {
  overflow: hidden;
}

.sp-collection-card-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.sp-collection-card-content {
  margin-top: 6px;
}

.sp-collection-card-name {
  margin-top: 10px;
}

.sp-collection-card-count {
  margin-top: 2px;
  display: block;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sp-nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 16px;
    height: auto;
  }
  .sp-collections-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .sp-product-gallery-main {
    height: 350px;
  }
}

@media (max-width: 480px) {
  .sp-masonry-wrap {
    padding: 16px 12px;
  }

  .sp-page-content {
    padding: 28px 16px 48px;
  }

  .sp-product-image img {
    max-width: 100%;
  }

  .sp-product-meta-label {
    min-width: 64px;
  }
}
