/*
 * custom.css
 * Layered on top of poole + lanyon. Overrides and enhancements only.
 */

/* -------------------------
   Smooth scrolling
   ------------------------- */
html {
  scroll-behavior: smooth;
}

/* -------------------------
   Wider reading area
   ------------------------- */
@media (min-width: 56em) {
  .container {
    max-width: 46rem;
  }
}

/* -------------------------
   Masthead
   ------------------------- */
.masthead {
  border-bottom: 1px solid #ebebeb;
  margin-bottom: 2.5rem;
}

.masthead-title a {
  color: #313131;
  letter-spacing: -0.01rem;
}

.masthead-title a:hover {
  color: #268bd2;
  text-decoration: none;
}

/* -------------------------
   Post title & metadata
   ------------------------- */
.post-title {
  line-height: 1.15;
  margin-bottom: 0.35rem;
}

/* Clickable post titles on homepage */
.post-title a {
  color: #313131;
  text-decoration: none;
  transition: color 0.15s ease;
}

.post-title a:hover {
  color: #268bd2;
}

.post-date {
  display: block;
  margin-bottom: 1.75rem;
  color: #bbb;
  font-size: 0.78em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: "PT Sans", Helvetica, Arial, sans-serif;
}

/* -------------------------
   Body text readability
   ------------------------- */
.post p,
.page p {
  line-height: 1.75;
}

/* -------------------------
   Headings inside posts
   ------------------------- */
.post h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #ebebeb;
}

.post h3 {
  margin-top: 1.75rem;
}

/* -------------------------
   Links inside post body
   ------------------------- */
.post a,
.page a {
  transition: color 0.15s ease;
}

/* -------------------------
   Section breaks
   ------------------------- */
hr {
  margin: 2.75rem 0;
  border: 0;
  border-top: 1px solid #e8e8e8;
}

/* -------------------------
   Images — shadow + breathing room
   ------------------------- */
.post img,
.page img {
  display: block;
  max-width: 100%;
  margin: 2rem auto 0.5rem;
  border-radius: 6px;
  box-shadow: 0 3px 18px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.2s ease;
}

.post img:hover,
.page img:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
}

/* Image captions: the <em> paragraph immediately after an image paragraph */
p:has(> img) + p {
  text-align: center;
  font-size: 0.79em;
  color: #aaa;
  margin-top: 0;
  margin-bottom: 2rem;
  font-style: italic;
  font-family: "PT Sans", Helvetica, Arial, sans-serif;
}

/* -------------------------
   Code blocks
   ------------------------- */
pre,
.highlight pre {
  background-color: #f6f6f6;
  border-left: 3px solid #268bd2;
  border-radius: 0 5px 5px 0;
  padding: 1rem 1.2rem;
  font-size: 0.78rem;
  line-height: 1.55;
}

code {
  font-size: 0.82em;
  background-color: #f1f1f1;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: #c0392b;
}

pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
  font-size: 100%;
}

/* -------------------------
   Blockquotes
   ------------------------- */
blockquote {
  border-left: 3px solid #268bd2;
  background-color: #f7fbfe;
  padding: 0.85rem 1.3rem;
  border-radius: 0 5px 5px 0;
  color: #555;
}

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

/* -------------------------
   Homepage post list
   ------------------------- */
.posts .post {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #f0f0f0;
}

.posts .post:last-child {
  border-bottom: none;
}

/* -------------------------
   Pagination
   ------------------------- */
.pagination {
  margin: 2rem 0;
  font-family: "PT Sans", Helvetica, Arial, sans-serif;
  font-size: 0.85em;
  color: #999;
}

.pagination-item {
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 0.4rem 0.9rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

a.pagination-item:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
  text-decoration: none;
}

/* -------------------------
   Related posts
   ------------------------- */
.related {
  padding-top: 2rem;
  padding-bottom: 2rem;
  border-top: 1px solid #ebebeb;
}

.related h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
  margin-bottom: 1rem;
}

.related-posts li small {
  color: #bbb;
}

/* -------------------------
   Sidebar polish
   ------------------------- */
.sidebar-nav-item {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

/* -------------------------
   Buy Me a Coffee — in sidebar
   ------------------------- */
.sidebar-bmc {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-bmc script,
.sidebar-bmc iframe {
  display: block;
}

.sidebar-bmc .bmc-btn {
  transform: scale(0.85);
  transform-origin: left center;
}

/* -------------------------
   Giscus comments section
   ------------------------- */
.giscus {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #ebebeb;
}
