/* The original search stays in the binding. Only the leaf for the current page turns. */
.search-history {
  --key: #344133; --grain: url("/folio/assets/folio-paper.png") center / 155px;
  --reading-ink: var(--note-ink, #ebeadd); --reading-soft: var(--note-soft, #bdc2ae);
  --reading-rule: var(--note-rule, #495141);
  --leaf-cut: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
  container: search-exhibit / inline-size; isolation: isolate;
  min-width: 0; margin: 0; color: var(--reading-ink); font-family: var(--sans);
}
.history-object {
  position: relative; isolation: isolate; display: grid; overflow: clip;
  grid-template-columns: 35% minmax(0, 1fr); align-items: center;
  width: min(100%, 780px); margin: 0 auto;
  padding: clamp(24px, 4cqi, 38px) 5% clamp(28px, 5cqi, 46px) 4%;
  color: var(--key); font: 490 clamp(14px, 2cqi, 17px)/1.35 var(--sans);
}
.history-reference, .history-window, .history-record { position: relative; }
.history-reference {
  isolation: isolate; margin-right: -17%; padding: 8% 19% 9% 10%;
  transform: rotate(-6deg) skewX(-3deg); transform-origin: 85% 55%;
  color: #363b2b;
}
.history-reference::before, .history-reference::after,
.history-page, .history-record::before, .history-record::after {
  clip-path: var(--leaf-cut);
}
.history-reference::before, .history-reference::after, .history-record::before, .history-record::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
}
.history-reference::before, .history-record::before {
  transform: translate(3px, 5px);
  background: repeating-linear-gradient(0deg,#344131 0 1px,#8d9779 1px 3px);
}
.history-reference::after {
  border-left: 2px solid #b18d6b; background: var(--grain), #d5ad87;
  box-shadow: inset 0 1px #eaceab, inset 0 -1px #93765c;
}
.history-reference-label { display: block; font: 530 clamp(12px, 1.8cqi, 15px)/1.3 var(--sans); }
.history-query {
  display: block; margin-top: 2px; font: 555 clamp(23px, 4.7cqi, 42px)/1.06 var(--display);
  letter-spacing: -.048em;
}
.history-turn { display: block; width: 76%; max-width: 165px; height: auto; margin: 11% auto 9% 0; }
.history-original, .history-jobs { list-style: none; margin: 0; padding: 0; }
.history-original li { border-top: 1px solid #a08667; padding: .28em 0; font-size: clamp(12px,1.8cqi,15px); }
.history-window { isolation: isolate; transform: rotate(2deg) skewX(-2deg); }
.history-page-edge {
  position: absolute; inset: 0; transform: translate(4px, 7px); clip-path: var(--leaf-cut);
  background: repeating-linear-gradient(0deg, #43503d 0 1.5px, #9ca889 1.5px 3.5px);
}
.history-page {
  position: relative; padding: 0 6% 4%;
  background: var(--grain), #d5d9bf; box-shadow: inset 0 0 0 1px #9ca58b, inset 0 2px #e6e9cc;
}
.fold-insert .history-page { background-color: #e4e5cd; }
.history-page::after, .history-record::after {
  background-image: linear-gradient(45deg,transparent 47%,#53624a 49%,#78866a 54%),
    url("/folio/assets/folio-paper.png");
  background-position: top right, center; background-size: 13px 13px, 155px; background-repeat: no-repeat, repeat;
}
.history-page::after { content: ""; position: absolute; right: 0; top: 0; width: 13px; height: 13px; }
.history-address, .history-record-head {
  display: flex; align-items: center; gap: .8em; padding-block: .72em .65em;
  border-bottom: 1px solid #7f8a70; font: 520 clamp(12px, 1.9cqi, 16px)/1.25 var(--sans);
}
.history-address svg { flex: none; width: 1.8em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; }
.history-address svg path { stroke-linecap: square; }
.history-address span { white-space: nowrap; }
.history-page-title { display: block; margin: .37em 0 .25em; font: 550 clamp(23px, 4.4cqi, 38px)/1.07 var(--display); letter-spacing: -.042em; }
.history-input {
  display: flex; gap: .55em; align-items: center; min-height: 2.05em;
  border: 1px solid #818d73; padding-inline: .55em; background: #ecedd53b;
}
.history-input svg { flex: none; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; }
.history-input [data-input]:empty::after { content: "Search jobs"; color: #5a6552; }
.history-jobs { margin-top: .6em; min-height: 6.6em; }
.history-jobs li {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  min-height: 2.18em; border-bottom: 1px solid #a6af96; padding: .23em .4em;
}
.history-jobs li[hidden] { display: none; }
.history-jobs li::after { content: ""; width: .35em; height: .35em; border: solid currentColor; border-width: 1px 1px 0 0; transform: rotate(45deg); }
.history-jobs [data-job="survey"] { color: #623c25; background: #dca779; }
.history-record {
  visibility: hidden; pointer-events: none; position: absolute; z-index: 1; inset: 19% 3% 6% 6%;
  display: flex; flex-direction: column; padding: 0 6% 4%; color: #e7e9cc;
  transform: perspective(850px) rotateY(-91deg) rotate(-5deg);
  transform-origin: 2% 48%; backface-visibility: hidden; isolation: isolate;
}
.history-record::after { background-color: #465c47; box-shadow: inset 1px 1px #879779; }
.history-record-head { justify-content: space-between; border-color: #97a488; }
.history-record-body { flex: 1; display: flex; align-items: center; justify-content: space-between; column-gap: 6%; }
.history-record-body strong { max-width: 10ch; font: 530 clamp(24px,4.6cqi,40px)/1.04 var(--display); letter-spacing: -.045em; }
.history-record-body svg { width: 27%; max-width: 105px; flex: none; }
.search-history[data-phase="record"] .history-record { visibility: visible; transform: perspective(850px) rotateY(0deg) rotate(-5deg); }
.search-history[data-phase="record"] .history-list { opacity: .32; }
.history-stops { display: flex; flex-wrap: wrap; gap: 0 clamp(10px, 3cqi, 25px); border-block-end: 1px solid var(--reading-rule); }
.history-stops[hidden] { display: none; }
.history-stops button {
  position: relative; min-height: 44px; padding: 0; color: var(--reading-soft);
  font: 510 clamp(13px, 2cqi, 16px)/1.25 var(--sans); cursor: pointer;
}
.history-stops button::after {
  content: ""; position: absolute; bottom: -1px; inset-inline: 0; height: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
}
.history-stops button[aria-pressed="true"] { color: var(--reading-ink); }
.history-stops button[aria-pressed="true"]::after { transform: scaleX(1); }
.history-stops button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (hover: hover) {
  .history-stops button:hover { color: var(--reading-ink); }
}
.history-proof { display: grid; grid-template-columns: 1fr 2.55fr; align-items: baseline; min-height: 5em; gap: 3%; padding-block: clamp(12px,2cqi,18px); }
.history-proof > strong { font: 530 clamp(18px,2.75cqi,26px)/1.18 var(--display); letter-spacing: -.033em; }
.history-wait { color: var(--reading-soft); font-size: clamp(14px,2cqi,18px); }
.history-proof dl { display: grid; grid-template-columns: 1fr 1fr 1.15fr; margin: 0; }
.history-proof dl > div { padding-left: clamp(9px,1.6cqi,16px); border-left: 1px solid var(--reading-rule); }
.history-proof dt { color: var(--reading-soft); font: 450 clamp(12px, 1.8cqi, 15px)/1.3 var(--sans); letter-spacing: 0; }
.history-proof dd { margin: 4px 0 0; color: var(--reading-ink); font: 530 clamp(14px,2.3cqi,19px)/1.23 var(--sans); letter-spacing: -.015em; }
.search-history[data-phase="before"] .history-proof dd { color: var(--note-accent, #e9ae84); }

@container search-exhibit (max-width: 445px) {
  .history-object { display: block; padding: 14px 4% 22px; font-size: clamp(13px, 3.4cqi, 16px); }
  .history-reference {
    width: 86%; padding: 9px 13px 16px; margin: 0 0 -3px 1%;
    display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: baseline;
    gap: 4px .55em; transform: rotate(-2.1deg); transform-origin: 50% 100%;
  }
  .history-reference-label { font-size: 12px; }
  .history-query { font-size: clamp(18px, 4.6cqi, 22px); }
  .history-turn { position: absolute; right: 6%; top: 9px; width: 13%; max-width: 40px; margin: 0; }
  .history-original { grid-column: 1 / -1; padding-top: 3px; border-top: 1px solid #a08667; }
  .history-original li { border: 0; padding: 1px 0; font-size: clamp(12px, 3.5cqi, 14px); line-height: 1.25; }
  .history-window { transform: rotate(1.2deg) skewX(-1deg); }
  .history-page { padding-bottom: 3%; }
  .history-proof { display: block; }
  .history-proof > strong { display: block; margin-bottom: 9px; }
  .history-proof dl > div:first-child { padding-left: 0; border: 0; }
}
@container search-exhibit (max-width: 320px) {
  .history-stops { justify-content: space-between; gap: 0 6px; }
  .history-stops button { font-size: 12px; }
  .history-turn { right: 4%; width: 12%; }
  .history-proof dd { font-size: 13px; }
}
@media screen and (prefers-reduced-motion: no-preference) {
  .history-record {
    transition: transform 360ms cubic-bezier(.3,.78,.22,1), visibility 0s linear 360ms;
  }
  .search-history[data-phase="record"] .history-record { transition-delay: 0s; }
  .history-list { transition: opacity 220ms ease-out; }
  .history-stops button::after { transition: transform 175ms var(--ease); }
}
@media print {
  .history-object { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .history-stops { display: none; }
}
