/* Dalt Vila Moments — submission widget + gallery styles.
   Linked only on the 55 widget pages and 6 gallery pages, not sitewide. */

.psa-cta {
  background: var(--sand, #ece5da);
  border-radius: 8px;
  padding: 32px;
  margin: 40px 0;
}

.psa-cta-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 760px) {
  .psa-cta-grid {
    grid-template-columns: 1fr;
  }
}

.psa-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.psa-gallery-empty {
  font-size: 14px;
  color: var(--ink-soft, #5f7e8d);
}

.psa-gallery-card {
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
}

.psa-gallery-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: pointer;
  display: block;
}

.psa-gallery-card figcaption {
  font-size: 11px;
  padding: 4px;
  color: var(--ink-soft, #5f7e8d);
}

.psa-gallery-link {
  display: block;
  margin-top: 10px;
  font-size: 13px;
}

.psa-panel {
  margin-top: 20px;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
}

.psa-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}

.psa-label:first-child {
  margin-top: 0;
}

.psa-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(22, 49, 63, 0.2);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.psa-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.psa-code-hint {
  font-size: 13px;
  color: var(--ink-soft, #5f7e8d);
  margin: 4px 0 12px;
}

.psa-gate-row {
  display: flex;
  gap: 10px;
}

.psa-gate-hint {
  color: #a3302a;
  font-size: 13px;
  margin-top: 8px;
}

.psa-rules {
  background: var(--paper, #fbfaf8);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.psa-rules-title {
  font-weight: 600;
  font-size: 13.5px;
  margin: 0 0 8px;
}

.psa-rules-list {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--ink-soft, #5f7e8d);
}

.psa-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--ink-soft, #5f7e8d);
  margin: 10px 0;
}

.psa-check input {
  margin-top: 3px;
}

.psa-status {
  margin-top: 12px;
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 6px;
}

.psa-ok {
  background: #e7f5ec;
  color: #1a5c34;
}

.psa-error {
  background: #fbeaea;
  color: #a3302a;
}

.moments-grid {
  columns: 4;
  column-gap: 14px;
}

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

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

.moments-grid--sparse {
  columns: 2;
}

.moments-card {
  break-inside: avoid;
  margin: 0 0 14px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

/* moments-gallery.js cycles these 3 classes deterministically per card so the
   masonry columns don't all show the same aspect ratio. */
.moments-card--lg img {
  aspect-ratio: 3 / 4;
}

.moments-card--md img {
  aspect-ratio: 1 / 1;
}

.moments-card--sm img {
  aspect-ratio: 4 / 3;
}

.moments-card img {
  width: 100%;
  display: block;
  cursor: pointer;
}

.moments-card-meta {
  padding: 8px 10px;
  font-size: 12.5px;
}

.moments-card-name {
  display: block;
  font-weight: 600;
}

.moments-card-caption {
  margin: 4px 0 0;
  color: var(--ink-soft, #5f7e8d);
}

.moments-badge {
  position: absolute;
  background: rgba(22, 49, 63, 0.8);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

.moments-invite-card {
  break-inside: avoid;
  background: var(--sand, #ece5da);
  border-radius: 8px;
  padding: 20px;
  margin: 0 0 14px;
  text-align: center;
}

.moments-invite-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.moments-invite-card p {
  font-size: 13px;
  margin: 0 0 14px;
}

.moments-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.moments-lightbox:not([hidden]) {
  display: flex;
}

.moments-lightbox__figure {
  max-width: 90vw;
  max-height: 85vh;
  margin: 0;
}

.moments-lightbox__img {
  max-width: 90vw;
  max-height: 75vh;
  display: block;
  margin: 0 auto;
}

.moments-lightbox__caption {
  color: #fff;
  text-align: center;
  font-size: 13px;
  margin-top: 10px;
}

.moments-lightbox__name {
  display: block;
  font-weight: 600;
}

.moments-lightbox__close,
.moments-lightbox__prev,
.moments-lightbox__next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  padding: 10px 16px;
}

.moments-lightbox__close { top: 10px; right: 10px; }
.moments-lightbox__prev { left: 10px; top: 50%; transform: translateY(-50%); }
.moments-lightbox__next { right: 10px; top: 50%; transform: translateY(-50%); }

.moments-lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 12px;
}
