/* The archive viewer: a version toolbar, the recovered page in a gilt frame, and a footer of page tools. */
.ze-archive {
  --zv-gilt: linear-gradient(135deg, #ecd48d 0%, #b28e47 22%, #dcc078 48%, #8e6c31 74%, #bb9952 100%);
  --zv-ink-line: #5a421d;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.ze-archive [hidden] {
  display: none !important;
}
.ze-archive button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.ze-archive svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.zv-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 1320px);
  height: calc(100dvh - 104px);
  min-height: 600px;
  margin-inline: auto;
  padding: 18px 32px 0;
}
.zv-workspace:has(#site-frame[data-era^="v"]) {
  width: min(100%, 1140px);
}

/* Toolbar: a gilt flourish at each end, the version picker, Browse all versions and Find a page. */
.zv-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 56px;
}
.zv-toolbar::before,
.zv-toolbar::after {
  content: "";
  flex: none;
  width: 48px;
  height: 9px;
  background:
    linear-gradient(45deg, transparent 38%, var(--ze-brass) 38% 62%, transparent 62%) center / 9px 9px no-repeat,
    linear-gradient(var(--ze-brass), var(--ze-brass)) center / 100% 1px no-repeat;
}
.version-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 6;
}
.zv-label {
  font: 600 0.75rem/1 var(--ze-font-display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ze-muted);
}
.versions-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 190px;
  min-height: 42px;
  padding: 8px 12px 8px 14px;
  border: 1px solid var(--ze-brass);
  border-radius: 3px;
  background: var(--ze-vellum);
  box-shadow: inset 0 1px #fff, 0 1px 2px #5a421d33;
  color: var(--ze-ink) !important;
  font: 400 1.05rem/1.2 var(--ze-font-display) !important;
  text-align: left;
}
.versions-toggle svg {
  width: 16px;
  height: 16px;
  margin-left: auto;
}
.versions-toggle:hover,
.versions-toggle[aria-expanded="true"] {
  border-color: var(--ze-oxblood);
}
.versions-toggle:disabled {
  opacity: 0.6;
  cursor: default;
}
.version-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: min(560px, calc(100dvh - 190px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--ze-rule);
  border-radius: 3px;
  background: var(--ze-vellum);
  box-shadow: 0 14px 34px #2a1c1240;
}
.milestone {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 2px;
  color: var(--ze-ink);
  text-decoration: none;
}
.milestone strong {
  font: 600 1.05rem/1.3 var(--ze-font-display);
}
.milestone span {
  font-size: 0.85rem;
  color: var(--ze-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.milestone:hover {
  background: var(--ze-paper-inset);
}
.milestone[aria-current="true"] {
  background: var(--ze-malachite);
  color: var(--ze-vellum);
}
.milestone[aria-current="true"] span {
  color: #d9e4d2;
}
.milestone:focus-visible {
  outline-offset: -3px;
}
.zv-browse {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 0 0 20px;
  border: 0;
  border-left: 1px solid var(--ze-rule);
  background: none;
  font: 400 1rem/1.2 var(--ze-font-body) !important;
  color: var(--ze-ink) !important;
  text-decoration: underline;
  text-decoration-color: var(--ze-brass);
  text-underline-offset: 0.3em;
}
.zv-browse svg {
  width: 16px;
  height: 16px;
}
.zv-browse:hover,
.zv-browse[aria-expanded="true"] {
  color: var(--ze-oxblood) !important;
  text-decoration-color: currentColor;
}
.zv-find {
  display: flex;
  margin: 0 0 0 auto;
}
.zv-find input {
  width: clamp(180px, 20vw, 250px);
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--ze-brass);
  border-right: 0;
  border-radius: 3px 0 0 3px;
  background: var(--ze-vellum);
  box-shadow: inset 0 1px 2px #5a421d26;
  color: var(--ze-ink);
  font: 400 1rem/1.2 var(--ze-font-body);
}
.zv-find input::placeholder {
  color: var(--ze-muted);
}
.zv-find button {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 42px;
  border: 1px solid var(--ze-green-deep);
  border-radius: 0 3px 3px 0;
  background: linear-gradient(#1f5646, var(--ze-green-deep));
  color: var(--ze-vellum) !important;
}
.zv-find button svg {
  width: 18px;
  height: 18px;
}
.zv-find button:hover {
  background: var(--ze-malachite);
}

/* The stage: optional panels above the frame, or About and All versions in its place. */
.stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 12px;
}
.stage:focus {
  outline: none;
}
.panel-open .viewport,
.panel-open .inspection {
  display: none !important;
}
.zv-panel {
  position: relative;
  border: 1px solid var(--ze-rule);
  border-radius: 3px;
  background: var(--ze-vellum);
  box-shadow: 0 1px 3px #5a421d26;
}
.zv-panel:focus {
  outline: none;
}
.inspection {
  max-height: 46%;
  overflow: auto;
  margin-bottom: 12px;
  padding: 18px 24px;
}
.inspection p {
  max-width: 72ch;
  margin: 0 0 12px;
  color: var(--ze-body-ink);
}
.inspection ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.inspection li {
  border-top: 1px solid var(--ze-paper-inset);
}
.inspection li a {
  display: block;
  padding: 10px 0;
  color: var(--ze-navy);
  text-decoration: none;
}
.inspection li a:hover {
  text-decoration: underline;
}
.inspection li span {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--ze-muted);
  overflow-wrap: anywhere;
}
.inspection li button {
  margin: 10px 0;
  padding: 6px 12px;
  border: 1px solid var(--ze-brass);
  border-radius: 3px;
  background: var(--ze-parchment);
}
.inspection h2 {
  margin: 0 0 10px;
  font: 600 1.5rem/1.2 var(--ze-font-display);
  color: var(--ze-ink);
}
.inspection h3 {
  margin: 20px 0 8px;
  font: 600 1.15rem/1.2 var(--ze-font-display);
}
#results-count {
  font-size: 0.9rem;
  color: var(--ze-muted);
}
.notes dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 12px;
  margin: 16px 0;
  font-size: 0.9rem;
}
.notes dt {
  color: var(--ze-muted);
}
.notes dd {
  margin: 0;
  overflow-wrap: anywhere;
}
#historical-artwork figure {
  max-width: 620px;
  margin: 20px 0;
}
#historical-artwork img {
  display: block;
  width: 100%;
  height: auto;
}
#historical-artwork figcaption {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--ze-muted);
}
.about,
.zv-overview {
  flex: 1;
  overflow: auto;
  padding: clamp(24px, 4vw, 56px);
}
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 48px;
}
.about h2,
.zv-overview h2 {
  margin: 0 0 22px;
  font: 700 clamp(2rem, 3.4vw, 2.8rem)/1.1 var(--ze-font-display);
  color: var(--ze-ink);
}
.about h3 {
  margin: 30px 0 12px;
  font: 600 1.6rem/1.2 var(--ze-font-display);
  color: var(--ze-ink);
}
.about p {
  max-width: 64ch;
  margin: 0 0 16px;
}
.about .about-intro,
.zv-overview-intro {
  font-size: 1.15rem;
  color: var(--ze-ink);
}
.recovery-details {
  margin: 18px 0;
  font-size: 0.9rem;
  color: var(--ze-muted);
}
.recovery-details summary {
  cursor: pointer;
  min-height: 30px;
}
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 24px;
}
.about-art figure {
  margin: 0 0 26px;
}
.about-art img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 8px;
  border: 1px solid var(--ze-rule);
}
.about-art figcaption {
  font-size: 0.85rem;
  color: var(--ze-muted);
}
.back-link {
  margin-top: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ze-navy) !important;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
#overview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.zv-version {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--ze-rule);
  border-radius: 3px;
  background: var(--ze-parchment-dye);
  color: var(--ze-body-ink);
  text-decoration: none;
}
.zv-version strong {
  font: 600 1.25rem/1.2 var(--ze-font-display);
  color: var(--ze-ink);
}
.zv-version-period,
.zv-version-count {
  font-size: 0.85rem;
  color: var(--ze-muted);
}
.zv-version-text {
  font-size: 0.95rem;
  line-height: 1.5;
}
.zv-version:hover {
  border-color: var(--ze-oxblood);
}
.zv-version[aria-current="true"] {
  border-color: var(--ze-malachite);
  box-shadow: inset 0 0 0 2px var(--ze-malachite);
}

/* The gilt frame: a gold moulding around a dark inset, with fitted corner pieces. */
.viewport {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 4px;
  border-radius: 2px;
  background: var(--zv-gilt);
  box-shadow:
    0 0 0 1px var(--zv-ink-line),
    inset 0 0 0 1px #fff3c4aa,
    0 10px 24px #2a1c1238;
}
.viewport::before {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 1;
  border: 1px solid #3f2d12;
  box-shadow: 0 0 0 1px #fbe8b066;
  pointer-events: none;
}
/* Cast brackets seated flush in the moulding's outer corners, reaching well past its inner edge. The art is the
   top-left corner on a transparent square (imgreq/archive-frame-corner-gilt); the others are mirrors of it. */
.zv-corner {
  position: absolute;
  z-index: 2;
  width: 20px;
  height: 20px;
  pointer-events: none;
  background: image-set(url("https://assets.zeldaelements.net/assets/ze/archive-frame-corner-20.4ef440d0a058.webp") 1x type("image/webp"), url("https://assets.zeldaelements.net/assets/ze/archive-frame-corner-40.cdcd8c4a2729.webp") 2x type("image/webp"), url("https://assets.zeldaelements.net/assets/ze/archive-frame-corner-60.a2b7cc4826fb.webp") 3x type("image/webp")) 0 0 / 100% 100% no-repeat;
  filter: drop-shadow(0 0 0.7px #1a100699);
}
.zv-corner--tl {
  top: 0;
  left: 0;
}
.zv-corner--tr {
  top: 0;
  right: 0;
  transform: scaleX(-1);
}
.zv-corner--bl {
  bottom: 0;
  left: 0;
  transform: scaleY(-1);
}
.zv-corner--br {
  bottom: 0;
  right: 0;
  transform: scale(-1);
}
#site-frame {
  display: block;
  flex: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  background: #1c1a22;
}
#frame-status {
  position: absolute;
  inset: 24px;
  z-index: 3;
  height: max-content;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--ze-rule);
  background: var(--ze-vellum);
  color: var(--ze-body-ink);
}

/* Footer: page tools on the left, the original address and year in the middle, Open full size on the right. */
.zv-footer {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  margin-top: 16px;
  padding: 8px 0 10px;
  background: linear-gradient(90deg, var(--ze-brass) calc(50% - 22px), transparent 0 calc(50% + 22px), var(--ze-brass) 0)
    0 0 / 100% 1px no-repeat;
  font: 400 0.9rem/1.3 var(--ze-font-body);
}
.zv-footer-mark {
  position: absolute;
  top: -12px;
  left: calc(50% - 14px);
  width: 28px;
  height: 22px;
  color: var(--ze-brass);
  fill: currentColor;
  stroke: none !important;
}
.zv-footer .tools {
  display: flex;
  align-items: center;
}
.zv-footer .tools > * + * {
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--ze-rule);
}
.zv-footer .tools button,
.zv-footer .tools a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding-block: 0;
  border-block: 0;
  border-right: 0;
  background: none;
  color: var(--ze-ink) !important;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--ze-rule);
  text-underline-offset: 0.3em;
}
.zv-footer .tools > :first-child {
  padding-left: 0;
  border-left: 0;
}
.zv-footer .tools button:hover,
.zv-footer .tools a:hover,
.zv-footer .tools button[aria-expanded="true"] {
  color: var(--ze-oxblood) !important;
  text-decoration-color: currentColor;
}
.zv-footer .tools svg {
  width: 14px;
  height: 14px;
}
#page-count {
  font-size: 0.8rem;
  color: var(--ze-muted);
  font-variant-numeric: tabular-nums;
}
.view-tools {
  justify-content: flex-end;
}
.zv-address {
  margin: 0;
  color: var(--ze-body-ink);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.zv-noscript {
  max-width: 60ch;
  margin: 24px auto;
  padding: 0 24px;
}

@media (max-height: 820px) and (min-width: 801px) {
  .zv-workspace {
    padding-top: 10px;
  }
  .zv-footer {
    margin-top: 10px;
    min-height: 50px;
  }
}
@media (max-width: 1000px) {
  .zv-toolbar::before,
  .zv-toolbar::after {
    content: none;
  }
}
@media (max-width: 800px) {
  .zv-workspace {
    height: auto;
    min-height: 0;
    padding: 12px 12px 0;
  }
  .zv-toolbar {
    flex-wrap: wrap;
    gap: 10px 14px;
  }
  .version-picker {
    flex: 1 0 100%;
    gap: 10px;
  }
  .versions-toggle {
    flex: 1;
    min-width: 0;
  }
  .zv-browse {
    padding-left: 0;
    border-left: 0;
    font-size: 0.95rem !important;
  }
  .zv-find {
    flex: 1;
  }
  .zv-find input {
    width: 100%;
    min-width: 0;
  }
  .stage {
    flex: none;
    height: 72svh;
    min-height: 420px;
  }
  .about-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .about,
  .zv-overview {
    padding: 22px 18px;
  }
  .viewport {
    padding: 3px;
  }
  .viewport::before {
    inset: 2px;
  }
  .zv-corner {
    width: 16px;
    height: 16px;
  }
  .zv-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    padding-top: 14px;
  }
  .view-tools {
    justify-content: center;
  }
  .zv-address {
    order: 3;
    font-size: 0.85rem;
  }
}
