/* The notes page's own layer: a dated list, set in the two middle columns. Everything else is
   page.css.

   The sheet already spans four diamond columns, so a quarter in and a half wide puts the text
   between the second and third rules exactly — a reading measure that is a grid position rather
   than a max-width picked to look about right. It also gives the panel on the left something to
   sit beside rather than above, which is what the extra column is for. */
@media(min-width:901px){
  .sheet.is-narrow > :not(.side-panel){width:50%;margin-left:25%;transition:margin-left .28s cubic-bezier(.2,.7,.3,1)}
  /* While a note is open the list steps left a column, into the first two, and the reader takes
     the other two. Without it the reader lands on top of the right half of every row, so the only
     way to open a second note is to close the first — and a list you cannot use is a list that
     may as well have been replaced. */
  .reading .sheet.is-narrow > :not(.side-panel){margin-left:0}
}
@media(prefers-reduced-motion:reduce){
  .sheet.is-narrow > :not(.side-panel){transition:none}
}
.notes{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
/* A rail for the date and a column for the note, so the dates line up down the page and the
   titles start on one edge however long a date is. */
.note{display:grid;width:100%;grid-template-columns:minmax(0,124px) minmax(0,1fr);gap:4px 24px;padding:18px 0;border-top:1px solid var(--hairline);text-align:left;color:inherit;transition:opacity .15s}
.note:hover .note-title,.note:focus-visible .note-title{color:var(--line)}
/* The list says which note the reader is showing, since the panel covers the row it came from. */
.note.is-open .note-title{color:var(--line)}
.note.is-open .note-date{color:var(--line);opacity:1}
.note:first-child{border-top:0;padding-top:4px}
.note-date{margin:0;color:var(--line)}
.note-body{display:flex;flex-direction:column;gap:6px;min-width:0}
.note-title{margin:0;color:var(--ink);transition:color .15s}
.note-what{margin:0;color:var(--text);max-width:62ch}

a.note{color:inherit;transition:opacity .15s}
a.note:hover .note-title,a.note:focus-visible .note-title{color:var(--line)}

/* A draft looks like one, in the list and in the reader. */
.note.is-draft .note-date{color:var(--text);opacity:.55}
.note.is-draft .note-title,.note.is-draft .note-what{opacity:.6}
.read-date.is-draft{color:var(--text);opacity:.6}
.read-p.is-draft{opacity:.6}

@media(max-width:720px){
  .note{grid-template-columns:1fr;gap:4px}
}

/* The reader. It opens from the right with its left edge on the middle major rule — notes.js sets
   that from the same lattice everything else is measured against — and overlays rather than
   pushing, so the list you were reading is still where you left it when it closes. */
.reader{position:fixed;top:var(--edge);right:var(--edge);bottom:var(--edge);z-index:6;
  left:var(--reader-left,50%);display:flex;flex-direction:column;
  background:var(--surface);border:1px solid var(--hairline);border-radius:var(--radius);
  box-shadow:-18px 0 44px #1d1a0c14;overflow:hidden;
  transform:translateX(calc(100% + var(--edge)));transition:transform .28s cubic-bezier(.2,.7,.3,1)}
.reader.is-open{transform:translateX(0)}
.reader-close{position:absolute;top:14px;right:14px;z-index:2;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:2px;color:var(--text);transition:background-color .15s,color .15s}
.reader-close:hover,.reader-close:focus-visible{background:var(--surface-sunk);color:var(--line)}
.reader-close svg{width:16px;height:16px}

.reader-body{overflow-y:auto;padding:28px 28px 40px;display:flex;flex-direction:column;gap:12px}
/* Capped inside a panel that is wider than a line should be: the panel is sized by the grid, the
   text by what is comfortable to read. */
.read-date{margin:0;color:var(--line)}
.read-title{margin:0 0 4px;color:var(--ink);max-width:24ch}
.read-p{margin:0;color:var(--text);max-width:62ch}
.read-list{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px;color:var(--text);max-width:62ch}

@media(prefers-reduced-motion:reduce){
  .reader{transition:none}
}
@media(max-width:900px){
  /* Full width on a phone: a side panel that leaves a sliver of the page behind it is neither. */
  .reader{left:var(--edge)}
}

/* In the homepage's panel the note's own X sits beside the panel's, not under it. */
html.in-panel .reader-close{right:48px}
