/* ============================================================
   Event Gallery — shared styles for all event pages
   ============================================================ */

.event-gallery-section {
  padding: 4rem 0;
  background: #f8f6f1;
}

.event-gallery-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.eg-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.eg-header h2 {
  font-family: 'Podkova', Georgia, serif;
  font-size: 2rem;
  color: #1a2e44;
  margin: 0 0 0.25rem;
}

.eg-header p {
  color: #666;
  margin: 0;
  font-size: 0.95rem;
}

.eg-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  background: #C8A030;
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
  transition: background 0.2s;
}

.eg-submit-btn:hover {
  background: #b08e28;
}

/* Photo grid */
.eg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

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

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

.eg-photo {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: #e5e5e5;
}

.eg-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.eg-photo:hover img {
  transform: scale(1.05);
}

.eg-photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
  color: white;
  font-size: 0.78rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.eg-photo:hover .eg-photo-caption {
  opacity: 1;
}

/* Empty state */
.eg-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 1rem;
  color: #999;
}

.eg-empty p {
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

/* Loading */
.eg-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #aaa;
  font-size: 0.9rem;
}

.eg-loading p { margin: 0.5rem 0 0; }

@keyframes egSpin {
  to { transform: rotate(360deg); }
}

.eg-spinner {
  display: block;
  margin: 0 auto;
  animation: egSpin 1s linear infinite;
  color: #ccc;
}

/* ── Lightbox ─────────────────────────────────────────────── */
.eg-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.eg-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.eg-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.eg-lb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.75rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}

.eg-lb-close:hover { background: rgba(255, 255, 255, 0.2); }

.eg-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2.5rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.eg-lb-nav:hover { background: rgba(255, 255, 255, 0.2); }
.eg-lb-prev { left: 1rem; }
.eg-lb-next { right: 1rem; }

.eg-lb-info {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  text-align: center;
  max-width: 80%;
  pointer-events: none;
}

/* ── Submit Modal ─────────────────────────────────────────── */
.eg-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.eg-modal.active {
  opacity: 1;
  visibility: visible;
}

.eg-modal-box {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s;
}

.eg-modal.active .eg-modal-box {
  transform: none;
}

.eg-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #f0f0f0;
  border: none;
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: background 0.15s;
}

.eg-modal-close:hover { background: #e0e0e0; }

.eg-modal-box > h3 {
  font-family: 'Podkova', Georgia, serif;
  font-size: 1.5rem;
  color: #1a2e44;
  margin: 0 0 0.3rem;
  padding-right: 2rem;
}

.eg-modal-box > p {
  color: #777;
  font-size: 0.875rem;
  margin: 0 0 1.5rem;
}

/* Form fields */
.eg-form-group {
  margin-bottom: 1.2rem;
}

.eg-form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: #1a2e44;
  margin-bottom: 0.4rem;
  font-family: 'Montserrat', sans-serif;
}

.eg-form-group input[type="text"],
.eg-form-group input[type="email"],
.eg-form-group textarea {
  width: 100%;
  padding: 0.65rem 0.875rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: 'Montserrat', sans-serif;
  color: #333;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.eg-form-group input:focus,
.eg-form-group textarea:focus {
  outline: none;
  border-color: #C8A030;
}

.eg-form-group textarea {
  resize: vertical;
}

/* File upload area */
.eg-file-area {
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.eg-file-area:hover,
.eg-file-area.drag-over {
  border-color: #C8A030;
  background: #fffbf0;
}

.eg-file-area input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.eg-file-area p {
  margin: 0.5rem 0 0.2rem;
  font-size: 0.875rem;
  color: #555;
}

.eg-file-area span {
  font-size: 0.75rem;
  color: #999;
}

/* File preview thumbnails */
.eg-file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.eg-preview-item {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.eg-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eg-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  border: none;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

/* Consent */
.eg-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: #555;
  cursor: pointer;
  line-height: 1.5;
}

.eg-consent-label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Error banner */
.eg-form-error {
  background: #fff0f0;
  border: 1px solid #ffc0c0;
  color: #c00;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  display: none;
}

/* Form actions */
.eg-form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.eg-btn-cancel {
  padding: 0.65rem 1.25rem;
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  transition: background 0.15s;
}

.eg-btn-cancel:hover { background: #e0e0e0; }

.eg-btn-submit {
  padding: 0.65rem 1.4rem;
  background: #C8A030;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Montserrat', sans-serif;
  transition: background 0.15s;
}

.eg-btn-submit:hover:not(:disabled) { background: #b08e28; }
.eg-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Success state */
.eg-submit-success {
  text-align: center;
  padding: 2rem 1rem;
  display: none;
}

.eg-submit-success h3 {
  font-family: 'Podkova', Georgia, serif;
  color: #1a2e44;
  margin: 0 0 0.5rem;
}

.eg-submit-success p {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 1.75rem;
}

/* Share button on photo hover */
.eg-photo-share {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s;
  z-index: 3;
  flex-shrink: 0;
}

.eg-photo:hover .eg-photo-share {
  opacity: 1;
}

.eg-photo-share:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Toast */
.eg-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1a2e44;
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}

.eg-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .eg-header { flex-direction: column; }
  .eg-lb-nav { display: none; }
  .eg-modal-box { padding: 1.5rem; }
}
