/* The owner's bar between the blog and the dashboard (platform
   owner.html on the blog, View/Layout.elm in the dashboard, which loads
   this file too): fixed in the window's top right corner. In it: the
   dashboard's sections (posts and settings), a new post, for admins the
   admin panel, the toggle (on the blog a gear that edits what's showing,
   in the dashboard the way back to the blog), and the owner, which opens
   to their blogs and signing out. */
.owner-bar {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font: 500 0.85rem/1 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.owner-new,
.owner-admin,
.owner-toggle,
.owner-user > summary {
  display: grid;
  place-items: center;
  height: 2.5rem;
  border-radius: 999px;
  background: #fff;
  color: #222;
  box-shadow: 0 0.15rem 0.6rem rgb(0 0 0 / 0.2);
  text-decoration: none;
  cursor: pointer;
}
.owner-new { padding: 0 1rem; background: #222; color: #fff; }
.owner-admin { width: 2.5rem; }
.owner-toggle { width: 2.5rem; margin-right: 0.6rem; padding: 0; border: 0; font: inherit; }
/* While the front page is being edited the gear becomes the way back to
   the blog, as the dashboard has it. */
.owner-toggle .owner-toggle-view,
.owner-toggle[aria-pressed="true"] .owner-toggle-edit { display: none; }
.owner-toggle[aria-pressed="true"] .owner-toggle-view { display: block; }

/* The dashboard's sections, in one pill centred at the top of the
   window, the one showing marked. They show in edit mode: always in the
   dashboard, on the blog while the gear is on. */
.owner-links {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  height: 2.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0.15rem 0.6rem rgb(0 0 0 / 0.2);
}
.owner-link {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  color: #444;
  text-decoration: none;
  white-space: nowrap;
}
.owner-link:hover { background: #f0f0ee; color: #000; }
.owner-link[aria-current="page"] { background: #222; color: #fff; }
.app .owner-links,
.owner-bar:has(.owner-toggle[aria-pressed="true"]) .owner-links { display: flex; }
/* On narrow screens they're in the owner's menu instead. */
.owner-menu .owner-menu-links { display: none; }
@media (max-width: 60rem) {
  .app .owner-links,
  .owner-bar:has(.owner-toggle[aria-pressed="true"]) .owner-links { display: none; }
  .app .owner-menu .owner-menu-links,
  .owner-bar:has(.owner-toggle[aria-pressed="true"]) .owner-menu .owner-menu-links { display: block; }
}
/* The owner: an outline of a person, round like the toggle. */
.owner-user > summary { width: 2.5rem; padding: 0; list-style: none; }
.owner-user > summary::-webkit-details-marker { display: none; }
.owner-user > summary :is(svg, .icon) { display: block; }
.owner-new:hover,
.owner-admin:hover,
.owner-toggle:hover,
.owner-user > summary:hover { box-shadow: 0 0.2rem 0.9rem rgb(0 0 0 / 0.3); }
.owner-new:hover { color: #fff; }
.owner-admin:hover,
.owner-toggle:hover { color: #000; }
.owner-admin svg,
.owner-admin .icon,
.owner-toggle svg,
.owner-toggle .icon { display: block; }
.owner-user { position: relative; }
.owner-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 12rem;
  max-width: 20rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  padding: 0.3rem;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0.3rem 1.2rem rgb(0 0 0 / 0.2);
}
/* A section of the menu, such as the blogs. */
.owner-heading {
  margin: 0.4rem 1rem 0.2rem;
  color: #777;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.owner-menu a,
.owner-menu button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #222;
  font: inherit;
  text-align: left;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.owner-menu a[aria-current="page"] { font-weight: 700; }
.owner-menu a[aria-current="page"]::before { content: "✓ "; }
.owner-menu a:hover,
.owner-menu button:hover { background: #f0f0ee; color: #222; }
/* Signing out, apart from the blogs. */
.owner-menu form { margin: 0.3rem 0 0; padding-top: 0.3rem; border-top: 1px solid #eee; }
@media print { .owner-bar { display: none; } }

/* Visitors' way to sign in (platform owner.html): a person, where the
   signed-in owner's bar has its person (.owner-user), the same size. */
.visitor-signin {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1000;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: #fff;
  color: #222;
  box-shadow: 0 0.15rem 0.6rem rgb(0 0 0 / 0.2);
}
.visitor-signin:hover,
.visitor-signin:focus-visible { color: #000; box-shadow: 0 0.2rem 0.9rem rgb(0 0 0 / 0.3); }
.visitor-signin svg { display: block; }
@media print { .visitor-signin { display: none; } }

/* When the theme's header stays at the top and shrinks as the page
   scrolls (the header_sticky and header_shrink settings, over the first
   8rem, as the themes do it), the bar and the sign-in shrink with it, so
   they stay well inside the shrunk header. */
@property --owner-shrink {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@keyframes owner-shrink { to { --owner-shrink: 1; } }
@supports (animation-timeline: scroll()) {
  .setting-header_sticky-true:not(.setting-header_shrink-false) :is(.owner-bar, .visitor-signin) {
    animation: owner-shrink linear both;
    animation-timeline: scroll(root);
    animation-range: 0 8rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  :is(.owner-bar, .visitor-signin) { animation: none !important; }
}
.owner-bar,
.owner-links,
.visitor-signin {
  --owner-size: calc(2.5rem - 0.75rem * var(--owner-shrink));
  top: calc(0.75rem - 0.125rem * var(--owner-shrink));
}
.owner-bar { gap: calc(0.6rem - 0.15rem * var(--owner-shrink)); }
.owner-links,
.owner-new,
.owner-admin,
.owner-toggle,
.owner-user > summary,
.visitor-signin { height: var(--owner-size); }
.owner-admin,
.owner-toggle,
.owner-user > summary,
.visitor-signin { width: var(--owner-size); }
.owner-new {
  padding: 0 calc(1rem - 0.2rem * var(--owner-shrink));
  font-size: calc(0.85rem - 0.07rem * var(--owner-shrink));
}
.owner-bar svg,
.visitor-signin svg { width: calc(20px - 3px * var(--owner-shrink)); height: auto; }

/* The room the bar takes in the window's top right corner, for themes to
   keep their header's contents clear of it (pkg/theme/doc.go). On narrow
   screens New post folds to a "+", leaving the blog's name more room. */
:root:has(.visitor-signin) { --owner-bar-space: 3.5rem; }
:root:has(.owner-bar) { --owner-bar-space: 14rem; }
:root:has(.owner-admin) { --owner-bar-space: 17rem; }
@media (max-width: 40rem) {
  .owner-new { width: var(--owner-size); padding: 0; font-size: 0; }
  .owner-new::before { content: "+"; font-size: 1.5rem; font-weight: 400; line-height: 1; }
  :root:has(.owner-bar) { --owner-bar-space: 10.5rem; }
  :root:has(.owner-admin) { --owner-bar-space: 13.5rem; }
}
