/* Meetup gallery pages (includes/meetup-page.php). Loaded after the theme's main.css. */

/* clip (not hidden) keeps sideways scroll off without breaking the sticky year bar */
html, body { overflow-x: clip; }

body.meetup-page {
  position: relative;
  margin: 0;
  background: #1c1d26;
  color: #fff;
}

/* Blurred group photo behind everything, darkened so the photos stand out */
body.meetup-page::before,
body.meetup-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body.meetup-page::before {
  z-index: 0;
  background: var(--mp-bg) center / cover no-repeat;
  filter: blur(2px);
  transform: scale(1.06);
}
body.meetup-page::after { z-index: 1; background: rgba(0, 0, 0, 0.58); }
body.meetup-page #page-wrapper { position: relative; z-index: 3; background: transparent; }

.mp { font-family: Roboto, Helvetica, Arial, sans-serif; }

/* ---------- Title ---------- */
.mp-hero { padding: 56px 20px 26px; text-align: center; }
.mp-hero h1 {
  margin: 0;
  color: #fff;
  font-size: 48px;
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}
.mp-year { display: block; margin-top: 10px; color: rgba(255, 255, 255, 0.8); font-size: 0.55em; }
.mp-meta { margin: 14px 0 0; color: rgba(255, 255, 255, 0.78); font-size: 16px; font-weight: 300; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.mp-hero::after { content: ""; display: block; width: min(20em, 60%); height: 4px; margin: 24px auto 0; background: #e44c65; }

/* ---------- Year switcher (pins under the site nav) ---------- */
.mp-years {
  position: sticky;
  top: var(--sn-h, 60px);
  z-index: 6;
  margin: 0 0 18px;
  padding: 10px 16px;
  background: rgba(28, 29, 38, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.mp-years-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.mp-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
a.mp-step { border-bottom-color: rgba(255, 255, 255, 0.18); }
a.mp-step:hover { border-color: #e44c65; background: rgba(228, 76, 101, 0.12); color: #fff !important; }
.mp-arrow { font-size: 22px; line-height: 0; }
.mp-step.is-disabled { color: rgba(255, 255, 255, 0.3); border-color: rgba(255, 255, 255, 0.08); }

.mp-pick { position: relative; display: inline-flex; align-items: center; margin: 0; }
.mp-pick select {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: auto;
  min-width: 210px;
  height: 40px;
  margin: 0;
  padding: 0 40px 0 18px;
  border: 1px solid #e44c65;
  border-radius: 999px;
  background: #e44c65;
  background-image: none;
  box-shadow: none;
  color: #fff;
  font: 500 15px/40px Roboto, Helvetica, Arial, sans-serif;
  text-overflow: ellipsis;
  cursor: pointer;
}
.mp-pick select:focus { outline: 2px solid #fff; outline-offset: 2px; }
.mp-pick select option { background: #272833; color: #fff; }
.mp-pick svg {
  position: absolute;
  right: 15px;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.mp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Gallery ----------
   Without JS: an even grid of square tiles. meetup.js turns it into real columns (masonry).
   Real columns instead of CSS multi-column: lazy loading misfires inside multi-column in Chrome. */
.mp-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px 56px;
}
.mp-gallery.is-masonry { display: flex; align-items: flex-start; }
.mp-col { display: flex; flex: 1 1 0; flex-direction: column; gap: 12px; min-width: 0; }

.mp-item {
  position: relative;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.mp-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.25s ease, opacity 0.35s ease;
}
.is-masonry .mp-item img { aspect-ratio: var(--ar); }
.js .mp-item img { opacity: 0; }
.js .mp-item.is-loaded img { opacity: 1; }
.mp-item:hover img { transform: scale(1.06); }
.mp-item:focus-visible { outline: 3px solid #e44c65; outline-offset: 2px; }

.mp-empty { padding: 40px 20px 80px; color: rgba(255, 255, 255, 0.75); font-size: 18px; text-align: center; }

/* ---------- Photo viewer ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 96px 84px;   /* side room for the arrows */
  background: rgba(12, 12, 16, 0.95);
  overflow: hidden;
  font-family: Roboto, Helvetica, Arial, sans-serif;
  touch-action: none;   /* gestures in the viewer zoom the photo, not the page */
  -webkit-user-select: none;
  user-select: none;
}
.lb[hidden] { display: none; }
body.lb-open { overflow: hidden; }

.lb-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transform-origin: 0 0;
  -webkit-user-drag: none;
  cursor: zoom-in;
  transition: filter 0.25s ease;
}
.lb-img.is-soft { filter: blur(3px); }
.lb-img.is-animating { transition: filter 0.25s ease, transform 0.25s ease; }
.lb.is-zoomed .lb-img { cursor: grab; box-shadow: none; border-radius: 0; }
.lb.is-dragging .lb-img { cursor: grabbing; }
.lb-zoom-out, #lb-zoom.is-zoomed .lb-zoom-in { display: none; }
#lb-zoom.is-zoomed .lb-zoom-out { display: block; }
#lb-zoom.is-zoomed { background: rgba(228, 76, 101, 0.55); }

/* :where() keeps this reset light so the button styles below win */
.lb :where(button, a) {
  -webkit-appearance: none;
  appearance: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.lb-side {
  position: absolute;
  top: 50%;
  width: 56px;
  height: 56px;
  margin-top: -50px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  font-size: 34px;
  line-height: 52px;
  text-align: center;
  transition: background-color 0.15s ease;
}
.lb-side:hover { background: rgba(228, 76, 101, 0.6); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }

.lb-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
}
.lb-btn {
  border: 0;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(20, 20, 26, 0.72);
  font-size: 28px;
  line-height: 1;
  transition: background-color 0.15s ease;
}
.lb-btn:hover { background: rgba(60, 60, 72, 0.9); color: #fff !important; }
.lb-btn svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-count { min-width: 64px; color: rgba(255, 255, 255, 0.85); font-size: 15px; text-align: center; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
.lb-bar-prev, .lb-bar-next { display: none; }
.lb-spacer { flex: 1; }
.lb button:focus-visible, .lb a:focus-visible { outline: 2px solid #e44c65; outline-offset: 2px; }

/* ---------- Phones ---------- */
@media screen and (max-width: 736px) {
  .mp-hero { padding: 36px 16px 20px; }
  .mp-hero h1 { font-size: 38px; }
  .mp-years { padding: 8px 10px; }
  .mp-years-inner { gap: 8px; }
  /* Phones: arrows only, so the year picker gets the room */
  .mp-step { width: 40px; min-width: 0; padding: 0; }
  .mp-step-year { display: none; }
  .mp-step.is-disabled { visibility: hidden; }
  .mp-pick select { min-width: 0; max-width: calc(100vw - 132px); padding-left: 16px; font-size: 14px; }
  .mp-gallery { gap: 8px; padding: 0 8px 40px; }
  .mp-col { gap: 8px; }

  .lb { padding: 12px 8px 78px; }
  .lb-bar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .lb-btn { width: 42px; height: 42px; }
  .lb-count { min-width: 52px; font-size: 14px; }
  .lb-side { display: none; }
  .lb-bar-prev, .lb-bar-next { display: inline-grid; }
}

@media (prefers-reduced-motion: reduce) {
  .mp-item img, .lb-img { transition: none; }
}
