/* The guides, as a screen of the app shell.

   These pages are read rather than scanned, so the sheet is the same paper the
   boards use and the type is the same type: a serif heading, sans prose, one
   green, hairlines instead of boxes. What the page adds is the only thing a
   reader needs from a long piece - a measure that stays at 68 characters, a
   contents rail that follows the scroll, and a short answer set apart before
   the argument starts.

   Nothing here speaks louder than the rest of the site: no full-bleed bands,
   no numbered slabs, no second palette. The one picture sits at the width of
   the sheet, cropped to a band, and carries the subject the way the item page's
   icon does. */

/* ---- the screen ---------------------------------------------------------- */

.shell[data-screen="guide"] .workspace {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}
.shell[data-screen="guide"] .col-side { display: none; }
/* The sheet runs to the foot of the workspace, so an article is a page rather
   than a card that stops a third of the way down. The hub is an index and ends
   with its last row, as the account desks' sheets do. */
.shell[data-screen="guide"] .col-main > .list-card { flex: 1; }
.shell[data-screen="guide"] .col-main > .list-card:has(.guideview-index) {
  flex: 0 0 auto;
}
/* The piece is one sheet, so the blocks inside it own their padding and the
   picture can meet the sheet's edges. */
.shell[data-screen="guide"] .list-card {
  padding: 0;
  overflow: visible;
}
.shell[data-screen="guide"] .board-body { padding: 0; overflow: visible; }

/* Every guide screen prints its name on the sheet - the hub its own, an article
   its piece - so the head above the paper is only ever the open-items strip's
   row, and only when there is a strip. */
#shell[data-screen="guide"] .page-head { display: none; }
/* With open items the strip gets the row to itself. */
#shell[data-screen="guide"] .page-head:has(#tb-pages:not([hidden])) {
  align-items: center;
  padding-block: 8px 12px;
}
#shell[data-screen="guide"] .page-head:has(#tb-pages:not([hidden])) #tb-pages {
  order: 0;
  flex: 1 1 0;
  min-width: 0;
  height: 50px;
}
#shell[data-screen="guide"] .page-head:has(#tb-pages:not([hidden])) #items-all { order: 0; }

/* ---- shared type --------------------------------------------------------- */

/* A sheet of prose is not a table: the card stays the width of the page, and
   the document on it is the width a reader can actually hold, centred, so the
   cream either side of the measure reads as a margin rather than as a gap in
   the layout. The measure ends where reading does, at 70 characters. */
.guideview {
  width: 100%;
  max-width: 920px;
  margin-inline: auto;
  padding: 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.72;
}
/* The hub is an index, not a piece of prose: it is the sheet's own width, as
   every other hub is, so its rules and its cards meet the sheet's edges. */
.guideview-index { max-width: none; }
/* With items open the head is the strip's row and nothing else: the same
   18px/14px padding and the same single-height chips every other screen's head
   keeps, so the sheet starts at the same line on all of them. */
#shell[data-screen="guide"] .page-head:has(#tb-pages:not([hidden])) {
  display: flex;
  height: var(--strip-h);
  min-height: var(--strip-h);
  flex-wrap: nowrap;
  padding: 18px 30px 14px;
  row-gap: 0;
}
#shell[data-screen="guide"] .page-head:has(#tb-pages:not([hidden])) #tb-pages {
  height: 19px;
  flex: 1 1 auto;
}
/* Both sheets wear the account desks' brass top rule on their own edge, the way
   Lists, Flips and Alerts wear it, rather than a second line inside the frame. */
#shell[data-screen="guide"] .list-card {
  border-top: 2px solid var(--line-strong);
}
.guideview a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.guideview a:hover {
  color: var(--accent-2);
  text-decoration-color: currentColor;
}
.guideview b { color: var(--ink); font-weight: 600; }

.gd-eyebrow,
.gd-label,
.gd-intro-title {
  margin: 0;
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.gd-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.gd-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink-4);
  font-size: 12px;
  letter-spacing: .01em;
}
.gd-dot { color: var(--line-strong); }
.gd-go { display: block; color: var(--ink-4); }
.gd-go svg { display: block; width: 15px; height: 15px; }

/* ---- the picture --------------------------------------------------------- */

.gd-hero,
.gd-feature-figure { margin: 0; }
.gd-hero img,
.gd-feature-figure img {
  display: block;
  width: 100%;
  object-fit: cover;
  object-position: center 46%;
}
/* The band takes the picture's own shape, which the image's width and height
   attributes carry: the guide markup reads them from the file, so a new
   screenshot needs no change here. `cover` would enlarge a mismatched one. */
.gd-hero img { height: auto; }
.gd-feature-figure img { height: clamp(180px, 26vw, 380px); }

/* ---- the article --------------------------------------------------------- */

.guideview-article { display: flex; flex-direction: column; }

/* The run, the day and the read stand in the mast's right column, the way a
   desk keeps its own reading or its deed there, so the piece opens with its
   name and ends its head with one line of furniture. */
.gd-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 14px;
  margin: 0;
}
.gd-byline .gd-kicker {
  padding: 3px 7px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
}
.gd-byline .gd-meta { font-size: 12px; }

/* Prose is set a step above the board's 14px rows: a screen of reading earns
   the size, and the larger face is what makes the measure fill the sheet
   without stretching the line past comfort. */
.gd-main {
  max-width: 620px;
  padding: 30px 32px 44px;
  font-size: 17.5px;
  line-height: 1.7;
  text-wrap: pretty;
}
.gd-main > :first-child { margin-top: 0; }
.gd-main p { margin: 0 0 15px; }

.gd-main h2 {
  margin: 36px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
  text-transform: none;
  text-wrap: balance;
}
.gd-main h2::before { content: none; }
.gd-main h3 {
  margin: 22px 0 6px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}

/* Conditions are ticked squares; steps are numbered, because an order matters
   and a reader skipping the piece reads the numbers first. */
.guideview-article .gd-list,
.guideview-article .gd-steps {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.guideview-article .gd-list li {
  position: relative;
  margin: 0 0 11px;
  padding-left: 19px;
}
.guideview-article .gd-list li::before {
  content: "";
  position: absolute;
  top: .58em;
  left: 2px;
  width: 5px;
  height: 5px;
  background: var(--accent);
}
.guideview-article .gd-steps { counter-reset: gd-step; }
.guideview-article .gd-steps li {
  counter-increment: gd-step;
  position: relative;
  margin: 0 0 13px;
  padding-left: 26px;
}
.guideview-article .gd-steps li::before {
  content: counter(gd-step);
  position: absolute;
  top: .08em;
  left: 0;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
}

/* A picture inside the prose is the product, not ornament: it takes the
   measure's width and keeps the same hairline frame the hub's card uses, so a
   screenshot reads as a window into the app rather than a floating plate. */
#shell[data-screen="guide"] .gd-shot { margin: 2px 0 20px; }
#shell[data-screen="guide"] .gd-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
#shell[data-screen="guide"] .gd-shot a { display: block; cursor: zoom-in; }

/* The press opens the picture over the page rather than leaving it: the shot at
   the width the window can hold, the article dimmed behind it, one mark to
   close. `dialog::backdrop` is the browser's own layer, so nothing here has to
   sit above the app's panels. */
.gd-lightbox {
  padding: 0;
  border: 0;
  background: none;
  max-width: 94vw;
  max-height: 92vh;
  overflow: visible;
}
.gd-lightbox::backdrop { background: rgba(7, 25, 37, .8); }
.gd-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: 94vw;
  max-height: 88vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.gd-lightbox-x {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(7, 25, 37, .72);
  color: #fff;
  cursor: pointer;
}
.gd-lightbox-x:hover { background: rgba(7, 25, 37, .92); }
.gd-lightbox-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* The worked example is a table because the comparison is read across, not
   down: two columns of figures are a table, not a list. The wrapper scrolls
   rather than the sheet, so a phone can read both columns without the page
   moving sideways under it.

   The article is rendered inside `#board`, and `.board-body` dresses every
   `th` there as a ledger head: a dark plate, 9px capitals and a teal rule. A
   table in prose sits on the sheet, so each of those is restated under the
   shell's own name, which is the weight that outranks it. */
#shell[data-screen="guide"] .gd-table { margin: 0 0 18px; overflow-x: auto; }
#shell[data-screen="guide"] .gd-main table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
#shell[data-screen="guide"] .gd-main table th,
#shell[data-screen="guide"] .gd-main table td {
  position: static;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: right;
  text-transform: none;
  white-space: nowrap;
}
#shell[data-screen="guide"] .gd-main table tr > :first-child {
  width: 45%;
  text-align: left;
  white-space: normal;
}
#shell[data-screen="guide"] .gd-main table thead th {
  border-bottom-color: var(--line);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
#shell[data-screen="guide"] .gd-main table tbody th {
  color: var(--ink-3);
  font-weight: 400;
}
#shell[data-screen="guide"] .gd-main table tr:last-child > * { border-bottom: 0; }

/* Where to go next is a list of doors on the sheet's ruled rows. */
.guideview-article .gd-next {
  margin: 34px 0 0;
  padding: 0;
  border: 0;
  background: none;
}
.guideview-article .gd-next ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.guideview-article .gd-next li { border-bottom: 1px solid var(--line-soft); }
.guideview-article .gd-next a {
  display: block;
  padding: 9px 0;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}
.guideview-article .gd-next a:hover { color: var(--accent); }

.guideview .gd-note {
  margin: 22px 0 0;
  color: var(--ink-4);
  font-size: 12px;
  line-height: 1.55;
}

/* The rail: the piece's sections, in the margin, following the scroll. */
.gd-rail { font-size: 13px; }
.gd-toc { position: sticky; top: 14px; }
.gd-toc ol {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.gd-toc li { border-top: 1px solid var(--line-soft); }
.gd-toc li:last-child { border-bottom: 1px solid var(--line-soft); }
.gd-toc a {
  display: block;
  padding: 8px 0 8px 10px;
  border-left: 2px solid transparent;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
}
.gd-toc a:hover {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

@media (min-width: 1080px) {
  .guideview-article {
    display: grid;
    grid-template-columns: minmax(0, 620px) 208px;
    grid-template-rows: auto auto 1fr;
    column-gap: 40px;
    align-items: start;
    justify-content: space-between;
  }
  .gd-mast { grid-column: 1 / -1; }
  .gd-hero { grid-column: 1 / -1; }
  .gd-main { grid-column: 1; grid-row: 3; }
  .guideview-article .gd-rail {
    grid-column: 2;
    grid-row: 3;
    align-self: stretch;
    padding: 30px 32px 32px 0;
  }
}
@media (max-width: 1079px) {
  /* With the contents rail gone the piece is one column, centred on the sheet,
     so the mast, the picture and the prose share a measure instead of sitting
     in the left of a 920px page with the rail's column empty beside them. */
  .guideview-article {
    max-width: 684px;
    margin-inline: auto;
  }
  /* The mast's padding is the measure's gutter, so the prose fills the column
     at 620 characters instead of stopping 64px short of its own picture. */
  .guideview-article .gd-main { max-width: none; }
  .guideview-article .gd-rail { display: none; }
}
/* A desk's mast drops its lede on a phone, where there is no room for a line of
   description above the work. An article's standfirst is not a description of a
   section but the sentence that says what the piece is for, so it stays; the
   hub, whose lede describes the section, keeps hiding its own. */
@media (max-width: 760px) {
  .guideview-article .page-mast-lede {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.5;
  }
}

/* The mast is printed on the piece's own measure: its trail, name and standfirst
   start on the line the prose under them starts on. */
.guideview-article .gd-mast { padding-inline: 32px; }

/* ---- the hub ------------------------------------------------------------- */

.guideview-index { display: flex; flex-direction: column; }

/* The hub's mast: the account desks' page mast, printed on the sheet rather
   than in the shell's head, so the trail, the name and the reading open the
   paper the way they open Lists and Alerts. */
.gd-mast {
  padding: 18px 30px 16px;
  border-bottom: 1px solid var(--line);
}
/* The name and the reading take the desk masthead's own sizes, so the hub's
   first lines are the ones Lists and Alerts print. */
.gd-mast .page-mast-title {
  margin: 0;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1;
}
.gd-mast .page-mast-lede {
  max-width: 64ch;
  margin-top: 7px;
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.5;
  text-wrap: pretty;
}

/* The newest piece: the sheet's own frame, a picture on the left, the name set
   as the page's second largest thing, and the run's own facts in a margin of
   their own so the block reaches the sheet's right edge. The picture starts on
   the same 30px gutter as the intro above and the note below. */
.gd-feature {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr) 176px;
  margin: 0;
  padding-left: 30px;
  border-bottom: 1px solid var(--line);
}
/* The picture and the name are one anchor: a press anywhere on the card is the
   way into the piece, not just the words in its corner. */
.gd-feature-link {
  grid-column: 1 / 3;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  text-decoration: none;
}
.gd-feature-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gd-feature-figure { grid-column: 1; }
.gd-feature-figure img {
  height: 100%;
  min-height: 236px;
  object-position: 52% 40%;
  /* A hairline, not a frame: the picture sits in the sheet rather than on it. */
  outline: 1px solid var(--line-soft);
  outline-offset: -1px;
}
.gd-feature-main {
  grid-column: 2;
  padding: 24px 30px 24px;
}
.guideview .gd-feature-title {
  margin: 6px 0 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.gd-feature-link:hover .gd-feature-title { color: var(--accent); }
.gd-feature-dek {
  display: block;
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.55;
}
.gd-feature-rail {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 24px 28px 24px 22px;
  border-left: 1px solid var(--line);
}
.gd-feature-rail .gd-read { margin-top: auto; padding-top: 12px; }
/* The rail is narrow: the date and the read go one per line there, so the dot
   between them is not left hanging at the end of a wrapped line. */
@media (min-width: 1024px) {
  .gd-feature-rail .gd-meta { flex-direction: column; align-items: flex-start; gap: 3px; }
  .gd-feature-rail .gd-meta .gd-dot { display: none; }
}
/* A cue, not a control: the card around it is the link, so this line carries the
   direction without taking a press or a tab stop of its own. */
.gd-read {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
}
.gd-feature-link:hover .gd-read { color: var(--accent); }
.gd-read .gd-go { color: var(--accent); }

/* The tools behind the guides: three pages a reader can use now, so a hub with
   one article still ends with somewhere to go. */
.gd-tools > .gd-label { padding: 20px 30px 10px; }
.gd-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  /* One ruled register: the rule runs under the label across the sheet, and the
     columns are divided by hairlines rather than each card carrying its own. */
  padding: 0 30px 20px;
  list-style: none;
  border-top: 1px solid var(--line);
}
.gd-tools-grid > li + li { border-left: 1px solid var(--line-soft); }
.gd-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  row-gap: 5px;
  padding: 13px 18px 15px 0;
  color: var(--ink);
  text-decoration: none;
}
.gd-tools-grid > li + li .gd-tool { padding-left: 18px; }
.gd-tool-name {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.gd-tool-dek { grid-column: 1 / -1; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.gd-tool .gd-go { grid-column: 2; grid-row: 1; }
.gd-tool:hover .gd-tool-name { color: var(--accent); }
.gd-tool:hover .gd-go { color: var(--accent); }

/* Older pieces: ruled rows, the name a size above the description. */
.guideview-index > .gd-label { padding: 22px 30px 10px; }
.gd-posts {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.gd-post {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  column-gap: 24px;
  padding: 14px 30px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
}
.gd-post-copy { display: block; max-width: 64ch; }
.gd-post-title {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.gd-post-dek { display: block; margin-top: 3px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.gd-post .gd-meta { font-size: 11px; }
.gd-post:hover { background: rgba(33, 31, 26, .025); }
.gd-post:hover .gd-post-title { color: var(--accent); }
.gd-post:hover .gd-go { color: var(--accent); }
.gd-go { transition: color var(--t-quick, .16s) var(--ease, ease); }

/* Phones and portrait tablets: one column, the padding tightened, the sheet and
   the picture kept. The three-column card holds from 1024 down to a 340px
   picture and a 176px rail with the name in between, so the row starts there
   rather than at the same 1041 the rail's stacked meta used to start at. */
@media (max-width: 1023px) {
  .gd-feature { grid-template-columns: minmax(0, 1fr); padding-left: 0; }
  .gd-feature-link { grid-column: 1; grid-template-columns: minmax(0, 1fr); }
  .gd-feature-figure,
  .gd-feature-main,
  .gd-feature-rail { grid-column: 1; grid-row: auto; }
  .gd-feature-figure img { height: clamp(170px, 40vw, 260px); min-height: 0; }
  .gd-feature-rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 20px 20px;
    border-left: 0;
  }
  .gd-feature-main { padding: 18px 20px 12px; }
  /* The cue takes its own line under the facts, rather than butting against the
     read time at the end of a wrapped row. */
  .gd-feature-rail .gd-read { flex-basis: 100%; margin-top: 0; padding-top: 2px; }
}
/* Three columns while three columns fit; below that the tools become one ruled
   list rather than a squeezed row. */
@media (max-width: 900px) {
  .gd-tools-grid { grid-template-columns: minmax(0, 1fr); padding: 0 20px 16px; }
  .gd-tools > .gd-label { padding: 18px 20px 8px; }
  .gd-tools-grid > li + li { border-left: 0; border-top: 1px solid var(--line-soft); }
  .gd-tools-grid > li + li .gd-tool { padding-left: 0; }
}
@media (max-width: 700px) {
  .guideview-article .gd-mast { padding: 16px 20px 14px; }
  .gd-byline { gap: 6px 12px; }
  .gd-main { padding: 22px 20px 34px; font-size: 16.5px; }
  .gd-main h2 { font-size: 1.375rem; margin-top: 28px; }
  .gd-feature-main { padding: 16px 20px 10px; }
  .gd-feature-rail { padding: 0 20px 18px; }
  .guideview .gd-feature-title { font-size: 1.4375rem; }
  .guideview-index > .gd-label { padding: 18px 20px 8px; }
  .gd-post {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 6px;
    padding: 12px 20px;
  }
  .gd-post .gd-go { display: none; }
  .gd-post-title { font-size: 1.0625rem; }
}
