@charset "utf-8";

/* ==============================
   Utility / Lists / Icons
   ============================== */

ul.isopod { padding-left: 1%; }
ul.isopod li {
  list-style: none;
  padding-left: 3rem;
  background-image: url("../images/Fun/isopod.svg");
  background-repeat: no-repeat;
  background-position: left top;
  background-size: 1.35rem;
}

/* ==============================
   Navbar / Layout Frames
   ============================== */

.navbar_logo { width: 10vh; max-width: 50px; }
.navbar .navbar-collapse { text-align: center; }

.container { padding-top: 20px; }
.container section figure { text-align: center; }

.container-fluid.footer .container {
  padding-left: 2%;
  padding-right: 2%;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

#title { text-align: center; margin-top: 20px; }
#sponsor, #logo { text-align: center; padding: 20px; }

.navbar-stripe {
  background: linear-gradient(rgba(0,0,0,0) 5%, rgba(255,255,255,0.5) 15%, rgba(225,225,225,0.92) 25%, rgba(225,225,225,0.92) 75%, rgba(255,255,255,0.5) 85%, rgba(0,0,0,0) 95%);
  color: black;
  margin: auto;
  justify-content: center;
  align-items: center;
  font-weight: bold;
}

/* Mobile-first newspage width */
.newspage {
  width: 100%;
  margin-left: auto; margin-right: auto;
  padding: 0 15px;
  box-sizing: border-box;
}

/* Medium devices (tablets, 768px and down) */
@media (max-width: 768px) {
  .navbar-collapse.show {
    background: linear-gradient(rgba(0,0,0,0) 5%, rgba(255,255,255,0.5) 10%,rgba(225,225,225,0.92) 15%, rgba(225,225,225,0.92) 85%, rgba(255,255,255,0.5) 90%, rgba(0,0,0,0) 95%);
    color: black;
    padding-top: 70px;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    margin-top: -70px;
  }
}

@media (min-width: 769px) {
  .card-carousel .row {
    display: flex;
    flex-direction: row;
  }
  .card-carousel .carousel-img {
    width: 33.333333%;
  }
  .card-carousel .card-quote {
    width: 66.666667%;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .newspage {
    width: 75%;
    margin-left: auto; margin-right: auto;
    padding: 0 15px; box-sizing: border-box;
  }
}

/* ==============================
   Background Frame
   ============================== */

.bg-image {
  background-image: url('../images/Background/background.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: top center;
  background-attachment: scroll; /* Changed from fixed to prevent jumping */
  background-origin: border-box;
  background-clip: border-box;
  min-height: 100vh;
  padding-top: 0;
  /* Performance optimizations */
  will-change: auto;
  contain: layout style paint;
  /* Enhanced stabilization properties to prevent layout shifts */
  will-change: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
  contain: layout style paint;
}

.content {
  /* Cross-browser gradient compatibility */
  background: rgba(211,211,211,0.9); /* Fallback */
  background: linear-gradient(180deg, rgba(211,211,211,0.85) 1%, rgba(211,211,211,0.95) 10%);
  background: -webkit-linear-gradient(rgba(211,211,211,0.85) 1%, rgba(211,211,211,0.95) 10%);
  border-radius:.5rem!important;
  margin-top: 40px;
  padding: 20px 10%;
  /* Prevent background attachment issues */
  background-attachment: scroll;
  background-clip: padding-box;
}

.text-main { text-align: justify; text-align-last: none; }

/* ==============================
   Performance & Stability
   ============================== */

/* Prevent background-related layout shifts */
.stable-background {
  background-attachment: scroll !important;
  background-repeat: no-repeat !important;
  will-change: auto;
  transform: translateZ(0);
}

/* Force hardware acceleration for smooth rendering */
.hardware-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Container stabilization */
.container, .container-fluid {
  transform: translateZ(0);
}

/* ==============================
   Performance Monitoring (M5 D3)
   ============================== */

/* LCP optimization for main content areas */
.news-card, .card-carousel, .content {
  contain-intrinsic-size: auto 300px;
  content-visibility: auto;
}

/* Critical rendering path optimization */
.above-fold {
  contain: layout style paint;
  will-change: auto;
}

/* Layout shift prevention for dynamic content */
.dynamic-content {
  min-height: 200px;
  contain: size layout;
}

/* Performance monitoring indicators */
.perf-monitor {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  z-index: 9999;
  display: none; /* Hidden by default, shown via JavaScript */
}

/* Image loading optimization */
img[loading="lazy"] {
  min-height: 200px;
  background-color: rgba(211,211,211,0.3);
  background-image: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
  background-size: 200% 200%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% -200%; }
  100% { background-position: 200% 200%; }
}

/* ==============================
   Carousel / Cards
   ============================== */

.carousel-control-prev { z-index: 2; }
.carousel-control-next { z-index: 2; }
/* Add a reasonable width for controls so they're easy to hit */
.carousel .carousel-control-prev,
.carousel .carousel-control-next { width: 7%; }

#carousel-index .carousel-item {
    min-height: 400px;
}

.card-grid { display: flex !important; }
.card { background-color: rgba(211,211,211,0.85); }

.card-team { flex: 1 1 auto !important; margin-bottom: 20px; padding: 10px; }
.card-reference { margin-bottom: 20px; padding: 10px; }

.interests { margin-top: 4vh; }

.card-carousel { margin-bottom: 1rem; max-width: 60vw; }

.carousel-img {
  aspect-ratio: 4 / 3;
  width: 100%;
  border-radius: 0.3rem;
  display: flex; justify-content: center; overflow: hidden;
  background-color: rgba(201, 201, 201, 0.85);
  /* Prevent layout shifts during image loading */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.carousel-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  margin-top: auto;
  margin-bottom: auto;
  /* Prevent image position shifts */
  display: block;
  position: relative;
  z-index: 1;
}

#img_full { max-width: 100%; max-height: 100%; object-fit: contain; }
.card-quote .card-body {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#carousel-index .carousel-item {
    min-height: 400px;
}

/* ==============================
   General Imagery
   ============================== */

.bubble {
  border-radius: 50%;
  height: 10vh; width: 10vh;
  object-fit: cover; object-position: 50% 10%;
  margin-bottom: 1.5rem;
}

.quote { margin: auto; }
.speaker-link { display: block; text-decoration: none; }

/* Tooltips */
.tooltip { position: relative; display: inline-block; border-bottom: 1px dotted black; }
.tooltip .tooltiptext {
  visibility: hidden; width: 120px; background-color: black; color: #fff;
  text-align: center; padding: 5px 0; border-radius: 6px; position: absolute; z-index: 1;
}
.tooltip:hover .tooltiptext { visibility: visible; }

/* ==============================
   Institutions / Footer Logos
   ============================== */

.col-institution { margin-top: 20px; }
.card-institution { width: 100%; }
.img-institution {
  width: 100%; height: 8rem; object-fit: contain; padding: 1rem;
  background-color: white; border-radius:.5rem;
}

.card-social { display: flex; justify-content: space-around; text-align: center; }
.logo-sozial { width: auto; height: 2rem; padding: 0.2rem; }
.logo-footer { width: auto; height: 3rem; padding: 0.2rem; }

.img-inline {
  display: block; margin-left: auto; margin-right: auto;
  width: 100%; height: 4rem; object-fit: contain;
  border-radius: 0.5rem; padding: 10px;
}

.img-container .col-6 { display: flex; justify-content: center; }
#promote { height: 8rem; }
.img-container { border-radius: 0.5rem; background-color: white; }

#institution { margin-top: 20px; }
#footer { color: rgba(211,211,211,1); margin-top: 10px; }

/* ==============================
   Subpages / Frames
   ============================== */

.frame {
  border-radius: 0.5rem;
  width: 100%; max-height: 25vh;
  object-fit: cover; object-position: 50% 35%;
}

/* Team */
.card-team .card-reference .card-img-top { border-radius: 0.5rem; }
.name { font-weight: bold; margin-bottom: 0; }
.association { font-style: italic; margin-top: 0px; }
.link_visit { text-align: center; }
.associate_card { text-align: justify; text-align-last: none; }
.section { padding-top: 20px; }
.person_background { hyphens: auto; text-align: justify; }

/* Partners */
.card_partner { width: 100%; max-width: 540px; margin-bottom: 20px; }
.partner_img { border-radius: 0.5rem; }

/* ==============================
   Contact / Tables / Messages
   ============================== */

.contact_form { padding-top: 40px; }
.card-text { font-size: 14px; font-size-adjust: auto; }
.card-title { font-size: 18px; font-size-adjust: auto; }

.table-responsive { overflow-x: auto; }
.table-sites { background-color: rgba(211,211,211,1); }

.visitor-count {
  color: forestgreen; font-style:italic; font-weight: bold; font-size: 1.1rem;
  padding: 20px; text-align: center;
}

.msg-success {
  color: blue; font-style:italic; font-weight: bold; font-size: 1.1rem;
  padding: 20px; margin-bottom: 15px; text-align: center;
}

/* ==============================
   Galleries / Lightbox
   ============================== */

.img-gallery { position: relative; overflow: hidden; height: 10vh; }
.img-gallery img {
  position: absolute; top: 50%; left: 50%;
  min-width: 100%; min-height: 100%;
  transform: translate(-50%, -50%); object-fit: cover;
}
.card-gallery { width: 100%; padding: 0 !important; }
.lightbox img { max-height: 75vh; width: auto; height: auto; object-fit: contain; }

/* ==============================
   News Page (Title, Cards, Images)
   ============================== */

.news-page-title {
  font-size: 3.75em; text-align: center; color: black;
  text-shadow: -1px -1px 0 #f0c808, 1px -1px 0 #f0c808, -1px 1px 0 #f0c808, 1px 1px 0 #f0c808;
  transform: perspective(200px) rotateX(30deg); transform-style: preserve-3d;
}

.news-card {
  padding: 20px; background-color: rgba(215,215,215,0.99);
  border-radius: 0.3rem; margin-bottom: 20px;
}

.news-card-qualifier {
  display: flex; width: 100%; align-items: center;
  justify-content: space-between; margin-bottom: 20px;
}

.news-paragraph { font-size: 14px; font-weight: 400; margin: 0; }
.news-date { font-size: 14px; font-weight: 400; margin: 0 0 0 20px; }
.news-header { font-size: 22px; font-weight: 600; margin: 0; }
.news-card-section { margin-bottom: 20px; }

.news-ul { margin: 0; padding: 0; list-style: none; }

.news-img-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-img-gallery > li {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.news-img-gallery > li > :first-child {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.news-img-gallery li img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.news-img-legend {
  font-style: italic;
  font-size: 0.95rem;
  color: #495057;
  margin: 0;
}

.news-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.news-manage-actions .btn {
  white-space: nowrap;
}


/* Keep any rendered gallery images boxed within cards/sections */
.news-card .news-card-section {
  overflow: visible;
}

.news-img-gallery,
.news-img-gallery li {
  overflow: visible;
}

.news-img-gallery > li > :first-child,
.news-img-gallery li img {
  position: relative;
  border-radius: 8px;
}

/* Ensure UL wrapper doesn't indent unexpectedly */
.news-ul { padding-left: 0; }

/* Make sure carousel controls remain clickable above images */
.carousel-control-prev, .carousel-control-next { z-index: 3; }

/* News carousel images should show completely without cropping */
.news-carousel .carousel-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  max-height: 400px;
}

/* Stabilize news carousels to prevent height jumps */
.news-carousel .carousel-inner {
  aspect-ratio: 3 / 2;
  max-width: 600px;
  margin: 0 auto;
}
.news-carousel .carousel-item {
  height: 100%;
}

/* Ensure avatar bubbles in carousel stay small and perfectly round */
#carousel-index .bubble {
  display: inline-block;
  width: 10vh;
  height: 10vh;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 10%;
}


/* ==============================
   Comments
   ============================== */

.comment-header { font-size: 1em; font-style: oblique; color: blue; margin-bottom: 10px; }
.comment-list { list-style-type: none; padding: 0; margin-bottom: 20px; }

.comments { background-color: rgba(201,201,201,0.85); width: 98%; padding: 1rem; border-radius: 0.3rem; }
.comment {
  padding: 10px; margin-bottom: 10px; background-color: rgba(190, 190, 190, 1);
  font-size: 14px; color: blue;
}
.comment-lable { text-align: end; color: red; }
.comment-form { display: flex; flex-direction: column; align-items: flex-end; }
.comment-form textarea {
  width: 100%; min-height: 3rem; border: 1px solid #ccc; border-radius: 0.3rem; padding: 10px;
  resize: vertical; margin-bottom: 10px; box-sizing: border-box;
}
.comment-form input[type="submit"] {
  background-color: blue; color: #fff; border: none; border-radius: 0.3rem; padding: 8px 16px; cursor: pointer;
}
.submit-container { display: flex; justify-content: space-between; width: 100%; }
.reminder-text { display: block; margin-bottom: 1em; }

.reply-trigger {
  color: #007bff; cursor: pointer; text-decoration: underline; margin-left: 20px; font-weight: bold;
}
.reply-trigger:hover { color: #0056b3; }

.comment-header { display: flex; }
.comment .comment-text, .comment-author p { margin: 0; padding: 0; }
.comment-author { display: block; font-weight: bold; margin-right: 10px; }
.comment .comment {
  background-color: rgba(201, 201, 201, 0.50);
  border-left: 3px solid #007bff; margin-left: 20px; padding-left: 10px;
}

/* ==============================
   News Image Effects (Public Render)
   ============================== */

/* Keep images contained in sections on public pages as well */
.news-card .news-card-section {
  overflow: visible;
}

.news-img-gallery,
.news-img-gallery li {
  overflow: visible;
}

.news-img-gallery > li > :first-child,
.news-img-gallery li img {
  position: relative;
  border-radius: 8px;
}


/* Hover-swap: overlay two images; reveal second on hover */
.news-hover-swap { position: relative; overflow: hidden; }
.news-hover-swap .img-1 { display:block; transition: opacity .25s ease; }
.news-hover-swap .img-2 { position:absolute; inset:0; opacity:0; transition: opacity .25s ease; }
.news-hover-swap:hover .img-1 { opacity:0; }
.news-hover-swap:hover .img-2 { opacity:1; }

/* Hover grayscale -> color */
.news-hover-grayscale { display:block; filter: grayscale(100%) contrast(130%); transition: filter .25s ease; }
.news-hover-grayscale:hover { filter: grayscale(0%) contrast(100%); }

/* Hover zoom */
.news-hover-zoom img { transition: transform .25s ease; will-change: transform; }
.news-hover-zoom:hover img { transform: scale(1.04); }

/* Hologram (always-on ghostly blue; stabilizes on hover) */
.news-hologram { position: relative; overflow: hidden; border-radius: 16px; }
.news-hologram img {
  opacity: .3; /* ~30% */
  filter: hue-rotate(195deg) saturate(130%) brightness(115%);
  transition: opacity .25s ease, filter .25s ease;
}
.news-hologram::before {
  content: ""; position: absolute; inset: -10%; pointer-events: none;
  background: radial-gradient(circle at center,
    rgba(255,255,255,0) 55%,
    rgba(0,0,0,0.25) 75%,
    rgba(0,0,0,0.45) 100%
  );
  mix-blend-mode: multiply;
}
.news-hologram::after {
  content:""; position:absolute; inset:0; pointer-events:none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.08), rgba(255,255,255,0.08) 2px,
    rgba(0,0,0,0) 2px, rgba(0,0,0,0) 4px
  );
  mix-blend-mode: screen;
  animation: holo-flicker 2.2s infinite linear;
}
@keyframes holo-flicker { 0%, 100% { opacity: .4; } 50% { opacity: .2; } }
.news-hologram:hover img { opacity: .95; filter: hue-rotate(0deg) saturate(100%) brightness(100%); }
.news-hologram:hover::after { animation: none; opacity: 0; }

/* Lightspeed (animated jump between two images) */
.news-lightspeed {
  position: relative; overflow: hidden; border-radius: 12px;
  min-height: 120px; --ls-duration: 6s;
}
.news-lightspeed .ls-frame {
  position:absolute; inset:0; opacity:0; transform: scale(1) translateZ(0);
  transition: opacity .25s linear;
}
.news-lightspeed .ls-frame img { width:100%; height:auto; display:block; }
.news-lightspeed .ls-streaks {
  position:absolute; inset:0; pointer-events:none;
  background: repeating-linear-gradient(90deg,
    rgba(255,255,255,0.0) 0px,
    rgba(255,255,255,0.0) 8px,
    rgba(255,255,255,0.35) 9px,
    rgba(255,255,255,0.35) 10px
  );
  mix-blend-mode: screen; opacity: 0; transform: translateX(-100%);
}
.news-lightspeed .frame1 { animation: ls-frame1 var(--ls-duration) infinite linear; }
.news-lightspeed .frame2 { animation: ls-frame2 var(--ls-duration) infinite linear; }
.news-lightspeed .ls-streaks { animation: ls-streaks var(--ls-duration) infinite ease-in-out; }
@keyframes ls-frame1 {
  0% {opacity:1; transform:scale(1);} 36% {opacity:1; transform:scale(1.03);}
  43% {opacity:0; transform:scale(1.1);} 86% {opacity:0; transform:scale(1.0);}
  93% {opacity:1; transform:scale(1.02);} 100% {opacity:1; transform:scale(1);}
}
@keyframes ls-frame2 {
  0% {opacity:0; transform:scale(1.0);} 36% {opacity:0; transform:scale(1.0);}
  43% {opacity:1; transform:scale(1.0);} 86% {opacity:1; transform:scale(1.03);}
  93% {opacity:0; transform:scale(1.1);} 100% {opacity:0; transform:scale(1.0);}
}
@keyframes ls-streaks {
  0% {opacity:0; transform:translateX(-100%);} 32% {opacity:0; transform:translateX(-100%);}
  38% {opacity:0; transform:translateX(-80%);} 43% {opacity:.9; transform:translateX(0%);}
  46% {opacity:0; transform:translateX(100%);} 86% {opacity:0; transform:translateX(100%);}
  90% {opacity:.8; transform:translateX(0%);} 94% {opacity:0; transform:translateX(-100%);}
  100% {opacity:0; transform:translateX(-100%);}
}

/* ==============================
   User login / warning
   ============================== */

.warning-wrapper { position: relative; display: inline-block; width: 100%; }
.user-warning {
  display: none; background-color: #f9f9f9; border: 1px solid #d3d3d3; color: black;
  padding: 5px; position: absolute; z-index: 1000; left: 0; top: 40px; width: 100%; box-sizing: border-box;
}

/* ==============================
   Calendar / Buttons
   ============================== */

.table-schedule { background-color: rgba(211,211,211,1); }

.accordion-button {
  font-size: 22px; font-weight: 600; background-color: rgba(211,211,211,1);
}
.accordion-collapse { background-color: rgba(211,211,211,1); }
.accordion-button:not(.collapsed) { background-color: #600; color: #fff; }

.btn-info {
  position: relative; background-color: #900; border: none; color: #fff;
  transition: background-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 15px 5px #f00;
}
.btn-info:hover, .btn-info:focus { background-color: #f00 !important; box-shadow: 0 0 20px 10px #f00; }

/* ==============================
   Project Aims Gallery
   ============================== */

.main-image img { width: 100%; height: auto; }

/* New responsive grid for Project Aims */
.aims-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 10px 0 20px 0;
}
.thumbnail { position: relative; width: 100%; padding-top: 100%; overflow: hidden; }
.thumbnail img {
  position: absolute; top: 50%; left: 50%;
  width: 100%; height: 100%; object-fit: cover; object-position: center; transform: translate(-50%, -50%);
}
.card-gallery { display: none; }
.caption { text-align: center; font-size: 0.8rem; color: #333; }
.aims-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(211,211,211,0.85);
}
.aims-thumb a { display: block; position: relative; }
.aims-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform .25s ease;
}
.aims-thumb:hover img { transform: scale(1.035); }
.aims-thumb__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 6px 8px;
  font-size: 0.8rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0.0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}
.aims-thumb:hover .aims-thumb__caption { opacity: 1; transform: translateY(0); }

/* Scoped lightbox */
.de-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.92);
  z-index: 1100;
  padding: 2rem;
  /* Caption opacity controls (easier future tuning) */
  --de-caption-bottom: 0.96; /* bottom-most opacity */
  --de-caption-mid: 0.82;    /* mid gradient opacity */
  --de-caption-blur: 3px;    /* backdrop blur strength */
}
.de-lightbox[aria-hidden="false"] { display: flex; }
.de-lightbox .de-lightbox-inner { position: relative; }
.de-lightbox .de-lightbox-inner img {
  max-width: min(92vw, 1200px);
  max-height: 80vh;
  width: auto; height: auto;
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
}
.de-lightbox #lightbox-caption,
.de-lightbox .de-lightbox-caption { color: #fff; }
.de-lightbox-close {
  position: absolute;
  top: 12px; right: 16px;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.12);
  color: #fff; font-size: 28px; line-height: 1;
}
.de-lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* Lightbox navigation arrows */
.de-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border: none;
  width: 48px;
  height: 72px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 28px;
  line-height: 1;
  z-index: 2;
}
.de-lightbox-prev { left: 16px; }
.de-lightbox-next { right: 16px; }
.de-lightbox-nav:hover { background: rgba(0,0,0,0.55); }

/* Auto-hide caption support */
.de-lightbox-caption {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  /* Full-width without scrollbar overflow issues */
  background: linear-gradient(
    0deg,
    rgba(0,0,0,var(--de-caption-bottom, 0.96)) 0%,
    rgba(0,0,0,var(--de-caption-mid, 0.82)) 60%,
    rgba(0,0,0,0.0) 100%
  );
  -webkit-backdrop-filter: blur(var(--de-caption-blur, 3px));
  backdrop-filter: blur(var(--de-caption-blur, 3px));
  padding: 22px 16px calc(26px + env(safe-area-inset-bottom, 0px));
  color: #fff;
  opacity: 1;
  transition: opacity .25s ease;
  z-index: 1101; /* above image and nav */
  border-radius: 0 !important; /* prevent any inherited rounding */
  pointer-events: none; /* let clicks pass to image for toggle */
}

.de-lightbox-caption .caption-inner {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px; /* minimal horizontal breathing room */
  border-radius: 0;
  background: transparent; /* remove inner box so it matches the overlay */
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 3px rgba(0,0,0,0.85);
  font-weight: 600;
  line-height: 1.5;
  font-size: clamp(14px, 1.5vw, 18px);
}
.de-lightbox[data-caption-hidden="true"] .de-lightbox-caption { opacity: 0; pointer-events: none; }

#main-img, #main-description {
    transition: opacity 0.25s ease-in-out;
}

.main-image-container {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==============================
   Provenance Metadata (Accessibility)
   ============================== */



/* Carousel layout tweaks: only target the left preview image, not bubble avatars */
#carousel-index .carousel-item .carousel-img img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 769px) {
  #carousel-index .carousel-item .row { display: flex; align-items: center; }
  #carousel-index .carousel-item .col-md-4.carousel-img img { width: 100%; height: 100%; object-fit: cover; }
  #carousel-index .card-quote .row { display: flex; align-items: center; }
}
\n/* Footer transparency */
#footer, #footer footer { background-color: transparent !important; }

/* Lightbox Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
}

/* Override Bootstrap modal backdrop to ensure it does not cover custom modals */
.modal-backdrop {
  z-index: 999 !important;
}
.modal.show + .modal-backdrop {
  z-index: 1000 !important;
}

.modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
}

#lightbox-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: 150px;
}

.modal-content, #lightbox-caption {
  animation-name: zoom;
  animation-duration: 0.6s;
}

@keyframes zoom {
  from {transform:scale(0)}
  to {transform:scale(1)}
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}


/* --- News extra components --- */
.news-callout {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid #1b4965;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(27,73,101,0.12), rgba(27,73,101,0.04));
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.news-callout__title {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #13324a;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.news-callout__body {
  display: block;
  color: #1f2933;
}

.news-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0;
}
.news-columns__col {
  flex: 1 1 240px;
  background: rgba(27,73,101,0.05);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(27,73,101,0.08);
}

.news-button {
  margin: 1.75rem 0;
  text-align: left;
}
.news-button__link {
  padding-inline: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.news-separator {
  border: 0;
  border-top: 2px dashed rgba(27,73,101,0.3);
  margin: 2.5rem 0;
}

.news-blockquote {
  border-left: 4px solid #495057;
  padding-left: 1.25rem;
  margin: 2rem 0;
  font-style: italic;
  color: #1f2933;
}
.news-blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-style: normal;
  font-weight: 600;
  color: #6c757d;
}

.news-embed {
  margin: 2rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.news-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.news-sw-crawl {
  margin: 2.5rem 0;
  padding: 2rem 1.5rem;
  background: radial-gradient(circle at top, rgba(255, 193, 7, 0.35), rgba(0,0,0,0));
  color: #ffe082;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  overflow: hidden;
}
.news-sw-crawl__intro {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  text-transform: none;
  color: #fff9c4;
}
.news-sw-crawl__headline {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: #ffec99;
}
.news-sw-crawl__body {
  font-size: 0.9rem;
  line-height: 1.6;
  text-transform: none;
  color: #fff8dc;
}

.news-holo-box {
  margin: 2rem 0;
  padding: 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(13, 202, 240, 0.2), rgba(0,0,0,0.05));
  box-shadow: 0 12px 30px rgba(13, 202, 240, 0.25);
  color: #e8f7fc;
  position: relative;
}
.news-holo-box::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(13, 202, 240, 0.35);
  border-radius: 0.9rem;
  pointer-events: none;
}
.news-holo-box p {
  margin: 0;
  font-size: 1.05rem;
}

/* Mixed effects gallery styling */
.mixed-effects-gallery .carousel-item {
  transition: transform 0.6s ease, opacity 0.35s ease;
}

.mixed-effects-gallery .carousel-item:hover {
  opacity: 0.97;
}

.mixed-effects-gallery .news-hover-zoom img {
  transition: transform 0.3s ease;
}

.mixed-effects-gallery .carousel-item:hover .news-hover-zoom img {
  transform: scale(1.04);
}

.mixed-effects-gallery .news-hover-grayscale {
  filter: grayscale(100%) contrast(130%);
  transition: filter 0.3s ease;
}

.mixed-effects-gallery .carousel-item:hover .news-hover-grayscale {
  filter: grayscale(0%) contrast(100%);
}

.mixed-effects-gallery .effect-indicator {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.35rem 0.6rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Mobile-specific tweaks to reduce gap between image legend/description and title */
@media (max-width: 576px) {
  .news-card .news-img-gallery { margin-bottom: 6px; }
  .news-card .news-img-legend { margin-top: 4px; margin-bottom: 4px; font-size: 0.95rem; }
  .news-card .news-header { margin-top: 6px; margin-bottom: 6px; font-size: 1.15rem; }
  .news-card .news-card-section { margin-bottom: 8px; padding-bottom: 0; }
}

/* Star Wars crawl content animation on public page (match editor preview) */
.news-sw-crawl .sw-content {
  position: absolute;
  width: 90%;
  text-align: center;
  animation: crawl-up 12s linear infinite;
  transform-origin: 50% 100%;
  bottom: 0;
  padding: 1.5rem;
  line-height: 1.8;
  font-size: 1.4rem;
  font-weight: 500;
  transform-style: preserve-3d;
}

@keyframes crawl-up {
  0% {
    bottom: -20%;
    transform: perspective(400px) rotateX(45deg) scale(1.2);
    opacity: 1;
  }
  95% {
    opacity: 1;
  }
  100% {
    bottom: 110%;
    transform: perspective(400px) rotateX(45deg) scale(0.4);
    opacity: 0;
  }
}
