/* User Provided Stylesheet */

/* Lemmata site styles. Kept small: the book theme does the rest. */

/* Entry header: contributors line + "Cite as", set apart from the mathematics below.
   Neutral colours via currentColor so it works in light and dark mode. */
.lemmata-header {
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 2rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}
.lemmata-header .lemmata-provenance { opacity: 0.8; margin-bottom: 0.75rem; }
.lemmata-header .lemmata-provenance p { margin: 0; }
.lemmata-header details { margin: 0; font-size: 0.875rem; }

/* "Cite as" as a quiet inline control rather than a content box: no card, no shadow,
   metadata-sized text. The opened panel keeps its code block (with the copy button). */
.lemmata-header details.myst-dropdown {
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}
.lemmata-header summary.myst-dropdown-header {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 0;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
  background: transparent;
  box-shadow: none;
  opacity: 0.8;
}
.lemmata-header summary.myst-dropdown-header:hover { opacity: 1; box-shadow: none; }
/* The copy button is invisible until hover by default; show it here, where copying is
   the whole point (and touch screens have no hover). */
.lemmata-header details button { opacity: 1 !important; }

/* The theme floats the chevron right inside the title and nudges it up 1px, so next to
   our small inline label it sat ~3px above the text. Lay title and chevron out as one
   centred row and size the chevron to the text. */
.lemmata-header .myst-dropdown-header-title {
  display: inline-flex;
  flex-direction: row-reverse;   /* the chevron's span comes first in the markup */
  align-items: center;
  gap: 0.25rem;
  line-height: 1.25rem;
}
.lemmata-header .myst-dropdown-header-title > span { float: none; display: inline-flex; }
.lemmata-header .myst-dropdown-header-icon {
  width: 1em;
  height: 1em;
  padding: 0;
  margin: 0;
  transform: none;
}
/* The theme's open state is rotate(90deg) plus a -5px shift that compensated for its old
   position; without the shift the chevron stays centred when it turns. */
.lemmata-header details[open] > summary .details-toggle { transform: rotate(90deg); }

/* Tagline under the site name, top left. logo_text is plain text only, so the second
   line is added here. Hidden on narrow screens, where the header has no room. */
.myst-home-link > span { display: flex; flex-direction: column; line-height: 1.15; }
.myst-home-link > span::after {
  content: "experimental mathematics repository";
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  opacity: 0.65;
}
@media (max-width: 640px) { .myst-home-link > span::after { display: none; } }

/* Sidebar footer: "Made with MyST" and the maintainer line, small and centred. */
/* The theme animates the sidebar footer in on load: transparent and 24px low, sliding
   up over ~0.7s. With it forced visible (so the maintainer line is readable at once,
   also on touch screens) the slide showed as a jump. Pin it in place: visible, not
   shifted, no transition. Colours match the theme's own "Made with MyST". */
.myst-primary-sidebar-footer {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
/* The theme sizes the sidebar only after hydration (inline height on
   .myst-primary-sidebar-pointer: min(100vh - 60px, page height)). Until then the column
   is as short as its content, so the footer first sat under the last category and then
   dropped to the bottom -- the original fade-in hid that. Give it the same height from
   the first paint; the later inline style wins and matches it. 60px = top bar. */
@media (min-width: 1280px) {
  .myst-primary-sidebar-pointer { height: calc(100vh - 60px); }
}
/* Left-aligned, flush with the navigation text above it (and the logo): on wide screens
   the theme centres the whole layout, so the sidebar column floats in white space and a
   centred footer read as indented next to the left-aligned list. The external-link icon
   hangs off the end of each link without taking space. */
.lemmata-sidebar-footer { font-size: 0.8rem; text-align: left; }
.lemmata-sidebar-footer a { position: relative; }
.lemmata-sidebar-footer a svg { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 2px; }
@media (min-width: 1280px) {
  /* Outer footer box = navigation column: content from the text edge (40px) to the
     right edge of the chevrons (240px). */
  .myst-primary-sidebar-footer.flex-none { margin-right: 20px !important; padding-left: 12px; }
}
/* The part is rendered inside a second element that also carries the theme's `article`
   class, whose grid gutters indented the lines by 12px on each side. */
.article.myst-primary-sidebar-footer { display: block; padding: 0; margin: 0; }
.lemmata-sidebar-footer, .lemmata-sidebar-footer a { color: var(--myst-color-text-secondary, #6b7280); }
.lemmata-sidebar-footer a:hover { color: var(--myst-color-link, #2563eb); }
.lemmata-sidebar-footer p { margin: 0.15rem 0; }
.lemmata-sidebar-footer a { text-decoration: none; }

/* AI use statement and acknowledgements at the end of an entry: small, set apart from
   the verification panel by a rule, like the header block at the top. */
.lemmata-notes {
  font-size: 0.875rem;
  line-height: 1.55;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  opacity: 0.85;
}
.lemmata-notes p { margin: 0 0 0.6rem; }

/* Identifier line (rendered by a widget, which styles its own link and "copy" control):
   no extra margin around the widget inside the header. */
.lemmata-header .myst-anywidget, .lemmata-header [class*="anywidget"] { margin: 0 0 0.15rem; }

/* End-of-proof square, right-aligned on the last line of every proof. MyST uses
   .myst-proof-body for every prf: environment; only proofs get a header with
   bg-myst-proof-bg (theorems: -theorem-bg, corollaries: -example-bg), so select on that.
   The square is absolutely positioned at the bottom right of the body, level with the
   last line of text (or below a closing display formula). */
.myst-proof-header.bg-myst-proof-bg + .myst-proof-body { position: relative; }
.myst-proof-header.bg-myst-proof-bg + .myst-proof-body > :last-child { padding-right: 1.6em; }
.myst-proof-header.bg-myst-proof-bg + .myst-proof-body::after {
  content: "∎";
  position: absolute;
  right: 1rem;
  /* The last line box ends at the body's bottom edge (the paragraph's margin collapses
     through it), so a square with the text's own line height and bottom: 0 sits exactly
     on that line. Measured: 0px offset. */
  bottom: 0;
  line-height: inherit;
  opacity: 0.8;
}
