/**
 * Events & Gallery page
 * Brand: #0000ff · #0A2540 · Poppins
 */

#EventsGallery.eg {
  --eg-blue: #0000ff;
  --eg-ink: #0a2540;
  --eg-muted: #667384;
  --eg-line: #e4e9f3;
  --eg-wash: #f5f7ff;
  --eg-ease: cubic-bezier(.22, .82, .18, 1);
  font-family: Poppins, sans-serif;
  color: var(--eg-ink);
  background: #fff;
}

#EventsGallery .container {
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* ── Hero ── */
.eg-hero {
  position: relative;
  isolation: isolate;
  padding: 72px 0 64px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 60% at 12% 20%, rgba(0, 0, 255, .08), transparent 58%),
    radial-gradient(ellipse 40% 50% at 90% 80%, rgba(136, 136, 255, .1), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, var(--eg-wash) 100%);
}

.eg-hero__grid {
  position: absolute;
  inset: 0;
  opacity: .35;
  background-image:
    radial-gradient(rgba(0, 0, 255, .12) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
  pointer-events: none;
  z-index: 0;
}

.eg-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
}

.eg-hero__kicker {
  margin: 0 0 12px;
  color: var(--eg-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eg-hero__title {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--eg-ink);
}

.eg-hero__title span {
  background: linear-gradient(to right, #0000ff, #0000ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--eg-blue);
}

.eg-hero__copy {
  margin: 0 0 28px;
  max-width: 34rem;
  color: var(--eg-muted);
  font-size: 16px;
  line-height: 1.65;
}

.eg-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.eg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: background .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.eg-btn--primary {
  background: var(--eg-blue);
  color: #fff !important;
  box-shadow: 0 12px 28px -16px rgba(0, 0, 255, .55);
}

.eg-btn--primary:hover {
  background: #0000cc;
  transform: translateY(-1px);
}

.eg-btn--ghost {
  border: 1.5px solid var(--eg-ink);
  color: var(--eg-ink) !important;
  background: #fff;
}

.eg-btn--ghost:hover {
  background: var(--eg-ink);
  color: #fff !important;
}

/* ── Section heads ── */
.eg-section-head {
  max-width: 36rem;
  margin: 0 0 36px;
}

.eg-section-head__kicker {
  margin: 0 0 8px;
  color: var(--eg-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eg-section-head h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--eg-ink);
}

.eg-section-head p {
  margin: 0;
  color: var(--eg-muted);
  font-size: 15px;
  line-height: 1.65;
}

.eg-empty {
  margin: 0;
  padding: 28px;
  border: 1px dashed var(--eg-line);
  border-radius: 16px;
  color: var(--eg-muted);
  text-align: center;
}

/* ── Events (image cards) ── */
.eg-events {
  position: relative;
  padding: 88px 0 64px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 48% 55% at 8% 18%, rgba(0, 0, 255, .07), transparent 58%),
    radial-gradient(ellipse 40% 48% at 92% 88%, rgba(136, 136, 255, .1), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, var(--eg-wash) 48%, #ffffff 100%);
}

.eg-section-head--events {
  max-width: 40rem;
  margin-bottom: 44px;
}

.eg-events__stage {
  margin-bottom: 22px;
}

.eg-events__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 48px;
}

.eg-events__past-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 20px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--eg-ease), transform .7s var(--eg-ease);
}

.eg-events__past-head.is-in {
  opacity: 1;
  transform: none;
}

.eg-events__past-head h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 700;
  color: var(--eg-ink);
  letter-spacing: -.02em;
}

.eg-events__past-head p {
  margin: 0;
  color: var(--eg-muted);
  font-size: 14px;
}

.eg-events__rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 320px);
  gap: 18px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.eg-events__rail::-webkit-scrollbar { height: 6px; }
.eg-events__rail::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 255, .25);
  border-radius: 999px;
}

.eg-card {
  --eg-i: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--eg-line);
  box-shadow: 0 18px 40px -30px rgba(10, 37, 64, .35);
  overflow: hidden;
  opacity: 0;
  transform: translateY(28px) scale(.98);
  transition:
    opacity .75s var(--eg-ease),
    transform .75s var(--eg-ease),
    box-shadow .35s ease,
    border-color .35s ease;
  transition-delay: calc(var(--eg-i) * 70ms);
  scroll-snap-align: start;
}

.eg-card.is-in {
  opacity: 1;
  transform: none;
}

.eg-card:hover {
  border-color: rgba(0, 0, 255, .22);
  box-shadow: 0 28px 50px -28px rgba(0, 0, 255, .28);
  transform: translateY(-4px);
}

.eg-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(180deg, #eff3ff, #e8eef8);
  aspect-ratio: 16 / 10;
}

.eg-card__media--empty {
  background:
    radial-gradient(ellipse 60% 50% at 30% 40%, rgba(0, 0, 255, .12), transparent 60%),
    linear-gradient(145deg, #eef2ff, #e4ebf7 55%, #dfe8f4);
}

.eg-card--featured .eg-card__media {
  aspect-ratio: 21 / 9;
  min-height: 280px;
}

.eg-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .9s var(--eg-ease), filter .5s ease;
}

.eg-card:hover .eg-card__media img {
  transform: scale(1.05);
  filter: saturate(1.05);
}

.eg-card__sheen {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .28) 48%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
  z-index: 1;
}

.eg-card:hover .eg-card__sheen {
  animation: eg-card-sheen .9s var(--eg-ease);
}

@keyframes eg-card-sheen {
  to { transform: translateX(120%); }
}

.eg-card__badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 64px;
  padding: 10px 12px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(228, 233, 243, .9);
  box-shadow: 0 10px 24px -14px rgba(10, 37, 64, .4);
  text-align: center;
  line-height: 1;
}

.eg-card__badge strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--eg-ink);
}

.eg-card__badge em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--eg-blue);
}

.eg-card__badge small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--eg-muted);
}

.eg-card__type {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 255, .92);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.eg-card--past .eg-card__type {
  background: rgba(10, 37, 64, .78);
}

.eg-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 20px;
  flex: 1;
}

.eg-card--featured {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  min-height: 340px;
}

.eg-card--featured .eg-card__media {
  min-height: 100%;
  aspect-ratio: auto;
  height: 100%;
}

.eg-card--featured .eg-card__body {
  justify-content: center;
  padding: 28px 28px 30px;
}

.eg-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--eg-muted);
}

.eg-card__when { font-weight: 650; color: var(--eg-ink); }

.eg-card__loc i {
  margin-right: 5px;
  color: var(--eg-blue);
}

.eg-card__title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.eg-card--featured .eg-card__title {
  font-size: clamp(1.45rem, 2.8vw, 2rem);
}

.eg-card__title a {
  color: var(--eg-ink);
  text-decoration: none;
}

.eg-card__title a:hover { color: var(--eg-blue); }

.eg-card__excerpt {
  margin: 0;
  color: var(--eg-muted);
  font-size: 14px;
  line-height: 1.65;
}

.eg-card--featured .eg-card__excerpt {
  font-size: 15px;
  max-width: 28rem;
}

.eg-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  color: var(--eg-blue) !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: gap .25s ease, transform .25s ease;
}

.eg-card__cta:hover {
  gap: 12px;
}

.eg-card--past .eg-card__media { aspect-ratio: 4 / 3; }

@media (max-width: 991px) {
  .eg-card--featured {
    grid-template-columns: 1fr;
  }

  .eg-card--featured .eg-card__media {
    aspect-ratio: 16 / 9;
    min-height: 220px;
  }

  .eg-events__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .eg-events { padding: 64px 0 48px; }

  .eg-events__rail {
    grid-auto-columns: minmax(240px, 78vw);
  }
}

/* ── Gallery ── */
.eg-gallery {
  position: relative;
  padding: 56px 0 80px;
  background:
    radial-gradient(ellipse 50% 40% at 80% 0%, rgba(0, 0, 255, .05), transparent 55%),
    linear-gradient(180deg, var(--eg-wash) 0%, #ffffff 40%);
}

.eg-gallery__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}

.eg-chip {
  border: 1px solid var(--eg-line);
  border-radius: 999px;
  background: #fff;
  color: var(--eg-muted);
  font-family: Poppins, sans-serif;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .04em;
  padding: 8px 14px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.eg-chip:hover {
  border-color: rgba(0, 0, 255, .35);
  color: var(--eg-blue);
}

.eg-chip.is-active {
  background: var(--eg-blue);
  border-color: var(--eg-blue);
  color: #fff;
}

.eg-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.eg-tile {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  border: 1px solid var(--eg-line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--eg-wash);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  text-align: left;
  transition: transform .35s var(--eg-ease), box-shadow .35s ease, opacity .35s ease;
}

.eg-tile.is-hidden {
  display: none;
}

.eg-tile.is-enter {
  animation: eg-tile-in .45s var(--eg-ease) both;
}

@keyframes eg-tile-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.eg-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .7s var(--eg-ease);
}

.eg-tile__veil {
  position: absolute;
  inset: auto 0 0;
  padding: 28px 14px 14px;
  background: linear-gradient(180deg, transparent, rgba(10, 37, 64, .72));
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s var(--eg-ease);
}

.eg-tile__title {
  display: block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.eg-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px -28px rgba(10, 37, 64, .45);
}

.eg-tile:hover img { transform: scale(1.04); }

.eg-tile:hover .eg-tile__veil {
  opacity: 1;
  transform: none;
}

/* ── Lightbox ── */
.eg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 37, 64, .82);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.eg-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.eg-lightbox[hidden] { display: none !important; }

.eg-lightbox.is-open[hidden] { display: grid !important; }

.eg-lightbox__figure {
  margin: 0;
  max-width: min(920px, 100%);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: eg-lb-in .4s var(--eg-ease) both;
}

@keyframes eg-lb-in {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
  to { opacity: 1; transform: none; }
}

.eg-lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  border-radius: 12px;
  background: #0a2540;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55);
}

.eg-lightbox__figure figcaption {
  margin-top: 14px;
  text-align: center;
  color: #fff;
  max-width: 36rem;
}

.eg-lightbox__figure strong {
  display: block;
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 4px;
}

.eg-lightbox__figure span {
  display: block;
  font-size: 13px;
  opacity: .8;
  line-height: 1.5;
}

.eg-lightbox__close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}

.eg-lightbox__close:hover { background: rgba(255, 255, 255, .22); }

.eg-lightbox__nav {
  position: absolute;
  top: 50%;
  margin-top: -24px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s ease, transform .2s ease;
}

.eg-lightbox__nav svg { width: 20px; height: 20px; }

.eg-lightbox__nav:hover {
  background: rgba(255, 255, 255, .22);
  transform: scale(1.04);
}

.eg-lightbox__nav--prev { left: 16px; }
.eg-lightbox__nav--next { right: 16px; }

@media (max-width: 991px) {
  .eg-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .eg-hero { padding: 52px 0 44px; }

  .eg-event {
    grid-template-columns: 60px 1fr;
    gap: 14px;
  }

  .eg-event__date {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }

  .eg-event__day { font-size: 18px; }

  .eg-gallery__grid {
    grid-template-columns: 1fr;
  }

  .eg-lightbox__nav--prev { left: 8px; }
  .eg-lightbox__nav--next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .eg-tile,
  .eg-tile img,
  .eg-tile__veil,
  .eg-lightbox,
  .eg-lightbox__figure,
  .eg-chip,
  .eg-btn,
  .eg-card,
  .eg-card__media img,
  .eg-card__sheen,
  .eg-events__past-head {
    animation: none !important;
    transition: none !important;
  }

  .eg-card,
  .eg-events__past-head {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Keep CTA panel visually separate from the blue site footer */
#EventsGallery .pf-bottom-cta {
  margin-top: 64px;
  margin-bottom: 56px;
}

#EventsGallery.eg {
  padding-bottom: 8px;
}
