/* ----------------------------------------------------------
   Custom styles for the events page on top of nulife main.css
   Stays consistent with the existing design system
   ---------------------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* protect images from easy save */
.event-card img,
.gallery-item img,
.lightbox__content img {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
}

/* ---------- toolbar ---------- */
.events-toolbar {
  border-bottom: 1px solid #eee;
  padding-bottom: 24px;
}
.events-toolbar__sub {
  color: #777;
}
.events-toolbar__controls {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.events-search input,
.events-filter select {
  font-family: var(--font-primary, "Jost", sans-serif);
  border: 1px solid #ddd;
  background: #fff;
  height: 44px;
  padding: 0 16px;
  border-radius: 4px;
  font-size: 15px;
  min-width: 200px;
  outline: none;
  transition: border-color .2s ease;
}
.events-search input:focus,
.events-filter select:focus {
  border-color: #b48a52;
}

/* ---------- grid ---------- */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
  margin-top: 30px;
}
.events-grid--skeleton { display: none; } /* shown via JS only briefly */

.event-card {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.05);
  transition: transform .25s ease, box-shadow .25s ease;
}
.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.1);
}
.event-card__link {
  display: block; color: inherit; text-decoration: none;
}
.event-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f3f3f3;
}
.event-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.event-card:hover .event-card__media img { transform: scale(1.05); }
.event-card__pin {
  position: absolute; top: 12px; left: 12px;
  background: rgba(0,0,0,0.7); color: #fff;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; letter-spacing: .5px; text-transform: uppercase;
}
.event-card__body {
  padding: 18px 20px 22px;
}
.event-card__date {
  text-transform: uppercase;
  font-size: 12px; letter-spacing: .8px;
  color: #b48a52; font-weight: 500;
}
.event-card__title {
  font-size: 20px; font-weight: 500;
  margin: 6px 0 6px;
  color: #1a1a1a;
}
.event-card__desc {
  font-size: 14px; color: #777;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.events-empty {
  padding: 60px 0; text-align: center;
}

/* ---------- skeletons (visible briefly, removed by JS) ---------- */
.event-card--skeleton { box-shadow: none; }
.skeleton-block,
.skeleton-line {
  background: linear-gradient(90deg, #f1f1f1 25%, #e9e9e9 37%, #f1f1f1 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 4px;
}
.skeleton-block { width: 100%; aspect-ratio: 4/3; }
.skeleton-line { height: 14px; margin-top: 12px; }
.skeleton-line--sm { width: 30%; height: 10px; }
.skeleton-line--md { width: 60%; }
@keyframes skeleton-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- detail page ---------- */
.event-detail__top {
  border-bottom: 1px solid #eee;
  padding-bottom: 24px;
}
.event-detail__date { color: #b48a52; }
.event-detail__desc { max-width: 720px; }

.share-buttons {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.share-btn {
  border: 1px solid #ddd; background: #fff;
  height: 40px; padding: 0 16px; border-radius: 999px;
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: all .2s ease;
}
.share-btn:hover { border-color: #b48a52; color: #b48a52; }
.share-btn--whatsapp:hover { border-color: #25D366; color: #25D366; }
.share-btn--facebook:hover { border-color: #1877F2; color: #1877F2; }
.share-btn--copy.copied { border-color: #2ea043; color: #2ea043; }

/* ---------- gallery grid ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 30px;
}
.gallery-item {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: zoom-in;
  background: #111;
  border-radius: 2px;
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease, opacity .35s ease;
}
.gallery-item:hover img { transform: scale(1.04); opacity: 0.92; }
.gallery-item__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 14px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0));
  color: #fff; font-size: 13px;
  pointer-events: none;
}
.gallery-item--video { cursor: pointer; }
.gallery-item__playicon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; color: #fff;
  background: rgba(0,0,0,0.25);
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  transition: background .25s ease, transform .25s ease;
}
.gallery-item--video:hover .gallery-item__playicon {
  background: rgba(0,0,0,0.45);
  transform: scale(1.05);
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  user-select: none;
  touch-action: none;
}
.lightbox[hidden] { display: none; }
.lightbox__close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,0.55); border: 0; color: #fff;
  font-size: 32px; line-height: 1; cursor: pointer;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(4px);
}
.lightbox__close:hover { background: rgba(0,0,0,0.8); }
.lightbox__content {
  width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  touch-action: none;
}
.lightbox__content img {
  max-width: 100%;
  max-height: 100%;
  width: auto; height: auto;
  transform-origin: center center;
  transition: transform .12s ease-out;
  cursor: grab;
  display: block;
}
.lightbox__content img.is-zoomed { cursor: grab; }
.lightbox__content img.is-grabbing { cursor: grabbing; transition: none; }
.lightbox__content iframe {
  width: 100vw;
  aspect-ratio: 16/9;
  border: 0;
  background: #000;
  max-height: 100vh;
}
.lightbox__caption {
  position: absolute;
  left: 0; right: 0;
  bottom: 68px;
  text-align: center;
  color: #fff; font-size: 14px;
  pointer-events: none;
  padding: 0 70px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  z-index: 10001;
}
.lightbox__zoom-controls {
  position: absolute; left: 50%; bottom: 16px;
  transform: translateX(-50%);
  display: flex; gap: 4px;
  background: rgba(0,0,0,0.6);
  padding: 5px 8px; border-radius: 999px;
  backdrop-filter: blur(6px);
  z-index: 10001;
}
.lightbox__zoom-controls button {
  background: transparent; border: 0; color: #fff;
  width: 38px; height: 32px;
  font-size: 18px; line-height: 1; cursor: pointer;
  border-radius: 999px;
  transition: background .15s ease;
}
.lightbox__zoom-controls button:hover { background: rgba(255,255,255,0.15); }
.lightbox__zoom-controls button[data-share-current] {
  width: auto; padding: 0 14px; font-size: 13px;
}

/* ---------- video popup (YouTube — no zoom controls) ---------- */
.videopop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.96);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.videopop[hidden] { display: none; }
.videopop__close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,0.6); border: 0; color: #fff;
  font-size: 32px; line-height: 1; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 10001; backdrop-filter: blur(4px);
  transition: background .2s ease;
}
.videopop__close:hover { background: rgba(0,0,0,0.9); }
.videopop__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  border-radius: 50%; width: 48px; height: 48px;
  background: rgba(0,0,0,0.55); border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10001; transition: background .2s ease;
}
.videopop__nav--prev { left: 14px; }
.videopop__nav--next { right: 14px; }
.videopop__nav:hover,
.videopop__nav:active { background: rgba(0,0,0,0.85); }
.videopop__frame {
  width: min(calc(100vw - 120px), 1200px);
  max-width: 100%;
}
.videopop__frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}
.videopop__caption {
  position: absolute; left: 0; right: 0; bottom: 20px;
  text-align: center; color: rgba(255,255,255,0.7);
  font-size: 14px; pointer-events: none;
  padding: 0 70px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
@media (max-width: 720px) {
  .videopop__frame { width: 100vw; }
  .videopop__nav { width: 44px; height: 44px; font-size: 20px; }
  .videopop__nav--prev { left: 8px; }
  .videopop__nav--next { right: 8px; }
}

/* ---------- page header overlay: boost to 50% dark ---------- */
/* Main.css sets this at 20% opacity; override to 50% for readability */
.pageHeader.-type-1 .pageHeader__image::after {
  background-color: #000 !important;
  opacity: 0.5 !important;
}

/* ---------- lightbox nav: round circle on all screen sizes ---------- */
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  border-radius: 50%;
  width: 48px; height: 48px;
  background: rgba(0, 0, 0, 0.55) !important;
  border: 1.5px solid rgba(255,255,255,0.2) !important;
  backdrop-filter: blur(4px);
  color: #fff; font-size: 24px; cursor: pointer;
  display: flex !important;
  align-items: center; justify-content: center;
  z-index: 10001;
  transition: background .2s ease;
}
.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }
.lightbox__nav:hover,
.lightbox__nav:active {
  background: rgba(0, 0, 0, 0.82) !important;
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .events-toolbar { flex-direction: column; align-items: flex-start; }
  .events-toolbar__controls { width: 100%; }
  .events-search input,
  .events-filter select { flex: 1; min-width: 0; }
  .events-grid { gap: 18px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .lightbox__nav {
    width: 44px !important;
    height: 44px !important;
    font-size: 22px !important;
  }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__close { top: 10px; right: 10px; }
}
@media (max-width: 460px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

.error-page {
  min-height: 70vh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 0;
}
