/*
 * The staff legal pages (#3819; redesign #2911 T125, #3842, board S8): the frame round ClinicalMassage.UI's shared,
 * counsel-approved documents. Signed in they sit in the shell; signed out in the _SignedOutLayout wide card. The
 * document's markup is the client portal's and may not change, so everything here is scoped to .pw-legal-document.
 * The contents is not fixed while scrolling: that waits on design § Proposed 4 (LegalPageStylesTests).
 */
.pw-legal {
  container-type: inline-size;
  color: var(--pw-ink);
  font-family: var(--pw-font-body);
}
.pw-legal__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--pw-space-3);
  margin-bottom: var(--pw-space-3);
}
.pw-legal__eyebrow { margin: 0; font-size: var(--pw-fs-13); color: var(--pw-muted); }
.pw-legal__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pw-space-3); }
.pw-legal__actions .pw-chip { white-space: normal; }

/* The tabs are links between the three pages, so the open one is aria-current rather than aria-selected. */
.pw-legal__tabs { margin: 0 0 var(--pw-space-5); }
.pw-legal__tabs .pw-tabs__tab { display: inline-flex; align-items: center; text-decoration: none; }
.pw-legal__tabs .pw-tabs__tab[aria-current="page"] { border-bottom-color: var(--pw-action); color: var(--pw-navy); font-weight: 700; }

.pw-legal__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--pw-space-5); }
@container (min-width: 880px) {
  .pw-legal__layout { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
}

.pw-legal__contents {
  padding: var(--pw-space-4);
  border: 1px solid var(--pw-line);
  border-radius: var(--pw-radius-card-md);
  background: var(--pw-white);
}
.pw-legal__contents-title {
  margin: 0 0 var(--pw-space-2);
  font-size: var(--pw-fs-12);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pw-label);
}
.pw-legal__contents-list { margin: 0; padding: 0; list-style: none; }
.pw-legal__contents-list li { margin: var(--pw-space-1) 0; }
.pw-legal__contents-list a { color: var(--pw-action); font-size: var(--pw-fs-15); overflow-wrap: anywhere; }
.pw-legal__contents-list .pw-legal__contents-sub { padding-left: var(--pw-space-4); }
.pw-legal__contents-list .pw-legal__contents-sub a { font-size: var(--pw-fs-13); }

.pw-legal-document {
  min-width: 0;
  padding: var(--pw-space-5);
  border: 1px solid var(--pw-line);
  border-radius: var(--pw-radius-card-md);
  background: var(--pw-white);
  overflow-wrap: anywhere;
  line-height: 1.65;
}

/* The client portal's hero banner (an inline gradient round the title) is dropped: the title and date stay, as text. */
.pw-legal-document > section:first-child {
  background: none !important;
  color: inherit !important;
  padding: 0 0 var(--pw-space-3) !important;
}
.pw-legal-document > section:first-child h1 {
  margin: 0 0 var(--pw-space-1);
  font-family: var(--pw-font-heading);
  font-size: var(--pw-fs-28);
  font-weight: 700;
  line-height: 1.25;
  color: var(--pw-navy);
}
.pw-legal-document > section:first-child p { font-size: var(--pw-fs-13); color: var(--pw-muted); opacity: 1 !important; }

/* The portal's card padding (inline) would double the frame's. */
.pw-legal-document .feature-card { padding: 0 !important; }
.pw-legal-document h2,
.pw-legal-document h3 {
  font-family: var(--pw-font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--pw-navy);
  scroll-margin-top: var(--pw-space-5);
}
/* In the shell a contents link must land below the sticky 64 px header, not under it. */
.pw-shell .pw-legal-document h2,
.pw-shell .pw-legal-document h3 { scroll-margin-top: calc(64px + var(--pw-space-5)); }
.pw-legal-document h2 { margin: var(--pw-space-5) 0 var(--pw-space-3); font-size: var(--pw-fs-22); }
.pw-legal-document h3 { margin: var(--pw-space-4) 0 var(--pw-space-2); font-size: var(--pw-fs-17); }
.pw-legal-document p { margin: 0 0 var(--pw-space-3); }
.pw-legal-document ul,
.pw-legal-document ol { margin: 0 0 var(--pw-space-3); padding-left: var(--pw-space-5); }
.pw-legal-document a { color: var(--pw-action); }

/* Signed out, the wide card is already the frame. */
.pw-signed-out__card .pw-legal-document { padding: 0; border: 0; }

@media print {
  .pw-sidebar,
  .pw-header,
  .pw-skip-link,
  .pw-signed-out__mark,
  .pw-signed-out__legal,
  .pw-legal__tabs,
  .pw-legal__contents,
  [data-pw-legal-print] { display: none !important; }
  .pw-shell__content { padding: 0; }
  .pw-signed-out__card { max-width: none; padding: 0; border: 0; box-shadow: none; }
  .pw-legal__layout { display: block; }
  .pw-legal-document { padding: 0; border: 0; }
}
