.wpns-section {
  position: relative;
  z-index: 1;
}
.wpns-section.is-sticky {
  position: sticky;
  top: 0;
}
.wpns-header {
  width: 100%;
  background: #4a4a4a;
  color: #fff;
}
.wpns-header-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}
.wpns-heading {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}
.wpns-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}
.wpns-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.wpns-year {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}
.wpns-list {
  display: grid;
  gap: 20px;
  overflow: hidden; /* prevent horizontal scroll from extending bars */
}
.wpns-item {
  display: grid;
  grid-template-columns: 5fr 7fr; /* default: image(5) then text(7) */
  gap: 20px;
  align-items: stretch;
  height: 420px;
  min-height: 0;
}
/* Odd rows: image left (5fr), text right (7fr) */
.wpns-item:nth-child(odd) {
  grid-template-columns: 5fr 7fr;
}
.wpns-item:nth-child(odd) .wpns-image { order: 1; }
.wpns-item:nth-child(odd) .wpns-content { order: 2; }

/* Even rows: text left (7fr), image right (5fr) */
.wpns-item:nth-child(even) {
  grid-template-columns: 7fr 5fr;
}
.wpns-item:nth-child(even) .wpns-image { order: 2; }
.wpns-item:nth-child(even) .wpns-content { order: 1; }

.wpns-item.no-image .wpns-image.is-empty { 
  background: transparent; 
}
.wpns-item.no-image .wpns-image.is-empty::after { 
  display: none; 
}

.wpns-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible; /* allow pseudo-element to show outside */
  border-radius: 8px;
  background: #f3f3f3;
}
.wpns-image::before {
  content: "";
  position: absolute;
  bottom: -12px; /* sit fully outside the bottom edge */
  width: 12px; /* side bar thickness */
  height: calc(100% + 24px); /* extend beyond top & bottom */
  background: #9CC24A;
  border-radius: 8px;
  z-index: 1;
}
/* Left corner bar for odd rows (image on left) */
.wpns-item:nth-child(odd) .wpns-image::before {
  left: -12px; /* outside left */
}
/* Right corner bar for even rows (image on right) */
.wpns-item:nth-child(even) .wpns-image::before {
  right: -12px; /* outside right */
}
.wpns-image::after {
  content: "";
  position: absolute;
  bottom: -12px; /* outside bottom */
  width: 100%;
  height: 12px; /* match side bar thickness */
  background: #9CC24A;
  border-radius: 2px;
}
/* Green bars should start from the near bottom corner and leave space for side bar */
.wpns-item:nth-child(odd) .wpns-image::after { 
  left: -12px; /* extend to meet outer side bar */
  width: calc(100% + 12px);
}
.wpns-item:nth-child(even) .wpns-image::after { 
  right: -12px; /* extend to meet outer side bar */
  width: calc(100% + 12px);
}

.wpns-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wpns-content {
  display: flex;
  flex-direction: column;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  height: 100%;
  min-height: 0;
}
.wpns-meta {
  font-size: 13px;
  color: #777;
  margin-bottom: 8px;
}
.wpns-title {
  font-size: 20px;
  margin: 0 0 8px 0;
}
.wpns-text {
  position: relative;
  overflow: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}
.wpns-section .wpns-text { 
  overflow: auto !important; 
}
.wpns-text p { 
  margin: 0 0 10px 0; 
}
.wpns-loading,
.wpns-empty {
  text-align: center;
  padding: 24px;
  color: #666;
}
@media (max-width: 768px) {
    .wpns-item,
    .wpns-item:nth-child(odd),
    .wpns-item:nth-child(even) {
      grid-template-columns: 1fr !important; /* collapse to single column on mobile */
      height: auto;
    }
  /* Mobile pe hamesha image pehle (top), text baad mein (bottom) */
    .wpns-image {
      order: 1 !important;
      height: auto; /* natural height on mobile */
      overflow: hidden; /* hide the extending bar on mobile */
    }
  .wpns-content { 
    order: 2 !important;
  }
  /* Remove the side green bar on mobile, keep only bottom bar */
  .wpns-image::before {
    display: none;
  }
  .wpns-text {
    max-height: 150px;
    overflow: hidden !important;
  }
  .wpns-text.is-expanded {
    max-height: none;
  }
  .wpns-toggle {
    display: inline-block;
    margin-top: 8px;
    color: #2b6cb0;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
  }
}