/* Existing site styles */
.theme-credit,
.cat-links,
.site-info,
.byline {
  display: none;
}

#main {
  padding-top: 0 !important;
}

.post {
  margin: 1% 0 0 0 !important;
}

/* Preserve the existing divider outside the blog index. */
body:not(.blog) .post::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(40em, 90%);
  border-bottom: 1px solid white !important;
}

.entry-content {
  font-family: charter, Georgia, Cambria, "Times New Roman", Times, serif;
  line-height: 1.6;
  -webkit-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
  text-align: justify;
}

img {
  border: 1px solid white !important;
  border-radius: 10px;
}

input,
input:focus {
  background-color: inherit;
  border: 1px solid white;
  color: inherit;
}

input::placeholder {
  color: #b8b8b8;
}

.entry-footer {
  padding-top: 0;
  padding-bottom: 3%;
  background-color: inherit !important;
}

.prev,
.next {
  background-color: #202020 !important;
}

.entry-content ol,
.entry-content ul {
  list-style-position: inside !important;
  margin-left: 0 !important;
  padding-left: 1.5em !important;
}

.secondary-toggle {
  border-radius: 50%;
}

a:hover {
  color: #007bff;
}

html,
body {
  margin: 0;
  overflow-x: hidden;
}

/* Existing mobile layout safeguards */
@media (max-width: 768px) {
  .site,
  .content-block,
  .content-block-group,
  .alignfull,
  .alignwide,
  [data-align="full"],
  [data-align="wide"] {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  img,
  video,
  iframe,
  embed,
  object {
    max-width: 100%;
    height: auto;
  }

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

/* Blog layout: applies to initial and infinite-scroll posts. */
body.blog #main article.post {
  box-sizing: border-box;
  position: relative;
  margin: 0 0 16px !important;
  padding-top: 32px;
  padding-bottom: 48px;
  background-color: #202020;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Centred divider: two-thirds of each post's width. */
body.blog #main article.post::after {
  content: "";
  display: block;
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 66.6667%;
  max-width: none;
  height: 0;
  transform: translateX(-50%);
  border: 0;
  border-bottom: 2px solid #b8b8b8 !important;
}

/* Keep each title close to its opening paragraph. */
body.blog #main article.post .entry-title {
  margin-bottom: 20px;
}

body.blog #main article.post .entry-title,
body.blog #main article.post .entry-title a {
  color: #f0f0f0;
}

body.blog #main article.post .entry-title a:hover {
  color: #80bfff;
}

/* Comfortable reading rhythm */
body.blog #main article.post .entry-content {
  padding-bottom: 16px;
  text-align: left;
}

body.blog #main article.post .entry-content p {
  margin-bottom: 24px;
}

body.blog #main article.post .entry-content > p:last-child {
  margin-bottom: 0;
}

/* Keep the date attached to the article it belongs to. */
body.blog #main article.post .entry-footer {
  padding-top: 0;
  padding-bottom: 0;
  background-color: inherit !important;
  border: 0;
  border-radius: 0;
}

/* Mobile spacing and typography */
@media screen and (max-width: 767px) {
  body.blog #main article.post {
    margin: 0 12px 8px !important;
    padding-top: 24px;
    padding-bottom: 32px;
  }

  body.blog #main article.post .entry-header,
  body.blog #main article.post .entry-content,
  body.blog #main article.post .entry-footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  body.blog #main article.post .entry-title {
    margin-bottom: 16px;
  }

  body.blog #main article.post .entry-content {
    font-size: 16px;
    line-height: 1.65;
    padding-bottom: 12px;
    text-align: left;
  }

  body.blog #main article.post .entry-content p {
    margin-bottom: 20px;
  }

  body.blog #main article.post .entry-content > p:last-child {
    margin-bottom: 0;
  }
}

/* Pagination fix: hide it when infinite scrolling takes over.
   Normal pagination remains available otherwise. */
body.blog #main .navigation.pagination[hidden] {
  display: none !important;
}

/* Keep labels and quotations readable in the dark theme. */
.post-navigation .meta-nav { color: #a7a7a7; }
.entry-content blockquote { color: #a7a7a7; }
