/* =====================================================================
   Referral review example: the packet in, the must-knows out.

   One block of markup (the drawn packet, the review sheet as a figure, and
   three plain points) is copied unchanged into every page that shows it:
   index, demo, products/admit-score, referral-packet-review-software,
   snf-admissions-software, medicare-advantage-authorization and
   high-cost-medication-review-snf-admissions. The site has no includes, so
   tests/marketing-markup.test.js keeps the copies identical.

   The example is the made-up 6-page packet from /admitscore-sample-report, so
   every line on the sheet can be checked against the product's own screen.
   Theme tokens come from home-premium.css (.admit-home) and site-premium.css
   (.vs-premium); the fallbacks match their values. Live text, not a
   screenshot, so it stays sharp at every width. No pills, glows or motion.
   ===================================================================== */

.packet-flow,
.packet-before,
.review-figure,
.packet-points {
  --pf-ink: var(--ink, #0c1d31);
  --pf-text: var(--text, #1e293b);
  --pf-muted: var(--muted, #5b6676);
  --pf-line: var(--line, #dce1e8);
  --pf-paper: var(--paper, #f5f7fa);
  --pf-accent: var(--accent-ink, #1d3762);
  --pf-teal: var(--accent-2, #0f766e);
  --pf-edge: #c3cbd6;
}

/* Page-wide paragraph and list rules stay out of the example. Zero specificity, so the
   component rules below still set their own spacing. */
:where(.review-sheet, .packet-before) p,
:where(.packet-points) li {
  max-width: none;
  margin: 0;
}

/* ---------- the hospital packet (a drawing) ---------- */
.packet-before {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.125rem;
}
.packet-before__label {
  flex: 1;
  min-width: 0;
  color: var(--pf-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}
.packet-before__label strong {
  display: block;
  color: var(--pf-ink);
  font-size: 1rem;
  font-weight: 600;
}

/* Six sheets of paper: the front page, with five page edges behind it. */
.packet-stack {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 52px;
  height: 66px;
  padding: 8px 7px;
  background: #fff;
  border: 1px solid #aeb8c5;
  border-radius: 2px;
  box-shadow:
    3px 3px 0 -1px #fff,
    3px 3px 0 0 var(--pf-edge),
    6px 6px 0 -1px #fff,
    6px 6px 0 0 var(--pf-edge),
    9px 9px 0 -1px #fff,
    9px 9px 0 0 var(--pf-edge);
}
.packet-stack__title,
.packet-stack__foot {
  display: none;
}
.packet-stack__lines {
  flex: 1;
  /* Text lines: a 3px bar every 7px, two of them tinted teal (facts found). */
  background:
    linear-gradient(rgba(15, 118, 110, 0.38), rgba(15, 118, 110, 0.38)) 0 7px / 80% 3px no-repeat,
    linear-gradient(rgba(15, 118, 110, 0.38), rgba(15, 118, 110, 0.38)) 0 28px / 64% 3px no-repeat,
    repeating-linear-gradient(#dfe4ea 0 3px, transparent 3px 7px);
}

.packet-arrow {
  display: flex;
  flex-basis: 100%;
  padding-left: 15px;
  color: #8a94a3;
}
.packet-arrow svg {
  display: block;
  width: 22px;
  height: 28px;
}
.packet-arrow .packet-arrow__right {
  display: none;
}

/* ---------- the review sheet ---------- */
.review-figure {
  /* The sheet's own width picks its row layout: a hero column at 1024px is
     narrower than a phone held sideways. */
  container: review-sheet / inline-size;
  display: grid;
  gap: 0.75rem;
  margin: 0;
}
.review-figure figcaption {
  color: var(--pf-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.review-sheet {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(12, 29, 49, 0.05);
  color: var(--pf-text);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: left;
}
.pilot-hero .review-sheet {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

/* The example label is part of the sheet, so it stays on any crop or screenshot. */
.review-sheet__flag {
  padding: 0.5rem 1.125rem;
  border-bottom: 1px solid var(--pf-line);
  background: var(--pf-paper);
  color: var(--pf-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
}
/* Plain wrapping on every page: site-premium's `.vs-premium p { text-wrap: pretty }` split
   "made-up / packet" on phones. */
.review-sheet .review-sheet__flag {
  text-wrap: wrap;
}
.review-sheet__body {
  padding: 0.875rem 1.125rem 1.125rem;
}
.review-sheet__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--pf-line);
}
.review-sheet__title {
  color: var(--pf-ink);
  font-family: var(--display-font, inherit);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.review-sheet__read {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--pf-ink);
  font-weight: 600;
  white-space: nowrap;
}
.review-sheet__read svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--pf-teal);
}
.review-sheet__label {
  margin: 1rem 0 0.25rem;
  color: var(--pf-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

/* The page reference: one quiet tag per source page, never a pill. */
.review-sheet__page {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0 0.4375rem;
  border: 1px solid var(--pf-line);
  border-radius: 4px;
  background: #fff;
  color: var(--pf-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.review-sheet__page::before {
  content: '';
  flex: none;
  width: 10px;
  height: 12px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12' fill='none' stroke='black' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M1.2.9h4.9l2.7 2.7v7.5H1.2z'/%3E%3Cpath d='M6 .9v2.8h2.8M3 6.3h4M3 8.4h4'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12' fill='none' stroke='black' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M1.2.9h4.9l2.7 2.7v7.5H1.2z'/%3E%3Cpath d='M6 .9v2.8h2.8M3 6.3h4M3 8.4h4'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* Each line with a page is a native <details>: selecting it shows the packet's own words, as
   the product's screen does for every quoted item. No script. */
.review-sheet summary {
  display: block;
  margin: 0 -0.5rem;
  padding: 0 0.5rem;
  border-radius: 4px;
  list-style: none;
  cursor: pointer;
}
.review-sheet summary::-webkit-details-marker {
  display: none;
}
/* Hover tint only where a pointer can hover (it would stick after a tap on phones). */
@media (hover: hover) {
  .review-sheet summary:hover {
    background: var(--pf-paper);
  }
  .review-sheet__calls summary:hover {
    background: #eaeef3;
  }
}
.review-sheet summary:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: 1px;
}
/* A small chevron on every line that opens, so a phone visitor can see it expands in place
   (the page tag alone looked like a button that opens the PDF). It turns over when open. */
.review-sheet summary .review-sheet__row::after {
  content: '';
  grid-area: chev;
  align-self: center;
  width: 12px;
  height: 12px;
  background: var(--pf-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: transform 0.15s ease;
}
.review-sheet details[open] > summary .review-sheet__row::after {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .review-sheet summary .review-sheet__row::after {
    transition: none;
  }
}
.review-sheet details[open] .review-sheet__page {
  border-color: var(--pf-accent);
  background: var(--pf-accent);
  color: #fff;
}
.review-sheet__quote {
  margin: 0.125rem 0 0.5rem;
  padding: 0.3125rem 0.625rem;
  border-left: 2px solid var(--pf-teal);
  background: var(--pf-paper);
  color: var(--pf-text);
  font-size: 0.875rem;
  line-height: 1.45;
}
.review-sheet__calls .review-sheet__quote {
  background: #fff;
}
.review-sheet__quote span {
  color: var(--pf-muted);
  font-weight: 600;
}

/* What the packet says: topic and page on one line, the answer under them. */
.review-sheet__facts {
  margin: 0;
  padding: 0;
  list-style: none;
}
.review-sheet__facts > li {
  margin: 0;
  border-top: 1px solid var(--pf-line);
}
.review-sheet__facts > li:first-child {
  border-top: 0;
}
.review-sheet__facts .review-sheet__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    'topic page chev'
    'answer answer answer';
  align-items: baseline;
  gap: 0.125rem 0.75rem;
  padding: 0.5rem 0;
}
.review-sheet__topic {
  grid-area: topic;
  color: var(--pf-ink);
  font-weight: 600;
}
.review-sheet__answer {
  grid-area: answer;
}
.review-sheet__answer strong {
  color: var(--pf-ink);
  font-weight: 600;
}
.review-sheet__facts .review-sheet__page {
  grid-area: page;
  justify-self: end;
}

/* Pages disagree: one plain question each, with both pages, on a quiet band. */
.review-sheet__calls {
  margin: 0.25rem 0 0;
  padding: 0.125rem 0.875rem;
  list-style: none;
  counter-reset: call;
  background: var(--pf-paper);
  border: 1px solid var(--pf-line);
  border-radius: 6px;
}
.review-sheet__calls > li {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  column-gap: 0.25rem;
  margin: 0;
  counter-increment: call;
}
.review-sheet__calls > li + li {
  border-top: 1px solid var(--pf-line);
}
.review-sheet__calls > li::before {
  content: counter(call) '.';
  padding-top: 0.5rem;
  color: var(--pf-accent);
  font-weight: 600;
}
.review-sheet__calls .review-sheet__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'ask chev'
    'pages pages';
  align-items: start;
  gap: 0.3125rem 0.75rem;
  padding: 0.5rem 0;
}
.review-sheet__ask {
  grid-area: ask;
}
.review-sheet__ask strong {
  color: var(--pf-ink);
  font-weight: 600;
}
.review-sheet__pages {
  grid-area: pages;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.375rem;
}

.review-sheet__more {
  margin-top: 0.75rem;
  color: var(--pf-muted);
  font-size: 0.875rem;
}
.review-sheet__decision {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--pf-line);
}
.review-sheet__decision strong {
  color: var(--pf-ink);
  font-weight: 600;
}

/* A wide sheet puts each answer on one line with its page. */
@container review-sheet (min-width: 32.5rem) {
  .review-sheet__flag {
    padding-inline: 1.375rem;
  }
  .review-sheet__body {
    padding: 1rem 1.375rem 1.25rem;
  }
  .review-sheet__facts .review-sheet__row {
    grid-template-columns: 9.75rem minmax(0, 1fr) auto auto;
    grid-template-areas: 'topic answer page chev';
    column-gap: 1rem;
  }
  .review-sheet__facts .review-sheet__quote {
    margin-left: 10.75rem;
  }
  .review-sheet__calls .review-sheet__row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: 'ask pages chev';
    column-gap: 0.75rem;
  }
  .review-sheet__pages {
    flex-wrap: nowrap;
  }
}

/* ---------- three plain points ---------- */
.packet-points {
  display: grid;
  gap: 1.125rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.packet-points li {
  padding-left: 0.875rem;
  border-left: 3px solid var(--pf-teal);
  color: var(--pf-text);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.packet-points strong {
  display: block;
  color: var(--pf-ink);
  font-size: 1rem;
  font-weight: 600;
}

/* ---------- the packet above the sheet (phones everywhere; product heroes at every width) ---------- */
.packet-to-sheet {
  margin-top: 2rem;
}
.packet-to-sheet > .review-figure {
  margin-top: 0.75rem;
}

/* ---------- homepage: heading, big drawn packet and points on the left, sheet on the right ---------- */
.packet-flow > .packet-to-sheet {
  margin-top: 0;
}
@media (min-width: 992px) {
  .packet-flow {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-areas:
      'intro sheet'
      'before sheet'
      'points sheet';
    grid-template-rows: auto auto 1fr;
    column-gap: 4rem;
    align-items: start;
  }
  /* The wrapper steps aside so the drawing and the sheet sit in their own columns. */
  .packet-flow > .packet-to-sheet {
    display: contents;
  }
  .packet-flow > .admit-section-header {
    grid-area: intro;
    margin: 0;
  }
  .packet-flow .packet-before {
    grid-area: before;
    margin-top: 2.25rem;
  }
  .packet-flow .review-figure {
    grid-area: sheet;
    margin: 0;
  }
  .packet-flow > .packet-points {
    grid-area: points;
    margin-top: 2.5rem;
  }

  /* The big drawn packet, with the arrow in the column gap at its middle. */
  .packet-flow .packet-before {
    position: relative;
    flex-wrap: nowrap;
    gap: 1.5rem;
  }
  .packet-flow .packet-stack {
    width: 150px;
    height: 192px;
    padding: 0.875rem 0.8125rem 0.6875rem;
    gap: 8px;
    box-shadow:
      3px 3px 0 -1px #fff,
      3px 3px 0 0 var(--pf-edge),
      6px 6px 0 -1px #fff,
      6px 6px 0 0 var(--pf-edge),
      9px 9px 0 -1px #fff,
      9px 9px 0 0 var(--pf-edge),
      12px 12px 0 -1px #fff,
      12px 12px 0 0 var(--pf-edge),
      15px 15px 0 -1px #fff,
      15px 15px 0 0 var(--pf-edge);
  }
  .packet-flow .packet-stack__title,
  .packet-flow .packet-stack__foot {
    display: block;
    color: var(--pf-muted);
    font-size: 0.6875rem;
    line-height: 1;
  }
  .packet-flow .packet-stack__title {
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .packet-flow .packet-stack__foot {
    text-align: right;
  }
  .packet-flow .packet-stack__lines {
    background:
      linear-gradient(rgba(15, 118, 110, 0.34), rgba(15, 118, 110, 0.34)) 0 22px / 86% 5px no-repeat,
      linear-gradient(rgba(15, 118, 110, 0.34), rgba(15, 118, 110, 0.34)) 0 66px / 70% 5px no-repeat,
      linear-gradient(rgba(15, 118, 110, 0.34), rgba(15, 118, 110, 0.34)) 0 99px / 78% 5px no-repeat,
      repeating-linear-gradient(#dfe4ea 0 5px, transparent 5px 11px);
  }
  .packet-flow .packet-before__label {
    flex: 0 1 15rem;
  }
  .packet-flow .packet-arrow {
    position: absolute;
    top: 85px;
    right: -3.5rem;
    padding: 0;
  }
  .packet-flow .packet-arrow svg {
    width: 40px;
    height: 22px;
  }
  .packet-flow .packet-arrow .packet-arrow__down {
    display: none;
  }
  .packet-flow .packet-arrow .packet-arrow__right {
    display: block;
  }
}

/* ---------- product heroes: packet and sheet on the right, the three points on the left ---------- */
@media (min-width: 769px) and (max-width: 991px) {
  .pilot-hero--sheet .packet-points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}
@media (min-width: 992px) {
  /* The packet and sheet span the text rows; a last flexible row takes any extra height,
     so the headline, copy and buttons keep their own spacing instead of spreading out.
     When the text column is the taller one, the sheet stays centred beside it. */
  body.vs-premium .pilot-hero--sheet .section-container {
    grid-template-rows: repeat(5, auto) 1fr;
    align-items: start;
  }
  body.vs-premium .pilot-hero--sheet .section-container > .packet-to-sheet {
    grid-column: 2;
    grid-row: 1 / span 6;
    align-self: center;
    margin: 0;
  }
  body.vs-premium .pilot-hero--sheet .section-container > .packet-points {
    margin-top: 2.5rem;
  }
  .pilot-hero--sheet .review-sheet {
    font-size: 0.875rem;
  }
}
