/* =====================================================================
   Photo Gallery — Styles
   ===================================================================== */

/* ── Upload card (collapsible) ──────────────────────────────────── */
.gallery-upload-card {
  margin-bottom: 36px;
}

.gallery-upload-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-red);
  text-align: left;
}
.gallery-upload-toggle:hover { opacity: 0.82; }

.toggle-chevron {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: transform 0.28s var(--ease);
}
.toggle-chevron.open { transform: rotate(180deg); }

.gallery-upload-body {
  margin-top: 20px;
  animation: cardIn 0.3s var(--ease);
}

.gallery-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(217, 107, 39, 0.07), rgba(216, 107, 129, 0.10));
  border: 2px dashed var(--border-soft);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}
.gallery-photo-placeholder:hover {
  border-color: var(--accent-orange);
  background: linear-gradient(135deg, rgba(217, 107, 39, 0.12), rgba(216, 107, 129, 0.15));
}
.gallery-photo-placeholder.drag-over {
  border-color: var(--accent-orange);
  background: linear-gradient(135deg, rgba(217, 107, 39, 0.20), rgba(216, 107, 129, 0.22));
  box-shadow: 0 0 0 4px rgba(217, 107, 39, 0.15);
}

.gallery-photo-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 2px solid var(--highlight-pink);
  display: block;
}

.gallery-upload-success {
  padding: 12px 16px;
  background: rgba(63, 157, 90, 0.10);
  border: 2px solid #3f9d5a;
  border-radius: var(--radius-md);
  color: #2a6b3e;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 14px;
  animation: cardIn 0.3s var(--ease);
}

/* ── Gallery section ───────────────────────────────────────────────── */
.gallery-section {
  padding-bottom: 60px;
}

.gallery-section-title {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  color: var(--primary-red);
  text-align: center;
  margin-bottom: 22px;
}

/* Masonry-style columns */
.gallery-grid {
  columns: 2 160px;
  column-gap: 14px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 14px;
  background: var(--surface-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  box-shadow: 0 4px 14px rgba(43, 33, 33, 0.08);
  animation: cardIn 0.4s var(--ease);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(43, 33, 33, 0.14);
}

.gallery-img {
  width: 100%;
  display: block;
  object-fit: cover;
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.gallery-img:hover { opacity: 0.9; }

.gallery-caption {
  font-size: 0.88rem;
  color: var(--text-dark);
  padding: 10px 12px 4px;
  line-height: 1.45;
  font-style: italic;
}

.gallery-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  padding: 4px 12px 10px;
  font-weight: 600;
}

.gallery-loading,
.gallery-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 36px 0;
}

/* ── Lightbox ────────────────────────────────────────────────────── */
.lightbox {
  display: none;   /* hidden by default; shown via .is-open */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: lightboxIn 0.22s ease;
}
.lightbox.is-open {
  display: flex;
}
@keyframes lightboxIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  font-family: inherit;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }
.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  animation: lightboxIn 0.25s ease;
}
.lightbox-caption {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  text-align: center;
  max-width: 640px;
  line-height: 1.45;
}
