/* Only keep this unique gradient override for the news section */
.slide::after {
  background: linear-gradient(45deg, hsla(var(--DarkRed), 0.5), hsla(var(--Gold), 0.5), hsla(var(--Blue), 0.5));
}

.contentFrame h1, .contentFrame h2, .contentFrame h3 {
  color: hsl(var(--PrimaryColor));
}

/* Content frame styles */
.contentFrame {
  position: relative;
  padding: 2em;
  background: hsla(var(--White), 0.9);
  border-radius: 10px;
  min-height: 60vh;
  width: 90%;
  max-width: 1920px;
  z-index: 10;
  box-sizing: border-box;
  margin: 0 auto;
}

.contentFrame img {
  border-radius: 10px;
}

.contentFrame ul,
.contentFrame ol {
  overflow: hidden;
  list-style-type: disc;
  list-style-position: inside;
  margin-left: 20px;
  margin-bottom: 20px;
  line-height: 1;
}

.contentFrame li {
  list-style-type: disc;
  color: hsl(var(--PrimaryColor));
  margin-left: 20px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.contentFrame .bulletList {
  margin-left: 20px;
}

/* Video element generic styling */
video {
  width: 100%;
  height: auto;
}


/* Desktop-specific positioning */
@media screen and (min-width: 769px) {
  .contentFrame {
    margin-top: -20vw; /* Keep negative margin only for desktop */
  }
}

/* Adjust for mobile with proper stacking */
@media screen and (max-width: 768px) {
  .contentFrame {
    margin-top: 20px; /* Positive margin for natural stacking */
    padding: 1.5em;
    width: 95%;
  }
}

/*------News Styles------*/
.galleryGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-gap: 1em;
}

@media screen and (max-width: 768px) {
  .galleryGrid {
    grid-template-columns: 1fr;
  }
}

.featureGalleryGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 1em;
}

@media screen and (max-width: 1200px) {
  .featureGalleryGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .featureGalleryGrid {
    grid-template-columns: 1fr;
  }
}

.galleryGrid img,
.featureGalleryGrid img {
  border-radius: 10px;
  width: 100%;
  transition: all 0.3s ease-in-out;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.galleryGrid .roundedBorder,
.featureGalleryGrid .roundedBorder {
  border-radius: 10px;
  border: 1px solid hsla(var(--SecondaryColor), 0.25);
  padding: 1em;
  display: flex;
  flex-direction: column;
  background-color: white;
}

.galleryGrid .roundedBorder a,
.featureGalleryGrid .roundedBorder a {
  display: flex;
  flex-direction: column;
}

.galleryGrid .roundedBorder img,
.featureGalleryGrid .roundedBorder img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  transition: all 0.3s ease-in-out;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  align-self: flex-end;
}

.galleryGrid a,
.featureGalleryGrid a {
  text-decoration: none;
  color: hsl(var(--PrimaryColor));
}

.galleryGrid a:hover,
.featureGalleryGrid a:hover {
  color: hsl(var(--SecondaryColor));
}

.galleryGrid a:hover img,
.featureGalleryGrid a:hover img {
  opacity: 0.5;
  border-radius: 10px;
}

/* Standardized title container with ellipsis for overflow */
.galleryGrid .roundedBorder .title-container,
.featureGalleryGrid .roundedBorder .title-container {
  height: 6em;
  overflow: hidden;
  margin-bottom: 0.5em;
  position: relative;
}

/* Title styling */
.galleryGrid .roundedBorder .title-container h2,
.featureGalleryGrid .roundedBorder .title-container h2 {
  margin: 0;
  font-size: 1.1em;
  line-height: 1.4;
}

/* Optional fade effect for text overflow */
.galleryGrid .roundedBorder .title-container::after,
.featureGalleryGrid .roundedBorder .title-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.4em;
  background: linear-gradient(transparent, white);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

/* Only show fade when text overflows */
.galleryGrid .roundedBorder .title-container.overflow::after,
.featureGalleryGrid .roundedBorder .title-container.overflow::after {
  opacity: 1;
}

/* Date styling */
.galleryGrid .roundedBorder .date,
.featureGalleryGrid .roundedBorder .date {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 0.75em;
}

/* Image container */
.galleryGrid .roundedBorder .image-container,
.featureGalleryGrid .roundedBorder .image-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

/* Image styling */
.galleryGrid .roundedBorder .image-container img,
.featureGalleryGrid .roundedBorder .image-container img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  border-radius: 8px;
  transition: all 0.3s ease-in-out;
}

/* Hover effect */
.galleryGrid .roundedBorder a:hover .image-container img,
.galleryGrid .roundedBorder a:focus .image-container img,
.featureGalleryGrid .roundedBorder a:hover .image-container img,
.featureGalleryGrid .roundedBorder a:focus .image-container img {
  transform: scale(1.05);
}

/* Ensure modal is using flex layout for centering */
#imageModal {
  display: none;
  z-index: 1000;
}

.modal {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  overflow: hidden;
  animation: scaleUp 0.3s ease;
}

.modal-content img {
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.modal-image {
  width: 100%;
  height: auto;
  border-radius: 5px;
  max-height: 70vh;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  color: white;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.articleFeature {
  float: left;
  width: 33%;
  max-width: 1000px;
  margin-right: 1em;
}

@media screen and (max-width: 768px) {
  .articleFeature {
    width: 90%;
    margin-bottom: 1em;
  }
}

.articleFeatureContent {
  display: flex;
  flex-direction: column;
}

.articleFeature img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 10px;
}

.mainArticle {
  padding: 10px;
}

.mainArticle::after {
  content: "";
  display: table;
  clear: both;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  color: hsl(var(--PrimaryColor));
}

/* Hover Effects for Gallery Images */
.gallery-image {
  width: 100%;
  height: auto;
  border-radius: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  cursor: pointer;
}

.gallery-image.hovered {
  transform: scale(1.05);
  opacity: 0.75;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: hsl(var(--PrimaryColor));
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 1em;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Related News Hover Effects */
.related-news {
  margin-top: 1em;
}

.related-news .galleryGrid img {
  transition: transform 0.3s ease, opacity 0.3s ease, border-radius 0.3s ease;
}

.related-news .galleryGrid img.hovered {
  transform: scale(1.05);
  opacity: 0.8;
  border-radius: 20px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleUp {
  from {
    transform: scale(0.9);
  }
  to {
    transform: scale(1);
  }
}