/* ==========================================================================
   Alchemisc — Site Styles
   ========================================================================== */

/* Reset & Base
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.75;
  color: #1a1816;
  background-color: #F5F2ED;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout
   ========================================================================== */

.site-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Links
   ========================================================================== */

a {
  color: #1a1816;
  text-decoration-color: #8a8580;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: #1a1816;
}

/* Site Header
   ========================================================================== */

.site-header {
  margin-bottom: 3rem;
}

.site-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: #1a1816;
  display: block;
}

.site-name:hover {
  text-decoration: none;
  color: #1a1816;
}

.site-tagline {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  color: #6b6560;
  margin-top: 0.4rem;
  margin-bottom: 1.5rem;
}

.site-header hr {
  border: none;
  border-top: 1px solid #d5d0c9;
}

/* Post List (Homepage)
   ========================================================================== */

.post-list {
  list-style: none;
  padding: 0;
}

.post-list-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.6rem 0;
}

.post-list-title {
  font-family: 'Libre Baskerville', serif;
  font-weight: 400;
  font-size: 0.95rem;
}

.post-list-title a {
  text-decoration: none;
}

.post-list-title a:hover {
  text-decoration: underline;
  text-decoration-color: #8a8580;
}

.post-list-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: #8a8580;
  white-space: nowrap;
  flex-shrink: 0;
}

.subscribe-line {
  margin-top: 3rem;
  padding-top: 1.5rem;
  font-size: 0.95rem;
}

.subscribe-line a {
  text-decoration-color: #8a8580;
}

/* Post Pages
   ========================================================================== */

.post-header {
  margin-bottom: 2.5rem;
}

.post-title {
  font-family: 'Libre Baskerville', serif;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: #8a8580;
  display: block;
}

/* Post Content
   ========================================================================== */

.post-content p {
  margin-bottom: 1.5em;
}

.post-content h2 {
  font-family: 'Libre Baskerville', serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin-top: 2.5em;
  margin-bottom: 0.8em;
  line-height: 1.3;
}

.post-content h3 {
  font-family: 'Libre Baskerville', serif;
  font-weight: 700;
  font-size: 1.15rem;
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.4;
}

.post-content blockquote {
  border-left: 3px solid #d5d0c9;
  margin: 1.5em 0;
  padding-left: 1.25em;
  color: #8a8580;
  font-style: italic;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}

.post-content li {
  margin-bottom: 0.4em;
}

.post-content pre {
  background: #eae7e1;
  border: 1px solid #d5d0c9;
  border-radius: 3px;
  padding: 1.25em;
  margin: 1.5em 0;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

.post-content code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85em;
}

.post-content p code,
.post-content li code {
  background: #eae7e1;
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em auto;
}

.post-content hr {
  border: none;
  border-top: 1px solid #d5d0c9;
  margin: 2.5em 0;
}

.post-content a {
  text-decoration-color: #8a8580;
}

.post-content a:hover {
  text-decoration-color: #1a1816;
}

/* Post Footer
   ========================================================================== */

.post-footer hr {
  border: none;
  border-top: 1px solid #d5d0c9;
  margin: 3rem 0 1.5rem;
}

.author-bio {
  font-size: 0.9rem;
  color: #8a8580;
  margin-bottom: 1rem;
}

.subscribe-prompt {
  font-size: 0.9rem;
  color: #8a8580;
  margin-bottom: 2rem;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  padding-top: 1rem;
  border-top: 1px solid #d5d0c9;
}

.post-nav a {
  color: #8a8580;
  text-decoration: none;
}

.post-nav a:hover {
  color: #1a1816;
}

.post-nav-prev {
  text-align: left;
}

.post-nav-next {
  text-align: right;
  margin-left: auto;
}

/* Old Post Notice
   ========================================================================== */

.old-post-notice {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: #8a8580;
  border: 1px solid #d5d0c9;
  padding: 0.75em 1em;
  margin-bottom: 2em;
}

.old-post-notice a {
  color: #8a8580;
}

/* Page Styles
   ========================================================================== */

.page-title {
  font-family: 'Libre Baskerville', serif;
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.page-content p {
  margin-bottom: 1.5em;
}

.page-content a {
  text-decoration-color: #8a8580;
}

.page-content a:hover {
  text-decoration-color: #1a1816;
}

/* Site Footer
   ========================================================================== */

.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d5d0c9;
  font-size: 0.8rem;
  color: #8a8580;
}

.footer-nav {
  margin-bottom: 0.5rem;
}

.footer-nav a {
  color: #8a8580;
  text-decoration: none;
}

.footer-nav a:hover {
  color: #1a1816;
}

.footer-sep {
  margin: 0 0.4em;
}

.footer-copyright {
  margin: 0;
}

/* 404 Page
   ========================================================================== */

.error-page {
  text-align: center;
  padding: 3rem 0;
}

.error-page h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.error-page p {
  color: #8a8580;
}

/* Selection
   ========================================================================== */

::selection {
  background: #d5d0c9;
  color: #1a1816;
}

/* Smooth transitions
   ========================================================================== */

.post-list-item {
  transition: padding-left 0.15s ease;
}

.post-list-item:hover {
  padding-left: 0.3rem;
}

.post-nav a {
  transition: color 0.15s ease;
}

.footer-nav a {
  transition: color 0.15s ease;
}

/* Print
   ========================================================================== */

@media print {
  body {
    background: white;
    color: black;
  }

  .site-header,
  .site-footer,
  .post-nav,
  .subscribe-prompt,
  .old-post-notice {
    display: none;
  }

  .post-title {
    font-size: 1.6rem;
  }

  a {
    color: black;
    text-decoration: none;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* Responsive
   ========================================================================== */

@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  .site-wrapper {
    padding: 2rem 1rem;
  }

  .post-title {
    font-size: 1.6rem;
  }

  .post-list-item {
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 0;
  }

  .post-list-date {
    font-size: 0.75rem;
  }

  .post-nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .post-nav-next {
    margin-left: 0;
    text-align: left;
  }
}
