/* =========================
   FROSTED PANEL (unchanged)
   ========================= */

/* PANEL BASE (full-width visual band) */
.frosted-panel{
  position: relative;
  z-index: 1050;
  background: rgba(255,255,255,0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  padding-top: 20px;
  width: 100%;
}

/* CONTENT WRAPPER — matches site width */
.frosted-panel .btn-group-wrapper{
  width: 100%;
  max-width: 1100px;
  padding: 0 1rem;
  margin: 0 auto;
}

/* Full-width menu row inside constrained wrapper */
.frosted-panel .col-md-12.btn-group{
  display: flex !important;
  flex-wrap: nowrap;
  justify-content: stretch !important;
  width: 100%;
  padding: 0;
  margin: 0;
}

/* Menu tabs */
.frosted-panel .btn.btn-secondary{
  flex: 1 1 0;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #000 !important;
  text-align: center;
  position: relative;
}

/* Typography styling identical to your section titles */
.frosted-panel .btn.btn-secondary h4{
  margin: 0;
  padding: 16px 0;
  font-size: 20px;
  font-weight: 400;
  display: inline-block;
  line-height: 1.2;
}

/* Vertical separators */
.frosted-panel .btn.btn-secondary:not(:first-child)::before{
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 1px;
  background: rgba(0,0,0,0.12);
}

/* Hover / Active */
.frosted-panel .btn.btn-secondary:hover{
  background: rgba(0,0,0,0.06) !important;
}
.frosted-panel .btn.btn-secondary:active{
  background: rgba(0,0,0,0.12) !important;
}

/* Responsive tuning */
@media (max-width: 768px){
  .frosted-panel .btn-group-wrapper{
    padding: 0 0.75rem;
  }
  .frosted-panel .btn.btn-secondary h4{
    font-size: 18px;
    padding: 12px 0;
  }
}

/* Hide entire showcase system on small screens */
@media (max-width: 1000px) {
  .frosted-panel,
  .showcasebackground,
  .showcase,
  #showcase,
  .showcase-wrapper,
  .showcase-track,
  #showcasePrev,
  #showcaseNext,
  .showcase-btn {
    display: none !important;
  }
}



/* Swiper carousel (container-bounded) */
.publication-swiper {
  width: 100%;
  max-width: 100%;
  padding: 0;
  height: auto !important; /* prevent full-viewport/tall swiper */
}

/* Side fade overlays (visual focus + improves arrow contrast) */
.publication-swiper {
  position: relative;
}

/* Swiper pagination (dots) — below carousel */
.publication-swiper .swiper-pagination {
  position: relative;
  left: auto;
  transform: none;
  bottom: auto;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 12px;
  z-index: 1;
}

.publication-swiper::before,
.publication-swiper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 4;
  pointer-events: none;
}

.publication-swiper::before {
  left: 0;
  background: linear-gradient(to right, rgba(255,255,255,0.97), rgba(255,255,255,0));
}

.publication-swiper::after {
  right: 0;
  background: linear-gradient(to left, rgba(255,255,255,0.97), rgba(255,255,255,0));
}

.publication-swiper .swiper-wrapper {
  align-items: stretch;
  height: auto !important;
}
.publication-swiper .swiper-slide {
  height: auto !important; /* override Swiper default height:100% */
}

/* Ensure Flickity doesn't create horizontal bleed outside the container */
.publication-swiper {
  overflow: hidden;
}

/* Cards: scoped to Swiper so this wins over any older carousel-cell rules */
.publication-swiper .carousel-cell {
  position: relative;
  width: min(50%, 720px) !important;
  aspect-ratio: 16 / 9;
  height: auto;
  margin-right: 0; /* Swiper handles spacing via spaceBetween */
  border-radius: 16px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  transform-origin: center center;
  transition: transform 180ms ease;
}
.publication-swiper .swiper-slide-active.carousel-cell { transform: scale(1.03); }

/* Make single-card view on narrow screens */
@media (max-width: 768px) {
  .publication-swiper .carousel-cell {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto;
    margin-right: 0;
    border-radius: 12px;
  }
}

/* Video overlay */
.carousel-cell .preview-video {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Video becomes visible only after JS adds .video-on to the slide (after a delay) */
.publication-swiper .carousel-cell.video-on .preview-video {
  opacity: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fallback if the browser ignores aspect-ratio on video: keep it centered and bounded */
@supports not (aspect-ratio: 16 / 9) {
  .publication-swiper .carousel-cell {
    height: 300px;
  }
  @media (max-width: 768px) {
    .publication-swiper .carousel-cell { height: 220px; }
  }
  .publication-swiper .carousel-cell.video-on .preview-video {
    inset: 0;
    width: 100%;
    height: 100%;
  }
}

/* Content overlay (hidden by default) */
.carousel-cell .content {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  color: #fff;
  z-index: 2;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

/* Show content only for the focused (active) slide */
.publication-swiper .swiper-slide-active .content {
  opacity: 1;
  pointer-events: auto;
}

/* Gradient for readability */
.carousel-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0) 55%);
  z-index: 1;
}

/* Title sizing */
.carousel-cell .content h5 {
  margin: 0 0 4px 0;
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.2;
  font-weight: 500;
}

.carousel-cell .content span {
  font-size: 14px;
  opacity: .9;
}

/* Swiper pagination bullets wrapper */
.publication-swiper .swiper-pagination-bullets {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Swiper pagination (dots) */
.publication-swiper .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  opacity: 0.35;
  background: rgba(0,0,0,0.65);
  margin: 0 6px !important;
}

.publication-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  background: rgba(0,0,0,0.85);
}

/* More visible navigation arrows */
.publication-swiper {
  --swiper-navigation-color: #fff;
  --swiper-navigation-size: 20px;
}

.publication-swiper .swiper-button-prev,
.publication-swiper .swiper-button-next {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(0,0,0,0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.45);
  z-index: 6;
}

.publication-swiper .swiper-button-prev:hover,
.publication-swiper .swiper-button-next:hover {
  background: rgba(0,0,0,0.55);
}

.publication-swiper .swiper-button-prev::after,
.publication-swiper .swiper-button-next::after {
  font-size: 18px;
  opacity: 0.85;
}

.publication-swiper .swiper-button-prev,
.publication-swiper .swiper-button-next {
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
}

.publication-swiper .swiper-button-prev { left: 14px; }
.publication-swiper .swiper-button-next { right: 14px; }

.publication-swiper .swiper-slide-active {
  cursor: pointer;
}

/* Desktop: place arrows beside pagination dots */
@media (min-width: 769px) {
  /* Reserve space for controls row */
  .publication-swiper {
    padding-bottom: 56px;
  }

  /* Keep pagination below carousel */
  .publication-swiper .swiper-pagination {
    margin-top: 14px;
  }

  /* Move arrows down to pagination row */
  .publication-swiper .swiper-button-prev,
  .publication-swiper .swiper-button-next {
    top: auto;
    bottom: 10px;
    transform: none;
  }

  /* Position arrows left/right of dot pill */
  .publication-swiper .swiper-button-prev { left: calc(50% - 140px); }
  .publication-swiper .swiper-button-next { right: calc(50% - 140px); }
}

@media (max-width: 768px) {
  /* Remove side fades on mobile */
  .publication-swiper::before,
  .publication-swiper::after {
    display: none;
  }

  /* Reserve a row for pagination + arrows */
  .publication-swiper {
    padding-bottom: 54px; /* space for controls row */
  }

  /* Place pagination centered below carousel */
  .publication-swiper .swiper-pagination {
    margin-top: 10px;
  }

  /* Move arrows next to the dots */
  .publication-swiper .swiper-button-prev,
  .publication-swiper .swiper-button-next {
    top: auto;
    bottom: 8px;
    transform: none;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.22);
    box-shadow: none;
    border: 1px solid rgba(0,0,0,0.12);
  }

  .publication-swiper .swiper-button-prev::after,
  .publication-swiper .swiper-button-next::after {
    font-size: 16px;
    opacity: 0.75;
  }

  /* Position left/right of the centered pagination pill */
  .publication-swiper .swiper-button-prev { left: calc(50% - 120px); }
  .publication-swiper .swiper-button-next { right: calc(50% - 120px); }
}
