/* --- Modals — field journal specimen drawers --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  backdrop-filter: blur(8px);
}

.modal-overlay.open { display: flex; }

/* Modal box — specimen drawer card */
.modal-box {
  background: linear-gradient(160deg,
    rgba(16,24,13,0.99) 0%,
    rgba(12,18,10,0.99) 100%);
  border: 1px solid var(--gold-rule);
  border-top: 3px solid var(--gold-dim);
  border-radius: 3px;
  width: 100%;
  max-width: 680px;
  margin: auto;
  padding: 28px 26px;
  position: relative;
  animation: modal-in 0.28s var(--ease-spring);
  box-shadow:
    0 36px 88px rgba(0,0,0,0.72),
    inset 0 1px 0 rgba(200,150,42,0.12);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gold-rule);
  background: rgba(200,150,42,0.05);
  color: rgba(237,224,192,0.55);
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s var(--ease-spring);
}

.modal-close:hover {
  background: rgba(200,74,58,0.2);
  border-color: rgba(200,74,58,0.45);
  color: #e08070;
  transform: scale(1.1);
}

.modal-box h3 {
  font-size: 20px;
  font-style: italic;
  color: var(--gold-warm);
  margin-bottom: 16px;
}

.modal-box h3::before {
  content: attr(data-section);
  display: block;
  font-family: 'Libre Franklin', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(200,150,42,0.5);
  font-style: normal;
  margin-bottom: 4px;
}

/* Gallery in modal */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gallery-item {
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  background: var(--understory);
  border: 1px solid var(--gold-rule);
  transition: all 0.22s var(--ease-spring);
  display: flex;
  flex-direction: column;
  height: 140px;
}

.gallery-item img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.32s var(--ease-spring);
  display: block;
  filter: brightness(0.86) saturate(0.82);
}

.gallery-item-caption {
  padding: 5px 7px;
  font-family: 'Libre Franklin', sans-serif;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(237,224,192,0.45);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(12,18,10,0.85);
  flex-shrink: 0;
}

.gallery-item:hover {
  border-color: rgba(200,150,42,0.4);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.gallery-item:hover img {
  transform: scale(1.06);
  filter: brightness(1) saturate(0.95);
}

/* Videos in modal — field notes list */
.video-list-modal {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px;
  background: var(--gold-wash);
  border: 1px solid var(--gold-rule);
  border-left: 3px solid var(--gold-dim);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.video-list-item:hover {
  border-color: rgba(200,150,42,0.38);
  background: var(--gold-ink);
  transform: translateX(3px);
}

.video-thumb {
  width: 85px; height: 56px;
  border-radius: 3px;
  background: var(--understory);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--gold-rule);
}

.video-thumb img { width: 100%; height: 100%; object-fit: cover; }

.video-info h4 {
  font-family: 'Zilla Slab', serif;
  font-size: 15px;
  font-style: italic;
  color: var(--parchment);
  margin-bottom: 3px;
}

.video-info p { font-size: 12px; color: rgba(237,224,192,0.45); }

/* Modal video player */
.modal-video-player {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.6);
}

.modal-video-player iframe,
.modal-video-player video {
  width: 100%; height: 100%;
  border: none;
}

/* QR in modal */
#qr-code-attendee {
  width: 190px; height: 190px;
  background: var(--ivory);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  margin: 14px auto;
  padding: 10px;
  box-shadow:
    0 0 0 1px var(--gold-rule),
    0 0 0 4px rgba(200,150,42,0.12),
    0 10px 32px rgba(0,0,0,0.45);
}

/* Attendee footer bar */
#attendee-footer {
  position: fixed;
  bottom: calc(var(--footer-h) + var(--music-h)); left: 0; right: 0;
  height: 70px;
  background: linear-gradient(90deg,
    rgba(12,18,10,0.98) 0%,
    rgba(16,24,13,0.98) 100%);
  border-top: 1px solid var(--gold-rule);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 20px;
  z-index: 90;
  backdrop-filter: blur(12px);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}

#attendee-footer.visible { display: flex; }

.footer-action-btn {
  flex: 1;
  max-width: 230px;
  padding: 13px 20px;
  border-radius: 3px;
  border: none;
  font-family: 'Zilla Slab', serif;
  font-size: 17px;
  font-weight: 700;
  font-style: italic;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.22s var(--ease-spring);
}

.footer-btn-auction {
  background: linear-gradient(160deg, var(--gold-warm), var(--gold));
  color: var(--peat);
  box-shadow: 0 4px 16px rgba(200,150,42,0.3);
}

.footer-btn-donate {
  background: linear-gradient(160deg, #6ed498, #52b878);
  color: var(--peat);
  box-shadow: 0 4px 16px rgba(82,184,120,0.25);
}

.footer-action-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

/* External link full-screen modal */
#modal-external-link {
  z-index: 500;
  background: rgba(0,0,0,0.96);
}

#modal-external-link.open {
  display: flex;
}

/* Memorial photo grid */
.memorial-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 520px;
  margin: 20px auto 0;
}

.memorial-photo-item {
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(200,150,42,0.18);
  opacity: 0.6;
}

.memorial-photo-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
  filter: grayscale(0.6) brightness(0.7);
}
