/* ============================================================
   Library — landing page (library/index.html) and article pages
   (library/proof-of-life.html). Builds on the Technology page's
   tokens in style.css: offwhite bands, pink accents, flywheel steps.
   ============================================================ */

/* ── Landing page ── */
.library-section {
  padding: 4rem 2rem;
  scroll-margin-top: 4.5rem; /* clear the fixed nav on #anchor jumps */
}

.library-section-alt {
  background-color: var(--color-offwhite);
}

.library-section-alt .tech-pub-empty {
  background: var(--color-white);
}

.library-section:not(.library-section-alt) .tech-pub-empty {
  background: var(--color-offwhite);
}

.library-section-div {
  max-width: 800px;
  margin: 0 auto;
}

.library-entry {
  display: block;
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.library-entry:hover {
  border-color: var(--color-pink);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.library-entry-type {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-pink);
  margin-bottom: 0.5rem;
}

.library-entry-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.library-entry-subtitle {
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

.library-entry-authors {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}

.library-entry-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.library-entry-cta {
  font-weight: 600;
  color: var(--color-pink);
}

/* ── Article: header ── */
.pol-header {
  padding: 8rem 2rem 3.5rem;
  background-color: var(--color-offwhite);
  border-bottom: 1px solid var(--color-border);
}

.pol-header-div {
  max-width: 720px;
  margin: 0 auto;
}

.pol-header .section-label a:hover {
  color: var(--color-pink);
}

.pol-title {
  margin: 0.5rem 0 1rem;
}

.pol-subtitle {
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  line-height: 1.4;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

.pol-authors {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.35rem;
}

.pol-meta {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.pol-updated {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* ── Article: body column ── */
.pol-body {
  max-width: calc(720px + 4rem); /* 720px text column + side padding, aligned with .pol-header-div */
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--color-text-secondary);
}

.pol-body h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  color: var(--color-text-primary);
  margin: 3.5rem 0 1rem;
  scroll-margin-top: 6rem;
}

.pol-body h2:first-child {
  margin-top: 0;
}

.pol-body h3 {
  font-size: 1.25rem;
  color: var(--color-text-primary);
  margin: 2.5rem 0 0.75rem;
  scroll-margin-top: 6rem;
}

.pol-body p {
  margin-bottom: 1.1rem;
}

.pol-body strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.pol-body ul {
  list-style: disc;
  padding-left: 1.4rem;
  margin: 0 0 1.25rem;
}

.pol-body ul ul {
  list-style: circle;
  margin: 0.5rem 0 0.5rem;
}

.pol-body li {
  margin-bottom: 0.5rem;
}

.pol-body li > p {
  margin: 0.5rem 0 0;
}

.pol-body a {
  color: var(--color-pink);
}

.pol-body a:hover {
  color: var(--color-pink-hover);
  text-decoration: underline;
}

/* Citations: superscript links to #ref-n */
.pol-cite {
  font-size: 0.7em;
  line-height: 0;
  margin-left: 0.1em;
  white-space: nowrap;
}

.pol-cite a {
  font-weight: 600;
}

/* ── Wide elements break out of the text column ── */
.pol-wide {
  width: min(960px, calc(100vw - 2rem));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* ── Tables ── */
.pol-table-wrap {
  margin: 1.75rem 0 2.25rem;
}

.pol-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.pol-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--color-offwhite);
  border-bottom: 2px solid var(--color-border);
  color: var(--color-text-primary);
  font-weight: 600;
}

.pol-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.pol-table td:first-child {
  width: 22%;
}

/* On phones each row becomes a card; data-label supplies the column name. */
@media (max-width: 700px) {
  .pol-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .pol-table,
  .pol-table tbody,
  .pol-table tr,
  .pol-table td {
    display: block;
    width: 100%;
  }

  .pol-table tr {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
  }

  .pol-table td,
  .pol-table td:first-child {
    width: 100%;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-offwhite);
  }

  .pol-table td:last-child {
    border-bottom: none;
  }

  .pol-table td:first-child {
    font-size: 1.0625rem;
  }

  .pol-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.15rem;
  }
}

/* ── Attestation pipeline: Data Flywheel steps, as a vertical timeline ── */
.pol-pipeline {
  list-style: none;
  margin: 2rem 0 1rem;
  padding: 1.5rem;
  background: var(--color-offwhite);
  border-radius: 8px;
  counter-reset: none;
}

.pol-step {
  position: relative;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 1rem;
  margin: 0;
  padding-bottom: 1.25rem;
}

.pol-step:last-child {
  padding-bottom: 0;
}

/* Connector line between the numbered circles */
.pol-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1rem - 1px);
  top: 2.25rem;
  bottom: 0.25rem;
  width: 2px;
  background: var(--color-border);
}

.pol-step .flywheel-step-number {
  margin: 1.25rem 0 0;
  position: relative;
  z-index: 1;
}

.pol-step-body {
  background: var(--color-white);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  font-size: 1rem;
}

.pol-step-body .flywheel-step-label {
  margin: 0 0 0.5rem;
}

.pol-step-body p:last-child,
.pol-step-body ul:last-child {
  margin-bottom: 0;
}

@media (max-width: 500px) {
  .pol-pipeline {
    padding: 1rem;
  }

  .pol-step {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .pol-step:not(:last-child)::after {
    display: none;
  }

  .pol-step .flywheel-step-number {
    margin: 0 0 -1rem 1rem;
  }

  .pol-step-body {
    padding-top: 1.75rem;
  }
}

/* ── Calls to action ── */
.pol-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 1.5rem;
}

.pol-body .pol-cta-row .primary-cta {
  color: var(--color-white);
  text-decoration: none;
}

.pol-cta-link {
  font-weight: 600;
}

/* ── References ── */
.pol-references {
  padding-left: 1.75rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.pol-references li {
  margin-bottom: 0.75rem;
  padding-left: 0.25rem;
  scroll-margin-top: 6rem;
}

.pol-references a {
  overflow-wrap: anywhere;
}

/* Highlight a reference when reached from a citation */
.pol-references li:target {
  background: var(--color-light-pink-bg);
  border-radius: 4px;
  outline: 4px solid var(--color-light-pink-bg);
}

.pol-colophon {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

@media (max-width: 600px) {
  .pol-header {
    padding: 6.5rem 1.25rem 2.5rem;
  }

  .pol-body {
    padding: 2.5rem 1.25rem 4rem;
    font-size: 1rem;
  }
}
