/* PersonaScope 5.0 Phase 2: library completion */

/* Keep the page exactly where it was while a long article is open. */
html.library-scroll-locked,
body.library-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

/* The two foundation articles stay visible instead of being buried in the full list. */
.library-foundation-card {
  margin: 0 0 16px;
  padding: 18px;
  border: 1px solid rgba(115, 210, 199, .24);
  border-radius: 21px;
  background:
    radial-gradient(circle at 100% 0, rgba(94, 215, 200, .10), transparent 42%),
    linear-gradient(145deg, rgba(13, 35, 59, .94), rgba(8, 24, 43, .92));
  box-shadow: 0 18px 48px rgba(0, 0, 0, .14);
}
.library-foundation-heading {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 14px;
}
.library-foundation-heading h2 {
  margin: 4px 0 7px;
  font-size: clamp(19px, 5vw, 24px);
  line-height: 1.4;
}
.library-foundation-heading p {
  margin: 0;
  color: #adbbcf;
  font-size: 12px;
  line-height: 1.75;
}
.library-foundation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.library-foundation-grid button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 82px;
  padding: 13px 14px;
  border: 1px solid rgba(145, 205, 255, .17);
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.library-foundation-grid button:hover,
.library-foundation-grid button:focus-visible {
  border-color: rgba(107, 225, 211, .50);
  background: rgba(107, 225, 211, .08);
}
.library-foundation-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(104, 225, 211, .11);
  color: #82e9dc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}
.library-foundation-grid b,
.library-foundation-grid small {
  display: block;
}
.library-foundation-grid b {
  color: #f3f7ff;
  font-size: 13px;
  line-height: 1.5;
}
.library-foundation-grid small {
  margin-top: 3px;
  color: #91a4bd;
  font-size: 9px;
  line-height: 1.45;
}
.library-foundation-grid i {
  color: #7de1d7;
  font-size: 24px;
  font-style: normal;
}

/* Editorial articles read as one continuous piece. */
.library-editorial-signature {
  margin: 1.9em 0 0;
  padding: 0;
  border-top: 0;
  text-align: left;
}
.library-editorial-signature p {
  margin: 0;
  color: #d9e5f2;
  line-height: 1.9;
}
.library-editorial-signature strong {
  display: inline;
  margin-left: .25em;
  color: #f0f5fb;
  font-size: inherit;
  letter-spacing: .06em;
}
.library-editorial-signature + .library-sources {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .10);
}

/* Long article behavior on mobile and when moving through related articles. */
.library-dialog {
  overscroll-behavior: contain;
  scroll-behavior: auto;
  scrollbar-gutter: stable;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
.library-dialog-actions {
  z-index: 3;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.library-related-section h3 {
  margin-bottom: 11px;
}

@media (max-width: 680px) {
  .library-foundation-card {
    padding: 15px;
    border-radius: 18px;
  }
  .library-foundation-grid {
    grid-template-columns: 1fr;
  }
  .library-foundation-grid button {
    min-height: 72px;
  }
  .library-editorial-signature {
    margin-top: 1.8em;
  }
  .library-dialog {
    max-height: calc(100dvh - 26px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .library-foundation-grid button {
    transition: none !important;
  }
}


/* Screen changes focus the heading for accessibility; do not draw a false white frame around the title. */
.screen > .section-heading h1[tabindex="-1"]:focus,
.screen > .section-heading h1:focus {
  outline: none;
}
