/* ---- a note on the open web ----
   The only page in this app a stranger ever sees, so it is the only page that
   has to work on somebody with no reason to be patient. It is a reading surface
   first: the note takes the width, the type is set for prose rather than for a
   list scanned twenty times a day, and everything about the product is below the
   last word.

   Deliberately not the editor with its controls hidden. Chrome belongs to
   somebody who has notes of their own. */

.pub {
  min-block-size: 100dvh;
  padding: var(--space-8) var(--space-4) var(--space-16);
  background: var(--surface-2);
}

/* A sheet, centred, with the writing at a comfortable measure. The background
   behind it is what makes it read as a page rather than as an app screen. */
.pub-paper {
  max-inline-size: 44rem;
  margin-inline: auto;
  padding: var(--space-12) var(--space-8);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-sm);
}

.pub-head {
  margin-block-end: var(--space-8);
  padding-block-end: var(--space-6);
  border-block-end: 1px solid var(--border-subtle);
}

.pub-title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  /* Even line lengths on a heading somebody is about to read once. */
  text-wrap: balance;
}

.pub-by {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.pub-author {
  font-weight: var(--weight-medium);
}

.pub-dot {
  color: var(--ink-faint);
}

/* Prose, not interface. Slightly larger and looser than the editor's preview,
   because this is read straight through rather than scanned. */
.pub-body {
  font-size: var(--text-lg);
  line-height: 1.75;
}

.pub-gone {
  text-align: center;
}

.pub-gone h1 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-2xl);
}

.pub-gone p {
  margin: 0 0 var(--space-6);
  color: var(--ink-muted);
  max-inline-size: 34rem;
  margin-inline: auto;
}

/* ---- giving one note away ----
   Behind a disclosure like the history above it, because it is a thing you go
   and do rather than a thing you need while writing. */

.notshare {
  margin-block-start: var(--space-6);
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--border-subtle);
}

.notshare > summary {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--ink-muted);
  cursor: pointer;
}

/* The two halves are separated, because they answer different questions: one
   goes to a named person, the other to whoever has the link. */
.notshare-block {
  margin-block-start: var(--space-5);
  max-inline-size: var(--measure);
}

.notshare-heading {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--ink-muted);
}

.notshare-give,
.notshare-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.notshare-email,
.notshare-url {
  flex: 1;
  min-inline-size: 12rem;
  min-block-size: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
}

.notshare-url {
  color: var(--ink-muted);
  /* The token is 64 characters and nobody reads it; it is here to be copied. */
  text-overflow: ellipsis;
}

.notshare-note {
  margin: var(--space-2) 0 0;
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.notshare-note.is-error {
  color: var(--danger);
}

.notshare-people {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.notshare-person {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.notshare-who {
  flex: 1;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notshare-role {
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.notshare-remove,
.notshare-unpublish {
  border: none;
  background: none;
  padding: 0;
  color: var(--ink-faint);
  font-size: var(--text-xs);
  cursor: pointer;
}

@media (hover: hover) {
  .notshare-remove:hover,
  .notshare-unpublish:hover {
    color: var(--danger);
  }
}

.notshare-unpublish {
  margin-block-start: var(--space-3);
}

/* The one line on this panel with a colour, for the one state worth announcing:
   this note is readable by anybody who has the link. */
.notshare-live {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0 0 var(--space-2);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
