/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #1d1d1f; max-width: 720px; margin: 0 auto; padding: 2.25rem 1.125rem; }

/* Typography */
h1, h2, h3, h4, h5, h6 { line-height: 1.15; margin: 2.25rem 0 0.765rem; font-weight: 600; letter-spacing: -0.022em; color: #000; }
h1 { font-size: 2.6rem; margin-top: 0; }
h2 { font-size: 1.95rem; }
h3 { font-size: 1.5rem; }
p { margin: 1.125rem 0; }
a { color: #06c; text-decoration: none; }
a:hover { color: #0051a8; }

/* Layout */
header[role="banner"] { padding-bottom: 2.25rem; margin-bottom: 2rem; border-bottom: 1px solid #d2d2d7; }
.site-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.site-title { font-size: 1.375rem; font-weight: 600; }
nav[role="navigation"] ul { display: flex; list-style: none; gap: 1.575rem; }
nav[role="navigation"] a { color: #6e6e73; font-size: 0.9375rem; }
footer[role="contentinfo"] { border-top: 1px solid #d2d2d7; padding-top: 2.25rem; margin-top: 4.5rem; text-align: center; color: #86868b; font-size: 0.875rem; }

/* Posts */
.post-list { list-style: none; margin-top: 2.7rem; }
.post-list > li { margin-bottom: 2.7rem; }
.post-list > li + li { padding-top: 2.7rem; border-top: 1px solid #f5f5f7; }
.post-list h2 { margin: 0 0 0.5rem; font-size: 1.75rem; }
.post-list time { color: #86868b; font-size: 0.875rem; }
.post-meta { color: #86868b; font-size: 0.875rem; margin: 1.575rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.post-meta time[title] { cursor: help; border-bottom: 1px dotted #86868b; }
.meta-sep { color: #d2d2d7; user-select: none; }
.post-taxonomy { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid #f5f5f7; display: flex; flex-direction: column; gap: 1rem; }
.tags, .categories { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.taxonomy-label { color: #1d1d1f; font-weight: 600; font-size: 0.8125rem; }
.tags a { background: #f5f5f7; color: #6e6e73; padding: 0.27rem 0.585rem; border-radius: 6px; font-size: 0.8125rem; }
.tags a:hover { background: #e8e8ea; }
.categories a { color: #6e6e73; font-size: 0.8125rem; }
.categories a:hover { color: #06c; }
.tag-heading { margin: 0; background: #f5f5f7; color: #6e6e73; padding: 0.4rem 0.75rem; border-radius: 6px; font-size: 1.1rem; display: inline-block; }

/* Article */
.article-content { line-height: 1.7; }
.article-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 2.25rem 0; }
.article-content pre { background: #f5f5f7; padding: 0.75rem; overflow-x: auto; border-radius: 12px; margin: 1.575rem 0; max-width: 100%; border: 1px solid #d0d7de; }
.article-content code { background: #f5f5f7; padding: 0.18rem 0.405rem; border-radius: 5px; font-family: Monaco, Consolas, monospace; font-size: 0.9em }
.article-content pre code { background: none; padding: 0; }
.article-content blockquote { border-left: 3px solid #d2d2d7; padding-left: 1.125rem; margin: 1.575rem 0; color: #6e6e73; font-style: italic; }
.article-content ul, .article-content ol { margin: 1.125rem 0; padding-left: 1.125rem; }

/* Tables */
.article-content table { width: 100%; border-collapse: collapse; margin: 1.575rem 0; font-size: 0.9375rem; }
.article-content thead { border-bottom: 1px solid #d2d2d7; }
.article-content th { text-align: left; padding: 0.75rem 1rem; font-weight: 600; color: #1d1d1f; background: #fbfbfd; }
.article-content th:first-child { border-radius: 8px 0 0 0; }
.article-content th:last-child { border-radius: 0 8px 0 0; }
.article-content td { padding: 0.75rem 1rem; border-bottom: 1px solid #f5f5f7; color: #1d1d1f; }
.article-content tbody tr:last-child td { border-bottom: none; }
.article-content tbody tr:hover { background: #fbfbfd; }

/* Syntax highlighting (Hugo highlight shortcode) */
.article-content .highlight { margin: 1.575rem 0; border-radius: 12px; overflow: hidden; background: #f5f5f7; border: 1px solid #d0d7de; position: relative; }
.article-content .highlight > div { overflow-x: auto; border-radius: 12px; padding: 0.75rem; -webkit-overflow-scrolling: touch; background: #f5f5f7; }
.article-content .highlight pre { margin: 0; padding: 0; background: none; border-radius: 0; overflow: visible; border: none; line-height: 1.5; }
.article-content .highlight table { border-spacing: 0; width: 100%; border-collapse: collapse; }
.article-content .highlight td { padding: 0; margin: 0; border: 0; vertical-align: top; }
.article-content .highlight td:first-child { padding-right: 0.75rem; border-right: 1px solid #d0d7de; user-select: none; }
.article-content .highlight td:first-child code { display: block; }
.article-content .highlight td:first-child code span { display: block; line-height: 1.5; }
.article-content .highlight td:last-child code span[style*="display:flex"] { line-height: 1.5; }
.article-content .highlight code { background: none; padding: 0; white-space: pre; }

/* Copy code button */
.copy-code-button { position: absolute; top: 0.5rem; right: 0.5rem; display: flex; align-items: center; gap: 0.35rem; background: #fff; color: #6e6e73; border: 1px solid #d0d7de; border-radius: 6px; padding: 0.35rem 0.6rem; font-size: 0.8125rem; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; cursor: pointer; transition: all 0.2s ease; z-index: 10; }
.copy-code-button:hover { background: #f6f8fa; color: #1d1d1f; border-color: #06c; }
.copy-code-button:active { transform: scale(0.95); }
.copy-code-button.copied { background: #06c; color: #fff; border-color: #06c; }
.copy-code-button svg { flex-shrink: 0; }
.copy-text { white-space: nowrap; }

/* Related Posts */
.related-posts { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #d2d2d7; }
.related-posts h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.related-posts ul { list-style: none; display: grid; gap: 1rem; }
.related-posts article { background: #fbfbfd; border: 1px solid #f5f5f7; border-radius: 10px; padding: 1rem; transition: all 0.2s ease; }
.related-posts article:hover { border-color: #d2d2d7; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
.related-posts h3 { font-size: 1.1rem; margin: 0 0 0.5rem; }
.related-posts h3 a { color: #1d1d1f; }
.related-posts h3 a:hover { color: #06c; }
.related-posts p { color: #6e6e73; font-size: 0.875rem; margin: 0 0 0.5rem; line-height: 1.5; }
.related-posts time { color: #86868b; font-size: 0.8125rem; }

/* Utilities */
.breadcrumbs ol { display: flex; list-style: none; gap: 0.45rem; font-size: 0.875rem; color: #6e6e73; margin-bottom: 1.25rem; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 0.45rem; color: #d2d2d7; }
.table-of-contents { background: #fbfbfd; padding: 1.575rem; margin: 2.25rem 0; border-radius: 12px; border: 1px solid #f5f5f7; }
.table-of-contents summary { font-size: 1.375rem; line-height: 1.15; margin: 0 0 0.765rem; font-weight: 600; letter-spacing: -0.022em; color: #000; cursor: pointer; list-style: none; display: flex; align-items: center; }
.table-of-contents summary::-webkit-details-marker { display: none; }
.table-of-contents summary::before { content: "▶"; font-size: 0.875rem; transition: transform 0.2s ease; display: inline-block; margin-right: 0.5rem; }
.table-of-contents details[open] summary::before { transform: rotate(90deg); }
.table-of-contents summary:hover { color: #06c; }
.table-of-contents ul { list-style: none; margin: 0; padding-left: 0; }
.table-of-contents ul ul { padding-left: 1.25rem; margin-top: 0.5rem; }
.table-of-contents li { margin: 0.5rem 0; }
.table-of-contents a { color: #1d1d1f; }
.table-of-contents a:hover { color: #06c; }
.table-of-contents nav > ul > li > a { font-weight: 600; }
.table-of-contents ul ul a { font-weight: 400; }
.pagination ul { display: flex; list-style: none; gap: 0.585rem; justify-content: center; margin: 3.15rem 0; }
.pagination a, .pagination-current span { padding: 0.495rem 0.9rem; border: 1px solid #e8e8ea; border-radius: 8px; }
.pagination a { color: #6e6e73; }
.pagination a:hover { border-color: #d2d2d7; background: #f5f5f7; color: #1d1d1f; }
.pagination-current span { background: #f5f5f7; color: #1d1d1f; border-color: #d2d2d7; font-weight: 500; }
.button { background: #06c; color: #fff; padding: 0.675rem 1.35rem; border-radius: 10px; }
.button:hover { background: #0051a8; color: #fff; }

/* Responsive */
@media (max-width: 768px) {
  html { font-size: 16px; }
  body { padding: 1.575rem 1.25rem; }
  .site-header { flex-direction: column; align-items: flex-start; gap: 0.99rem; }

  /* Reduce tag padding on mobile */
  .tags a { min-height: 0}

  /* Fix breadcrumb last item vertical alignment */
  .breadcrumbs li { display: flex; align-items: center; }

  /* Increase tags/categories font size on mobile */
  .tags a, .categories a { font-size: 0.875rem; }
}
