/* ── 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;
  position: relative;   /* anchor the feedback launcher in the lower-right */
}

.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 column (1/3): Overview + Announcement on top, cover photo below ── */
.rp-side-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--surface-page);
  padding: 0 20px 24px;   /* OVERVIEW sits flush against the hero */
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Cover photo: now a block inside the left column (below the details card),
   no longer the full-bleed 2/3 panel. */
.rp-photo-panel {
  flex: 1 1 auto;
  min-height: 240px;
  position: relative;
  overflow: hidden;
  background: var(--surface-dark);
  border-radius: 4px;
  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: the Photo & Media Gallery (2/3 width) ── */
.rp-content-panel {
  flex: 2;
  overflow-y: auto;
  background: var(--surface-page);
  padding: 0 20px 24px;   /* year-nav bar sits flush against the hero */
  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;
}
/* Two columns (column-first) so the panel is half as tall: left = Cover photo +
   Overview doc, right = Bulk upload + Possible duplicates. Collapses on narrow screens. */
.rp-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  grid-auto-flow: column;
  column-gap: 28px;
  row-gap: 8px;
  align-items: start;
}
.rp-admin-grid .rp-admin-row { margin-bottom: 0; }
@media (max-width: 640px) {
  .rp-admin-grid { grid-template-columns: 1fr; grid-auto-flow: row; column-gap: 0; }
}

.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;
}

/* Thumbnail-size slider (above the first row; gallery fills the wide 2/3 col) */
/* A compact, slightly raised toolbar so newcomers notice the controls. */
.rp-size-control {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 2px 0 14px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.rp-size-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}
.rp-size-control .rp-size-slider {
  flex: 1;
  max-width: 260px;
  height: 18px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.rp-size-slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--surface-border); }
.rp-size-slider::-moz-range-track { height: 6px; border-radius: 3px; background: var(--surface-border); }
.rp-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin-top: -6px;
  border-radius: 50%; background: var(--accent-forest);
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.rp-size-slider::-moz-range-thumb {
  width: 18px; height: 18px; border: 2px solid #fff;
  border-radius: 50%; background: var(--accent-forest); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.rp-size-ico { color: var(--text-muted); line-height: 1; }
.rp-size-ico--sm { font-size: 16px; }
.rp-size-ico--lg { font-size: 26px; }
.rp-size-spacer { flex: 1; }

/* Media filter dropdown (Photos / Videos / Audio / Documents / All) */
.rp-filter { position: relative; flex-shrink: 0; }
.rp-filter-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-forest-900);
  background: #fff;
  border: 1.5px solid var(--accent-primary);
  border-radius: 6px;
  padding: 7px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.rp-filter-btn:hover { background: var(--accent-forest); color: var(--text-on-dark); border-color: var(--accent-forest); }
.rp-filter-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  padding: 6px 4px;
  min-width: 168px;
}
.rp-filter-menu label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.rp-filter-menu label:hover { background: var(--surface-page); }
.rp-filter-menu input { cursor: pointer; width: 15px; height: 15px; accent-color: var(--accent-forest); }

@media (max-width: 860px) { .rp-size-control { display: none !important; } }

/* Gallery grid — column count is set inline by the size slider (JS) */
.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: box-shadow 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Hover lifts the card with a shadow only — the scale/zoom lives on the inner
   image (below), so the tile's own hit-box never changes size. Scaling the whole
   tile caused a rapid :hover on/off oscillation ("vibration") at the 5px grid gaps. */
.gallery-thumb:hover {
  box-shadow: var(--shadow-md);
}

.gallery-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
  transform-origin: center;
}

.gallery-thumb:hover img {
  transform: scale(1.06);
}

.gallery-thumb-caption {
  font-size: 14px;   /* ~30% smaller than the previous 20.25px; per-item override via caption_size */
  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 */
/* Split tool — ALWAYS visible (only admins/editors get the button at all) and
   LABELED, so multi-photo pages are easy to split without hunting on hover.
   Sits at the tile's top-left, clear of the hover delete/caption/rotate icons. */
.gallery-thumb-split {
  position: absolute;
  top: 3px;
  /* Sits just right of the caption-edit (✎) button (left:3px + 20px wide) so
     both are visible — was left:5px, which covered the edit button. On family
     pages an access-level select owns the top-left, so it drops a row (below). */
  left: 28px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(30, 19, 10, 0.80);
  color: #fff;
  border: none;
  border-radius: 12px;
  font: 600 11px/1 var(--font-body, sans-serif);
  letter-spacing: 0.02em;
  padding: 4px 9px 4px 8px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
  opacity: 0;
  transition: background 0.15s, opacity 0.15s;
}
.gallery-thumb:hover .gallery-thumb-split { opacity: 1; }
.gallery-thumb-split:hover { background: var(--accent-primary, #b5651d); }

/* Admin controls are revealed only on hover, consistently — the rotate buttons
   and (on family pages) the access-level select were previously always-on. */
.gallery-thumb-rotate,
.gallery-access-edit {
  opacity: 0;
  transition: opacity 0.15s;
}
.gallery-thumb:hover .gallery-thumb-rotate,
.gallery-thumb:hover .gallery-access-edit {
  opacity: 1;
}

/* Family / O-8 galleries carry an extra access-level <select> in the top-left
   corner. Drop the caption-edit (✎) and Split controls to a second row so they
   sit beneath that green bar instead of on top of it. Reunion pages (no access
   select) keep the top-row layout. */
.gallery-thumb:has(.gallery-access-edit) .gallery-thumb-edit-caption,
.gallery-thumb:has(.gallery-access-edit) .gallery-thumb-split {
  top: 28px;
}

.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) ── */
/* Feedback bubble relocated into a thin strip at the top of the content panel,
   just below the banner (upper-right of the beige) — matches the O-8 family pages,
   replacing the old fixed bottom-right float. */
/* The feedback launcher now lives in the nav bar (see feedback-bubble.css), so
   this anchor row is empty on reunion-year pages — collapse it to zero height so
   the sticky year-nav rises flush against the brown bar. */
.rp-fb-anchor {
  display: none;
}
.rp-fb-anchor .fb-bubble {
  position: static;
  margin-left: auto;
}

.rp-year-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  /* A bar spanning the gallery (right 2/3) pane only, pulled flush to the pane's
     top + side edges (negative margins cancel the panel's padding) so it sits
     snug right under the hero, leaving the OVERVIEW column clear above it.
     Desktop (>860px): the panel scrolls internally inside the fixed-height
     .rp-layout, so the bar sticks at the panel's own top (top:0). Mobile
     (<=860px, below) the window scrolls, so it pins under the sticky .site-nav. */
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--surface-page);
  margin: 0 0 14px;
  padding: 9px 0;
  box-shadow: 0 6px 10px -4px rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid var(--surface-border);
}

.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-side-panel {
    flex: none;
    overflow-y: visible;
    height: auto;
    padding: 0 16px 16px;
  }

  .rp-photo-panel {
    height: 58vw;
    min-height: unset;
    flex: none;
    cursor: pointer;
  }

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

  /* Stacked layout: the window scrolls (panel no longer scrolls internally), so
     the year-nav pins under the sticky .site-nav instead of the panel top. */
  .rp-year-nav {
    top: var(--rp-ynav-top, 84px);
    margin: 0 0 14px;
    padding: 9px 0;
  }

  .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; }

/* ── Possible-duplicates review modal (admin) ── */
.dup-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.dup-backdrop { position: absolute; inset: 0; background: rgba(18, 12, 4, 0.55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.dup-panel {
  position: relative; z-index: 1; width: min(860px, 100%); max-height: 88vh; overflow: auto;
  background: var(--surface-page); border: 1px solid var(--accent-primary); border-radius: 12px;
  box-shadow: var(--shadow-heavy); padding: 26px 28px 24px;
}
.dup-close {
  position: absolute; top: 10px; right: 14px; width: 38px; height: 38px; font-size: 26px; line-height: 1;
  color: var(--text-secondary); background: transparent; border: none; border-radius: 50%; cursor: pointer;
}
.dup-close:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-primary); }
.dup-title { font-family: var(--font-display); font-size: 22px; color: #1b2a4a; margin: 0 0 4px; }
.dup-sub { font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 16px; }
.dup-loading, .dup-empty { font-size: 15px; color: var(--text-muted); font-style: italic; text-align: center; padding: 28px 10px; }
.dup-count { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin: 0 0 12px; }
.dup-group-wrap { border: 1px solid var(--surface-border); border-radius: 8px; background: #fff; padding: 12px; margin-bottom: 14px; }
.dup-group { display: flex; flex-wrap: wrap; gap: 12px; }
.dup-item { width: 150px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.dup-item img { width: 150px; height: 150px; object-fit: cover; border-radius: 6px; background: var(--surface-border); display: block; }
.dup-item--keep img { outline: 3px solid var(--accent-forest); outline-offset: 1px; }
.dup-cap { font-size: 12px; color: var(--text-muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.dup-keep-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent-forest); }
.dup-remove {
  font-family: var(--font-body); font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(180, 30, 30, 0.85); border: none; border-radius: 5px; padding: 6px 10px; cursor: pointer;
}
.dup-remove:hover { background: rgba(200, 20, 20, 1); }
.dup-remove:disabled { opacity: 0.6; cursor: default; }
.dup-notdup {
  margin-top: 12px; font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--color-forest-900);
  background: transparent; border: 1px solid var(--surface-border); border-radius: 999px; padding: 5px 16px; cursor: pointer;
}
.dup-notdup:hover { background: var(--surface-page); border-color: var(--accent-primary); }
@media (max-width: 600px) { .dup-item, .dup-item img { width: 120px; } .dup-item img { height: 120px; } }


/* ── Era pages (Williams) ── */
.era-page #rp-overview-btn { display: none !important; }   /* no Announcements area on era Overviews */
.era-page .rp-overview-body { min-height: 2.4em; font-family: var(--font-body); color: var(--text-secondary); line-height: 1.6; }
/* Feedback pill ~20% smaller on era pages (both hero-attached and floating variants) */
.era-page .fb-has-bubble .fb-bubble,
.era-page .fb-bubble--floating { padding: 8px 13.6px 8px 11.2px; font-size: 11.2px; }
.era-page .fb-has-bubble .fb-bubble .fb-bubble__icon,
.era-page .fb-bubble--floating .fb-bubble__icon { font-size: 14.4px; }
@media (max-width: 640px) {
  .era-page .fb-bubble--floating { width: 62px; height: 62px; }
  .era-page .fb-bubble--floating .fb-bubble__icon { font-size: 26px; }
}

/* Novosibirsk Mission cover photo is portrait-oriented; center-crop zoomed
   in too tight. Left-justify so more of the photo shows before enlarging
   (Mike, 2026-07-19). Scoped via a body class added directly to that one
   generated era page (eras_generator.py does not emit an era-specific
   body class by default). */
.era-novosibirsk-mission #rp-cover-img {
  /* Wide group-table photo was cropping to a narrow sliver in the sidebar
     panel (only ~2 of 7 people visible); show the whole photo letterboxed
     instead of cropping it. Major Eras tile + lightbox enlarge are
     untouched (different elements/paths). (Mike, 2026-07-19) */
  object-fit: contain;
  object-position: center;
}

/* "The Seven" family pages: prev/next + back-to-index nav bar, styled to
   match the era pages' .rp-year-nav but static (not sticky) since family
   pages use a different two-column layout (Mike, 2026-07-19). */
.fam-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--surface-border);
}
.fam-nav a {
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.3px;
  flex: 1;
}
.fam-nav a:hover { color: var(--text-secondary); text-decoration: underline; }
.fam-nav__prev { text-align: left; }
.fam-nav__all { text-align: center; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.fam-nav__next { text-align: right; }

/* ── Memorable Events pages (Sage 2026-07-18) ──
   Same treatment as era pages: Overview is free-text, no Announcements area. */
.family-event-page #rp-overview-btn { display: none !important; }
.family-event-page .rp-overview-body { min-height: 2.4em; font-family: var(--font-body); color: var(--text-secondary); line-height: 1.6; }

/* ── Era sub-division tiles (Sage 2026-07-28) ────────────────────────────────
   Shown in an era page's LEFT column beneath the cover photo. Reuses .rt-card
   so cover art is fetched by the same history-thumbnails.js path that serves
   the Major Eras cards; that script injects a real <img>, so the image rules
   below mirror history.css (which era pages do not load). */
.rp-divisions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.rp-divisions .rp-division-card {
  display: block;
  text-decoration: none;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .10);
  transition: box-shadow .15s ease, transform .15s ease;
}
.rp-divisions .rp-division-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  transform: translateY(-1px);
}
.rp-divisions .rt-photo {
  position: relative;
  overflow: hidden;
  height: 160px;              /* 25% taller (Mike, 2026-07-28) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-brown-600, #6b5b4b), var(--accent-forest, #2f5d50));
  color: rgba(255, 255, 255, .35);
}
.rp-divisions .rt-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rp-divisions .rt-photo-fallback { position: relative; z-index: 1; }
.rp-divisions .rt-photo:has(img) .rt-photo-fallback { display: none; }
.rp-divisions .rt-info { padding: 8px 11px 11px; }
.rp-divisions .rt-year--era { font-size: 1.02rem; line-height: 1.25; font-weight: 700; }
.rp-divisions .rt-location { font-size: .82rem; line-height: 1.35; opacity: .85; }
