/* Bos Marketing — News gallery (public + preview + admin editor) */

/* ---------- Public / preview gallery ---------- */
.ng-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #e3e7ee; }
.ng-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.ng-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #011332; margin: 0; }
.ng-count { font-size: 0.72rem; color: #8a93a3; letter-spacing: 0.04em; }
.ng-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 420px) { .ng-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .ng-grid { grid-template-columns: repeat(3, 1fr); } }
.ng-item, .ng-figure { margin: 0; }
.ng-thumb {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; background: #eef1f6;
  border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3;
}
.ng-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.ng-thumb:hover img { transform: scale(1.03); }
.ng-thumb:focus-visible { outline: 3px solid #011332; outline-offset: 3px; }
.ng-caption { font-size: 0.8rem; color: #5b6475; line-height: 1.5; margin-top: 0.5rem; overflow-wrap: anywhere; }

/* ---------- Lightbox ---------- */
.ng-lightbox {
  position: fixed; inset: 0; z-index: 10000; background: rgba(1, 19, 50, 0.94);
  display: flex; flex-direction: column; color: #f3f5f9;
}
.ng-lightbox[hidden] { display: none; }
.ng-lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; }
.ng-lb-counter { font-size: 0.75rem; letter-spacing: 0.12em; font-weight: 600; color: #b9c2d3; }
.ng-lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 0 0.75rem 1.25rem; touch-action: pan-y; }
.ng-lb-figure { margin: 0; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ng-lb-img { max-width: 100%; max-height: calc(100% - 4rem); object-fit: contain; border-radius: 8px; display: block; user-select: none; }
.ng-lb-caption { margin-top: 0.85rem; font-size: 0.88rem; line-height: 1.5; max-width: 680px; text-align: center; color: #e3e8f0; overflow-wrap: anywhere; }
.ng-lb-btn {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.06); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.2s;
}
.ng-lb-btn:hover { background: rgba(255,255,255,0.16); }
.ng-lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ng-lb-btn[hidden] { display: none; }
@media (max-width: 600px) {
  .ng-lb-stage { position: relative; padding: 0 0.5rem 1rem; }
  .ng-lb-prev, .ng-lb-next { position: absolute; bottom: 1rem; }
  .ng-lb-prev { left: 1rem; } .ng-lb-next { right: 1rem; }
  .ng-lb-img { max-height: calc(100% - 7rem); }
  .ng-lb-caption { margin-bottom: 3.5rem; }
}

/* ---------- Preview notice ---------- */
.ng-preview-warn { margin-top: 2rem; padding: 0.75rem 1rem; border-radius: 8px; background: #fff6e5; border: 1px solid #f0d49a; color: #6b4a07; font-size: 0.82rem; }

/* ---------- Admin editor ---------- */
.nge { margin: 0 0 1.5rem; padding: 1.25rem; border: 1px solid #dfe4ec; border-radius: 8px; background: #f7f9fc; }
.nge-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.75rem; }
.nge-title { margin: 0; font-weight: 700; }
.nge-count { font-size: 0.75rem; font-weight: 700; color: #011332; background: #e8eef5; padding: 0.15rem 0.55rem; border-radius: 999px; white-space: nowrap; }
.nge-count.is-full { background: #011332; color: #fff; }
.nge-drop {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 1rem; border: 1.5px dashed #b9c3d3;
  border-radius: 8px; background: #fff; transition: border-color 0.2s, background 0.2s;
}
.nge-drop.is-over { border-color: #011332; background: #eef3fa; }
.nge-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nge-add {
  font-family: inherit; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: #011332; color: #fff; border: 0; border-radius: 8px; padding: 0.65rem 1.1rem; cursor: pointer; min-height: 40px;
}
.nge-add:disabled { opacity: 0.4; cursor: not-allowed; }
.nge-add:focus-visible, .nge-icon:focus-visible, .nge-text-btn:focus-visible { outline: 2px solid #011332; outline-offset: 2px; }
.nge-drop-text { font-size: 0.8rem; color: #5b6475; }
.nge-notice { margin-top: 0.75rem; padding: 0.6rem 0.85rem; border-radius: 6px; background: #fff6e5; border: 1px solid #f0d49a; color: #6b4a07; font-size: 0.8rem; }
.nge-notice[hidden] { display: none; }
.nge-status { font-size: 0.8rem; font-weight: 600; margin-top: 0.6rem; min-height: 0; }
.nge-status:empty { display: none; }
.nge-status.is-uploading { color: #1f4c8f; }
.nge-status.is-failed { color: #b42318; }
.nge-empty { font-size: 0.8rem; color: #7a8394; margin-top: 0.75rem; }
.nge-empty[hidden] { display: none; }
.nge-list { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.nge-row {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 1rem; align-items: start; padding: 0.85rem;
  background: #fff; border: 1px solid #e1e6ee; border-radius: 8px;
}
.nge-row.is-failed { border-color: #f1b5ae; background: #fffafa; }
.nge-thumb { position: relative; width: 120px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #e8eef5; }
.nge-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nge-row.is-uploading .nge-thumb img { opacity: 0.55; }
.nge-row.is-failed .nge-thumb img { opacity: 0.4; filter: grayscale(1); }
.nge-thumb-x { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: #7a8394; }
.nge-pos { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #011332; color: #fff; font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.nge-state { position: absolute; left: 6px; right: 6px; bottom: 6px; }
.nge-state-tag { display: inline-block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; background: #b42318; color: #fff; padding: 0.1rem 0.4rem; border-radius: 4px; }
.nge-bar { display: block; height: 4px; border-radius: 2px; background: rgba(1,19,50,0.2); overflow: hidden; }
.nge-bar-fill { display: block; height: 100%; width: 40%; background: #011332; border-radius: 2px; animation: ngeSlide 1.1s ease-in-out infinite; }
@keyframes ngeSlide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .nge-bar-fill { animation: none; width: 100%; opacity: 0.6; } }
.nge-fields { min-width: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.nge-stateline { font-size: 0.78rem; overflow-wrap: anywhere; }
.nge-stateline:empty { display: none; }
.nge-stateline.is-uploading { color: #1f4c8f; }
.nge-stateline.is-failed { color: #b42318; font-weight: 600; }
.nge-stateline.is-done { color: #237a45; }
.nge-field { display: flex; flex-direction: column; gap: 0.25rem; }
.nge-label { font-size: 0.75rem; font-weight: 600; color: #011332; }
.nge-label-hint { font-weight: 400; color: #7a8394; }
.nge-input { font-size: 0.85rem; resize: vertical; }
.nge-counter { font-size: 0.68rem; color: #9aa2b1; align-self: flex-end; }
.nge-actions { display: flex; flex-direction: column; gap: 0.4rem; align-items: stretch; }
.nge-icon {
  width: 40px; height: 40px; border-radius: 8px; border: 1px solid #cfd6e1; background: #fff; color: #011332;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.nge-icon:disabled { opacity: 0.35; cursor: not-allowed; }
.nge-text-btn {
  font-family: inherit; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  min-height: 40px; padding: 0 0.6rem; border-radius: 8px; border: 1px solid #cfd6e1; background: #fff; color: #011332; cursor: pointer;
}
.nge-retry { border-color: #011332; }
.nge-retry[hidden] { display: none; }
.nge-remove { color: #b42318; border-color: #f1c4be; }
.nge-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 640px) {
  .nge { padding: 0.9rem; }
  .nge-row { grid-template-columns: 1fr; }
  .nge-thumb { width: 100%; max-width: 260px; }
  .nge-actions { flex-direction: row; flex-wrap: wrap; }
  .nge-icon { width: 44px; height: 44px; }
  .nge-text-btn { min-height: 44px; flex: 1; }
}
