/* ====== LB Download & Login Popups ====== */
.lb-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: lbFadeIn 0.3s ease-in-out;
}

.lb-popup {
  background: #fff;
  border-radius: 12px;
  padding: 25px 30px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  text-align: center;
  position: relative;
  animation: lbSlideUp 0.35s ease-out;
}

.lb-popup h3 {
  margin-top: 0;
  color: #222;
  font-size: 1.4rem;
  font-weight: 600;
}

.lb-popup p {
  color: #555;
  font-size: 14px;
  margin: 8px 0;
}

.lb-popup strong {
  color: #111;
}

/* Buttons */
.lb-popup button,
.lb-popup a.button {
  display: inline-block;
  background: #0073aa;
  color: #fff !important;
  border: none;
  border-radius: 5px;
  padding: 8px 18px;
  margin: 8px 6px 0;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s ease;
}

.lb-popup button.cancel {
  background: #999;
}

.lb-popup button:hover,
.lb-popup a.button:hover {
  background: #005c87;
}

.lb-popup button.cancel:hover {
  background: #777;
}

/* Animations */
@keyframes lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lbSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====== Gallery Layout ====== */
.page-id-383 #mla_gallery-1.gallery {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 20px;
  margin: 30px 0;
  padding: 0;
}

/* --- Each Card --- */
#mla_gallery-1 .gallery-item {
  display: flex !important;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-direction: column;
  justify-content: space-between;
  margin: 0 !important;
  width: auto !important;
}

#mla_gallery-1 .gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

/* --- Image in popup --- */
.lb-popup-image img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 15px auto ;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

/* --- Image Container --- */
#mla_gallery-1 .gallery-icon {
  width: 100% !important;
  height: 200px !important;
  overflow: hidden;
  border-bottom: 1px solid #f0f0f0;
}

#mla_gallery-1 .gallery-icon img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border: none !important;
  transition: transform 0.3s ease;
}

#mla_gallery-1 .gallery-item:hover .gallery-icon img {
  transform: scale(1.05);
}

/* --- Caption --- */
#mla_gallery-1 .gallery-caption {
  padding: 12px 14px;
  font-size: 14px;
  color: #444;
  line-height: 1.4;
  flex-grow: 1;
}

/* --- Download Button --- */
#mla_gallery-1 .mla-download {
  text-align: center;
  padding: 12px 0 16px;
}

#mla_gallery-1 .mla-download a.lb-download {
  display: inline-block;
  background-color: #0073aa;
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 6px;
  transition: background 0.3s ease, transform 0.2s ease;
}

#mla_gallery-1 .mla-download a.lb-download:hover {
  background-color: #005f8a;
  transform: translateY(-2px);
}

/* ====== Responsive Design ====== */

/* --- Large Tablets / Small Laptops --- */
@media screen and (max-width: 1300px) {
  .page-id-383 #mla_gallery-1.gallery {
    grid-template-columns: repeat(3, minmax(200px, 1fr));
    gap: 18px;
  }
}

/* --- Tablets --- */
@media screen and (max-width: 992px) {
  .page-id-383 #mla_gallery-1.gallery {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 16px;
  }

  #mla_gallery-1 .gallery-icon {
    height: 180px !important;
  }
}

/* --- Mobile Phones --- */
@media screen and (max-width: 600px) {
  .page-id-383 #mla_gallery-1.gallery {
    repeat(2, minmax(180px, 1fr));
    gap: 14px;
  }

  #mla_gallery-1 .gallery-icon {
    height: 220px !important;
  }

  #mla_gallery-1 .gallery-caption {
    font-size: 13px;
  }

  #mla_gallery-1 .mla-download a.lb-download {
    font-size: 13px;
    padding: 6px 14px;
  }

  .lb-popup {
    width: 95%;
    padding: 20px;
  }

  .lb-popup h3 {
    font-size: 1.2rem;
  }

  .lb-popup p {
    font-size: 13px;
  }
}