/*==============================================================
  EVENTS / WORKSHOPS PAGE  (events.php) — page-specific styles
  Reuses the home page system: .section / .section-title /
  .light-background, 10px media radius, .event-overlay text over
  media (Poppins, white on dark gradient), soft shadows.
  (Shared header / navigation rules live in main.css.)
==============================================================*/

/* Banner: same treatment as the home hero, shorter */
.page-banner { position: relative; width: 100%; height: 280px; overflow: hidden; }
.page-banner img { width: 100%; height: 100%; object-fit: cover; filter: brightness(55%); display: block; }
.page-banner__content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 20px; text-align: center; color: #fff;
}
.page-banner__title { font-size: 44px; font-weight: 800; color: #fff; margin: 0; }
.page-banner__tagline {
  max-width: 640px; margin: 10px 0 0;
  font-family: var(--nav-font); font-size: 16px; line-height: 1.5; color: rgba(255,255,255,.92);
}
@media (max-width: 768px) {
  .page-banner { height: 220px; }
  .page-banner__title { font-size: 32px; }
  .page-banner__tagline { font-size: 14px; }
}
@media (max-width: 480px) {
  .page-banner__title { font-size: 28px; }
}

/* Section selector: normal document flow, directly under the banner */
.events-hub { padding: 36px 0 0; overflow: visible; }
.events-hub .container { display: flex; flex-direction: column; align-items: center; }
.events-switch {
  display: inline-flex; gap: 4px; margin: 0; padding: 4px; list-style: none;
  background: #f1f7fc;
  border: 1px solid color-mix(in srgb, var(--accent-color), transparent 82%);
  border-radius: 10px;
}
.events-switch a {
  display: block; padding: 10px 26px; border-radius: 7px;
  color: var(--accent-color);
  font-family: var(--nav-font); font-size: 15px; font-weight: 600; line-height: 1.25;
  text-align: center; text-decoration: none; white-space: nowrap;
  transition: background-color .25s ease, color .25s ease;
}
.events-switch a:hover,
.events-switch a:focus-visible,
.events-switch a.is-active { background: var(--accent-color); color: #fff; }
@media (max-width: 575px) {
  .events-hub { padding-top: 24px; }
  .events-hub .container { align-items: stretch; }
  .events-switch { display: grid; grid-template-columns: repeat(3, 1fr); }
  .events-switch a { padding: 10px 6px; font-size: 12.5px; white-space: normal; }
}

/* Sections: offset anchors by the sticky site header only */
.events-section { scroll-margin-top: calc(var(--events-header-h, 100px) + 4px); }
.events-section .section-title { padding-bottom: 40px; }

/* Card grid: centred rows, equal-width columns, consistent gap.
   Every card in a row stretches to the same height (flex default align-items: stretch). */
.events-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 24px; }
.events-grid .event-item { flex: 0 0 calc((100% - 48px) / 3); max-width: calc((100% - 48px) / 3); min-width: 0; }
@media (max-width: 991px) {
  .events-grid .event-item { flex-basis: calc((100% - 24px) / 2); max-width: calc((100% - 24px) / 2); }
}
@media (max-width: 575px) {
  .events-grid { gap: 20px; }
  .events-grid .event-item { flex-basis: 100%; max-width: 100%; }
}

.event-card {
  display: flex; flex-direction: column; height: 100%;
  overflow: hidden; border-radius: 10px;
  background: var(--surface-color);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
}

/* Media: fixed 16:10 frame for EVERY card (images, video, embeds) — cropped, never stretched */
.event-card .event-media {
  position: relative; flex: 0 0 auto; width: 100%; height: auto; aspect-ratio: 16 / 10;
  border-radius: 0; overflow: hidden; background: #0b0b2b;
}
.event-card .event-media .swiper,
.event-card .event-media .event-video-card { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.event-card .event-media .swiper-wrapper,
.event-card .event-media .swiper-slide { width: 100%; height: 100%; }
.event-card .event-media .swiper-slide { position: relative; overflow: hidden; }
.event-card .event-media .swiper-slide > img,
.event-card .event-media .event-video-card video {
  width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 0;
}
.event-card .event-media .event-video-card video { object-fit: contain; background: #000; }
.event-card .event-media .swiper-button-next,
.event-card .event-media .swiper-button-prev { --swiper-navigation-size: 18px; }
.event-card .event-media .swiper-slide > img[data-zoom],
.event-card .event-media .slide-fg[data-zoom] { cursor: zoom-in; }

/* Portrait posters: show the whole poster over a blurred copy of itself instead of cropping it */
.event-card .event-media .slide-contain { background: #0b0b2b; }
.event-card .event-media .slide-bg {
  position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px);
  object-fit: cover; filter: blur(16px) brightness(.55); transform: scale(1.05);
}
.event-card .event-media .slide-fg {
  position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain;
}

/* Missing media: branded placeholder instead of an empty/broken frame */
.event-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1b1b6b, #2d2dea 60%, #036dda);
  color: rgba(255,255,255,.35); font-size: 64px;
}

/* Text over media (same overlay as home gallery video tile) */
.event-card .event-overlay { top: 35%; padding: 8px 18px 30px; }
.event-card .event-video-card .event-overlay { padding-bottom: 52px; }
.event-card .event-overlay .ev-title {
  font-size: 1.1rem; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.event-card .event-overlay .ev-location { font-size: .82rem; }
.event-card .event-overlay .ev-date { font-size: .74rem; }
.event-card .swiper-pagination { z-index: 3; }

/* Card body: equal-height cards; long descriptions are clamped (full text opens in a popup) */
.event-card__body { flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; padding: 18px 20px 22px; }
.event-card__text {
  margin: 0; font-size: 15px; line-height: 1.65; width: 100%;
  white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.event-more {
  margin-top: auto; padding: 14px 0 0; background: none; border: 0;
  color: var(--accent-color); font-family: var(--nav-font); font-size: 14px; font-weight: 600; cursor: pointer;
}
.event-more:hover { text-decoration: underline; }
.event-more:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 3px; border-radius: 3px; }

/* Slider with a single slide: no arrows / dots */
.event-slider.is-single .swiper-button-next,
.event-slider.is-single .swiper-button-prev,
.event-slider.is-single .swiper-pagination { display: none; }

/* ------------------------------------------------ YouTube / Instagram / link media */
.event-embed { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; background: #0b0b2b; }
.event-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 4; }

.event-yt .embed-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.event-yt .embed-play {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 3;
  width: 64px; height: 64px; border: 0; border-radius: 50%;
  background: rgba(255, 0, 0, .92); color: #fff; font-size: 34px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 6px 22px rgba(0,0,0,.4); transition: transform .2s ease;
}
.event-yt .embed-play:hover { transform: translate(-50%, -50%) scale(1.08); }
.event-yt .embed-play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.event-yt .embed-open {
  position: absolute; right: 10px; top: 10px; z-index: 3;
  padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff;
  font-family: var(--nav-font); font-size: 11.5px; font-weight: 500; text-decoration: none;
}
.event-yt .embed-open:hover, .event-yt .embed-open:focus-visible { background: rgba(0,0,0,.85); color: #fff; }
.event-media.is-embed-playing .event-overlay { display: none; }

.event-ig { background: linear-gradient(135deg, #515bd4 0%, #8134af 30%, #dd2a7b 62%, #feda77 100%); }
.event-link { background: linear-gradient(135deg, #1b1b6b, #2d2dea 55%, #036dda); }
.event-embed .embed-center {
  position: absolute; left: 0; right: 0; top: 0; bottom: 42%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 14px; color: #fff; text-align: center;
}
.event-embed .embed-icon { font-size: 40px; line-height: 1; }
.event-embed .embed-kind { font-family: var(--nav-font); font-size: 13px; font-weight: 600; letter-spacing: .02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-embed .embed-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; position: relative; z-index: 3; }
.embed-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  border: 1.5px solid #fff; background: #fff; color: #1c1c8a;
  font-family: var(--nav-font); font-size: 12.5px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
}
.embed-btn:hover { background: rgba(255,255,255,.88); color: #1c1c8a; }
.embed-btn--ghost { background: transparent; color: #fff; }
.embed-btn--ghost:hover { background: rgba(255,255,255,.18); color: #fff; }
.embed-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Event details popup */
.event-modal .modal-title { font-family: var(--heading-font); font-size: 1.25rem; font-weight: 700; color: var(--heading-color); }
.event-modal__meta { margin: 4px 0 0; font-size: 13px; color: #55607a; }
.event-modal__meta:empty { display: none; }
.event-modal__text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.7; font-size: 15px; }

/* Empty state (shown when a list has no items) */
.events-empty { flex: 0 0 100%; text-align: center; padding: 30px 0; font-size: 17px; }
.events-empty[hidden] { display: none; }

@media (max-width: 480px) {
  .event-embed .embed-icon { font-size: 32px; }
  .embed-btn { padding: 5px 11px; font-size: 12px; }
  .event-yt .embed-play { width: 54px; height: 54px; font-size: 28px; }
}
