/* Pages: navigation, documents, archived Pages and bounded collection lists. */

/* Page links live in the header; the document has no inspection sidebar. */
#subnav:empty { display: none; }
.page-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}
.page-heading h1 { min-width: 0; max-width: 900px; overflow-wrap: anywhere; }
#view .page-heading h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.025em;
}
.page-commit-banner {
  padding: 10px 14px;
  margin-bottom: 24px;
  border: 1px solid var(--warn-rule);
  border-radius: 6px;
  line-height: 1.5;
}
/* ============ A page's trail of ancestors ============ */
.crumb2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 14px;
}
.crumb2 a {
  color: var(--muted);
  text-decoration: none;
}
.crumb2 a:hover {
  color: var(--fg);
  text-decoration: underline;
}
.crumb2 .sep {
  color: var(--field);
}

/* Rotor's Page frame follows the shared theme; authored content has its own document baseline. */
body[data-area="pages"] #view {
  width: 100%;
  max-width: calc(900px + var(--gutter) + var(--gutter));
  margin-inline: auto;
  padding-top: 40px;
  padding-bottom: 96px;
}
.work {
  max-width: 900px;
}
.wpage h1 {
  margin-bottom: 20px;
  overflow-wrap: anywhere;
}
#view p.pver {
  font-size: 14px;
  color: var(--muted);
  margin: -8px 0 18px;
  max-width: none;
}
#view p.pver a {
  color: inherit;
  text-decoration-color: var(--field);
}
#view p.pver a:hover {
  color: var(--fg);
}
.wpage > .note {
  margin: 0 0 12px;
}
.wpage > .note + .rotor-document {
  margin-top: 22px;
}
p.allp {
  margin-top: 24px;
}

/* An archived page: one plain line under the title, and what the archiving cites. */
.parch {
  max-width: 68ch;
  margin: -8px 0 22px;
  padding: 10px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--muted);
}
#view .parch p {
  margin: 0;
  color: inherit;
}
#view .parch p a {
  color: inherit;
  text-decoration-color: var(--field);
}

/* The pages under a page, after its document. */
.pkids {
  margin-top: 8px;
}
.pkids .lblh {
  margin-top: 24px;
}
.wpage:has(.page-content:empty) .pkids .lblh {
  margin-top: 0;
}
.pkids .inspection-window:has(button):not(:has(button:enabled)) {
  display: none;
}
.pkids a.lt {
  display: block;
  padding-block: 4px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}
.pkids a.lt:hover {
  text-decoration: underline;
}
@media (max-width: 600px) {
  body[data-area="pages"] #view {
    padding-top: 28px;
    padding-bottom: 64px;
  }
  #view .page-heading h1 {
    font-size: 26px;
  }
  .page-heading {
    padding-bottom: 16px;
    margin-bottom: 20px;
  }
}
#view p.parchl {
  margin: 12px 0 0;
  font-size: 14px;
}
#view p.parchl a {
  color: var(--muted);
  text-decoration-color: var(--field);
}
#view p.parchl a:hover {
  color: var(--fg);
}

/* A link to something that isn't there at the commit read: its text, and a word saying so. */
.dead {
  text-decoration: line-through dotted;
  text-decoration-color: var(--field);
}
:is(#view, #side) .rotor-document .page-content a.dead {
  color: var(--muted);
  cursor: default;
}
/* ============ All pages ============ */
.ptrail {
  font-size: 13px;
  color: var(--muted);
}
#pfind {
  width: 260px;
  max-width: 100%;
  min-width: 0;
  font-size: 13px;
  line-height: 18px;
  padding: 4px 9px;
}
@media (max-width: 860px) {
  #pfind {
    font-size: 16px;
    width: 100%;
    margin-top: 6px;
  }
}
#view .tline p.sub {
  margin: 0;
}

/* Rotor bounded inspection windows are additional to Rotor's Page controls. */
.inspection-window {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}
.inspection-window button.link:disabled,
.inspection-window button.link:disabled:hover {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
}

/* The collection is an interface list; authored Page documents keep their own reading surface. */
body[data-area="page-list"] #view { max-width: calc(720px + var(--gutter) + var(--gutter)); padding-top: 40px; }
body[data-area="page-list"] #view h1 { margin: 0 0 8px; }
body[data-area="page-list"] #view > .sub { margin: 0 0 24px; }
body[data-area="page-list"] ul.list { margin: 24px 0 0; border-top: 1px solid var(--rule); }
body[data-area="page-list"] ul.list > li { padding: 0; border-bottom: 1px solid var(--rule); }
body[data-area="page-list"] a.lt { display: block; padding: 16px 0; font-size: 15px; font-weight: 500;
  overflow-wrap: anywhere; }
body[data-area="page-list"] ul.list > li > .sub { margin: -8px 0 16px; }
@media (max-width: 600px) {
  body[data-area="page-list"] #view { padding-top: 28px; }
}

/* The first action is the empty database's main message, rather than secondary metadata. */
#view .page-welcome {
  max-width: 44ch;
  margin: 16px 0 24px;
  color: var(--fg);
  font-size: 20px;
  line-height: 1.55;
}

#view .connect-start {
  display: inline-block;
  padding: 12px 22px;
  font-size: 16px;
  border-radius: 8px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
#view .connect-start:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
