/*
 *  ___
 * /\_ \
 * \//\ \      __      ___   __  __    ___     ___
 *   \ \ \   /'__`\  /' _ `\/\ \/\ \  / __`\ /' _ `\
 *    \_\ \_/\ \_\.\_/\ \/\ \ \ \_\ \/\ \_\ \/\ \/\ \
 *    /\____\ \__/.\_\ \_\ \_\/`____ \ \____/\ \_\ \_\
 *    \/____/\/__/\/_/\/_/\/_/`/___/> \/___/  \/_/\/_/
 *                               /\___/
 *                               \/__/
 *
 * Designed, built, and released under MIT license by @mdo. Learn more at
 * https://github.com/poole/lanyon.
 */


/*
 * CSS Custom Properties for theming
 */

:root {
  --bg-color: #fcfcfa;
  --text-color: #37352f;
  --heading-color: #1a1a1a;
  --link-color: #37352f;
  --link-underline: rgba(55, 53, 47, 0.4);
  --muted-color: #6b6b6b;
  --border-color: #e6e4e0;
  --code-bg: #f5f5f3;
  --masthead-color: #1a1a1a;
}

[data-theme="dark"] {
  --bg-color: #181818;
  --text-color: #d4d4d4;
  --heading-color: #efefef;
  --link-color: #d4d4d4;
  --link-underline: rgba(212, 212, 212, 0.4);
  --muted-color: #888;
  --border-color: #2d2d2d;
  --code-bg: #232323;
  --masthead-color: #efefef;
}

/*
 * Contents
 *
 * Global resets
 * Masthead
 * Sidebar
 * Slide effect
 * Posts and pages
 * Pagination
 * Reverse layout
 * Themes
 */


/*
 * Global resets
 *
 * Update the foundational and global aspects of the page.
 */

/* Prevent scroll on narrow devices */
html,
body {
  overflow-x: hidden;
}

html {
  font-family: "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  color: var(--heading-color);
  letter-spacing: -0.01em;
}


/*
 * Wrapper
 *
 * The wrapper is used to position site content when the sidebar is toggled. We
 * use an outter wrap to position the sidebar without interferring with the
 * regular page content.
 */

.wrap {
  position: relative;
  width: 100%;
}


/*
 * Container
 *
 * Center the page content.
 */

.container {
  max-width: 28rem;
}
@media (min-width: 38em) {
  .container {
    max-width: 32rem;
  }
}
@media (min-width: 56em) {
  .container {
    max-width: 38rem;
  }
}


/*
 * Masthead
 *
 * Super small header above the content for site name and short description.
 */

.masthead {
  padding-top: 2rem;
  padding-bottom: 2rem;
  margin-bottom: 3rem;
}
.masthead-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.masthead-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--heading-color);
  text-decoration: none;
}
.masthead-title:hover {
  text-decoration: none;
}
.masthead-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.masthead-nav a {
  font-size: 0.85rem;
  color: var(--muted-color);
  text-decoration: none;
  transition: color 0.15s ease;
}
.masthead-nav a:hover {
  color: var(--heading-color);
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.5rem;
  color: var(--muted-color);
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}
.theme-toggle:hover {
  color: var(--heading-color);
  opacity: 1;
}
.theme-toggle .icon-moon {
  display: none;
}
[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}
[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}
.footer p {
  font-size: 0.8rem;
  color: var(--muted-color);
  margin: 0;
}

@media (max-width: 30em) {
  .masthead-nav {
    gap: 1rem;
  }
  .masthead-nav a {
    font-size: 0.8rem;
  }
}


/*
 * Posts and pages
 *
 * Each post is wrapped in `.post` and is used on default and post layouts. Each
 * page is wrapped in `.page` and is only used on the page layout.
 */

.page,
.post {
  margin-bottom: 5em;
  padding-bottom: 3em;
  border-bottom: 1px solid var(--border-color);
}
/* On homepage: no border on last post */
.post:last-child {
  border-bottom: none;
}

/* On single post pages: remove spacing/border since subscribe section follows */
.post:has(+ .subscribe-section) {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Blog post or page title */
.page-title,
.post-title,
.post-title a {
  color: var(--heading-color);
}
.page-title,
.post-title {
  margin-top: 0;
}

/* Meta data line below post title */
.post-date {
  display: block;
  margin-top: -.5rem;
  margin-bottom: 1rem;
  color: var(--muted-color);
}

/* Continue reading link */
.read-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted-color);
  text-decoration: none;
  transition: color 0.15s ease;
}
.read-more:hover {
  color: var(--heading-color);
  text-decoration: none;
}

/* Footnotes - hide kramdown separator */
.footnotes {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--muted-color);
}
.footnotes::before {
  display: none;
}
.footnotes hr {
  display: none;
}
.footnotes ol {
  padding-left: 1.25rem;
}

/* Subscribe section */
.subscribe-section {
  padding-top: 1rem;
  padding-bottom: 0.5rem;
  margin-top: 1rem;
  text-align: center;
}
.subscribe-section h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}
.buttondown-form {
  display: inline-flex;
  gap: 0.5rem;
  max-width: 400px;
}
.buttondown-form input[type="email"] {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.85rem;
}
.buttondown-form input[type="submit"] {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.buttondown-form input[type="submit"]:hover {
  border-color: var(--text-color);
}

/* Post tags */
.post-tags {
  display: block;
  font-size: 0.8rem;
  color: var(--muted-color);
  margin-top: -0.75rem;
  margin-bottom: 1rem;
}

/* Related posts */
.related {
  padding-top: 1.5rem;
  padding-bottom: 1rem;
  margin-top: 1rem;
}
.related h3 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
}
.related-posts {
  padding-left: 0;
  list-style: none;
  margin: 0;
}
.related-posts li {
  margin-bottom: 0.35rem;
}
.related-posts li small {
  font-size: 0.8rem;
  color: var(--muted-color);
  margin-left: 0.35rem;
}
.related-posts li a:hover {
  color: var(--link-color);
}


/* Show more button */
.post-hidden {
  display: none;
}
.show-more-wrap {
  text-align: center;
  margin-top: -2rem;
  margin-bottom: 2rem;
}
.show-more-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: "Newsreader", Georgia, serif;
  font-size: 0.9rem;
  color: var(--muted-color);
  padding: 0.5rem 0;
  transition: color 0.15s ease;
}
.show-more-btn:hover {
  color: var(--heading-color);
}

/* Tag filters on thoughts page */
.tag-filters {
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  align-items: center;
}
.tag-filter {
  background: none;
  border: none;
  cursor: pointer;
  font-family: "Newsreader", Georgia, serif;
  font-size: 0.85rem;
  color: var(--muted-color);
  padding: 0.15rem 0;
  transition: color 0.15s ease;
}
.tag-filter::after {
  content: "·";
  margin: 0 0.4rem;
  color: var(--muted-color);
  pointer-events: none;
}
.tag-filter:last-child::after {
  display: none;
}
.tag-filter:hover {
  color: var(--heading-color);
}
.tag-filter.active {
  color: var(--heading-color);
}

/* Thoughts page items */
.thought-item {
  transition: opacity 0.15s ease;
}
.thought-item.filtered-out {
  display: none;
}
.thought-item .post-tags {
  display: inline;
  margin: 0;
  margin-left: 0.35rem;
}


/*
 * Dark mode overrides for poole.css elements
 */

a {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--link-color);
}

strong {
  color: var(--heading-color);
}

hr {
  border-top-color: var(--border-color);
}

code,
pre {
  background-color: var(--code-bg);
}

code {
  color: var(--text-color);
}

pre code {
  background-color: transparent;
}

blockquote {
  color: var(--muted-color);
  border-left-color: var(--border-color);
}

table {
  border-color: var(--border-color);
}

td,
th {
  border-color: var(--border-color);
}

tbody tr:nth-child(odd) td,
tbody tr:nth-child(odd) th {
  background-color: var(--code-bg);
}

.related-posts li small {
  color: var(--muted-color);
}

/*
 * Lists
 */

ul {
  padding-left: 2rem;
}

ol {
  list-style: none;
  padding-left: 2.5rem;
  counter-reset: ol-counter;
}

ol > li {
  counter-increment: ol-counter;
  position: relative;
}

ol > li::before {
  content: counter(ol-counter) ".";
  position: absolute;
  left: -2rem;
  width: 1.75rem;
  color: var(--muted-color);
}
