.navbar {
  background: none;      /* No background */
  padding: 1rem 0;
  text-align: center;    /* Center contents */
}

.nav-list {
  list-style: none;
  display: inline-flex;  /* Inline flex to center */
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-list li a {
  color: #444;           /* Normal link color */
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.nav-list li a:hover {
  color: #888;
}

/* Highlight the current page link */
.nav-list li a.active {
  color: #e63946;        /* Highlight color */
  font-weight: 700;
}



.animation-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
  gap: 1rem; /* space between items */
  max-width: 960px; /* optional max width */
  margin: 0 auto; /* center the gallery */
}

.animation-entry {
  width: 100%;
  overflow: hidden;
}

.animation-entry video,
.animation-entry img {
  width: 100%;
  height: auto; /* keep aspect ratio */
  display: block;
  border-radius: 6px; /* optional: rounded corners */
  object-fit: contain; /* scale media correctly */
}

@media (max-width: 768px) {
  .animation-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.films-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
}

.film-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.film-video video,
.film-video img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.film-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.film-link {
  color: #222;
  text-decoration: underline;
  transition: color 0.3s;
}

.film-link:hover {
  color: #e63946;
}

.film-description {
  color: #555;
  font-size: 1rem;
  line-height: 1.5;
}

.hidden {
  display: none !important; /* Use !important to override any inline styles */
}

/* Full screen modal */
#animation-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

/* Container inside modal: flex column with fixed height */
.animation-viewer {
  display: flex;
  flex-direction: column;
  width: 90vw;
  height: 90vh;       /* fill 90% of viewport height */
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}

/* Stack carousel + main animation vertically */
.main-and-carousel {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 100%;
}

/* Carousel takes about 20% height, at top */
.carousel-column {
  flex-shrink: 0;
  height: 20%;
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  align-items: center;
  padding: 0 1rem;
  scrollbar-width: thin;  /* Firefox scrollbar styling */
  overscroll-behavior: contain; /* Modern browsers */
  -webkit-overflow-scrolling: touch; /* iOS-specific */
}

body.modal-open {
  overflow: hidden;
  touch-action: none; /* prevent gestures like swipe-back */
}


/* Carousel items horizontally */
.carousel-item {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  flex: 0 0 auto; /* fixed size */
  width: 70px;
  height: 70px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.carousel-item:hover {
  border-color: #e63946;
  box-shadow: 0 0 8px rgba(230, 57, 70, 0.5);
}

.carousel-item.selected {
  border-color: #e63946;
  box-shadow: 0 0 12px rgba(230, 57, 70, 0.8);
}

/* Main animation takes about 80% height, below carousel */
#main-animation {
  flex-grow: 1;           /* fill remaining space */
  max-height: 80%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: transparent;       /* optional black bg for video/images */
}

/* Media inside main animation */
#main-animation img,
#main-animation video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* Close button styling */
#close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
  z-index: 1100;
}

.thumbnail {
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.1s ease;
}

.thumbnail:hover {
  filter: brightness(1.1); /* Lighten on hover */
  transform: scale(1.2);
}

.thumbnail:active {
  transform: scale(0.98); /* Slight press effect */
}

.thumbnail.selected {
  outline: 2px solid #e63946; /* Highlight selected thumbnail */
  outline-offset: 2px;
  filter: brightness(1.2); /* Slightly more lit to show it's active */
}

.page-nav-button-row {
  display: flex;
  flex-wrap: wrap;      /* allow wrapping to next line */
  gap: 1rem;
  justify-content: center; /* center buttons if less than full width */
  padding: 0 1rem;
  box-sizing: border-box;
}

/* Flexible buttons that share the row width */
.custom-button {
  flex: 1 1 22%;       /* grow/shrink, basis ~22% for ~4 buttons with gaps */
  max-width: 250px;    /* optional max width */
  min-width: 150px;    /* optional min width to prevent too small */
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: white;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  transition: filter 0.3s ease;
}

.custom-button:hover,
.custom-button:focus {
  filter: brightness(1.2);
}

.button-text {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-size: 1.2rem;
  text-shadow: 0 0 5px rgba(0,0,0,0.7);
  pointer-events: none;
}

/* For smaller screens, force 2 columns */
@media (max-width: 600px) {
  .custom-button {
    flex: 1 1 45%;  /* roughly 2 per row */
    max-width: none; /* remove max-width to better fill */
  }
}



