/* =========================================================
   VINALI INTRANET GALLERY 2.0.2
   One page = one collection.
   Event covers remain grouped on the left.
   The carousel stays hidden until a cover is clicked.
   ========================================================= */

.vgig-collection,
.vgig-collection * {
  box-sizing: border-box;
}

.vgig-collection {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 30px;
  width: 100%;
  max-width: none;
  min-width: 0;
  align-items: start;
  font-family: "Raleway", "Segoe UI", Arial, sans-serif;
}

/* Oxygen shortcode wrapper compatibility */
.oxy-shortcode:has(.vgig-collection),
.ct-shortcode:has(.vgig-collection),
[id^="shortcode-"]:has(.vgig-collection) {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  align-self: stretch !important;
  flex: 1 1 100% !important;
}

.vgig-collection__covers,
.vgig-viewer {
  min-width: 0;
}

/* =========================================================
   LEFT SIDE — EVENT COVERS
   ========================================================= */

.vgig-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.vgig-event-card {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid #dce3e8;
  border-radius: 10px;
  background: #fff;
  color: #24323d;
  text-align: left;
  cursor: pointer;
  font: inherit;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.vgig-event-card:hover {
  transform: translateY(-2px);
  border-color: #c8d1d8;
  box-shadow: 0 7px 20px rgba(16, 24, 40, 0.08);
}

.vgig-event-card.is-active {
  border-color: #d61719;
  box-shadow: 0 0 0 2px rgba(214, 23, 25, 0.13);
}

.vgig-event-card:focus-visible {
  outline: 3px solid rgba(214, 23, 25, 0.20);
  outline-offset: 3px;
}

.vgig-event-card__media {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 5;
  place-items: center;
  overflow: hidden;
  padding: 7px;
  background: #f7f9fb;
}

.vgig-event-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.vgig-event-card__placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #7b8491;
  font-size: 12px;
  font-weight: 700;
}

.vgig-event-card__shade {
  display: none;
}

.vgig-event-card__content {
  position: static;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 11px 11px;
  border-top: 1px solid #edf1f4;
  background: #fff;
}

.vgig-event-card__date {
  margin-bottom: 3px;
  color: #d61719;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.vgig-event-card__title {
  width: 100%;
  overflow: hidden;
  color: #24323d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vgig-event-card__count {
  margin-top: 5px;
  color: #7b8491;
  font-size: 9px;
  font-weight: 600;
}

/* =========================================================
   RIGHT SIDE — VIEWER
   Hidden until an event cover is clicked.
   ========================================================= */

.vgig-viewer {
  display: none;
  position: sticky;
  top: 92px;
  align-self: start;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #dce3e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.vgig-collection.has-selection .vgig-viewer {
  display: block;
}

.vgig-event-view {
  display: none;
  width: 100%;
}

.vgig-event-view.is-active {
  display: block;
}

.vgig-viewer__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #edf1f4;
}

.vgig-viewer__date {
  margin-bottom: 4px;
  color: #d61719;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vgig-viewer__title {
  margin: 0;
  color: #24323d;
  font-size: clamp(19px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.2;
}

.vgig-viewer__counter {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
  color: #7b8491;
  font-size: 11px;
  font-weight: 700;
}

/* =========================================================
   CAROUSEL
   First slide = event cover.
   ========================================================= */

.vgig-carousel {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  min-height: 420px;
  padding: 14px 10px;
  background: #f7f9fb;
}

.vgig-carousel__stage {
  position: relative;
  width: 100%;
  height: 420px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
}

.vgig-carousel__slide {
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition:
    opacity 180ms ease,
    visibility 180ms ease,
    transform 180ms ease;
}

.vgig-carousel__slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.vgig-carousel__slide img {
  position: static !important;
  display: block !important;

  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;

  max-width: 100% !important;
  max-height: 100% !important;

  inline-size: auto !important;
  block-size: auto !important;
  max-inline-size: 100% !important;
  max-block-size: 100% !important;

  aspect-ratio: auto !important;

  object-fit: contain !important;
  object-position: center center !important;

  margin: 0 auto !important;
  padding: 0 !important;

  border-radius: 5px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.10);
}

.vgig-carousel__nav {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  justify-self: center;
  margin: 0;
  padding: 0;
  border: 1px solid #dce3e8;
  border-radius: 50%;
  background: #fff;
  color: #003046;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.vgig-carousel__nav:hover {
  border-color: #c8d1d8;
  color: #d61719;
  background: #fff;
}

.vgig-carousel__thumbs {
  display: flex;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  padding: 12px 18px 16px;
  border-top: 1px solid #edf1f4;
  background: #fff;
  scrollbar-width: thin;
}

.vgig-carousel__thumb {
  width: 66px;
  height: 48px;
  flex: 0 0 66px;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 5px;
  background: #eef2f5;
  opacity: 0.58;
  cursor: pointer;
  transition:
    opacity 160ms ease,
    border-color 160ms ease;
}

.vgig-carousel__thumb img {
  position: static !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
}

.vgig-carousel__thumb:hover {
  opacity: 0.85;
}

.vgig-carousel__thumb.is-active {
  border-color: #d61719;
  opacity: 1;
}

.vgig-empty {
  width: 100%;
  padding: 28px;
  border: 1px dashed #c8d1d8;
  border-radius: 8px;
  color: #7b8491;
  background: #fff;
  font-family: "Raleway", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  text-align: center;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
  .vgig-collection {
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 22px;
  }

  .vgig-event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .vgig-collection {
    grid-template-columns: 1fr;
  }

  .vgig-event-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .vgig-viewer {
    position: static;
    margin-top: 8px;
  }

  .vgig-carousel,
  .vgig-carousel__stage {
    min-height: 360px;
    height: 360px;
  }
}

@media (max-width: 640px) {
  .vgig-event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .vgig-event-grid {
    grid-template-columns: 1fr;
  }

  .vgig-event-card {
    max-width: 220px;
  }

  .vgig-carousel {
    grid-template-columns: 1fr;
    min-height: 320px;
    padding: 8px;
  }

  .vgig-carousel__stage {
    height: 320px;
  }

  .vgig-carousel__nav {
    position: absolute;
    z-index: 3;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.92);
  }

  .vgig-carousel__nav--prev {
    left: 12px;
  }

  .vgig-carousel__nav--next {
    right: 12px;
  }
}


/* =========================================================
   IMAGE FORMAT SAFETY
   PNG/JPG/WEBP/AVIF must all fit inside the active slide
   without being cropped by theme/Oxygen image rules.
   ========================================================= */

.vgig-carousel__slide > img[src$=".webp"],
.vgig-carousel__slide > img[src*=".webp?"],
.vgig-carousel__slide > img[src$=".avif"],
.vgig-carousel__slide > img[src*=".avif?"],
.vgig-carousel__slide > img[src$=".png"],
.vgig-carousel__slide > img[src*=".png?"],
.vgig-carousel__slide > img[src$=".jpg"],
.vgig-carousel__slide > img[src*=".jpg?"],
.vgig-carousel__slide > img[src$=".jpeg"],
.vgig-carousel__slide > img[src*=".jpeg?"] {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}

/* =========================================================
   COLLECTION LAYOUT — CLOSED VS OPEN
   Closed: covers use the full available width.
   Open: covers collapse to the left and viewer opens right.
   ========================================================= */

/* Default / no carousel selected */
.vgig-collection:not(.has-selection) {
  display: block !important;
  width: 100% !important;
}

.vgig-collection:not(.has-selection) .vgig-collection__covers {
  width: 100% !important;
  max-width: none !important;
}

.vgig-collection:not(.has-selection) .vgig-event-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
}

.vgig-collection:not(.has-selection) .vgig-event-card {
  width: 100% !important;
  max-width: none !important;
}

/* Once a cover is clicked */
.vgig-collection.has-selection {
  display: grid !important;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr) !important;
  gap: 30px !important;
  align-items: start !important;
}

.vgig-collection.has-selection .vgig-event-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

.vgig-collection.has-selection .vgig-viewer {
  display: block !important;
}

/* Large tablet */
@media (max-width: 1200px) {
  .vgig-collection:not(.has-selection) .vgig-event-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Tablet */
@media (max-width: 980px) {
  .vgig-collection:not(.has-selection) .vgig-event-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .vgig-collection.has-selection {
    grid-template-columns: 1fr !important;
  }

  .vgig-collection.has-selection .vgig-event-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .vgig-collection.has-selection .vgig-viewer {
    position: static !important;
    margin-top: 8px;
  }
}

/* Small tablet / mobile */
@media (max-width: 700px) {
  .vgig-collection:not(.has-selection) .vgig-event-grid,
  .vgig-collection.has-selection .vgig-event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .vgig-collection:not(.has-selection) .vgig-event-grid,
  .vgig-collection.has-selection .vgig-event-grid {
    grid-template-columns: 1fr !important;
  }

  .vgig-collection:not(.has-selection) .vgig-event-card,
  .vgig-collection.has-selection .vgig-event-card {
    max-width: 260px !important;
  }
}



/* =========================================================
   VIEWER CLOSE CONTROL
   ========================================================= */

.vgig-viewer__heading {
  min-width: 0;
}

.vgig-viewer__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.vgig-viewer__close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid #dce3e8;
  border-radius: 50%;
  background: #fff;
  color: #475467;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.vgig-viewer__close:hover {
  border-color: #c8d1d8;
  color: #d61719;
  background: #f7f9fb;
}

.vgig-viewer__close:focus-visible {
  outline: 3px solid rgba(214, 23, 25, 0.18);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .vgig-viewer__header {
    align-items: center;
  }

  .vgig-viewer__actions {
    gap: 8px;
  }

  .vgig-viewer__close {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
}

/* =========================================================
   VIDEO SUPPORT + VIEWER MOTION — v2.1.1
   ========================================================= */

/* Uploaded video slides */
.vgig-carousel__slide.is-video {
  background: #10161a;
  border-radius: 6px;
}

.vgig-carousel__video {
  position: static !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 auto !important;
  padding: 0 !important;
  background: #000;
  border-radius: 5px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
}

.vgig-carousel__thumb.is-video {
  display: grid;
  place-items: center;
  background: #24323d;
  color: #fff;
}

.vgig-carousel__thumb-play {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 10px;
  line-height: 1;
}

/* Keep the component as a grid in both states so the width change can animate. */
.vgig-collection,
.vgig-collection:not(.has-selection),
.vgig-collection.has-selection {
  display: grid !important;
  align-items: start !important;
  transition:
    grid-template-columns 320ms cubic-bezier(.2,.7,.2,1),
    gap 320ms cubic-bezier(.2,.7,.2,1);
}

/* Closed state: covers use the full width. */
.vgig-collection:not(.has-selection) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0fr) !important;
  gap: 0 !important;
}

.vgig-collection:not(.has-selection) .vgig-event-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

/* Open state: covers move left, viewer opens right. */
.vgig-collection.has-selection {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr) !important;
  gap: 30px !important;
}

.vgig-collection.has-selection .vgig-event-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

/* Override the old display:none rule so opacity/transform can animate. */
.vgig-viewer,
.vgig-collection:not(.has-selection) .vgig-viewer,
.vgig-collection.has-selection .vgig-viewer {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.vgig-viewer {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(28px) scale(0.97);
  transform-origin: center left;
  border-color: transparent !important;
  box-shadow: none !important;

  transition:
    opacity 260ms ease,
    transform 320ms cubic-bezier(.2,.7,.2,1),
    border-color 260ms ease,
    box-shadow 260ms ease,
    visibility 0s linear 320ms;
}

.vgig-collection.has-selection .vgig-viewer {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0) scale(1);
  border-color: #dce3e8 !important;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06) !important;

  transition:
    opacity 260ms ease,
    transform 320ms cubic-bezier(.2,.7,.2,1),
    border-color 260ms ease,
    box-shadow 260ms ease,
    visibility 0s linear 0s;
}

/* Closing state remains visible long enough to animate out. */
.vgig-collection.is-closing .vgig-viewer {
  opacity: 0 !important;
  transform: translateX(28px) scale(0.97) !important;
  pointer-events: none !important;
}

/* Slight motion on the cover cards makes the layout change feel intentional. */
.vgig-event-card {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 220ms ease,
    opacity 220ms ease;
}

@media (max-width: 1200px) {
  .vgig-collection:not(.has-selection) .vgig-event-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 980px) {
  .vgig-collection,
  .vgig-collection:not(.has-selection),
  .vgig-collection.has-selection {
    grid-template-columns: 1fr !important;
  }

  .vgig-collection:not(.has-selection) {
    gap: 0 !important;
  }

  .vgig-collection.has-selection {
    gap: 20px !important;
  }

  .vgig-collection:not(.has-selection) .vgig-event-grid,
  .vgig-collection.has-selection .vgig-event-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .vgig-viewer {
    position: static !important;
    transform: translateY(20px) scale(0.985);
  }

  .vgig-collection.has-selection .vgig-viewer {
    transform: translateY(0) scale(1);
  }

  .vgig-collection.is-closing .vgig-viewer {
    transform: translateY(20px) scale(0.985) !important;
  }
}

@media (max-width: 700px) {
  .vgig-collection:not(.has-selection) .vgig-event-grid,
  .vgig-collection.has-selection .vgig-event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 480px) {
  .vgig-collection:not(.has-selection) .vgig-event-grid,
  .vgig-collection.has-selection .vgig-event-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vgig-collection,
  .vgig-viewer,
  .vgig-event-card,
  .vgig-carousel__slide {
    transition: none !important;
  }
}

