
    /* Thumbnail Grid Layout */
    .gallery-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://basilthesheep.neocities.org/SiteImages/bg%20(6).jpg');
      background-repeat: no-repeat;
      background-size: cover;           
      border: 2px solid #0c0805;
      border-radius: 16px;
      padding: 25px;

      margin-top: 15px;
      margin-bottom: 15px;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
      box-sizing: border-box;
      max-width: 1200px;
    }
    .gallery-item {
      width: 90%;
      height: 200px;
      object-fit: cover;
      border-radius: 8px;
      margin: 10px;
      cursor: pointer;
      transition: transform 0.2s, box-shadow 0.2s;
      box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    .gallery-item:hover {
      transform: scale(1.03);
      box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    }

    
    /* Popup Modal Overlay */
    .modal {
      display: none; /* Hidden by default */
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.9);
      z-index: 1000;
      justify-content: center;
      align-items: center;
    }

    /* Active modal state managed by JS */
    .modal.active {
      display: flex;
    }

    /* Modal Main Content Box */
    .modal-content-wrapper {
      position: relative;
      max-width: 85%;
      max-height: 85%;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
    }
    .modal-img {
      max-width: 100%;
      max-height: 70vh;
      object-fit: contain;
      border-radius: 4px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    }

    /* Modal Text Section */
    .modal-text {
      color: #fff;
      margin-top: 15px;
    }
    .modal-title {
      font-size: 18px;
      font-weight: bold;
      margin-bottom: 4px;
    }
    .modal-desc {
      font-size: 14px;
      color: #ccc;
    }

    /* Action Buttons styling */
    .close-btn {
      position: absolute;
      top: -45px;
      right: 0;
      color: #fff;
      font-size: 35px;
      background: none;
      border: none;
      cursor: pointer;
    }

    /* Controls below the image */
    .controls {
      display: flex;
      gap: 20px;
      margin-top: 15px;
    }
    .nav-btn {
      background: rgba(255, 255, 255, 0.2);
      color: white;
      border: none;
      font-size: 18px;
      padding: 10px 24px;
      cursor: pointer;
      border-radius: 20px;
      transition: background 0.2s;
      user-select: none;
    }
    .nav-btn:hover {
      background: rgba(255, 255, 255, 0.4);
    }