/* ========== CASE STUDY GRID ========== */

.nkcs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 980px) {
  .nkcs-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .nkcs-grid { grid-template-columns: 1fr; }
}

/* ========== CARD ========== */

.nkcs-card {
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  border-bottom:2px solid #e86924;
}

.nkcs-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
}

.nkcs-card-link {
  color: inherit;
  text-decoration: none;
  display: block;
  height: 100%;
}

.nkcs-thumb {
  --nkcs-card-ratio: 16/9;
  --nkcs-fit: cover;
  aspect-ratio: var(--nkcs-card-ratio);
  overflow: hidden;
  width: 100%;
}

.nkcs-thumb img {
  width: 100%;
  height: 100%;
  object-fit: var(--nkcs-fit);
  display: block;
}

.nkcs-card-content { padding: 1rem; }

.nkcs-title {
  font-size: 20px !important;
  margin: 0 0 .5rem 0;
  padding: 0;
  font-weight: 500;
  color: #e86924;
  font-style:italic;
}

.nkcs-meta {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: 0.95rem;
}

.nkcs-byline {
  margin: .6rem 0 0 0;
  font-size:16px;
  line-height:1.3;
  color: #000;
}

/* ========== GALLERY ========== */

.nkcs-gallery {
  display: grid;
  gap: 2rem;
  --nkcs-cols: 3;
  grid-template-columns: repeat(var(--nkcs-cols), 1fr);

  --nkcs-gallery-ratio: 4/3;
  --nkcs-gallery-fit: cover;
}

.nkcs-gallery:where(.nkcs-cols-1) { --nkcs-cols: 1; }
.nkcs-gallery:where(.nkcs-cols-2) { --nkcs-cols: 2; }
.nkcs-gallery:where(.nkcs-cols-3) { --nkcs-cols: 3; }
.nkcs-gallery:where(.nkcs-cols-4) { --nkcs-cols: 4; }
.nkcs-gallery:where(.nkcs-cols-5) { --nkcs-cols: 5; }
.nkcs-gallery:where(.nkcs-cols-6) { --nkcs-cols: 6; }

@media (max-width: 980px) {
  .nkcs-gallery { --nkcs-cols: 2; }
}
@media (max-width: 767px) {
  .nkcs-gallery { --nkcs-cols: 1; }
}

.nkcs-gallery .nkcs-gallery-item { margin: 0; }

.nkcs-gallery .nkcs-frame {
  aspect-ratio: var(--nkcs-gallery-ratio, 4/3);
  overflow: hidden;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.nkcs-gallery .nkcs-frame > img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: var(--nkcs-gallery-fit, cover) !important;
  display: block;
}

.nkcs-gallery .nkcs-gallery-item a.nkcs-lightbox {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.nkcs-gallery .nkcs-caption {
  font-size: 0.9rem;
  color: #666;
  margin-top: .35rem;
}

/* ========== LIGHTBOX ========== */

.nkcs-lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.nkcs-lb-overlay.open { display: flex; }

.nkcs-lb-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}

.nkcs-lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 2rem;
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.nkcs-lb-nav .prev,
.nkcs-lb-nav .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: 0;
  color: #fff;
  font-size: 2rem;
  width: 48px;
  height: 56px;
  cursor: pointer;
  border-radius: 6px;
}

.nkcs-lb-nav .prev { left: 16px; }
.nkcs-lb-nav .next { right: 16px; }