/* Visitor Photo Wall – frontend styles */

.vpw-upload-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem;
  background: #f9ede0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.vpw-upload-form .vpw-field {
  margin-bottom: 1.25rem;
}

.vpw-upload-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #1f2937;
}

.vpw-required { color: #dc2626; }
.vpw-optional { color: #9ca3af; font-weight: 400; font-size: 0.875rem; }

.vpw-upload-form input[type="text"],
.vpw-upload-form input[type="file"],
.vpw-upload-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
  background: #fff;
}

.vpw-upload-form textarea {
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
}

.vpw-upload-form input:focus,
.vpw-upload-form textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.vpw-hint {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0.4rem 0 0;
}

.vpw-preview {
  margin-top: 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  max-width: 100%;
}

.vpw-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.vpw-submit-btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: #1f2937;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.vpw-submit-btn:hover { background: #374151; }
.vpw-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.vpw-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.vpw-message.is-success {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.vpw-message.is-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* Gallery */
.vpw-gallery {
  display: grid;
  grid-template-columns: repeat(var(--vpw-cols, 3), 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0;
}

@media (max-width: 768px) {
  .vpw-gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .vpw-gallery { grid-template-columns: 1fr; }
}

.vpw-card {
  margin: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.vpw-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.vpw-card-img {
  position: relative;
  width: 100%;
  padding-top: 100%; /* forces 1:1 square regardless of theme */
  overflow: hidden;
  background: #f3f4f6;
}

.vpw-card-img img {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}

.vpw-card figcaption {
  padding: 0.85rem 1rem;
}

.vpw-caption-text {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: #1f2937;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vpw-card-uploader {
  margin: 0;
  font-size: 0.8125rem;
  color: #6b7280;
}

.vpw-empty {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-style: italic;
  grid-column: 1 / -1;
}

/* Lightbox */
.vpw-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 2rem;
}

.vpw-lightbox[hidden] {
  display: none !important;
}

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

.vpw-lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
}

.vpw-lightbox-meta {
  color: #fff;
  text-align: center;
  margin-top: 1rem;
  max-width: 600px;
}

.vpw-lightbox-caption {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}

.vpw-lightbox-uploader {
  font-size: 0.875rem;
  opacity: 0.75;
  margin: 0;
}

.vpw-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.6rem;
}

.vpw-lightbox-close:hover { opacity: 0.7; }

/* Slideshow */
.vpw-slideshow {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 1.5rem auto;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.vpw-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.vpw-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  pointer-events: none;
}

.vpw-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.vpw-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.vpw-slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
  color: #fff;
}

.vpw-slide-caption p {
  margin: 0;
  font-size: 1rem;
}

.vpw-slide-uploader {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-top: 0.25rem !important;
}

.vpw-slide-prev,
.vpw-slide-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  font-size: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.vpw-slide-prev:hover,
.vpw-slide-next:hover { background: rgba(0, 0, 0, 0.75); }

.vpw-slide-prev { left: 1rem; }
.vpw-slide-next { right: 1rem; }

.vpw-slide-dots {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
}

.vpw-slide-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}

.vpw-slide-dots button.is-active {
  background: #fff;
}
