/* ── Shortcode Gallery Grid ───────────────────────────────── */
.jpm-sc-gallery {
  display: grid;
  gap: 16px;
  width: 100%;
  margin: 0 auto;
}
.jpm-sc-cols-1 { grid-template-columns: 1fr; }
.jpm-sc-cols-2 { grid-template-columns: repeat(2, 1fr); }
.jpm-sc-cols-3 { grid-template-columns: repeat(3, 1fr); }
.jpm-sc-cols-4 { grid-template-columns: repeat(4, 1fr); }
.jpm-sc-cols-5 { grid-template-columns: repeat(5, 1fr); }
.jpm-sc-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Item — uniform aspect ratio regardless of original photo dimensions */
.jpm-sc-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  width: 100%;
  background: #1a1a1a;
}
.jpm-sc-item img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  max-width: none !important;
  max-height: none !important;
  transition: transform 0.35s ease;
}
.jpm-sc-item:hover img { transform: scale(1.05); }

.jpm-sc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}
.jpm-sc-item:hover .jpm-sc-overlay { background: rgba(0,0,0,0.45); }

.jpm-sc-zoom {
  font-size: 30px;
  color: #fff;
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.25s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.jpm-sc-item:hover .jpm-sc-zoom { opacity: 1; transform: scale(1); }

.jpm-sc-empty {
  padding: 40px 20px;
  text-align: center;
  color: #888;
  font-size: 15px;
  border: 2px dashed #ccc;
  border-radius: 8px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 960px) {
  .jpm-sc-cols-4, .jpm-sc-cols-5, .jpm-sc-cols-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .jpm-sc-cols-3, .jpm-sc-cols-4, .jpm-sc-cols-5, .jpm-sc-cols-6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .jpm-sc-gallery { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
}

/* ═══════════════════════════════════════════════════
   STATIC LIGHTBOX (original behaviour — unchanged)
═══════════════════════════════════════════════════ */
.jpm-lightbox:not(.jpm-carousel) {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
}
.jpm-lightbox:not(.jpm-carousel) .jpm-lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.93); cursor: pointer;
}
.jpm-lb-content {
  position: relative; z-index: 1;
  max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column; align-items: center;
}
.jpm-lightbox:not(.jpm-carousel) .jpm-lb-img {
  max-width: 90vw; max-height: 80vh;
  object-fit: contain; border-radius: 4px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.8); display: block;
}
.jpm-lb-title {
  margin-top: 14px; color: #ccc; font-size: 14px;
  text-align: center; max-width: 600px;
}
.jpm-lightbox:not(.jpm-carousel) .jpm-lb-close {
  position: fixed; top: 20px; right: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 18px; cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.jpm-lightbox:not(.jpm-carousel) .jpm-lb-close:hover { background: var(--red, #e01c1c); }
.jpm-lightbox:not(.jpm-carousel) .jpm-lb-prev,
.jpm-lightbox:not(.jpm-carousel) .jpm-lb-next {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 26px; cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.jpm-lightbox:not(.jpm-carousel) .jpm-lb-prev { left: 20px; }
.jpm-lightbox:not(.jpm-carousel) .jpm-lb-next { right: 20px; }
.jpm-lightbox:not(.jpm-carousel) .jpm-lb-prev:hover,
.jpm-lightbox:not(.jpm-carousel) .jpm-lb-next:hover { background: var(--red, #e01c1c); }
@media (max-width: 768px) {
  .jpm-lightbox:not(.jpm-carousel) .jpm-lb-prev { left: 8px; }
  .jpm-lightbox:not(.jpm-carousel) .jpm-lb-next { right: 8px; }
}

/* ═══════════════════════════════════════════════════
   CAROUSEL LIGHTBOX — full viewport, image-first
═══════════════════════════════════════════════════ */

/* Overlay covers everything */
.jpm-lightbox.jpm-carousel {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.94);
  display: flex; flex-direction: column;
  animation: jpm-fade-in 0.2s ease;
}
@keyframes jpm-fade-in { from { opacity:0; } to { opacity:1; } }

.jpm-lightbox.jpm-carousel .jpm-lb-backdrop {
  display: none; /* whole overlay is the backdrop */
}

/* Panel = the whole lightbox, transparent, no panel box */
.jpm-lb-panel {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: transparent;
}

/* Header — floats over the image at the top */
.jpm-lb-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; gap: 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%);
  pointer-events: none;
}
.jpm-lb-header-text {
  display: flex; align-items: baseline; gap: 10px;
  min-width: 0; pointer-events: none;
}
.jpm-lb-caption-title {
  color: #fff; font-size: 16px; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.jpm-lb-counter {
  color: rgba(255,255,255,0.7); font-size: 13px; flex-shrink: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.jpm-lb-close {
  pointer-events: auto;
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; width: 36px; height: 36px; border-radius: 50%;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; flex-shrink: 0;
}
.jpm-lb-close:hover { background: rgba(255,255,255,0.2); }

/* Stage = full screen, image centered */
.jpm-lb-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; min-height: 0;
}

/* Prev / Next — positioned absolute over the image */
.jpm-lb-prev, .jpm-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; width: 52px; height: 52px; border-radius: 50%;
  font-size: 28px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; z-index: 5;
}
.jpm-lb-prev { left: 16px; }
.jpm-lb-next { right: 16px; }
.jpm-lb-prev:hover, .jpm-lb-next:hover { background: rgba(255,255,255,0.18); }
.jpm-lb-prev:disabled, .jpm-lb-next:disabled { opacity: 0.15; cursor: default; }

/* Image wrap — fills the stage */
.jpm-lb-img-wrap {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

/* THE image — scales to fit the viewport, never cropped */
.jpm-lb-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  transition: opacity 0.2s ease;
}
.jpm-lb-img.jpm-loading { opacity: 0.05; }

.jpm-lb-img-caption {
  position: absolute; bottom: 96px; left: 0; right: 0;
  color: rgba(255,255,255,0.45); font-size: 11px;
  text-align: center; padding: 0 16px; pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

/* Thumbnail strip — fixed at bottom */
.jpm-lb-thumbstrip {
  flex-shrink: 0; height: 88px;
  display: flex; gap: 6px; align-items: center;
  padding: 8px 16px; overflow-x: auto;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
  scrollbar-width: thin; scrollbar-color: #555 transparent;
}
.jpm-lb-thumbstrip::-webkit-scrollbar { height: 3px; }
.jpm-lb-thumbstrip::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }

.jpm-lb-thumb {
  flex-shrink: 0; width: 68px; height: 68px;
  object-fit: cover; border-radius: 5px; cursor: pointer;
  opacity: 0.5; border: 2px solid transparent;
  transition: opacity 0.15s, border-color 0.15s, transform 0.15s;
}
.jpm-lb-thumb:hover { opacity: 0.8; transform: scale(1.06); }
.jpm-lb-thumb.active { opacity: 1; border-color: #0177E3; transform: scale(1.1); }

@media (max-width: 600px) {
  .jpm-lb-prev, .jpm-lb-next { width: 40px; height: 40px; font-size: 22px; }
  .jpm-lb-prev { left: 8px; }
  .jpm-lb-next { right: 8px; }
  .jpm-lb-thumbstrip { height: 70px; }
  .jpm-lb-thumb { width: 52px; height: 52px; }
}

/* ═══════════════════════════════════════════════════
   JOB COVER CARD GRID (new shortcode architecture)
═══════════════════════════════════════════════════ */
.jpm-jobs-grid {
  display: grid;
  gap: 24px;
  width: 100%;
}
.jpm-jobs-cols-1 { grid-template-columns: 1fr; }
.jpm-jobs-cols-2 { grid-template-columns: repeat(2, 1fr); }
.jpm-jobs-cols-3 { grid-template-columns: repeat(3, 1fr); }
.jpm-jobs-cols-4 { grid-template-columns: repeat(4, 1fr); }
.jpm-jobs-cols-5 { grid-template-columns: repeat(5, 1fr); }
.jpm-jobs-cols-6 { grid-template-columns: repeat(6, 1fr); }

.jpm-job-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  gap: 12px;
}

.jpm-job-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a;
}
.jpm-job-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.jpm-job-card:hover .jpm-job-cover img { transform: scale(1.05); }

.jpm-job-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}
.jpm-job-card:hover .jpm-job-cover-overlay { background: rgba(0,0,0,0.38); }

.jpm-job-cover-icon {
  color: #fff;
  font-size: 36px;
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.25s ease;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
}
.jpm-job-card:hover .jpm-job-cover-icon { opacity: 1; transform: scale(1); }

.jpm-job-title-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 22px;
  background: #0177E3;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  text-align: center;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.2s, transform 0.15s;
  pointer-events: auto;
}
.jpm-job-card:hover .jpm-job-title-btn {
  background: #3395f0;
  transform: translateY(-1px);
}

@media (max-width: 960px) {
  .jpm-jobs-cols-4, .jpm-jobs-cols-5, .jpm-jobs-cols-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .jpm-jobs-cols-3, .jpm-jobs-cols-4, .jpm-jobs-cols-5, .jpm-jobs-cols-6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .jpm-jobs-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
}

/* ── Elementor-proof overrides ──────────────────────────── */

/* Lightboxes hidden by default — JS adds .jpm-open to show */
.jpm-lightbox {
  display: none !important;
}
.jpm-lightbox.jpm-open {
  display: flex !important;
}

/* Lock job card image to its container — prevent Elementor stretching */
.jpm-job-card,
.jpm-job-card * {
  box-sizing: border-box;
}
.jpm-job-cover {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  overflow: hidden !important;
  border-radius: 8px !important;
  position: relative !important;
}
.jpm-job-cover img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  display: block !important;
}
