/* News Photo Card — frontend */
.npc-wrap *, .npc-modal * { box-sizing: border-box; }
.npc-wrap {
  --npc-title-size: 34px;
  --npc-line-height: 1.45;
  --npc-radius: 18px;
  --npc-photo-border: #FFC400;
  max-width: 640px;
  margin: 20px auto;
  font-family: 'Hind Siliguri', 'Noto Sans Bengali', sans-serif;
}
.npc-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--npc-radius);
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  background: #0a2472;
  box-shadow: 0 12px 40px rgba(4, 20, 80, .28);
  transition: transform .18s ease, box-shadow .18s ease;
  user-select: none;
}
.npc-card:hover { transform: translateY(-2px); box-shadow: 0 18px 50px rgba(4,20,80,.36); }
.npc-card:focus-visible { outline: 3px solid #FFC400; outline-offset: 3px; }
.npc-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
  pointer-events: none;
}
/* Date pill */
.npc-date {
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: #ffffff;
  color: #111;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  padding: 11px 30px 13px;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 5px 14px rgba(0,0,0,.35);
  white-space: nowrap;
}
/* Photo */
.npc-photo {
    position: relative;
    z-index: 1;
    margin: 86px 20px 0;
    border: 4px solid var(--npc-photo-border);
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 2.2 / 1;
    background: #123;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.npc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.npc-photo-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(135deg,#1a3a8f,#0a1f5c);
  font-weight: 600;
}
/* Title */
.npc-title {
  position: relative; z-index: 1;
  margin: 15px 22px 0;
  padding: 0;
  text-align: center;
  color: #fff;
  font-size: var(--npc-title-size);
  line-height: var(--npc-line-height);
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.6);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.npc-title .npc-y { color: #FFD926; }
/* Footer */
.npc-footer {
  position: absolute; z-index: 1;
  left: 0; right: 0; bottom: 46px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
}
.npc-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.npc-logo {
  width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover; background: #fff;
  border: 2px solid #FFC400;
  box-shadow: 0 3px 10px rgba(0,0,0,.4);
  flex: none;
}
.npc-logo-fallback {
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #c00; color: #fff; font-weight: 700; font-size: 22px;
  border: 2px solid #FFC400; flex: none;
}
.npc-brand-name {
  color: #fff; font-weight: 700; font-size: 19px;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.npc-btn {
  flex: none;
  background: linear-gradient(180deg, #2f9bff 0%, #0b5ed7 60%, #0849b0 100%);
  border: 1.5px solid #9ccdff;
  color: #FFE234;
  font-weight: 700; font-size: 17px; line-height: 1;
  padding: 11px 22px;
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.35);
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
/* bottom site tab */
.npc-site {
  position: absolute; z-index: 1;
  bottom: 0; left: 50%; transform: translateX(-50%);
  background: #e9eefb;
  color: #0a2a7a;
  font-size: 13px; font-weight: 700; line-height: 1;
  padding: 9px 34px 11px;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -3px 10px rgba(0,0,0,.25);
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden; text-overflow: ellipsis;
}
/* hint */
.npc-hint {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 10px;
  color: #5b6b8c; font-size: 14px; font-weight: 500;
}
/* download open button under card */
.npc-actions { text-align: center; margin-top: 12px; }
.npc-open-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: none; cursor: pointer; font-family: inherit;
  background: linear-gradient(180deg, #1a73e8, #0a4fc4);
  color: #fff; font-weight: 700; font-size: 16px; line-height: 1;
  padding: 13px 30px; border-radius: 12px;
  box-shadow: 0 8px 22px rgba(10, 79, 196, .35);
  transition: filter .15s ease, transform .15s ease;
}
.npc-open-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.npc-open-btn:active { transform: translateY(0); }
/* Button-only mode: card preview hidden on page (kept in DOM for popup) */
.npc-button-only .npc-card { display: none; }
.npc-button-only .npc-actions { margin-top: 0; }

/* Responsive tweaks */
@media (max-width: 768px) {
  .npc-wrap {
    max-width: min(100%, 360px);
    margin: 16px auto;
  }
  .npc-date {
    font-size: 12px !important;
    padding: 6px 18px 7px !important;
    border-radius: 0 0 10px 10px !important;
    top: 0 !important;
  }
  /* Photo: 100% Full Width, zero side space */
  .npc-photo {
    width: 100% !important;
    margin: 34px 0 0 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 3px solid var(--npc-photo-border) !important;
    border-bottom: 3px solid var(--npc-photo-border) !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25) !important;
  }
  .npc-photo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
  }
  .npc-title {
    font-size: var(--npc-title-size-mobile, 18px) !important;
    line-height: var(--npc-line-height, 1.35) !important;
    margin: 10px 12px 0 !important;
    padding: 0 !important;
    -webkit-line-clamp: 3;
  }
  .npc-footer {
    bottom: 26px !important;
    padding: 0 12px !important;
    gap: 8px !important;
  }
  .npc-logo, .npc-logo-fallback {
    width: 32px !important;
    height: 32px !important;
  }
  .npc-brand-name {
    font-size: 13px !important;
  }
  .npc-btn {
    font-size: 11px !important;
    padding: 6px 11px !important;
    border-radius: 6px !important;
  }
  .npc-site {
    font-size: 11px !important;
    padding: 5px 18px 6px !important;
    border-radius: 8px 8px 0 0 !important;
  }
}

@media (max-width: 480px) {
  .npc-wrap {
    max-width: min(100%, 310px);
    margin: 12px auto;
  }
  .npc-date {
    font-size: 10.5px !important;
    padding: 4px 14px 5px !important;
    border-radius: 0 0 8px 8px !important;
    top: 0 !important;
  }
  /* Photo: 100% Full Width, zero side space */
  .npc-photo {
    width: 100% !important;
    margin: 28px 0 0 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 2.5px solid var(--npc-photo-border) !important;
    border-bottom: 2.5px solid var(--npc-photo-border) !important;
    border-radius: 0 !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .2) !important;
  }
  .npc-photo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
  }
  .npc-title {
    font-size: var(--npc-title-size-mobile, 18px) !important;
    line-height: var(--npc-line-height, 1.32) !important;
    margin: 8px 10px 0 !important;
    padding: 0 !important;
    -webkit-line-clamp: 3;
  }
  .npc-footer {
    bottom: 22px !important;
    padding: 0 10px !important;
    gap: 6px !important;
  }
  .npc-logo, .npc-logo-fallback {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
  }
  .npc-brand-name {
    font-size: 11.5px !important;
  }
  .npc-btn {
    font-size: 10px !important;
    padding: 4px 8px !important;
    border-radius: 5px !important;
  }
  .npc-site {
    font-size: 9.5px !important;
    padding: 4px 12px 5px !important;
    border-radius: 6px 6px 0 0 !important;
  }
  .npc-open-btn {
    padding: 9px 18px;
    font-size: 14px;
  }
  .npc-hint {
    font-size: 12px;
  }
}

/* ============ MODAL ============ */
.npc-modal { position: fixed; inset: 0; z-index: 999999; display: none; }
.npc-modal.open { display: block; }
.npc-modal-backdrop { position: absolute; inset: 0; background: rgba(5,12,35,.78); backdrop-filter: blur(4px); }
.npc-modal-box {
  position: relative;
  width: calc(100% - 24px); max-width: 1060px;
  max-height: 93vh; overflow: auto;
  margin: 3.5vh auto;
  background: #f4f6fb;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  font-family: 'Hind Siliguri', 'Noto Sans Bengali', sans-serif;
  animation: npcPop .22s ease;
}
@keyframes npcPop { from { transform: translateY(14px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.npc-modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: #101c3d; color: #fff;
  font-size: 15px; cursor: pointer; line-height: 1;
}
.npc-modal-close:hover { background: #c00; }
.npc-modal-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; align-items: start; }

.npc-modal-stage .npc-card { cursor: default; display: block !important; }
.npc-modal-stage .npc-card:hover { transform: none; }
.npc-modal-stage .npc-hint, .npc-modal-stage .npc-actions { display: none; }

.npc-modal-controls { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 6px 22px rgba(10,30,90,.08); position: sticky; top: 0; }
.npc-modal-controls h3 { margin: 0 0 14px; font-size: 19px; color: #0a2472; }
.npc-ctl { display: block; margin-bottom: 14px; }
.npc-ctl-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: #22315a; font-size: 15px; margin-bottom: 7px; }
.npc-ctl-head b { background: #0a2472; color: #fff; font-size: 13px; padding: 3px 10px; border-radius: 20px; min-width: 56px; text-align: center; }
.npc-range-row { display: flex; align-items: center; gap: 8px; }
.npc-range-row button {
  width: 34px; height: 34px; flex: none;
  border-radius: 9px; border: 1px solid #c4cfe8; background: #eef2fb;
  font-size: 20px; font-weight: 700; cursor: pointer; color: #0a2472; line-height: 1;
}
.npc-range-row button:hover { background: #0a2472; color: #fff; }
.npc-range-row input[type=range] { flex: 1; accent-color: #0a59d6; height: 34px; }
.npc-modal-controls textarea, .npc-modal-controls input[type=text], .npc-modal-controls select {
  width: 100%; border: 1.5px solid #c4cfe8; border-radius: 10px;
  padding: 9px 11px; font-size: 15px; font-family: inherit; color: #16224a; background: #fbfcff;
}
.npc-modal-controls textarea:focus, .npc-modal-controls input:focus, .npc-modal-controls select:focus { outline: none; border-color: #0a59d6; box-shadow: 0 0 0 3px rgba(10,89,214,.15); }
.npc-tip { color: #6b7aa3; font-size: 12.5px; margin-top: 4px; display: block; }
.npc-ctl-2col { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.npc-modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.npc-btn-ghost {
  flex: 1; border: 1.5px solid #c4cfe8; background: #fff; color: #33415e;
  border-radius: 11px; padding: 12px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.npc-btn-ghost:hover { background: #eef2fb; }
.npc-btn-primary {
  flex: 2; border: none; cursor: pointer; font-family: inherit;
  background: linear-gradient(180deg, #12b76a, #027a48);
  color: #fff; border-radius: 11px; padding: 12px;
  font-size: 16px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 20px rgba(2,122,72,.35);
}
.npc-btn-primary:hover { filter: brightness(1.06); }
.npc-btn-primary:disabled { opacity: .65; cursor: wait; }
.npc-note { font-size: 13px; color: #5b6b8c; margin: 10px 2px 0; text-align: center; }

/* Modal Responsive Rules for Mobile Devices */
@media (max-width: 920px) {
  .npc-modal-grid { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 768px) {
  .npc-modal-box {
    width: calc(100% - 16px);
    margin: 8px auto;
    padding: 14px 12px;
    border-radius: 16px;
    max-height: 95vh;
  }
  .npc-modal-close {
    width: 32px; height: 32px;
    font-size: 13px; top: 8px; right: 8px;
  }
  /* Stage card size on mobile: Keep it neat, compact, and centered so it never overwhelms the screen */
  .npc-modal-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
  }
  .npc-modal-stage .npc-wrap {
    max-width: 290px !important;
    width: 100% !important;
    margin: 0 auto !important;
  }
  .npc-modal-stage .npc-card {
    max-width: 290px !important;
    width: 100% !important;
  }
  .npc-modal-controls {
    padding: 14px 12px;
    border-radius: 12px;
  }
  .npc-modal-controls h3 {
    font-size: 16px;
    margin: 0 0 10px;
  }
  .npc-ctl {
    margin-bottom: 10px;
  }
  .npc-ctl-head {
    font-size: 13.5px;
    margin-bottom: 5px;
  }
  .npc-range-row button {
    width: 30px; height: 30px;
    font-size: 18px;
  }
  .npc-range-row input[type=range] {
    height: 30px;
  }
  .npc-modal-controls textarea,
  .npc-modal-controls input[type=text],
  .npc-modal-controls select {
    padding: 7px 10px;
    font-size: 14px;
    border-radius: 8px;
  }
  .npc-btn-primary,
  .npc-btn-ghost {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 8px;
  }
}
@media (max-width: 480px) {
  .npc-modal-box {
    width: calc(100% - 10px);
    margin: 5px auto;
    padding: 12px 10px;
    border-radius: 14px;
  }
  .npc-modal-stage .npc-wrap {
    max-width: 260px !important;
  }
  .npc-modal-stage .npc-card {
    max-width: 260px !important;
  }
}
