/* BD AI Solutions: styles for the policy pages and the footer Policies column.
   Loaded after styles.css and built from its tokens. */

/* ==========================================================================
   Policies: the Policies page and the four policy documents.
   Layout idea: each document reads in one calm column near 65 characters
   wide. Its numbered list of sections stays beside it on wide screens and
   folds above it on phones.
   ========================================================================== */

/* Hero: facts line and the switch between the four documents */
.policy-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--band-muted);
}
.policy-facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.policy-facts li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.policy-facts .ph {
  text-transform: none;
  letter-spacing: 0;
}
.policy-switch a[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* Blanks still to be filled in before launch */
.policy-doc .ph,
.policy-facts .ph,
.policy-card .ph {
  border: 1px dashed var(--line-strong);
  white-space: nowrap;
}
.policy-doc .ph-note {
  white-space: normal;
}

/* Document layout */
.policy-body {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3.5rem, 8vw, 6rem);
}
.policy-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

/* List of sections */
.policy-toc {
  position: sticky;
  top: calc(var(--header-h) + 1.25rem);
  max-height: calc(100vh - var(--header-h) - 2.5rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding-block: 0.375rem;
}
.policy-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  list-style: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.policy-toc summary::-webkit-details-marker {
  display: none;
}
.policy-toc summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}
.policy-toc[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}
.policy-toc ol {
  list-style: none;
  margin: 0;
  padding: 0 0 0.375rem;
}
.policy-toc a {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.25rem;
  padding: 0.45rem 1rem 0.45rem 0.875rem;
  border-left: 3px solid transparent;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.35;
}
.policy-toc a:hover {
  color: var(--fg);
  background: var(--surface-2);
}
.policy-toc a[aria-current="true"] {
  color: var(--fg);
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.toc-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-ink);
  padding-top: 0.1rem;
}

/* Document text */
.policy-doc {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 44rem;
  min-width: 0;
}
.policy-doc [id] {
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
}
.policy-intro {
  font-size: var(--fs-lead);
  line-height: 1.55;
}
.policy-sec {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: clamp(1.25rem, 3vw, 2rem);
  padding-top: clamp(1.75rem, 3.5vw, 2.5rem);
  border-top: 1px solid var(--line);
}
.policy-sec h2 {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.2;
}
.sec-num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--accent-ink);
}
.clause {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0.25rem 0.75rem;
  align-items: baseline;
}
.clause-num {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-ink);
}
.policy-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0;
  padding-left: 1.75rem;
}
.policy-list > li {
  padding-left: 0.4rem;
}
.policy-list > li::marker {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--accent-ink);
}
.clause + .policy-list {
  margin-left: 4rem;
}
.conspicuous {
  padding: 1.25rem 1.375rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  line-height: 1.55;
}
.back-top {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* Tables: two columns on wide screens, one block per row on phones */
.policy-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.policy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}
.policy-table th,
.policy-table td {
  padding: 0.9rem 1.125rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.policy-table thead th {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--surface-2);
}
.policy-table tbody th {
  width: 36%;
  font-family: var(--font-display);
  font-weight: 600;
}
.policy-table tbody tr:last-child > * {
  border-bottom: 0;
}
.topic-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.topic-wrap {
  max-width: 60rem;
}

/* Policy cards on the Policies page and below each document */
.policy-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
}
.policy-cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.policy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 1.875rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.section-alt .policy-card {
  background: var(--bg);
}
.policy-card:hover {
  border-color: color-mix(in srgb, var(--accent-ink) 70%, var(--line));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.policy-card h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  line-height: 1.2;
}
.policy-card h3 a {
  color: inherit;
  text-decoration: none;
}
.policy-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}
.policy-card > p:not(.card-tag) {
  color: var(--fg-muted);
}
.policy-card .ref-meta {
  font-size: var(--fs-small);
}
.policy-card .ref-meta div {
  grid-template-columns: 7.5rem minmax(0, 1fr);
}
.policy-card .link-arrow {
  margin-top: auto;
}
.policy-card .link-arrow span {
  display: inline-block;
  transition: transform 0.2s ease;
}
.policy-card:hover .link-arrow span {
  transform: translateX(4px);
}

/* Footer: Policies column, accessibility help link, and the terms notice */
@media (min-width: 1181px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.2fr) repeat(4, minmax(0, 0.75fr));
    gap: 2rem 2.5rem;
  }
}
@media (min-width: 861px) and (max-width: 1180px) {
  .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
.footer-col a {
  line-height: 1.3;
  padding-block: 0.35rem;
}
.footer-col .a11y-link {
  margin-top: 0.375rem;
  color: var(--band-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-notice {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--band-line);
  color: var(--band-muted);
  font-size: var(--fs-small);
}
.footer-notice a {
  color: var(--band-fg);
  text-underline-offset: 3px;
}
.footer-notice + .footer-base {
  margin-top: 0.75rem;
  padding-top: 0;
  border-top: 0;
}

@media (max-width: 1023px) {
  .policy-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .policy-toc {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .policy-doc {
    max-width: none;
  }
  .policy-cards-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .policy-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .policy-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .policy-table,
  .policy-table tbody,
  .policy-table tr,
  .policy-table th,
  .policy-table td {
    display: block;
    width: auto;
  }
  .policy-table tr {
    padding: 0.9rem 1.125rem;
    border-bottom: 1px solid var(--line);
  }
  .policy-table tbody tr:last-child {
    border-bottom: 0;
  }
  .policy-table tbody th,
  .policy-table td {
    padding: 0;
    border-bottom: 0;
  }
  .policy-table tbody th {
    width: auto;
    margin-bottom: 0.375rem;
  }
  .policy-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.2rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-muted);
  }
}
@media (max-width: 560px) {
  .clause {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.125rem;
  }
  .clause + .policy-list {
    margin-left: 0;
  }
}

/* Printing a policy: just the document, dark text on white */
@media print {
  .policy-page .site-header,
  .policy-page .site-footer,
  .policy-page .skip-link,
  .policy-page .page-hero-dots,
  .policy-page .breadcrumb,
  .policy-page .policy-switch-nav,
  .policy-page .policy-toc,
  .policy-page .back-top,
  .policy-page .policy-more,
  .policy-page .cta-band {
    display: none !important;
  }
  .policy-page,
  .policy-page .band,
  .policy-page .section-alt,
  .policy-page .policy-card,
  .policy-page .policy-table-wrap,
  .policy-page .policy-table thead th,
  .policy-page .conspicuous {
    background: #fff !important;
  }
  .policy-page,
  .policy-page * {
    color: #000 !important;
    box-shadow: none !important;
  }
  .policy-page .page-hero {
    padding-block: 0 1rem;
  }
  .policy-page .policy-body {
    padding-block: 0;
  }
  .policy-page .policy-layout {
    display: block;
  }
  .policy-page .policy-sec h2 {
    break-after: avoid;
  }
  .policy-page .policy-doc a {
    text-decoration: none;
  }
  .policy-page .ph {
    background: none !important;
    border: 1px solid #000 !important;
  }
}
