/* =========================================================================
   9-SLICE BOX CSS SYSTEM (Avengers Tactical / Shield / Gold Frames)
   True CSS border-image 9-slice architecture:
   - Corners (40x40 of 120x120 SVG) remain razor-sharp at any aspect ratio
   - Edges stretch seamlessly
   - Center fills cleanly with dark armored backdrop
   ========================================================================= */
.ns-box {
  position: relative;
  border-style: solid;
  border-width: 24px;
  border-image-source: url('/images/frames/avengers_9slice_tactical.svg');
  border-image-slice: 40 fill;
  border-image-width: 28px;
  border-image-outset: 0;
  border-image-repeat: stretch;
  background: transparent;
  padding: 2px 4px;
  box-shadow: 0 18px 46px rgba(3, 7, 18, 0.58);
}

.ns-box--shield {
  border-image-source: url('/images/frames/avengers_9slice_shield.svg');
  box-shadow:
    0 22px 54px rgba(3, 7, 18, 0.72),
    0 0 32px rgba(37, 99, 235, 0.14);
}

.ns-box--gold {
  border-image-source: url('/images/frames/avengers_9slice_gold.svg');
  box-shadow:
    0 20px 50px rgba(3, 7, 18, 0.66),
    0 0 28px rgba(245, 158, 11, 0.12);
}

.ns-box--sm {
  border-width: 16px;
  border-image-width: 20px;
  padding: 0;
}

.ns-box--lg {
  border-width: 28px;
  border-image-width: 34px;
  padding: 6px 8px;
}

.ns-box--interactive {
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.ns-box--interactive:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 24px 58px rgba(3, 7, 18, 0.78),
    0 0 26px rgba(56, 189, 248, 0.18);
}

/* Override standard rounded card borders when upgraded to 9-slice */
.ns-box.panel-card,
.ns-box.glass-card,
.ns-box.hero-copy-card,
.ns-box.metric-card,
.ns-box.popup-card,
.ns-box.post-detail-card,
.ns-box.modal-box,
.ns-box.admin-panel {
  border-radius: 0;
  background-color: transparent;
}

@media (max-width: 640px) {
  .ns-box,
  .ns-box--lg {
    border-width: 18px;
    border-image-width: 22px;
    padding: 0;
  }
}
