/* CaseModel website: css/p-built.css
   Case Construction's own two worked examples: a provision cut at its joints, and the walk from a figure to its page. */

/* ---- the law, cut ---- */
.law-s { margin: 22px 0 0; font: 400 clamp(22px, 2.5vw, 34px)/1.9 var(--ui); color: var(--text); max-width: 30em; }
.law-s span { position: relative; display: inline-block; white-space: nowrap; padding: 0 .28em; margin: 0 -.06em; border-radius: 6px; line-height: 1.5; box-shadow: inset 0 0 0 1.5px transparent; transition: background .5s var(--ease), box-shadow .5s var(--ease), color .5s var(--ease); }
.law-s span i { position: absolute; left: .28em; bottom: 100%; margin-bottom: 1px; font: 700 12.5px/1 var(--display); font-style: normal; letter-spacing: .07em; text-transform: uppercase; color: var(--azure-dd); white-space: nowrap; opacity: 0; transform: translateY(5px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
/* each part keeps room above it for its label, so a label never runs into the line above */
.law-s span { margin-top: 12px; }
.law:not([data-v="0"]) .law-s span { background: var(--sky-3); box-shadow: inset 0 0 0 1.5px #9cc6ff; }
.law:not([data-v="0"]) .law-s span i { opacity: 1; transform: none; }
.law:not([data-v="0"]) .law-s span:nth-of-type(2), .law:not([data-v="0"]) .law-s span:nth-of-type(2) i { transition-delay: .12s; }
.law:not([data-v="0"]) .law-s span:nth-of-type(3), .law:not([data-v="0"]) .law-s span:nth-of-type(3) i { transition-delay: .24s; }
.law:not([data-v="0"]) .law-s span:nth-of-type(4), .law:not([data-v="0"]) .law-s span:nth-of-type(4) i { transition-delay: .36s; }
.law:not([data-v="0"]) .law-s span:nth-of-type(5), .law:not([data-v="0"]) .law-s span:nth-of-type(5) i { transition-delay: .48s; }
.law[data-v="2"] .law-s span[data-k="conduct"], .law[data-v="2"] .law-s span[data-k="test"], .law[data-v="2"] .law-s span[data-k="circ"] { background: var(--navy); color: #fff; box-shadow: none; }
.law-q { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .7s var(--ease), opacity .6s var(--ease) .1s, margin .6s var(--ease); counter-reset: q; }
.law[data-v="2"] .law-q { max-height: 420px; opacity: 1; margin-top: 34px; }
.law-q li { counter-increment: q; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 14px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--sky-1); }
.law-q li::before { content: counter(q); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; font: 700 15px/1 var(--display); }
.law-q b { font: 700 clamp(17px, 1.5vw, 20px)/1.3 var(--display); color: var(--navy); letter-spacing: -.01em; }
.law-n { display: inline-flex; align-items: center; gap: 12px; font: 600 15px/1 var(--display); color: var(--text-3); white-space: nowrap; }
.law-n i { display: block; width: calc(var(--n) * 13px); height: 8px; border-radius: 4px; background: var(--azure); }
.law-foot { margin: 0; max-height: 0; opacity: 0; overflow: hidden; font-size: 16.5px; color: var(--text-2); max-width: 44em; transition: max-height .6s var(--ease), opacity .6s var(--ease) .2s, margin .6s var(--ease); }
/* room for the whole closing sentence at any width, and as the text is enlarged */
.law[data-v="2"] .law-foot { max-height: 20em; opacity: 1; margin-top: 22px; }
@media (max-width: 700px) {
  .law-s { line-height: 2.3; }
  .law-s span { white-space: normal; }
  .law-q li { grid-template-columns: 38px minmax(0, 1fr); }
  .law[data-v="2"] .law-q { max-height: 760px; }
  /* the count wraps under its bar where the card is too narrow for both */
  .law-n { grid-column: 2; flex-wrap: wrap; row-gap: 6px; white-space: normal; }
  .law-n i { max-width: 100%; }
}

/* ---- the walk ---- */
.walk { display: grid; grid-template-columns: 210px minmax(0, 1fr) minmax(0, 1.1fr); min-height: 600px; }
.walk-pick { display: flex; flex-direction: column; gap: 8px; padding: 22px 16px; border-right: 1px solid var(--line-2); background: var(--sky-1); }
.walk-pick button { text-align: left; padding: 14px 16px; border: 1px solid transparent; border-radius: 10px; background: none; transition: background .2s, border-color .2s, box-shadow .2s; }
.walk-pick button:hover { background: #fff; }
.walk-pick button[aria-selected="true"] { background: #fff; border-color: var(--line); box-shadow: var(--sh-2); }
.walk-pick b { display: block; font: 800 22px/1 var(--display); color: var(--navy); letter-spacing: -.02em; }
.walk-pick button[aria-selected="true"] b { background: linear-gradient(var(--gold), var(--gold)) 0 100% / 100% 32% no-repeat; display: inline-block; padding: 0 3px 1px; margin-left: -3px; }
.walk-pick span { display: block; margin-top: 6px; font-size: 15px; line-height: 1.3; color: var(--text-2); }
.walk-chain { padding: clamp(22px, 2.6vw, 36px); display: flex; flex-direction: column; }
.walk-chain .chain li { padding-bottom: 18px; }
.walk-fb { color: var(--text-2); }
.walk-fig { position: relative; background: linear-gradient(#fff, #eff7ff 55%, #e2effc); border-left: 1px solid var(--line-2); }
.walk-fig canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.walk-away { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line-2); }
.verdict { margin-top: 14px; padding: 14px 16px; border-radius: 8px; background: var(--sky-3); font-size: 16px; line-height: 1.45; color: var(--text); opacity: 0; max-height: 0; overflow: hidden; transition: opacity .45s var(--ease), max-height .45s var(--ease); }
.verdict.in { opacity: 1; max-height: 240px; }
.verdict .tag { margin-bottom: 8px; display: flex; width: max-content; }
.verdict.open { background: var(--orange-bg); }
.chain li.gone q { text-decoration: line-through; text-decoration-color: var(--text-3); color: var(--text-3); background: var(--line-2); }
.chain li.gone::before { border-color: var(--text-3); }
.chain li.noq q { background: var(--orange-bg); color: var(--orange-dd); }
@media (max-width: 1080px) {
  .walk { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .walk-pick { grid-column: 1 / -1; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line-2); padding: 12px; }
  .walk-pick button { flex: 1 0 150px; }
}
@media (max-width: 760px) {
  .walk { grid-template-columns: minmax(0, 1fr); }
  .walk-fig { order: 2; aspect-ratio: 5 / 4; border-left: 0; border-bottom: 1px solid var(--line-2); }
  .walk-chain { order: 3; }
}
