
  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0; padding: 1rem;
    background: #f5f5f5;
    color: #333;
  }
  h1 {
    text-align: center;
    margin-bottom: 1.5rem;
  }
  .filter-bar {
    text-align: center;
    margin-bottom: 1.5rem;
  }
  .filter-bar button {
    background: #eee;
    border: 1px solid #ccc;
    margin: 0 0.25rem;
    padding: 0.4rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
  }
  .filter-bar button.active,
  .filter-bar button:hover {
    background: #333;
    color: white;
    border-color: #333;
  }

  .gallery-grid {
    margin-top: 20px !important;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 150px;
    gap: 1rem;
  }

  .gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
  }

  .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.3s ease;
  }

  .gallery-item img.loaded {
    opacity: 1;
  }

  .gallery-item:hover img,
  .gallery-item:focus img {
    transform: scale(1.05);
  }

  .caption {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
  }

  .gallery-item:hover .caption,
  .gallery-item:focus .caption {
    opacity: 1;
  }

  /* Responsive tweak */
  @media (max-width: 600px) {
    .gallery-grid {
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      grid-auto-rows: 120px;
    }
  }

  /* Modal styles */
   #modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    flex-direction: column;
    outline: none;
  }
  #modal.open {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
  }
  @keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
  }

  /* Image wrapper for animation */
 /* Larger main image wrapper */
.image-wrapper {
  max-width: 90vw;
  max-height: 75vh; /* bigger vertical space */
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(255,255,255,0.4);
  position: relative;
  margin-bottom: 0.8rem;
}
  .main-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.35s ease, transform 0.35s ease;
  }
  .main-image.loaded {
    opacity: 1;
    transform: scale(1);
  }

  /* Caption */
  .caption {
    margin-top: 0.8rem;
    color: #eee;
    font-size: 1rem;
    max-width: 90vw;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 0 4px rgba(0,0,0,0.7);
  }

  /* Close button */
  .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #222;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.8);
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 11000;
  }
  .close-btn:hover,
  .close-btn:focus {
    background: #ff4c4c;
    outline: none;
    transform: scale(1.1);
  }

  /* Navigation buttons */
  .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(30,30,30,0.7);
    border: none;
    color: white;
    font-size: 2.5rem;
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.8);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nav-btn:hover,
  .nav-btn:focus {
    background: #444;
    box-shadow: 0 4px 12px rgba(0,0,0,1);
    outline: none;
    transform: translateY(-50%) scale(1.1);
  }
  .nav-prev {
    left: 1.2rem;
  }
  .nav-next {
    right: 1.2rem;
  }

  /* Preview thumbnails */
  .preview-thumbnails {
  display: flex;
  gap: 0.6rem;
  max-width: 90vw;
  height: 54px; /* fixed height for consistency */
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.3rem;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
  user-select: none;
}

.preview-thumbnails::-webkit-scrollbar {
  display: none !important; /* Chrome, Safari, Opera */
}
 .preview-thumbnails img {
  width: 64px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  border: 2px solid transparent;
  transition: opacity 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
}

.preview-thumbnails img:hover,
.preview-thumbnails img.active {
  opacity: 1;
  border-color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 8px #fff;
}


  /* Screen reader only */
  .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    border: 0 !important;
  }

  /* Responsive tweaks */
  @media (max-width: 600px) {
    .nav-btn {
      font-size: 2rem;
      width: 3rem;
      height: 3rem;
    }
    .close-btn {
      font-size: 1.8rem;
      width: 2.6rem;
      height: 2.6rem;
    }

  }
  @media (max-width: 600px) {
  .preview-thumbnails {
    height: 40px;
  }
  .preview-thumbnails img {
    width: 48px;
    height: 32px;
  }
}


#mobile-side-menu nav a {    /* 18px approx - a nice readable size */
font-weight: 700;
color: #000000 !important;
}


nav a.active {
  position: relative;
  color:rgb(255, 0, 0); /* red-600 */
  font-weight: 700;
  padding: 0.25rem 0.75rem; /* vertical + horizontal padding */
  border-radius: 0.5rem; /* rounded corners */
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.28); /* translucent red */
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.17);
  transition: background-color 0.3s ease, color 0.3s ease;
}

nav a.active:hover {
  background: rgba(220, 38, 38, 0.25);
  color: #b91c1c; /* darker red */
}

@media (max-width: 780px) {
nav a.active {
  padding: none !important; /* vertical + horizontal padding */
  border-radius: none !important; /* rounded corners */
  backdrop-filter: blur(8px);
  background: none !important; /* translucent red */
  color: #dc2626; /* Tailwind's red-600 */
  border-bottom: 2px solid #dc2626 !important;
  padding-bottom: 4px;
  font-weight: 700; /* Bold */
  transition: color 0.3s ease, border-color 0.3s ease;
}

nav a.active:hover {
  color: #b91c1c; /* Darker red on hover */
  border-color: #b91c1c;
}
}
.category-btn.active {
  background-color: #eb2546; /* Tailwind's blue-600 */
  color: white;
  border-color: #000000;
}
