/* app-page.css supplies the outer shell and h1; case articles use a paper sheet. */
.case-page {
  --case-section-gap: 80px;
  --case-subsection-gap: 40px;
  --case-paragraph-gap: 20px;
  --case-muted: #626560;
  --case-border: rgba(32, 35, 32, 0.16);

  overflow-wrap: anywhere;
}

.case-paper {
  width: 100%;
  max-width: 230mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 24mm 22mm;
  border: 1px solid #deded8;
  border-radius: 6px;
  background: var(--color-background);
  box-shadow: 0 6px 28px rgb(32 35 32 / 10%);
}

.case-paper .case-pill-row,
.case-paper .case-pill {
  display: none;
}

.case-page a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.case-page a:hover {
  text-decoration-thickness: 2px;
}

.case-page a:focus-visible,
.case-page button:focus-visible,
.case-page summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.case-page [id] {
  scroll-margin-top: 100px;
}

.case-hero {
  margin-bottom: var(--case-section-gap);
}

.case-deck {
  margin: 24px 0 0;
  font-size: 18px;
  line-height: 1.6;
}

.case-meta {
  margin: 24px 0 0;
  color: var(--case-muted);
  font-size: 13px;
  line-height: 1.6;
}

.case-meta cite {
  font-style: normal;
}

.case-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.case-pill {
  display: inline-block;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--case-border);
  border-radius: 999px;
  background: var(--color-background);
  font-size: 12px;
  line-height: 1.5;
}

.case-section + .case-section {
  margin-top: var(--case-section-gap);
}

.case-body {
  line-height: 1.75;
}

.case-body h2 {
  margin: 0 0 24px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.case-body h3 {
  margin: var(--case-subsection-gap) 0 16px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.case-body p,
.case-body ul,
.case-body ol,
.case-body blockquote {
  margin: var(--case-paragraph-gap) 0;
}

.case-body ul,
.case-body ol {
  padding-left: 24px;
}

.case-body li + li {
  margin-top: 8px;
}

.case-body blockquote {
  padding-left: 24px;
}

.case-body strong {
  font-weight: 600;
}

.case-media {
  max-width: 625px;
  margin: 32px auto;
}

.case-media > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.case-media-caption {
  margin-top: 12px;
  color: var(--case-muted);
  font-size: 13px;
  line-height: 1.6;
}

.case-section > :last-child {
  margin-bottom: 0;
}

.case-body .case-source-list {
  margin: 24px 0 0;
  font-size: 14px;
  line-height: 1.7;
}

.case-source-list .case-source + .case-source {
  margin-top: 24px;
}

.case-source-title {
  font-weight: 500;
}

.case-source p {
  margin: 8px 0 0;
  color: var(--case-muted);
  font-size: 13px;
}

.case-body .case-timeline {
  --case-timeline-gutter: 80px;

  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.case-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: var(--case-timeline-gutter) minmax(0, 1fr);
  padding-bottom: 36px;
}

.case-timeline .case-timeline-item + .case-timeline-item {
  margin-top: 0;
}

.case-timeline-item::before {
  position: absolute;
  top: 10px;
  bottom: -10px;
  left: var(--case-timeline-gutter);
  border-left: 1px solid var(--case-border);
  content: "";
}

.case-timeline-item:last-child {
  padding-bottom: 0;
}

.case-timeline-item:last-child::before {
  display: none;
}

.case-timeline-body {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding-left: 20px;
}

.case-timeline-body::before {
  position: absolute;
  top: 6px;
  left: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  outline: 4px solid var(--color-background);
  content: "";
}

.case-timeline-image {
  display: block;
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  width: 60px;
  height: 60px;
  margin-right: 20px;
  object-fit: contain;
}

.case-timeline-date {
  display: block;
  color: var(--case-muted);
  font-size: 13px;
  line-height: 1.5;
}

.case-body .case-timeline-text {
  margin: 8px 0 0;
  line-height: 1.65;
}

@media (max-width: 800px) {
  .case-page {
    --case-section-gap: 56px;
    --case-subsection-gap: 32px;
  }

  .case-body h2 {
    font-size: 24px;
  }

  .case-paper {
    padding: 64px 40px;
  }
}

@media (max-width: 600px) {
  .app-page.case-page {
    padding: 104px 12px 32px;
  }

  .case-paper {
    min-height: 0;
    padding: 48px 20px;
  }
}

/* Shared people and parties rows and profile dialogs. */
.case-body .case-people-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-people-list > li + li {
  margin-top: 24px;
}

.case-person {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.case-person-image {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.case-person-image--organization {
  padding: 12px;
}

.case-person-image--flag {
  padding: 4px;
}

.case-person-copy {
  display: block;
  flex: 1;
  min-width: 0;
}

.case-person-name {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
}

.case-person:hover .case-person-name {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.case-person-role {
  display: block;
  margin-top: 2px;
  color: var(--case-muted);
  font-size: 13px;
  line-height: 1.5;
}

.case-person-description {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.6;
}

.case-person-chevron {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin-top: 5px;
  opacity: 0.5;
}

.case-profile-dialog {
  width: calc(100% - 32px);
  max-width: 520px;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 40px;
  overflow: auto;
  border: 1px solid var(--case-border);
  border-radius: 6px;
  background: var(--color-background);
  color: var(--color-text);
  box-shadow: 0 12px 64px rgb(32 35 32 / 16%);
  font: inherit;
  line-height: 1.7;
}

.case-profile-dialog::backdrop {
  background: rgb(32 35 32 / 20%);
}

body:has(.case-profile-dialog[open]) {
  overflow: hidden;
}

.case-profile-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.case-profile-close:hover {
  background: rgb(32 35 32 / 5%);
}

.case-profile-portrait {
  display: block;
  width: 112px;
  height: 112px;
  margin-bottom: 24px;
  object-fit: contain;
}

.case-profile-portrait--organization {
  padding: 20px;
}

.case-profile-dialog h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.case-profile-dialog h3 {
  margin: 28px 0 8px;
  font-size: 16px;
  font-weight: 500;
}

.case-profile-dialog p {
  margin: 12px 0 0;
}

.case-profile-dialog .case-profile-role {
  margin-top: 8px;
  color: var(--case-muted);
  font-size: 13px;
}

.case-profile-dialog .case-profile-sources,
.case-profile-dialog .case-profile-credit {
  margin-top: 24px;
  color: var(--case-muted);
  font-size: 12px;
  line-height: 1.6;
}

.case-profile-dialog .case-profile-credit {
  margin-top: 12px;
}

.case-body .case-portrait-credits {
  margin-top: 32px;
  color: var(--case-muted);
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 600px) {
  .case-person {
    gap: 16px;
  }

  .case-person-image {
    flex-basis: 60px;
    width: 60px;
    height: 60px;
  }

  .case-person-image--organization {
    padding: 8px;
  }

  .case-person-chevron {
    display: none;
  }

  .case-profile-dialog {
    padding: 32px 24px;
  }
}

.case-body a.case-person {
  color: inherit;
  text-decoration: none;
}

.case-body a.case-person:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 6px;
}

/* The Microsoft case's compact courtroom infographic. */
.courtroom {
  padding: 24px 0 8px;
  text-align: center;
}

.case-body .courtroom-label {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--case-muted);
}

.courtroom-bench {
  width: fit-content;
  margin: 0 auto;
  position: relative;
  padding: 0 28px 80px;
  max-width: 100%;
}

.courtroom-judges {
  display: flex;
  justify-content: center;
  gap: 28px;
}

.courtroom-person {
  display: inline-grid;
  place-items: center;
  width: 112px;
  height: 112px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}

.courtroom-person img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.courtroom-person:hover {
  background: #f5f7fa;
  border-color: var(--case-border);
}

.courtroom-person:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.case-body .courtroom-stage {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--case-muted);
}

.courtroom-sides {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  margin: 48px auto 0;
}

.courtroom-versus {
  color: var(--case-muted);
  font-size: 20px;
}

.case-body .courtroom-hint {
  margin: 28px 0 0;
  color: var(--case-muted);
  font-size: 12px;
}

@media (max-width: 480px) {
  .courtroom-bench { padding-inline: 8px; }
  .courtroom-judges { gap: 16px; }
  .courtroom-sides { gap: 8px; }
}

/* A raised, paneled bench and two separate counsel tables. */
.courtroom-bench::before {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 4px;
  right: 4px;
  height: 48px;
  border: 1px solid #8f918e;
  border-radius: 2px;
  background: #e8e9e6;
  box-shadow: inset 0 0 0 7px #f4f4f1, inset 0 0 0 8px #c4c6c0, 0 9px 0 -2px #dedfda;
  pointer-events: none;
}

.courtroom-bench::after {
  content: "";
  position: absolute;
  bottom: 58px;
  left: 0;
  right: 0;
  height: 9px;
  border: 1px solid #777b74;
  border-radius: 2px;
  background: #f4f4f1;
  box-shadow: 0 3px 0 #b5b8b0;
  pointer-events: none;
}

/* Portraits sit behind the bench; stage labels sit on its front panel. */
.courtroom-bench {
  padding-bottom: 16px;
}

.courtroom-bench::before {
  z-index: 1;
}

.courtroom-bench::after {
  z-index: 2;
}

.courtroom-judges > div {
  position: relative;
}

.courtroom-judges .courtroom-person {
  padding-bottom: 0;
  align-items: end;
  transform: translateY(-10px);
}

.case-body .courtroom-stage {
  position: relative;
  z-index: 3;
  margin: 0;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--color-text);
}

/* Separate benches distinguish successive judicial stages. */
.courtroom-bench::before,
.courtroom-bench::after {
  content: none;
}

.courtroom-judges {
  gap: 24px;
}

.courtroom-judges > div {
  width: 132px;
  padding-bottom: 8px;
}

.courtroom-judges > div::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 3px;
  right: 3px;
  bottom: 0;
  height: 52px;
  border: 1px solid #8f918e;
  border-radius: 2px;
  background: #e8e9e6;
  box-shadow: inset 0 0 0 5px #f4f4f1, inset 0 0 0 6px #c4c6c0;
  pointer-events: none;
}

.courtroom-judges > div::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 52px;
  height: 8px;
  border: 1px solid #777b74;
  border-radius: 2px;
  background: #f4f4f1;
  pointer-events: none;
}

.case-body .courtroom-stage {
  height: 46px;
  align-content: center;
  line-height: 1.4;
}

.courtroom-stage span {
  display: block;
  font-size: 10px;
  color: var(--case-muted);
}

@media (max-width: 380px) {
  .courtroom-bench { padding-inline: 0; }
  .courtroom-judges { gap: 12px; }
  .courtroom-judges > div { width: 116px; }
}


.case-body .courtroom-sides .courtroom-label {
  margin: 12px 0 0;
}

/* Each image and its label or bench form one native button. */
.courtroom-sides .courtroom-person {
  height: auto;
  font: inherit;
  color: inherit;
}

.courtroom-judges .courtroom-person {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: auto;
  padding: 12px 0 8px;
  transform: none;
  font: inherit;
  color: inherit;
}

.courtroom-judges .courtroom-person img {
  margin-bottom: 10px;
}

.courtroom-judges > div {
  padding-bottom: 0;
}

.courtroom-judges .courtroom-person:hover {
  background: transparent;
}

.case-body .courtroom-sides .courtroom-label {
  display: block;
}

/* Preview framing only: article typography stays identical to the full document. */
.case-preview-document,
.case-preview-document body {
  overflow: hidden;
}
.case-preview-document .app-page {
  padding: 0;
}
