.popup {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  /* Add blur effect to background */
  backdrop-filter: blur(3px);
  animation: popup-fadein 0.3s;
}

@keyframes popup-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

.popup-content {
  background: linear-gradient(135deg, #fff 80%, #f0f4fa 100%);
  margin: auto;
  padding: 38px 32px 32px 32px;
  border: 1.5px solid #e0e6f0;
  max-width: 900px; /* max-w-4xl = 56rem = 896px, rounded to 900px */
  width: 100%;
  height: auto;
  max-height: 80vh; /* Changed from 90vh to 80vh for a shorter modal */
  overflow-y: visible; /* No scrollbar on large screens */
  border-radius: 18px;
  position: relative;
  box-sizing: border-box;
  box-shadow: 0 12px 40px rgba(35,57,108,0.18), 0 2px 8px rgba(0,0,0,0.04);
  animation: popup-content-fadein 0.4s;
  /* Scrollbar styling for popup-content */
  scrollbar-width: thin;
  scrollbar-color: #23396C #f0f4fa;
}

.popup-content::-webkit-scrollbar {
  width: 10px;
  background: #f0f4fa;
  border-radius: 18px; /* Match popup border-radius */
}

.popup-content::-webkit-scrollbar-thumb {
  background: #23396C;
  border-radius: 18px; /* Match popup border-radius */
}

.popup-content::-webkit-scrollbar-thumb:hover {
  background: #1a2a4d;
}

/* On small screens, force popup-content to be scrollable inside the popup */
@media (max-width: 700px) {
  .popup-content {
    max-width: 98vw !important;
    width: 98vw !important;
    min-width: 0 !important;
    padding: 18px !important;
    border-radius: 12px !important;
    box-sizing: border-box;
    max-height: 80vh !important;
    overflow-y: auto !important;
    /* Match scrollbar style on mobile/tablet */
    scrollbar-width: thin;
    scrollbar-color: #23396C #f0f4fa;
  }
  .popup-content::-webkit-scrollbar {
    width: 10px;
    background: #f0f4fa;
    border-radius: 12px; /* Match popup border-radius for tablet */
  }
  .popup-content::-webkit-scrollbar-thumb {
    background: #23396C;
    border-radius: 12px; /* Match popup border-radius for tablet */
  }
  .popup-content::-webkit-scrollbar-thumb:hover {
    background: #1a2a4d;
  }
}
@media (max-width: 480px) {
  .popup-content {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding: 10px 4px 18px 4px !important;
    border-radius: 0 !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
    /* Match scrollbar style on mobile */
    scrollbar-width: thin;
    scrollbar-color: #23396C #f0f4fa;
  }
  .popup-content::-webkit-scrollbar {
    width: 10px;
    background: #f0f4fa;
    border-radius: 0; /* No border-radius for full width mobile */
  }
  .popup-content::-webkit-scrollbar-thumb {
    background: #23396C;
    border-radius: 0;
  }
  .popup-content::-webkit-scrollbar-thumb:hover {
    background: #1a2a4d;
  }
}

.wwd-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  animation: popup-fadein 0.3s;
}
.wwd-popup > .wwd-popup-content {
  background: linear-gradient(135deg, #fff 80%, #f0f4fa 100%);
  margin: auto;
  padding: 38px 32px 32px 32px;
  border: 1.5px solid #e0e6f0;
  max-width: 900px !important;
  width: 100% !important;
  height: auto !important;
  max-height: 80vh !important;
  overflow-y: visible !important;
  border-radius: 18px !important;
  position: relative;
  box-sizing: border-box !important;
  box-shadow: 0 12px 40px rgba(35,57,108,0.18), 0 2px 8px rgba(0,0,0,0.04) !important;
  animation: popup-content-fadein 0.4s !important;
  scrollbar-width: thin;
  scrollbar-color: #23396C #f0f4fa;
}
.wwd-popup-content::-webkit-scrollbar {
  width: 10px;
  background: #f0f4fa;
  border-radius: 18px;
}
.wwd-popup-content::-webkit-scrollbar-thumb {
  background: #23396C;
  border-radius: 18px;
}
.wwd-popup-content::-webkit-scrollbar-thumb:hover {
  background: #1a2a4d;
}
@media (max-width: 700px) {
  .wwd-popup > .wwd-popup-content {
    max-width: 98vw !important;
    width: 98vw !important;
    min-width: 0 !important;
    padding: 18px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
  }
}
@media (max-width: 480px) {
  .wwd-popup > .wwd-popup-content {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding: 10px 4px 18px 4px !important;
    border-radius: 0 !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
  }
}

.popup > .popup-content {
  max-width: 900px !important;
  width: 100% !important;
  height: auto !important;
  max-height: 80vh !important;
  overflow-y: visible !important;
  border-radius: 18px !important;
  position: relative;
  box-sizing: border-box !important;
  box-shadow: 0 12px 40px rgba(35,57,108,0.18), 0 2px 8px rgba(0,0,0,0.04) !important;
  animation: popup-content-fadein 0.4s !important;
}
@media (max-width: 1080px) {
  .popup > .popup-content {
    max-width: 800px !important;
  }
}
@media (max-width: 700px) {
  .popup > .popup-content {
    max-width: 98vw !important;
    width: 98vw !important;
    min-width: 0 !important;
    padding: 18px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
  }
}
@media (max-width: 480px) {
  .popup > .popup-content {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding: 10px 4px 18px 4px !important;
    border-radius: 0 !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
  }
}

.popup-content h3 {
  color: #23396C;
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.5em;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.popup-content img {
  display: block;
  margin: 0 auto 20px;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(35,57,108,0.08);
}

.popup-content p,
.popup-content ul {
  text-align: justify;
  color: #333;
  font-size: 1.08em;
  line-height: 1.7;
}

.popup-content ul li {
  margin-bottom: 8px;
  list-style: disc;
  margin-left: 20px;
}

.close {
  color: #fff;
  background: #23396C;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(35,57,108,0.10);
  transition: background 0.2s, color 0.2s, transform 0.15s;
  border: 2px solid #fff;
}

.close:hover {
  background: #fff;
  color: #23396C;
  transform: scale(1.12);
  border-color: #23396C;
}

#core-services h2 {
    font-size: 2em;
    text-align: center;
    margin-bottom: 20px;
    color: #23396C
}

#core-services p {
    font-size: 1.2em;
    text-align: center;
    margin-bottom: 40px;
}

.intro-text {
  text-align: center;
  font-size: 1.2em;
  padding: 0 2px;
  margin-bottom: 40px;
}

/* --- Responsive, professional layout for all elements --- */

/* Service cards: 4 per row desktop, 2 per row tablet, 1 per row mobile */
.services {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 24px;
  margin: 0 auto;
  max-width: 1200px;
}
.service-card {
  flex: 1 1 21%;
  max-width: 23%;
  min-width: 240px;
  margin: 0;
  box-sizing: border-box;
  font-size: 1em !important;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.08);
  padding: 20px;
  height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
}
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.service-card img {
    width: 100%;
    height: auto;
    max-height: 160px;
    margin-bottom: 15px;
    border-radius: 5px;
    object-fit: contain;
}

.service-card h3 {
    margin-bottom: 20px;
    font-size: 1.3em;
    color: #23396C;
}

.service-card p {
    margin-bottom: 100px;
    font-size: 1em;
    color: #555;
    /* Make font size constant and prevent resizing */
    font-size: 1em !important;
    line-height: 1.5;
    min-height: 3.2em; /* Ensures at least 2 lines of space for consistency */
    max-height: 3.2em; /* Prevents growing if text is longer */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Show max 2 lines */
    line-clamp: 2; /* Standard property for compatibility */
    -webkit-box-orient: vertical;
}

/* Gallery Styles */
.wwd-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}
.wwd-gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}
.wwd-gallery-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;
  width: 100%;
}
.wwd-gallery-img {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  object-fit: contain;
  border-radius: 6px;
  border: none !important;
  cursor: pointer;
  background: none !important;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  margin-bottom: 0;
  box-shadow: 0 4px 24px rgba(35,57,108,0.18), 0 2px 8px rgba(0,0,0,0.04) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.wwd-gallery-img:hover {
  border-color: #23396C;
  box-shadow: 0 10px 30px rgba(35,57,108,0.15);
  transform: translateY(-6px) scale(1.06);
}
.wwd-gallery-content {
  margin-top: 10px;
}

/* Popup Main Image */
.wwd-popup-mainimg {
  display: block;
  margin: 0 auto 20px;
  max-width: 180px;
  border-radius: 8px;
}

/* Back Button Styles */
.wwd-inner-back {
  display: inline-block;
  margin-bottom: 15px;
  background: #23396C;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 6px 18px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}
.wwd-inner-back:hover {
  background: #1a2a4d;
}

/* Remove hover effect if image is not clickable (pointer-events:none set inline) */
.wwd-gallery-img[style*="pointer-events:none"]:hover {
  border-color: #eee !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
  transform: none !important;
  cursor: default !important;
}

/* Responsive Layout */
@media (max-width: 768px) {
    .service-card {
        flex: 1 1 calc(30% - 20px); /* Two cards per row */
    }
}

@media (max-width: 480px) {
    .service-card {
        flex: 1 1 100%; /* One card per row */
    }

    #core-services h2 {
        font-size: 1.5em;
        padding: 0px;
    }

    #core-services p {
        font-size: 1em;
        padding: 0 10px;
    }

    .intro-text {
        text-align: justify;
        font-size: 1em;
        padding: 0 10px;
    }
}

/* Responsive popup */
@media (max-width: 700px) {
  .popup-content {
    max-width: 98vw !important;
    width: 98vw !important;
    min-width: 0 !important;
    padding: 18px !important;
    border-radius: 12px !important;
    box-sizing: border-box;
    max-height: 80vh !important; /* Also update here for consistency */
    overflow-y: auto !important;
  }
}
@media (max-width: 480px) {
  .popup-content {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding: 10px 4px 18px 4px !important;
    border-radius: 0 !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto !important; /* Always scrollable inside popup on mobile */
  }
}

/* Responsive gallery grid/rows */
.wwd-gallery-grid {
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}
.wwd-gallery-row {
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}
.wwd-gallery-img {
  max-width: 100%;
  height: auto;
  min-width: 0;
  box-sizing: border-box;
}
@media (max-width: 700px) {
  .wwd-gallery-row .wwd-gallery-img,
  .wwd-gallery-row .wwd-gallery-img:only-child {
    max-width: 100vw !important;
    min-width: 0 !important;
  }
}
@media (max-width: 480px) {
  .wwd-gallery-row {
    gap: 6px;
  }
  .wwd-gallery-img {
    max-width: 100vw !important;
    min-width: 0 !important;
  }
}

/* Responsive popup main image */
.wwd-popup-mainimg {
  max-width: 90vw;
  width: 100%;
  height: auto;
  display: block;
}

/* Responsive text size for mobile */
@media (max-width: 600px) {
  #core-services h2,
  .popup-content h3,
  .wwd-inner-popup-content h3 {
    font-size: 1.08em !important;
    padding: 0 2vw;
  }
  
}

/* Responsive close button */
@media (max-width: 600px) {
  .close {
    font-size: 1.5em !important;
    width: 28px !important;
    height: 28px !important;
    top: 4px !important;
    right: 4px !important;
  }
}

/* Responsive: fix overflow for all popups */
.popup-content,
.wwd-inner-popup-content {
  box-sizing: border-box;
  overflow-x: auto;
  word-break: break-word;
}

/* Responsive admin table (if used) */
@media (max-width: 700px) {
  .form-table,
  .form-table th,
  .form-table td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }
  .form-table th {
    padding-top: 12px;
  }
}

/* No explicit font-family is set in this CSS file.
   The plugin uses the default font-family of the WordPress theme or browser. */

pup-content img,
.wwd-inner-popup-content .wwd-popup-mainimg {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border-radius: 8px !important;
}
@media (max-width: 700px) {
  .wwd-inner-popup-content img,
  .wwd-inner-popup-content .wwd-popup-mainimg {
    max-height: 100% !important;
  }
}
@media (max-width: 480px) {
  .wwd-inner-popup-content img,
  .wwd-inner-popup-content .wwd-popup-mainimg {
    max-height: 100% !important;
    border-radius: 5px !important;
  }
}