hr {
  position: relative;
  z-index: 1;
  margin: 2.5em 0 2em 0;
  border: none;
  border-top: 1.5px solid #bbb;
  background: none;
}

hr:after {
  content: '✂️';
  display: block;
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, 60%);
  padding: 0 0.2em;
  font-size: 2em;
  line-height: 1;
  z-index: 10;
  pointer-events: none;
}

img {
  height: auto;
  /* Prevent images from scaling larger than their natural size (or 2x on hidpi screens) */
  max-width: 100%;
  width: auto;
  image-rendering: auto;
}

@media (min-resolution: 192dpi), (min-resolution: 2dppx) {
  img {
    max-width: 200%; /* Allow up to 2x natural size on hidpi */
  }
}

/* --- Post Content --- */
.post-content {
  /* Headings */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    line-height: 1.2;
  }

  pre {
    overflow-x: auto;
  }

  pre code {
    display: block;
    line-height: normal;
    font-size: 0.8em;
    background: none;
    padding: 0;
  }

  blockquote {
    background: #f5f5f5;
    margin: auto;
    padding: 0 1rem;
    color: inherit;
  }

  ul,
  ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
  }

  ul li,
  ol li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
  }

  ul {
    list-style-type: disc;
  }

  ol {
    list-style-type: decimal;
  }

  p + p {
    margin-top: 0.5em;
  }

  p:only-child img {
    max-width: 70%;
    display: block;
  }
}

/* Override .post-content img to prevent upscaling beyond natural size (or 2x on hidpi) */
.post-content img,
.post-content p > img {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  image-rendering: auto;
}

/* Portrait images inside posts should be at most 50% width of the container */
.post-content img.portrait,
.post-content p > img.portrait {
  max-width: 50% !important;
}

.site-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.container,
.content {
  max-width: initial;
}

.logo {
  border-radius: initial;
}

p:has(> img) {
  background: white;
  padding: 6px;
}

p > img {
  display: block;
  margin: 6px auto;
}

.read-more {
  margin-top: 1rem;
  text-align: left;
}

.read-more a,
.read-more a:hover {
  text-decoration: underline;
}

.site-logo {
  height: 1em;
  width: auto;
  vertical-align: middle;
  position: relative;
  top: -0.18em;
}

/* --- Header & Nav --- */
header h1 > a {
  text-decoration: none;
}

header h1 {
  margin-bottom: 0.2em;
}

header nav {
  margin-top: 0;
  margin-bottom: 1em;
}

header nav a {
  margin-right: 0.75rem;
}

header nav a:last-child {
  margin-right: 0;
}

nav .nav-icon {
  width: 1em;
  height: 1em;
  vertical-align: baseline;
  margin-bottom: -0.12em;
  margin-right: 0.25em;
  opacity: 0.8;
}

nav a:hover .nav-icon {
  opacity: 1;
}

/* Make main page article titles use standard link colors */
.post-preview .post-title a:link {
  color: #0645ad !important;
}
.post-preview .post-title a:visited {
  color: #6e2ca6 !important;
}
.post-preview .post-title a:hover,
.post-preview .post-title a:active {
  color: #0b0080 !important;
  text-decoration: underline;
}

/* JS will set width and height attributes on images after load for better CSS targeting of portrait/landscape */

html, body {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
}

pre, code {
  word-break: break-word;
  white-space: pre-wrap;
}

/* Table styles */
.post-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
  font-size: 0.95em;
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.post-content table th,
.post-content table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eee;
  border-right: 1px solid #eee;
}

.post-content table th {
  background: #f8f8f8;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #ddd;
}

.post-content table th:last-child,
.post-content table td:last-child {
  border-right: none;
}

.post-content table tr:last-child td {
  border-bottom: none;
}

.post-content table tr:nth-child(even) {
  background: #fafafa;
}

.post-content table tr:hover {
  background: #f0f8ff;
}

.post-content table td:first-child,
.post-content table th:first-child {
  padding-left: 1rem;
}

.post-content table td:last-child,
.post-content table th:last-child {
  padding-right: 1rem;
}