/* Original, page-specific illustrations. These are decorative; live models stay intact. */
#command-view { --page-art: url('./assets/outpost/pages/command-v1.webp'); }
#colony-view { --page-art: url('./assets/outpost/pages/colony-v1.webp'); }
#roster-view { --page-art: url('./assets/outpost/pages/roster-v1.webp'); }
#expeditions-view { --page-art: url('./assets/outpost/pages/expeditions-v1.webp'); }
#warehouse-view { --page-art: url('./assets/outpost/pages/workshop-v1.webp'); }
#market-view { --page-art: url('./assets/outpost/pages/store-v1.webp'); }
#launch-view { --page-art: url('./assets/outpost/pages/launch-v1.webp'); }
#log-view { --page-art: url('./assets/outpost/pages/log-v1.webp'); }
#production-view { --page-art: url('./assets/outpost/pages/production-v1.webp'); }
#research-view { --page-art: url('./assets/outpost/pages/research-v1.webp'); }
#development-view { --page-art: url('./assets/outpost/pages/development-v1.webp'); }
#frontier-view { --page-art: url('./assets/outpost/pages/frontier-v1.webp'); }
#network-view { --page-art: url('./assets/outpost/pages/network-v1.webp'); }

/* The compact resource bar keeps its geometry and .04 opacity. Each route now
   has its own quiet ground instead of the old grouped buildings and robots. */
body:has(#command-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/command-v1.webp'); }
body:has(#colony-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/colony-v1.webp'); }
body:has(#roster-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/roster-v1.webp'); }
body:has(#expeditions-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/expeditions-v1.webp'); }
body:has(#warehouse-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/workshop-v1.webp'); }
body:has(#market-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/store-v1.webp'); }
body:has(#launch-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/launch-v1.webp'); }
body:has(#log-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/log-v1.webp'); }
body:has(#production-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/production-v1.webp'); }
body:has(#research-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/research-v1.webp'); }
body:has(#development-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/development-v1.webp'); }
body:has(#frontier-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/frontier-v1.webp'); }
body:has(#network-view:not([hidden])) { --page-topbar-art: url('./assets/outpost/pages/network-v1.webp'); }
.topbar::before { background-image: var(--page-topbar-art, none); background-position: center 48%; background-size: cover; opacity: .04; }
.topbar::after { background-image: none; opacity: .04; }

/* A reserved inset beside secondary copy. Nothing is drawn behind text,
   controls, state badges, the original shop sign or existing figures. */
#command-view .command-header > div:first-child,
#roster-view .section-intro > div:first-child,
#warehouse-view .workshop-panel > .section-intro > div:first-child,
#market-view .store-front > div:first-child,
#launch-view .launch-panel > .section-intro > div:first-child,
#log-view .section-intro > div:first-child,
#network-view .network-heading > div:first-child {
  position: relative;
  min-width: 0;
  min-height: 160px;
  padding-inline-end: 264px;
}

#command-view .command-header > div:first-child::after,
#colony-view .welcome-strip > div:nth-child(2)::after,
#roster-view .section-intro > div:first-child::after,
#expeditions-view > .expansion-links > div:first-child::after,
#warehouse-view .workshop-panel > .section-intro > div:first-child::after,
#market-view .store-front > div:first-child::after,
#launch-view .launch-panel > .section-intro > div:first-child::after,
#log-view .section-intro > div:first-child::after,
#production-view #production-workspace::after,
#research-view .research-facility > div:has(> .eyebrow)::after,
#development-view .development-overview::after,
#frontier-view #frontier-workspace::after,
#network-view .network-heading > div:first-child::after {
  content: '';
  display: block;
  width: min(100%, var(--page-illustration-width, 240px));
  aspect-ratio: 3 / 2;
  margin-block-start: 18px;
  background: var(--page-art) center / contain no-repeat;
  pointer-events: none;
}

#command-view .command-header > div:first-child::after,
#roster-view .section-intro > div:first-child::after,
#warehouse-view .workshop-panel > .section-intro > div:first-child::after,
#market-view .store-front > div:first-child::after,
#launch-view .launch-panel > .section-intro > div:first-child::after,
#log-view .section-intro > div:first-child::after,
#network-view .network-heading > div:first-child::after {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  margin-block-start: 0;
}

/* Landscapes sit at the edge of the working page; still lifes stay close to
   their relevant prose. Original models and all controls are left in place. */
#colony-view .welcome-strip > div:nth-child(2)::after {
  --page-illustration-width: 260px;
  border-block-end: 1px solid #52614b;
}
#expeditions-view > .expansion-links > div:first-child::after {
  --page-illustration-width: 260px;
  margin-inline-start: auto;
  border-block-end: 1px solid #6a5746;
}
#log-view .section-intro > div:first-child::after {
  --page-illustration-width: 220px;
  border-block-end: 1px solid #665a47;
}
#production-view #production-workspace::after,
#frontier-view #frontier-workspace::after {
  --page-illustration-width: 260px;
  margin-block: 28px 12px;
  margin-inline-start: auto;
  border-block-end: 1px solid #505e56;
}
#research-view .research-facility > div:has(> .eyebrow)::after {
  --page-illustration-width: 220px;
}
#development-view .development-overview::after {
  --page-illustration-width: 230px;
  margin-inline-start: auto;
}

/* Only the original gameplay guide gets this field notebook. Confirmation,
   transaction and item dialogs retain their own meaningful artwork and states. */
#game-dialog .guide-current::after,
#game-dialog:not(:has(.guide-current)) .guide-basics::after {
  content: '';
  display: block;
  width: min(100%, 230px);
  aspect-ratio: 3 / 2;
  margin: 18px 0 0 auto;
  background: url('./assets/outpost/pages/guide-v1.webp') center / contain no-repeat;
  pointer-events: none;
}

@media (max-width: 1000px) {
  #command-view .command-header > div:first-child,
  #roster-view .section-intro > div:first-child,
  #warehouse-view .workshop-panel > .section-intro > div:first-child,
  #market-view .store-front > div:first-child,
  #launch-view .launch-panel > .section-intro > div:first-child,
  #log-view .section-intro > div:first-child,
  #network-view .network-heading > div:first-child {
    min-height: 0;
    padding-inline-end: 0;
  }
  #command-view .command-header > div:first-child::after,
  #roster-view .section-intro > div:first-child::after,
  #warehouse-view .workshop-panel > .section-intro > div:first-child::after,
  #market-view .store-front > div:first-child::after,
  #launch-view .launch-panel > .section-intro > div:first-child::after,
  #log-view .section-intro > div:first-child::after,
  #network-view .network-heading > div:first-child::after {
    position: static;
    margin-block-start: 18px;
  }
}

@media (max-width: 700px) {
  #colony-view .welcome-strip > div:nth-child(2)::after,
  #expeditions-view > .expansion-links > div:first-child::after,
  #production-view #production-workspace::after,
  #development-view .development-overview::after,
  #frontier-view #frontier-workspace::after,
  #game-dialog .guide-current::after,
  #game-dialog:not(:has(.guide-current)) .guide-basics::after {
    margin-inline: 0;
  }
}
