/* Only FAQ and Security opt in. Reuse the curated composition layer so the
   chapter state stays legible above legacy theme overrides. */
@layer printpass-curated-sections {
  [data-pa-chapter-navigation] {
    --pa-chapter-top: 8rem;
  }

  [data-pa-chapter-navigation] [data-pa-chapter-content] :is(section[id], details[id]) {
    scroll-margin-top: var(--pa-chapter-top) !important;
  }

  [data-pa-chapter-navigation] [data-pa-chapter-index] a {
    border-radius: .5rem;
  }

  [data-pa-chapter-navigation] [data-pa-chapter-index] a[aria-current="location"] {
    background: var(--cur-accent, #087c84) !important;
    color: var(--cur-on-accent, #fff) !important;
    border-color: var(--cur-accent, #087c84) !important;
  }

  [data-pa-chapter-navigation] [data-pa-chapter-index] a[aria-current="location"] :is(span, b),
  [data-pa-chapter-navigation] [data-pa-chapter-index] a[aria-current="location"]::before {
    color: inherit !important;
    background: transparent !important;
  }

  .pa-security-chapter-rail [data-pa-chapter-index] a {
    padding-inline: .75rem !important;
  }

  /* This summary sits after, not inside, the sticky reading region. Pin its
     dark surface and foreground together instead of inheriting a pale fill. */
  .pa-curated-security > .pa-security-glance {
    background: #0d2631 !important;
    color: #d5e5e5 !important;
  }

  .pa-curated-security > .pa-security-glance :is(h2, li, span) {
    color: #edf7fa !important;
    background: transparent !important;
  }

  .pa-curated-security > .pa-security-glance .pa-security-glance__heading {
    background: transparent !important;
  }

  .pa-curated-security > .pa-security-glance :is(i, .pa-security-policy-links a),
  .pa-curated-security > .pa-security-glance i::before {
    color: #8fe8e4 !important;
    background: transparent !important;
  }

  @media (min-width: 992px) {
    [data-pa-chapter-navigation] [data-pa-chapter-rail] {
      position: sticky !important;
      top: var(--pa-chapter-top) !important;
      align-self: start !important;
      max-height: calc(100dvh - var(--pa-chapter-top) - 1rem) !important;
      overflow-y: auto;
      overscroll-behavior-y: contain;
      scrollbar-width: thin;
      scroll-padding-block: .5rem;
    }
  }

  @media (max-width: 991.98px) {
    [data-pa-chapter-navigation] [data-pa-chapter-rail] {
      position: static !important;
      max-height: none !important;
      overflow: visible;
    }
  }
}
