/* The bar every page of ours carries — the record, the setup form and the
   client view. One file so the three cannot drift apart. */
/* One column, 960px, centred — the bar included, so the title sits over the
   page's left edge and the buttons over its right rather than out at the window
   borders. `width: 100%` with `box-sizing: border-box` keeps the padding inside
   that 960 instead of adding to it, which is what makes the two margins equal. */
/* Colours come from tokens.css (the front's palette), linked by every page
   before this file, so the bar matches the front and the record rather than
   Phanpy: --surface is the page ground, --raised the bar band on top of it. */
body { background: var(--surface); }
/* The BAND spans the window; its CONTENTS stay in the 960 column. Constraining
   the element itself left the colour as a stripe with bare page either side.
   The inline padding is the column's own margin plus the 1rem the page uses
   inside it, so the title lands exactly on the page's left edge — and `max`
   keeps it at 1rem once the window is narrower than the column.
   No rule underneath: the tone change is the boundary, and a line as well
   would be drawing it twice. */
/* Wraps, because it does not fit: at 320px the title plus three destinations
   ran 67px past the viewport, and the bar is on every page — so the whole
   document scrolled sideways whatever was under it. */
#bar { flex: 0 0 auto; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  width: 100%; max-width: none; margin: 0; box-sizing: border-box;
  /* The column width is the page's to declare (--bar-col); 960 stands where a
     page says nothing. */
  padding: .5rem max(1rem, calc((100% - var(--bar-col, 960px)) / 2 + 1rem));
  background: var(--raised); }
/* The actor's fediverse handle, in the row between the title and the
   destinations. */
#bar-handle { color: var(--heading); font-size: .95rem; margin-right: .6rem; }
#bar-handle:empty { display: none; }
/* The actors dropdown, where a page's bar carries one instead of the static
   handle. Styled here so every page's bar shows the same control: the same
   light well and drawn caret every setting on the record page uses. */
#bar select { font: inherit; font-size: .95rem; max-width: min(24rem, 55vw);
  margin-right: .6rem; appearance: none; min-width: 0;
  padding: .15rem 1.7rem .15rem .55rem;
  border: 1px solid var(--field-edge); border-radius: .3rem;
  color: var(--ink); cursor: pointer;
  background-color: var(--field-bg); background-image: var(--chevron);
  background-repeat: no-repeat; background-position: right .55rem center;
  background-size: .6rem auto; }
#bar select:hover { background-color: var(--field-bg-hover); }
/* The app title, in px rather than rem: it is chrome, the same on every page,
   not something that should move when a page changes its base size. */
#bar .name { flex: 1 1 auto; font-weight: 600; font-size: 40px; color: var(--heading);
  margin: 0; line-height: 1.1; }
/* The browser build wraps the brand text in a link (to /?add) — the general
   #bar a rule below would otherwise pin it back down to nav-link size and
   colour, since a rule on the anchor itself always wins over inheriting the
   heading's size. */
#bar .name a { font: inherit; color: inherit; text-decoration: none; }
/* Plain text, not chrome: three destinations in a row read better without a
   box round each. */
#bar button, #bar a { font: inherit; font-size: .95rem; padding: .15rem .2rem;
  border: 0; background: none; color: var(--link); cursor: pointer;
  text-decoration: none; }
/* The page you are already on stays in the row, so the set never moves — it is
   underlined rather than removed. */
#bar button[aria-current="page"], #bar a[aria-current="page"] {
  text-decoration: underline; text-underline-offset: .3rem; }
/* The client control: which fediverse client this browser opens. The label is
   quieter than the links; the one in use is marked `aria-current="true"` — the
   current item of a set, which on the record page is not the current PAGE — so
   it needs its own mark rather than borrowing the rule above. */
#bar #client-pick, #bar #account-pick { display: inline-flex; gap: .6rem; align-items: baseline;
  white-space: nowrap; margin-left: 1rem; }
#bar #client-now, #bar #account-now { opacity: .75; }
/* The notices bell: the one filled control in the bar, because it is the one
   thing there that is not a place to go but something to be told. The count is
   how many notices this browser has not opened yet; with none it is quiet. */
#bar #bar-notices { display: inline-flex; align-items: center; gap: .35rem; margin-left: 1rem;
  padding: .3rem .7rem; border-radius: 999px; font-size: 1.05rem; line-height: 1;
  background: var(--btn); color: var(--btn-text); border: 1px solid var(--btn); }
/* `display` on an id rule outranks the browser's own [hidden] rule, and the
   shell has no !important of its own, so the bell hid on the record page and
   showed on the client with nothing to show. Said here, once, for every page. */
#bar #bar-notices[hidden] { display: none; }
#bar #bar-notices:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
#bar #bar-notices:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
#bar #bar-notices-count { font-size: .9rem; font-weight: 700; min-width: 1.3em; text-align: center;
  padding: .05rem .4rem; border-radius: 999px; background: var(--btn-text); color: var(--btn); }
#bar #bar-notices-count:empty { display: none; }
#bar #bar-notices[data-new="0"] { background: var(--field-bg); color: var(--ink); border-color: var(--field-edge); }
#bar a[aria-current="true"] {
  font-weight: 700; text-decoration: underline; text-underline-offset: .3rem; }

/* The two-clients notice: said once, to somebody who knew this page when it
   had one client. Sized and placed rather than left to the browser's default,
   which stretched it edge to edge and put it over the very links it names. */
#client-news, #notices-list, #notice-view {
  /* Low rather than centred: it points at the links in the bar, so the bar has
     to stay in view while it is read. */
  max-width: 34rem; margin: auto auto 2.5rem; padding: 1.5rem 1.7rem;
  border: 1px solid var(--dialog-edge); border-radius: .6rem;
  background: var(--raised); color: var(--fg);
  font: 1rem/1.55 var(--font);
  box-shadow: 0 .6rem 2rem rgba(0, 0, 0, .25);
}
#client-news::backdrop, #notices-list::backdrop, #notice-view::backdrop { background: rgba(0, 0, 0, .45); }
#client-news h2, #notices-list h2, #notice-view h2 { font-size: 1.25rem; margin: 0 0 .9rem; color: var(--heading); }
#client-news p, #notices-list p, #notice-view p { margin: 0 0 1.2rem; }
#client-news p:last-child, #notices-list p:last-child, #notice-view p:last-child { margin: 0; }
#client-news button, #notices-list button, #notice-view button {
  font: inherit; padding: .55rem 1.3rem; border-radius: .35rem; cursor: pointer;
  background: var(--btn); color: var(--btn-text); border: 1px solid var(--btn);
}
#client-news button:hover, #notices-list button:hover, #notice-view button:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
#client-news button:focus-visible, #notices-list button:focus-visible, #notice-view button:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* The notices dialogs are centred and never taller than the window: the
   client-news rule above sits low, and a short window pushed a list of
   notices up past the top edge where nothing could reach it. */
#notices-list, #notice-view { margin: auto; max-height: calc(100dvh - 3rem); overflow: auto; box-sizing: border-box; }
/* The list of notices: each title a button that opens that notice, the date
   beside it, the ones not yet opened here in bold. */
#notices-items { list-style: none; margin: 0 0 1.2rem; padding: 0; }
#notices-items li { display: flex; gap: .8rem; align-items: baseline; padding: .45rem 0;
  border-bottom: 1px solid var(--line); }
#notices-items li:last-child { border-bottom: 0; }
#notices-items button.notice-open { flex: 1 1 auto; text-align: left; padding: .1rem 0;
  background: none; border: 0; color: var(--link); text-decoration: underline; text-underline-offset: .2rem; }
#notices-items li.new button.notice-open { font-weight: 700; }
#notices-items .when, #notice-view .when { color: var(--sub); font-size: .9rem; white-space: nowrap; }
#notices-items p.none { color: var(--sub); }
#notice-view-body p { margin: 0 0 .9rem; }
#notice-view-body a { color: var(--link); word-break: break-all; }
