/* Site styles on top of sphinx-book-theme. */

/* Tagline under the site name in the sidebar (see _templates/navbar-logo.html). */
.logo__tagline {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.8;
  text-align: center;
}

/* "Part N of M" box under the title of a post in a series
   (see _templates/series-box.html), as on the Hugo site. */
.series-box {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 0.25rem solid var(--pst-color-primary);
  border-radius: 0.25rem;
  background: var(--pst-color-surface);
}
.series-box summary {
  cursor: pointer;
}
.series-box ol {
  margin: 0.5rem 0 0;
}

/* Posts on a series page (see _templates/series-page.html). */
.series-list > li {
  margin-bottom: 0.75rem;
}
.series-list__date {
  margin: 0;
  font-size: 0.85rem;
  color: var(--pst-color-text-muted);
}

/* The series being read, in the left pane's series list
   (see _templates/series-list.html). */
.ablog__series li.current > a {
  font-weight: bold;
}

/* ---- Header bar ------------------------------------------------------- */
/* Whether it stays on screen is set by keep_header_on_screen in conf.py
   (see fixed-header.css). */
.bd-header {
  /* header_footer_color in conf.py (written as --header-footer-color by
     _templates/layout.html), or else the page colour instead of the theme's
     bluish "on background" shade. The same thin line as the left pane's
     edge replaces the drop shadow (drawn inside, so the header stays
     exactly --pst-header-height tall). The theme sets the colour with
     !important. */
  background-color: var(--header-footer-color, var(--pst-color-background)) !important;
  box-shadow: inset 0 -1px 0 var(--pst-color-border);
}

/* Small logo at the left of the header (see _templates/header-logo.html).
   Scoped to the header to beat the theme's own .navbar-brand image rules. */
.bd-header .navbar-brand.header-logo {
  /* The header's inner box already has 0.5rem padding above and below. */
  height: calc(var(--pst-header-height) - 1rem);
  padding: 0.25rem 0;
}
.bd-header .navbar-brand.header-logo .header-logo__image {
  height: 100%;
  width: auto;
}

/* Fullscreen and light/dark buttons (see _templates/header-buttons.html). */
.header-buttons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.header-buttons .btn {
  color: var(--pst-color-text-muted);
  font-size: 1.1rem;
}
.header-buttons .btn:hover {
  color: var(--pst-color-text-base);
}

/* Wide screens: search stays at the left of the header's right-hand area
   (lined up with the article) and is wider than the theme's; the social
   links and buttons go to the far right. The theme shrinks the area that
   holds them to fit its contents, which left them near the middle. */
@media (min-width: 960px) {
  .bd-header .navbar-header-items__end {
    flex-grow: 1;
  }
  .bd-header .navbar-persistent--container {
    margin-right: auto;
  }
  .bd-header .navbar-persistent--container .search-button-field {
    width: 15rem;
  }
}

/* Narrow screens (below the theme's 960px breakpoint): the theme moves the
   social links and buttons into the slide-out left pane and hides search.
   Keep them all in the header instead, with search as just an icon:
   logo | search | social links | fullscreen, light/dark. */
@media (max-width: 959.98px) {
  .bd-header .navbar-header-items {
    display: flex;
    order: 2;
  }
  .bd-header .navbar-header-items__end,
  .bd-header .navbar-icon-links {
    column-gap: 0.5rem;
  }
  .bd-sidebar-primary .sidebar-header-items {
    display: none;
  }
  .bd-header .navbar-persistent--mobile {
    order: 1;
    margin-left: 0;
    margin-right: 0.5rem;
  }
  .bd-header .navbar-persistent--mobile .search-button-field {
    display: flex;
    width: auto;
    border: none;
    background: none;
    padding: 0.25rem;
    color: var(--pst-color-text-muted);
    font-size: 1.1rem;
  }
  .bd-header .navbar-persistent--mobile .search-button__default-text,
  .bd-header .navbar-persistent--mobile .search-button__kbd-shortcut {
    display: none;
  }
  /* The theme hides everything but an <svg> in the search button here, but
     the magnifier is sometimes still an <i> icon-font element. */
  .bd-header .navbar-persistent--mobile .search-button-field > i,
  .bd-header .navbar-persistent--mobile .search-button-field > svg {
    display: inline-block;
  }
}

/* ---- Footer ----------------------------------------------------------- */
/* Whether it stays on screen is set by keep_footer_on_screen in conf.py
   (see fixed-footer.css). Same colour as the header, and the top line is
   drawn exactly like the header's bottom line: an inset shadow in the
   border colour, in place of the theme's 1px light grey (#ccc) border. A
   real border looks brighter than the header's line on scaled screens
   (such as 125%), where the browser snaps it to a full screen pixel. */
footer.bd-footer-content {
  background-color: var(--header-footer-color, var(--pst-color-background));
  border-top: none;
  box-shadow: inset 0 1px 0 var(--pst-color-border);
}

/* Author and copyright on one line: "By Lytn1ng · © Copyright ...".
   They wrap onto two lines only when the screen is too narrow. */
.bd-footer-content__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.5em;
}
.bd-footer-content .footer-item {
  display: flex;
  align-items: baseline;
}
.bd-footer-content .footer-item + .footer-item::before {
  content: "·";
  margin-right: 0.5em;
}
.bd-footer-content .footer-item p {
  margin: 0;
}
/* The theme's copyright template ends with a line break. */
.bd-footer-content .copyright br {
  display: none;
}

/* "Blog post series" list on the home page (the serieslist directive in
   _ext/blog_series.py). */
.series-overview__count {
  color: var(--pst-color-text-muted);
}
