/* What the blog needs beyond the website's own stylesheet (site.css): its post lists, posts, comments and old-post oddities.
   Everything here is built from the website's colour variables, so it follows the light and dark themes. */

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

/* The header's search box, where the website has Pagefind's. */
.blog-search input[type='search'] {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  font-size: .9rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .35rem .7rem;
}

.blog-search input[type='search']:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* A post in a list: a panel, like the website's. */
article.post.feature {
  margin: 1.5rem 0;
  padding-top: 0.5rem;
  padding-bottom: 0.25rem;
}

.entry-title {
  margin-top: 0;
}

.entry-title a {
  color: inherit;
  text-decoration: none;
}

.entry-title a:hover {
  text-decoration: underline;
}

.entry-meta {
  margin-top: -.25rem;
}

.more-link {
  font-weight: 600;
}

/* Post bodies. */
.entry-content img,
.entry-content figure {
  max-width: 100%;
  height: auto;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.5rem;
}

.entry-content .alignnone { margin: .5rem 0; }
.entry-content .aligncenter { display: block; margin: .5rem auto; }
.entry-content .alignleft { float: left; margin: .25rem 1rem .5rem 0; }
.entry-content .alignright { float: right; margin: .25rem 0 .5rem 1rem; }

.entry-content .wp-caption {
  max-width: 100%;
}

.entry-content .wp-caption-text,
.entry-content figcaption {
  color: var(--muted);
  font-size: .9rem;
}

.entry-content::after {
  content: '';
  display: block;
  clear: both;
}

/* Old posts mark up keys and search queries with spans, as the old website did. */
.entry-content .keystroke {
  background-color: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 .3em;
  font-family: ui-monospace, Consolas, monospace;
  font-size: .9em;
}

.entry-content .query {
  font-family: ui-monospace, Consolas, monospace;
  background-color: var(--code-bg);
  border-radius: 4px;
  padding: 0 .2em;
}

/* Old posts also colour text with inline styles chosen for a white page. In the dark theme, black text would vanish and the dark
   colours would be hard to read, so they are replaced by the website's light-on-dark code colours. Tinted backgrounds keep their
   tint, so their text is made dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .entry-content [style*='color: #000000'] { color: inherit !important; }
  :root:not([data-theme='light']) .entry-content [style*='color: #808080'] { color: var(--py-x) !important; }
  :root:not([data-theme='light']) .entry-content [style*='color: #00007f'] { color: var(--py-o) !important; }
  :root:not([data-theme='light']) .entry-content [style*='color: #007f7f'] { color: var(--py-n) !important; }
  :root:not([data-theme='light']) .entry-content [style*='color: #007f00'] { color: var(--py-c) !important; }
  :root:not([data-theme='light']) .entry-content [style*='color: #7f007f'] { color: var(--icon-purple) !important; }
  :root:not([data-theme='light']) .entry-content [style*='background-color'] { color: #1e1e1e !important; }
}

:root[data-theme='dark'] .entry-content [style*='color: #000000'] { color: inherit !important; }
:root[data-theme='dark'] .entry-content [style*='color: #808080'] { color: var(--py-x) !important; }
:root[data-theme='dark'] .entry-content [style*='color: #00007f'] { color: var(--py-o) !important; }
:root[data-theme='dark'] .entry-content [style*='color: #007f7f'] { color: var(--py-n) !important; }
:root[data-theme='dark'] .entry-content [style*='color: #007f00'] { color: var(--py-c) !important; }
:root[data-theme='dark'] .entry-content [style*='color: #7f007f'] { color: var(--icon-purple) !important; }
:root[data-theme='dark'] .entry-content [style*='background-color'] { color: #1e1e1e !important; }

/* Comments. */
.comments {
  margin-top: 2rem;
}

.comments-title,
.comment-reply-title {
  margin-top: 0;
}

.comment-list,
.comment-list ol {
  list-style: none;
  padding-left: 0;
}

.comment-list .children {
  padding-left: 1.5rem;
  border-left: 2px solid var(--line);
}

.comment-body {
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}

.comment-content p {
  margin: .5rem 0;
}

.comment-form label {
  display: block;
  margin: .75rem 0 .25rem;
}

.comment-form input[type='text'],
.comment-form input[type='email'],
.comment-form input[type='url'],
.comment-form textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 40rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .4rem .6rem;
}

.comment-form .form-submit input[type='submit'],
.comment-form .btn {
  font: inherit;
  color: var(--accent-fg);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  padding: .5rem 1.25rem;
  cursor: pointer;
}

.comment-notes,
.logged-in-as,
.form-allowed-tags {
  color: var(--muted);
  font-size: .9rem;
}

.pager a {
  color: var(--link);
}

.feed-icon {
  vertical-align: baseline;
}
