/* ── Reunion subpage hero ── */
.rp-hero {
  background: var(--surface-mid);
  padding: var(--space-xl) var(--space-2xl);
  border-bottom: 3px solid var(--accent-primary);
  text-align: center;
  flex-shrink: 0;
}

.rp-hero__eyebrow {
  font-size: 22px;
  color: var(--text-accent-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.rp-hero__year {
  font-family: var(--font-display);
  font-size: 68px;
  font-weight: 700;
  color: var(--text-on-dark);
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.30);
}

.rp-hero__theme {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  color: var(--text-accent);
  margin-top: 8px;
  line-height: 1.3;
}

.rp-hero__location {
  font-size: 26px;
  color: var(--text-on-dark-muted);
  margin-top: 10px;
  letter-spacing: 0.4px;
}

/* ── Two-panel layout ── */
.rp-layout {
  display: flex;
  height: calc(100vh - 230px);
  min-height: 500px;
  overflow: hidden;
  width: 100%;
}

/* ── Left panel: cover photo (2/3 width) ── */
.rp-photo-panel {
  flex: 2;
  position: relative;
  overflow: hidden;
  background: var(--surface-dark);
  cursor: pointer;
}

.rp-photo-panel .rp-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  position: absolute;
  inset: 0;
}

.rp-photo-panel.has-photo .rp-cover-img {
  display: block;
}

.rp-photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  pointer-events: none;
}

.rp-photo-panel.has-photo .rp-photo-placeholder {
  display: none;
}

.rp-photo-ph-icon {
  font-size: 52px;
  opacity: 0.25;
}

.rp-photo-ph-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
}

/* Hover hint to enlarge */
.rp-photo-panel::after {
  content: '🔍  Click to enlarge';
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  letter-spacing: 0.4px;
  padding: 6px 18px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.rp-photo-panel.has-photo:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Right panel: scrollable content (1/3 width) ── */
.rp-content-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--surface-page);
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

/* ── Breadcrumb ── */
.rp-breadcrumb {
  margin-bottom: 16px;
  padding-top: 2px;
}

.rp-breadcrumb a {
  font-size: 26px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.3px;
}

.rp-breadcrumb a:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ── Details card: Overview + Announcements ── */
.rp-details-card {
  background: #fff;
  border: 1px solid var(--surface-border);
  border-top: 3px solid var(--accent-primary);
  border-radius: 4px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;            /* let the announcements button drop below when tight */
  align-items: stretch;
  overflow: hidden;
  /* The content panel is a fixed-height flex column; without this the tall
     gallery below can squeeze the Overview card to nothing once thumbnails
     render. Never let it shrink — the panel scrolls instead. */
  flex-shrink: 0;
}

/* Same protection for the breadcrumb above it. */
.rp-breadcrumb {
  flex-shrink: 0;
}

.rp-overview-section {
  flex: 1 1 240px;
  padding: 14px 16px;
  /* Never let the fixed-width announcements button crush the Overview to a
     sliver — keep at least ~240px (or the full card width on tiny screens).
     When there isn't room for both side-by-side, the announcements button
     wraps below instead. */
  min-width: min(100%, 240px);
}

.rp-overview-heading {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Detail rows as bullet list */
.rp-details-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rp-detail-row {
  display: flex;
  gap: 5px;
  align-items: baseline;
  line-height: 1.4;
}

.rp-detail-row::before {
  content: '•';
  color: var(--accent-primary);
  flex-shrink: 0;
  font-size: 21px;
}

.rp-detail-label {
  font-size: 16.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.rp-detail-label::after {
  content: ':';
}

.rp-detail-value {
  font-size: 19.5px;
  color: var(--text-secondary);
}

/* Announcements button (tall right rectangle) */
.rp-announcements-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 200px;
  flex-shrink: 0;
  background: var(--surface-mid);
  border-left: 1px solid var(--surface-border);
  cursor: pointer;
  padding: 14px 8px;
  gap: 10px;
  transition: background 0.15s;
  text-align: center;
  border: none;
  font-family: var(--font-body);
}

.rp-announcements-btn:hover {
  background: var(--surface-dark);
}

.rp-ann-icon {
  font-size: 22px;
}

.rp-ann-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-on-dark);
  line-height: 1.4;
}

/* Announcements thumbnail */
.rp-ann-thumb {
  width: 100%;
  max-height: 60%;
  object-fit: cover;
  border-radius: 2px;
}

.rp-announcements-btn.has-thumb {
  padding: 6px 6px;
  gap: 4px;
}

.rp-announcements-btn.has-thumb .rp-ann-label {
  display: none;
}

.rp-ann-caption {
  font-size: 14px;
  color: var(--text-on-dark-muted);
  line-height: 1.3;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

/* ── Admin panel (site_admin only) ── */
.rp-admin-panel {
  background: var(--surface-border);
  border: 1px dashed var(--accent-primary);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: 17px;
}

.rp-admin-panel h3 {
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.rp-admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.rp-admin-label {
  font-size: 17px;
  color: var(--text-muted);
  min-width: 75px;
}

.rp-admin-file-btn {
  display: inline-block;
  padding: 5px 12px;
  background: var(--surface-dark);
  color: var(--text-on-dark);
  font-size: 17px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s;
  border: none;
  font-family: var(--font-body);
}

.rp-admin-file-btn:hover { background: var(--accent-primary); }

.rp-admin-delete-btn {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(180, 30, 30, 0.75);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s;
  border: none;
  font-family: var(--font-body);
}

.rp-admin-delete-btn:hover { background: rgba(200, 20, 20, 1); }

.rp-admin-status {
  font-size: 17px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Photo gallery ── */
.rp-gallery {
  margin-bottom: 0;
  flex: 1;
}

/* Not-signed-in gate */
.gallery-auth-gate {
  background: var(--surface-border);
  border-radius: 6px;
  padding: 24px 16px;
  text-align: center;
}

.gallery-auth-gate p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-style: italic;
}

/* Upload zone (shown at top of gallery when signed in) */
.gallery-upload-zone {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gallery-upload-btn {
  display: inline-block;
  padding: 8px 18px;
  background: var(--accent-forest);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background var(--transition-fast), transform 0.1s;
}

.gallery-upload-btn:hover {
  background: var(--accent-forest-light);
  transform: translateY(-1px);
}

.gallery-upload-status {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* Gallery grid — 4 thumbnails across in narrow column */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.gallery-thumb {
  border-radius: 3px;
  cursor: pointer;
  background: var(--surface-border);
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-thumb:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-md);
}

.gallery-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.gallery-thumb-caption {
  font-size: 20.25px;   /* ~75% of the previous 27px */
  line-height: 1.3;
  color: var(--text-muted);
  padding: 4px 5px 5px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  background: #fff;
}

/* Position relative for delete button overlay */
.gallery-thumb {
  position: relative;
}

/* Document tiles */
.gallery-thumb--doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-mid);
  gap: 4px;
  padding: 6px 4px;
}

.gallery-doc-icon {
  font-size: 28px;
  line-height: 1;
}

.gallery-doc-label {
  font-size: 12px;
  color: var(--text-on-dark-muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  line-height: 1.3;
}

/* Admin delete button on thumbnails */
.gallery-thumb-delete {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(180, 30, 30, 0.85);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}

.gallery-thumb:hover .gallery-thumb-delete {
  opacity: 1;
}

.gallery-thumb-delete:hover {
  background: rgba(200, 20, 20, 1);
}

/* Admin caption-edit button (top-left, mirrors the delete button) */
.gallery-thumb-edit-caption {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(30, 19, 10, 0.82);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}

.gallery-thumb:hover .gallery-thumb-edit-caption {
  opacity: 1;
}

.gallery-thumb-edit-caption:hover {
  background: rgba(30, 19, 10, 1);
}

/* Access level badge on thumbnails */
.gallery-access-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  line-height: 1;
}

/* Access level selector in upload zones */
.fg-access-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.fg-access-select {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid var(--surface-border);
  border-radius: 3px;
  background: #fff;
  font-family: var(--font-body);
}

.fg-spouse-label {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Admin panel access selector */
.rp-admin-access-sel {
  font-size: 11px;
  padding: 3px 6px;
  border: 1px solid var(--surface-border);
  border-radius: 3px;
  background: #fff;
  font-family: var(--font-body);
}

.rp-admin-spouse-label {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.gallery-empty {
  background: var(--surface-border);
  border-radius: 6px;
  padding: 22px 16px;
  text-align: center;
}

.gallery-empty p {
  font-size: 26px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0;
}

/* View all photos link */
.gallery-view-all {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  text-decoration: none;
  letter-spacing: 0.3px;
}

.gallery-view-all:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ── Lightbox ── */
.gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gallery-lightbox.open {
  display: flex;
}

.gallery-lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
  cursor: default;
  pointer-events: none;
}

.lightbox-pdf {
  width: 90vw;
  height: 90vh;
  border: none;
  border-radius: 3px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
  background: #fff;
  cursor: default;
}

.lightbox-video {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 3px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
  background: #000;
  cursor: default;
  outline: none;
}

/* Play button overlay on video thumbnails */
.gallery-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  pointer-events: none;
  z-index: 2;
  transition: background 0.15s;
}

.gallery-thumb:hover .gallery-play-overlay {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 36px;
  cursor: pointer;
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
  font-family: sans-serif;
  transition: color 0.15s;
}

.lightbox-close:hover {
  color: #fff;
}

/* ── Year navigation (sits at the top of the content panel, replacing the
   old "← Reunion History" breadcrumb) ── */
.rp-year-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0 0;
  margin-bottom: 16px;
  gap: 8px;
  flex-shrink: 0;   /* don't let the tall gallery below squeeze it */
}

.rp-year-nav a {
  font-size: 22px;
  line-height: 0.9;        /* tighter spacing when a link wraps to two lines */
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.3px;
  flex: 1;
}

.rp-year-nav a:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

.rp-year-nav__prev { text-align: left; }
.rp-year-nav__all  { text-align: center; font-size: 19px; text-transform: uppercase; letter-spacing: 1px; }
.rp-year-nav__next { text-align: right; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .rp-layout {
    flex-direction: column;
    height: auto;
    min-height: unset;
    overflow: visible;
  }

  .rp-photo-panel {
    height: 52vw;
    flex: none;
    cursor: pointer;
  }

  .rp-content-panel {
    flex: none;
    overflow-y: visible;
    height: auto;
    padding: 16px;
  }

  .rp-hero__eyebrow {
    font-size: 14px;
  }

  .rp-hero__location {
    font-size: 16px;
  }

  .rp-year-nav a {
    font-size: 18px;
  }

  .rp-year-nav__all {
    font-size: 15px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

/* ── Overview inline edit (admin) ── */
.rp-overview-edit-btn {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  background: var(--surface-mid);
  color: var(--text-on-dark);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-body);
}
.rp-overview-edit-btn:hover { background: var(--accent-primary); }

.rp-edit-modal { display: none; position: fixed; inset: 0; z-index: 1100; }
.rp-edit-modal.open { display: block; }
.rp-edit-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.rp-edit-panel {
  position: relative;
  max-width: 480px;
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 8px;
  padding: 22px 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.rp-edit-panel h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--surface-mid);
  margin-bottom: 8px;
}
.rp-edit-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.rp-edit-panel textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  resize: vertical;
}
.rp-edit-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.rp-edit-actions button {
  font-size: 13px; font-weight: 600; padding: 8px 20px;
  border: none; border-radius: 5px; cursor: pointer; font-family: var(--font-body);
}
.rp-edit-save { background: var(--accent-forest); color: #fff; }
.rp-edit-cancel { background: #999; color: #fff; }
.rp-edit-status { font-size: 12px; color: var(--text-muted); font-style: italic; }
