/* Blog — minimalist reading layout on the main site theme
   (Helvetica, orange #f36c3d accent, #666 secondary) */

.blog-container {
  max-width: 42rem;
}

.blog.section {
  background: #fff;
}

/* Index */
.blog-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 2rem;
}

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

.post-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
}

.post-list a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid #ddd;
}

.post-list a:hover {
  color: #f36c3d;
  border-bottom-color: #f36c3d;
}

.post-list time {
  color: #666;
  font-size: 0.85em;
  white-space: nowrap;
}

/* Table of contents */
.toc {
  margin: 0 0 2.5rem;
  padding: 1rem 1.25rem;
  background: #f6f6f6;
  border-radius: 10px;
}

.toc summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid #666;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s ease;
}

.toc details[open] summary::before {
  transform: rotate(90deg);
}

.toc .inner {
  margin-top: 0.5rem;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.toc .inner > ul > li {
  padding: 0.25em 0;
}

.toc li ul {
  margin: 0.25em 0 0 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid #ddd;
}

.toc li ul li {
  padding: 0.2em 0;
}

.toc a {
  color: #666;
  font-size: 0.9rem;
  text-decoration: none;
}

.toc a:hover {
  color: #f36c3d;
}

/* Side notes: margin notes on wide screens, inline note box otherwise */
.sidenote {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #666;
}

@media screen and (min-width: 1160px) {
  .sidenote {
    float: right;
    clear: right;
    width: 200px;
    margin-right: -240px;
    margin-top: 0.3em;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid #ddd;
  }
}

@media screen and (max-width: 1159px) {
  .sidenote {
    display: block;
    background: #f6f6f6;
    border-left: 3px solid #f36c3d;
    border-radius: 0 6px 6px 0;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
  }

  .sidenote::before {
    content: "Note: ";
    font-weight: 700;
    color: #363636;
  }
}

/* Post */
.post-header h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  color: #363636;
  margin: 0 0 0.5rem;
}

.post-meta {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 3rem;
}

.post-body {
  font-size: 1.1rem;
  line-height: 1.7;
}

.post-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #363636;
  margin: 2.5rem 0 0.75rem;
  scroll-margin-top: 1rem;
}

.post-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #363636;
  margin: 2rem 0 0.5rem;
  scroll-margin-top: 1rem;
}

.post-body p,
.post-body ul,
.post-body ol {
  margin: 0 0 1.25rem;
}

.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
}

.post-body li {
  margin-bottom: 0.35rem;
}

.post-body a {
  color: #f36c3d;
  text-decoration: none;
  border-bottom: 1px solid #ddd;
}

.post-body a:hover {
  border-bottom-color: #f36c3d;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.post-body blockquote {
  margin: 0 0 1.25rem;
  padding: 0 0 0 1rem;
  border-left: 2px solid #f36c3d;
  color: #666;
}

.post-body hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 2.5rem 0;
}

.post-body code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: #f6f6f6;
  color: inherit;
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

.post-body pre {
  background: #f6f6f6;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.55;
  margin: 0 0 1.25rem;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.post-back {
  margin: 3rem 0 0;
}

.post-back a {
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
}

.post-back a:hover {
  color: #f36c3d;
}
