/* Base Styles */
body {
  margin: 0;
  font-family: Arial, sans-serif;
}

#scrolly {
  position: relative;
}

.scrolly-container {
  display: flex;
  flex-direction: column;
  align-items: center; /* Center content horizontally */
  justify-content: flex-start;
  width: 100%; 
  margin: 0 auto;
}

.article {
  width: 90%; /* Center article content */
  max-width: 800px; /* Restrict max width for readability */
  padding: 20px;
  text-align: center; /* Center-align text */
  margin-bottom: 50px; /* Add spacing below sections */
}

.graphic {
  display: flex; /* Ensure it's a flex container */
  justify-content: center; /* Center-align the image horizontally */
  width: 100%; /* Full width of the parent container */
  max-width: 800px; /* Restrict max width */
  margin: 0 auto 20px; /* Center container and add spacing below */
}

.graphic img {
  display: block; /* Ensure image acts like a block element */
  max-width: 100%; /* Image should scale with the container */
  height: auto; /* Maintain aspect ratio */
}

section {
  margin-bottom: 2rem; /* Add spacing between sections */
}

#network-diagram,
#arc-diagram,
#map {
  width: 100%;
  height: 600px;
  margin-top: 20px;
}

/* Tooltip Styling */
.tooltip {
  position: absolute;
  visibility: hidden; /* Hidden by default */
  text-align: center;
  width: auto;
  padding: 8px;
  font: 12px sans-serif;
  background: rgba(0, 0, 0, 0.7); /* Dark background */
  color: #fff;
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
  white-space: pre-wrap; /* Allow multi-line text */
  opacity: 0; /* Hidden by default */
  transition: opacity 0.3s ease-in-out; /* Smooth fade-in/out */
}

/* Tooltip Visibility on Hover */
.library-tile:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* Main Galleries */
.galleries {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 tiles across */
  gap: 16px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 0;
  box-sizing: border-box; /* Ensure padding and borders count towards total width */
  overflow-x: auto; /* Allow horizontal scroll if tiles exceed width */
}

/* Fixed: SubGalleries Layout */
.subGalleries {
  display: block; /* Changed from grid to block to prevent layout conflicts */
  max-height: 400px; /* Adjust based on your layout needs */
  overflow-y: auto; /* Enable vertical scrolling */
  padding: 10px; /* Optional: Add padding for better visuals */
  background-color: #f9f9f9; /* Optional: Add a background for better contrast */
  border: 1px solid #ddd; /* Optional: Add a border for clarity */

  /* Scrollbar Styling */
  scrollbar-width: thin; /* For Firefox: set scrollbar width to thin */
  scrollbar-color: #852221 #f9f9f9; /* Thumb color and track color */
}

.subGalleries::-webkit-scrollbar {
  width: 10px; /* Scrollbar width for WebKit browsers */
}

.subGalleries::-webkit-scrollbar-track {
  background: #f9f9f9; /* Track background color */
  border-radius: 5px; /* Optional: Round the edges */
}

.subGalleries::-webkit-scrollbar-thumb {
  background: #852221; /* Thumb color */
  border-radius: 5px; /* Optional: Round the edges */
}

.subGalleries::-webkit-scrollbar-thumb:hover {
  background: #b02a30; /* Color when hovered */
}

.subGalleries:not(.hidden) {
  opacity: 1; /* Fully visible */
  pointer-events: auto; /* Allow interactions */
  transform: translateY(0); /* Reset position */
}

.hidden {
  display: none;
}

/* Smooth Transition Effects for Elements Using .hidden */
[data-step] {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-step]:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

/* Library Tile Styling */
.library-tile {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  flex-direction: column;
  background-color: #fff;
  overflow: hidden;
  box-sizing: border-box; /* Prevent padding/border from affecting layout */
  position: relative; /* Enable positioning for tooltip */
}

/* Adjusted Styling for Image Containers */
.heroImage-container,
.image-container {
  width: 100%;
  padding: 7px;
  border-radius: 9px;
  background: var(--Schemes-On-Error-Container, #852221);
  margin-bottom: 1px; /* Space below the image container */
  box-sizing: border-box; /* Include border and padding in total width/height */
}

.heroImage,
.image {
  width: 100%; /* Full width of the tile */
  border-radius: 2px;
  padding-top: 100%; /* Maintain square aspect ratio */
  background-size: cover; /* Ensure image covers the div */
  background-position: center; /* Center the image */
  background-repeat: no-repeat; /* No tiling */
  box-sizing: border-box; /* Ensure padding-top is accounted for */
}

/* Gallery Title and Subtitle */
.gallery-title {
  margin: 1px 0 0; /* Space above title */
  font-size: 24px;
  font-family: "Libre Caslon Text", serif; /* Apply desired font */
  font-weight: 400;
  color: #231F20; /* Dark grey */
  text-align: left; /* Align to left */
}

.gallery-subtitle {
  margin: 0; /* No extra margin */
  font-feature-settings: 'ss01' on;
  font-size: 18px;
  font-family: "IBM Plex Mono", monospace; /* Apply desired font */
  font-style: normal;
  font-weight: 700;
  line-height: 100%;
  letter-spacing: -0.9px;
  color: #877A7A; /* Ash grey */
  text-transform: uppercase; /* Uppercase styling */
  text-align: left; /* Align to left */
}

.asset-name {
  flex: 1 0 0;
  color: var(--Color-Dark-grey, #231F20);
  font-feature-settings: 'dlig' on, 'ss01' on;
  font-family: "Libre Caslon Text";
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 114%;
  letter-spacing: -0.72px;
}

.asset-subheading {
  color: var(--Color-Ash, #877A7A);
  font-feature-settings: 'ss01' on;
  font-family: "IBM Plex Mono";
  font-size: 18px;
  font-style: normal;
  font-weight: 700;
  line-height: 100%;
  letter-spacing: -0.9px;
  text-transform: uppercase;
}

.gallery-description-heading,
.gallery-description {
  width: 437px;
  color: #000;
  font-family: "Libre Caslon Text";
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 114%;
  letter-spacing: -0.72px;
}

.image-description-heading,
.image-description {
  width: 437px;
  color: #000;
  font-family: "Libre Caslon Text";
  font-size: 32px;
  font-style: normal;
  font-weight: 400;
  line-height: 114%;
  letter-spacing: -0.96px;
}

.image-description {
  font-size: 24px;
  color: #000;
  text-align: center;
}

.nav-menu {
  display: flex;
  width: 217px;
  padding: 16px 16px 20px 16px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  background: var(--Color-Warm-grey-lighter, #E2E1D5);
}

.dashboard-image {
  display: flex;
  width: 622px; /* Set fixed width */
  height: 428px; /* Set fixed height */
  overflow: hidden;
  position: relative;
  border-radius: 8px;
}

.dashboard-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Scale image to cover the container */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Center the image */
  border-radius: 8px;
}

.image-title {
  margin-top: 16px;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
}

.image-description {
  margin-top: 8px;
  font-size: 16px;
  color: #555;
  text-align: center;
}

/* Loading Spinner Styles */
.loading-spinner {
  font-size: 1.5em;
  color: #852221;
  text-align: center;
  margin: 20px;
  animation: fadeIn 1s infinite;
}

@keyframes fadeIn {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Carousel Container */
.subGallery-carousel {
  width: 100%;
  box-sizing: border-box;
}

/* Swiper Container Adjustments */
.swiper-container {
  width: 100%;
  height: 100%;
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
}

.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 5px;
  background-color: #f5f5f5;
}

/* Dots Indicator (Pagination) */
.swiper-pagination-bullet {
  background-color: #ccc;
  opacity: 1;
}

.swiper-pagination-bullet-active {
  background-color: #852221;
}

/* Navigation Buttons */
.swiper-button-prev,
.swiper-button-next {
  color: #852221;
}

/* Responsiveness */
@media (max-width: 768px) {
  .subGallery-carousel {
    height: 40vh; /* Slightly taller on smaller screens */
  }

  .swiper-slide img {
    width: 80px;
    height: 80px;
  }

  .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
  }

  .swiper-button-prev,
  .swiper-button-next {
    display: none; /* Hide navigation buttons on smaller screens */
  }
}
