/* Nike Design Systems case page — extends main site (styles.min.css + site-typography) */

.np-case-page .np-skip {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.np-case-page .np-skip:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 10050;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: #fff;
  border: 2px solid #00abcd;
  color: #333;
  clip: auto;
  overflow: visible;
  font-weight: 700;
  text-decoration: none;
}

/*
 * Single source of truth for in-page motion: scrollIntoView / scrollTo with
 * behavior: auto follows this on the root scrollport (CSS Scroll Behavior).
 * prefers-reduced-motion overrides below — no parallel easing in JS.
 */
@media (prefers-reduced-motion: no-preference) {
  html:has(body.np-case-page) {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:has(body.np-case-page) {
    scroll-behavior: auto;
  }
}

/* Full-width intro — anchors sidebar + main (not a nav bar) */
.np-page-masthead {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 0;
}

.np-page-masthead-accent {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #00abcd 0%, #5bd9ee 55%, #00abcd 100%);
}

.np-page-masthead-inner {
  padding-top: 1.15rem;
  padding-bottom: 1.1rem;
}

.np-page-masthead-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
}

.np-page-masthead-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #222;
  line-height: 1.2;
}

.np-page-masthead-subtitle {
  margin: 0;
  font-size: 0.9375rem;
  color: #555;
  font-weight: 500;
  line-height: 1.45;
}

.np-page-masthead-brand {
  color: #00abcd;
  font-weight: 700;
}

/*
 * Scroll targets: TOC ids sit on section roots / gallery groups so lettered
 * headings stay visible (not only the card below an h4).
 */
.np-case-page section[id],
.np-case-page main [id],
.np-case-page .np-gallery-group[id^="np-shot-"] {
  scroll-margin-block-start: clamp(1rem, 3.5vw, 2.25rem);
  scroll-margin-block-end: 0.75rem;
}

.np-case-wrap {
  padding-bottom: 20px;
}

/*
 * Bootstrap 3 .container uses fixed widths at breakpoints (750 / 970 / 1170).
 * Narrow parents can make nested .containers overflow horizontally.
 */
.np-case-page .np-doc-body .container {
  width: 100% !important;
  max-width: 100%;
}

.np-case-page .np-doc-body .container.np-case-wrap {
  width: 100% !important;
  max-width: 100%;
}

.np-case-page .np-doc-frame.container {
  box-sizing: border-box;
}

.np-case-page .np-doc-body img {
  max-width: 100%;
  height: auto;
}

/* Sticky sidebar + primary column */
.np-doc-frame {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding-top: 1.35rem;
  padding-bottom: 2rem;
}

.np-doc-body {
  flex: 1;
  min-width: 0;
}

.np-toc-rail {
  flex: 0 0 228px;
  width: 228px;
  position: sticky;
  top: 12px;
  align-self: flex-start;
  z-index: 7;
  max-height: calc(100vh - 24px);
}

.np-toc-details {
  margin: 0;
  border: 0;
  padding: 0;
}

.np-toc-summary {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.02em;
  padding: 11px 14px;
  margin: 0 -4px 0 -4px;
  border-radius: 3px;
  border: 1px solid #e0e0e0;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.np-toc-summary::-webkit-details-marker {
  display: none;
}

.np-toc-summary-label::after {
  content: "▾";
  float: right;
  margin-left: 8px;
  font-size: 12px;
  color: #888;
  transition: transform 0.2s ease;
}

.np-toc-details[open] .np-toc-summary-label::after {
  transform: rotate(-180deg);
}

.np-toc-scroll {
  padding-top: 6px;
  max-height: calc(100vh - 40px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.np-toc-scroll::-webkit-scrollbar {
  width: 6px;
}

.np-toc-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 6px;
}

.np-toc-nav .np-toc-root {
  list-style: none;
  margin: 0;
  padding: 0;
}

.np-toc-nav li {
  margin-bottom: 6px;
}

.np-toc-sub {
  list-style: none;
  margin: 6px 0 10px;
  padding: 0 0 0 10px;
  border-left: 2px solid #ebebeb;
}

.np-toc-sub li {
  margin-bottom: 4px;
}

.np-toc-nav a {
  font-size: 13px;
  font-weight: 600;
  color: #6d6d6d;
  display: block;
  padding: 4px 0 4px 10px;
  border-left: 2px solid transparent;
  margin-left: -2px;
  border-radius: 2px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.np-toc-sub a {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 0 2px 6px;
  border-left: 2px solid transparent;
  margin-left: -2px;
}

.np-toc-nav a:hover,
.np-toc-nav a:focus {
  color: #00abcd;
  text-decoration: none;
  border-left-color: rgba(0, 171, 205, 0.35);
  background: rgba(0, 171, 205, 0.05);
}

.np-toc-nav a.is-active {
  color: #009eb8;
  border-left-color: #00abcd;
  background: rgba(0, 171, 205, 0.08);
}

@media (max-width: 767px) {
  .np-doc-frame {
    flex-direction: column;
    gap: 0;
    padding-top: 0.65rem;
  }

  .np-toc-rail {
    flex: none;
    width: 100%;
    max-height: none;
    top: 0;
    padding-bottom: 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid #ececec;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .np-toc-summary {
    display: flex;
  }

  .np-toc-scroll {
    max-height: min(65vh, 480px);
    padding-top: 8px;
    padding-right: 4px;
  }
}

@media (min-width: 768px) {
  .np-toc-summary {
    display: none !important;
  }

  /* Long TOC: let the page scroll — avoid nested overflow here (wheel/focus fights main column). */
  .np-toc-rail {
    max-height: none;
  }

  .np-toc-details > .np-toc-scroll {
    padding-top: 4px;
    max-height: none;
    overflow-x: visible;
    overflow-y: visible;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .np-toc-summary-label::after {
    transition: none;
  }

  .np-toc-nav a {
    transition: none;
  }
}

/* Hero / intro body copy inside white bands */
.np-case-page .np-lead {
  font-size: 1.2rem;
  line-height: 1.65;
  color: #555;
  margin-bottom: 16px;
}

.np-case-page .np-support {
  color: #666;
  margin-bottom: 20px;
}

.np-case-page .np-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.np-case-page .np-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 999px;
  color: #008fa8;
  background: rgba(0, 171, 205, 0.08);
  border: 1px solid rgba(0, 171, 205, 0.35);
}

.np-case-page .np-note {
  font-size: 14px;
  padding: 14px 16px;
  background: rgba(0, 171, 205, 0.06);
  border: 1px solid #e2e2e2;
  border-left: 4px solid #00abcd;
  border-radius: 0;
  color: #444;
}

.np-case-page .np-note strong {
  color: #333;
}

/* Section headings inside content (gallery groups) */
.np-gallery-group-title {
  font-size: 17px;
  font-weight: 700;
  color: #00abcd;
  margin: 0 0 14px;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.3;
}

.np-gallery {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.np-gallery-group {
  min-width: 0;
}

.np-cards {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Screenshot cards */
.np-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

.np-card-header {
  padding: 14px 16px 0;
}

.np-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.35;
}

.np-card-caption {
  padding: 6px 16px 14px;
  margin: 0;
  font-size: 15px;
  color: #666;
  line-height: 1.55;
}

.np-card-figure {
  margin: 0;
  background: #f3f3f3;
  position: relative;
}

.np-card-figure button.np-zoom {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}

.np-card-figure button.np-zoom:focus-visible {
  outline: 2px solid #00abcd;
  outline-offset: -2px;
}

.np-card-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.np-zoom-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #555;
  border: 1px solid #ddd;
  pointer-events: none;
}

/* Contribution: CSS Grid replaces Bootstrap float cols — aligned rows, equal-height wells */
.np-case-page .np-contribution-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 1.25rem;
  margin-top: 1.25rem;
}

@media (min-width: 992px) {
  .np-case-page .np-contribution-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

.np-case-page .np-contribution-grid .well {
  height: 100%;
  margin-bottom: 0;
  box-sizing: border-box;
}

.np-case-page .np-contribution-grid .well p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #555;
}

/* Principles: scoped h3 so global h2 styles don’t cascade oddly */
.np-principles .np-principle h3 {
  font-size: 17px;
  font-weight: 700;
  color: #00abcd;
  margin: 0 0 8px;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.35;
}

.np-principles .np-principle p {
  margin: 0;
  font-size: 15px;
  color: #666;
  line-height: 1.55;
}

.np-case-page .np-cta-row {
  margin-top: 20px;
}

.np-case-page .np-cta-row .btn {
  margin: 6px 12px 6px 0;
}

/* Fixed back-to-top — docs-style wayfinding */
.np-back-top {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 96;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: #00abcd;
  border: none;
  border-radius: 3px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.np-back-top:hover {
  filter: brightness(1.06);
  color: #fff;
}

.np-back-top:focus-visible {
  outline: 2px solid #00abcd;
  outline-offset: 3px;
}

.np-back-top .fa {
  font-size: 14px;
  line-height: 1;
}

.np-back-top-label {
  position: relative;
  top: 1px;
}

.np-back-top[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .np-back-top {
    transition: none;
  }
}

@media (min-width: 768px) {
  .np-back-top {
    right: 1.5rem;
    bottom: 1.5rem;
  }
}

/* Lightbox — light surface like site modals */
.np-lightbox {
  max-width: min(96vw, 1400px);
  width: 100%;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: #333;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
}

.np-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.np-lightbox-inner {
  padding: 12px 12px 16px;
  max-height: 90vh;
  overflow: auto;
}

.np-lightbox-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  margin-bottom: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 2px;
  border: 1px solid #ddd;
  background: #f9f9f9;
  color: #333;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
}

.np-lightbox-close:hover {
  background: #eee;
}

.np-lightbox-close:focus-visible {
  outline: 2px solid #00abcd;
  outline-offset: 2px;
}

.np-lightbox img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  border: 1px solid #e5e5e5;
}

.np-lightbox-caption {
  margin: 12px 0 0;
  font-size: 14px;
  color: #666;
}
