html {
  min-height: 100%;
  scroll-behavior: auto;

  @media (prefers-reduced-motion) {
    scroll-behavior: auto;
  }
}

body,
#___gatsby,
#gatsby-focus-wrapper {
  min-height: 100vh;
  height: 100%;
}

#gatsby-focus-wrapper {
  display: flex;
  flex-direction: column;
}

/* This is a temporary fix until I get it working through MDX. */
article.c1v0-blog-post img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  /* Matches the Theme UI default breakpoints. See https://theme-ui.com/theme-spec#breakpoints. */
  @media (min-width: 56em) and (orientation: landscape) {
    max-width: 120%;
    margin-left: -10%;
  }
}

article.c1v0-blog-post img.solid-background {
  /* Hack to give these images a light background color in dark mode. */
  background-color: #fcfcfc;
  padding: 16px;
}

/* See https://webaim.org/techniques/css/invisiblecontent/ */
.sr-only {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.media-item_grid .media-item_media,
.media-item_media .media-item_caption {
  transition: opacity 300ms ease;
}

.media-item_grid--interacting .media-item_media:not(.media-item--focused) {
  opacity: 0.4;
}

.media-item_grid--interacting .media-item_media.media-item--focused {
  .media-item_caption {
    opacity: 1;
  }
}

.gatsby-highlight-code-line {
  background-color: #feb;
  display: block;
  margin-right: -1em;
  margin-left: -1em;
  padding-right: 1em;
  padding-left: 0.75em;
  border-left: 0.25em solid #f99;
}

/**
 * Add back the container background-color, border-radius, padding, margin
 * and overflow that we removed from <pre>.
 */
.gatsby-highlight {
  background-color: #fdf6e3;
  border-radius: 0.3em;
  margin: 0.5em 0;
  padding: 1em;
  overflow: auto;
}

/**
 * Remove the default PrismJS theme background-color, border-radius, margin,
 * padding and overflow.
 * 1. Make the element just wide enough to fit its content.
 * 2. Always fill the visible space in .gatsby-highlight.
 * 3. Adjust the position of the line numbers
 */
.gatsby-highlight pre[class*='language-'] {
  background-color: transparent;
  margin: 0;
  padding: 0;
  overflow: initial;
  float: left; /* 1 */
  min-width: 100%; /* 2 */
}

/* If you already use line highlighting, just use this. */
.gatsby-highlight pre[class*='language-'].line-numbers {
  padding-left: 2.8em;
}

@import '@chronogrove/ui/color-toggle-styles';

/* LightGallery Instagram Album Styling */
.lg-sub-html .lg-sub-html-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 24px;
  width: 100%;
  box-sizing: border-box;
}

.lg-sub-html .lg-caption {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #ccc;
  max-width: 600px;
  text-align: center;
}

.lg-sub-html .lg-post-position {
  display: inline-block;
  background: linear-gradient(135deg, #e1306c 0%, #fd1d1d 50%, #f77737 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 1px;
}

/* Album boundary indicators in LightGallery thumbnails */
.lg-thumb-item[data-album-start='true'] {
  border-left: 3px solid #e1306c !important;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.lg-thumb-item[data-album-end='true'] {
  border-right: 3px solid #e1306c !important;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

/* Subtle background for album groups */
.lg-thumb-item[data-album-start='true']:not([data-album-end='true']),
.lg-thumb-item:not([data-album-start='true']):not([data-album-end='true']),
.lg-thumb-item[data-album-end='true']:not([data-album-start='true']) {
  position: relative;
}

.lg-thumb-item[data-album-start='true']::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -3px;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e1306c, transparent);
  border-top-left-radius: 4px;
}
