/* Copied from the Spera (src/ui/shell.module.css) by scripts/copy_spera_css.py; do not edit here. Classes prefixed with 'shell-'. */

/* Mobile first: content on top, navigation as a glass bubble floating over the foot of the page. From 860px up it becomes a side bar. */

.shell-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.shell-main {
  flex: 1;
  min-width: 0;
  padding: 20px 16px calc(108px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shell-sidebar {
  position: fixed;
  inset: auto 12px calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
}

.shell-brand {
  display: none;
}

.shell-brandName {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 28px;
  letter-spacing: -0.02em;
}

.shell-nav {
  position: relative;
  z-index: 0;
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  border-radius: var(--radius-xl);
}

/*
 * The glass: the page shows through, blurred, behind a thin veil. It is drawn on a layer of its own, so the
 * menu sheet (a child of the bar) can blur what is behind it too.
 */
.shell-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* A light edge inside a faint dark one, the way a pane of glass catches the light. */
  border: 1px solid color-mix(in srgb, var(--surface-raised) 80%, transparent);
  outline: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: inherit;
  background: color-mix(in srgb, var(--surface-raised) 45%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.8);
  backdrop-filter: blur(18px) saturate(1.8);
}

.shell-link {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 6px 4px;
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 11px;
  line-height: 14px;
  text-decoration: none;
  cursor: pointer;
}

/* In the bar of a phone a section is its icon alone; the name stays for screen readers. */
.shell-link svg {
  width: 24px;
  height: 24px;
}

.shell-linkLabel {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell-link:hover {
  color: var(--ink);
}

.shell-link[aria-current="page"],
.shell-link[data-active] {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
  font-weight: 500;
}

.shell-count {
  position: absolute;
  inset: 2px auto auto calc(50% + 4px);
  min-width: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--sol);
  color: var(--neverything);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.shell-dot {
  position: absolute;
  inset: 6px auto auto calc(50% + 8px);
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--sol);
}

/* The menu: the sections that do not fit the bar, the account and the way out, in a glass sheet above it. */
.shell-more {
  display: none;
}

.shell-more[data-open] {
  position: absolute;
  inset: auto 0 calc(100% + 8px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: var(--radius-lg);
  background: var(--nav-glow), color-mix(in srgb, var(--surface-raised) 80%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
}

.shell-more .shell-link {
  flex: none;
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  font-size: 15px;
  line-height: 20px;
}

.shell-more .shell-link svg {
  width: 20px;
  height: 20px;
}

/* In the sheet, and in the side bar of wider screens, each section goes by its name. */
.shell-more .shell-linkLabel {
  position: static;
  width: auto;
  height: auto;
  max-width: 100%;
  clip-path: none;
  text-overflow: ellipsis;
}

.shell-more .shell-link[aria-current="page"] {
  background: var(--accent);
  color: var(--on-accent);
}

.shell-more .shell-count {
  position: static;
  margin-left: auto;
  min-width: 24px;
  padding: 0 7px;
  font-size: 12px;
  line-height: 22px;
}

.shell-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  padding: 12px 14px 4px;
  border-top: 1px solid var(--line);
}

.shell-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.shell-userName {
  display: block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

/* The avatar wears a thin sunset ring. */
.shell-avatar {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: var(--on-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
}

.shell-avatar::after {
  content: "";
  position: absolute;
  inset: -4px;
  padding: 1.5px;
  border-radius: var(--radius-full);
  background: var(--sunset);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.shell-logout {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}

.shell-watermark {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

/* On phones the mark closes each page; from tablet up it lives at the foot of the side bar. */
.shell-pageWatermark {
  align-self: center;
  margin-top: auto;
  padding-top: 8px;
}

@media (min-width: 860px) {
  .shell-pageWatermark {
    display: none;
  }

  .shell-shell {
    flex-direction: row;
  }

  .shell-main {
    padding: 40px 48px 64px;
    gap: 28px;
  }

  .shell-sidebar {
    position: sticky;
    inset: 0 auto auto;
    order: -1;
    flex: none;
    width: 232px;
    height: 100dvh;
    padding: 28px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    background: var(--nav-glow), var(--surface-raised);
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    overflow-y: auto;
  }

  .shell-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 14px;
    text-decoration: none;
    color: var(--ink);
  }

  .shell-nav {
    position: static;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    border-radius: 0;
  }

  .shell-nav::before {
    content: none;
  }

  .shell-link,
  .shell-more .shell-link {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: var(--radius-full);
    font-size: 15px;
    line-height: 20px;
  }

  .shell-link svg {
    width: 20px;
    height: 20px;
  }

  .shell-linkLabel {
    position: static;
    width: auto;
    height: auto;
    max-width: 100%;
    clip-path: none;
    text-overflow: ellipsis;
  }

  .shell-link[aria-current="page"] {
    background: var(--accent);
    color: var(--on-accent);
  }

  .shell-link[data-more-toggle] {
    display: none;
  }

  .shell-count,
  .shell-more .shell-count {
    position: static;
    margin-left: auto;
    min-width: 24px;
    padding: 0 7px;
    font-size: 12px;
    line-height: 22px;
  }

  /* The sheet dissolves: its links join the column and the account block drops to the foot. */
  .shell-more,
  .shell-more[data-open] {
    position: static;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .shell-footer {
    margin-top: auto;
    padding: 0 14px;
    border-top: 0;
  }
}
