/* SPDX-License-Identifier: GPL-2.0-or-later
 * horo theme reading pages, 2026. Native Hugo content and Chroma. Original styling.
 */
.article-layout { position: relative; min-width: 0; max-width: 760px; margin: 0 auto; }
.ordinary-page, .gallery-page .article-layout { max-width: none; }

/* ---------- Opening page ---------- */
.article-cover { margin: 0 0 34px; border-radius: 22px; overflow: hidden; box-shadow: var(--h-lift); }
.article-cover img { display: block; width: 100%; max-height: 420px; object-fit: cover; filter: brightness(var(--h-dim)); }
.article-header { margin-bottom: 40px; text-align: center; }
.article-header::after { content: ""; display: block; width: 150px; height: 14px; margin: 28px auto 0; background: radial-gradient(circle, var(--h-wheat) 0 3.5px, transparent 4px) center / 14px 14px no-repeat, linear-gradient(90deg, transparent, var(--h-line-strong) 30%, var(--h-line-strong) 70%, transparent) center / 100% 1.5px no-repeat; }
.article-kicker { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 14px; }
.article-header h1 { margin: 0; font-size: clamp(27px, 4vw, 40px); line-height: 1.38; font-weight: 900; letter-spacing: .02em; overflow-wrap: anywhere; text-wrap: balance; }
.article-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; margin-top: 16px; font: 13.5px/1.6 var(--h-sans); color: var(--h-ink-3); }
.article-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px var(--h-wheat); }
.article-meta a:hover { color: var(--h-apple); }
.ordinary-page .article-header, .shuoshuo-single .article-header { text-align: left; }
.ordinary-page .article-header::after, .shuoshuo-single .article-header::after { margin-left: 0; }
:is(.ordinary-page, .shuoshuo-single) :is(.article-meta, .article-kicker) { justify-content: flex-start; }
.ordinary-page .article-header h1 { font-size: clamp(30px, 4.6vw, 44px); }

/* ---------- Prose ---------- */
.article-prose { min-width: 0; line-height: 1.95; }
.article-prose > :first-child { margin-top: 0; }
.article-prose :is(p, ul, ol, blockquote, figure, table, pre, dl) { margin-block: 1.15em; }
.article-prose :is(h1, h2, h3, h4, h5, h6) { position: relative; margin: 2em 0 .8em; line-height: 1.45; scroll-margin-top: 96px; overflow-wrap: anywhere; }
.article-prose h1 { font-size: 30px; font-weight: 900; }
.article-prose h2 { width: fit-content; max-width: 100%; font-size: 26px; font-weight: 800; padding: 0 4px; background: linear-gradient(transparent 60%, var(--h-wheat-soft) 60%); }
.article-prose h3 { font-size: 21px; font-weight: 800; padding-left: 20px; }
.article-prose h3::before { content: ""; position: absolute; left: 2px; top: .62em; width: 9px; height: 9px; border-radius: 2px; background: var(--h-apple); rotate: 45deg; }
.article-prose h4 { font-size: 19px; font-weight: 700; color: var(--h-fur); }
.article-prose :is(h5, h6) { font-size: 17px; font-weight: 700; color: var(--h-ink-2); }
.heading-link { margin-inline-start: .35em; font: 600 .7em/1 var(--h-sans); color: var(--h-apple); opacity: 0; transition: opacity .15s; }
:is(h1, h2, h3, h4, h5, h6):hover .heading-link, .heading-link:focus-visible { opacity: .8; }
.article-prose a { color: var(--h-apple-ink); text-decoration: underline; text-decoration-color: rgb(232 169 59 / .7); text-decoration-thickness: 1.5px; text-underline-offset: .24em; transition: color .15s, text-decoration-color .15s; }
.article-prose a:hover { color: var(--h-apple); text-decoration-color: currentColor; }
.article-prose :is(ul, ol) { padding-left: 1.6em; }
.article-prose li { margin: .35em 0; padding-left: .2em; }
.article-prose li > :is(ul, ol) { margin: .2em 0; }
.article-prose ul > li::marker { color: var(--h-wheat); font-size: 1.1em; }
.article-prose ol > li::marker { color: var(--h-apple); font: 700 .88em var(--h-sans); }
.article-prose blockquote { position: relative; margin-inline: 0; padding: 18px 28px 18px 54px; border-radius: 16px; background: var(--h-paper); box-shadow: var(--h-lift); color: var(--h-ink-2); }
.article-prose blockquote::before, .article-prose blockquote::after { position: absolute; font-size: 40px; line-height: 1; font-weight: 900; color: var(--h-wheat); }
.article-prose blockquote::before { content: "「"; left: 12px; top: 12px; }
.article-prose blockquote::after { content: "」"; right: 10px; bottom: 6px; }
.article-prose blockquote p { margin: .5em 0; }
.article-prose :not(pre) > code { padding: .12em .42em; border-radius: 6px; background: var(--h-apple-soft); color: var(--h-apple-ink); font-size: .86em; overflow-wrap: anywhere; }
.article-prose kbd { padding: .1em .45em; border-radius: 6px; background: var(--h-paper); box-shadow: inset 0 -2px 0 var(--h-line-strong), 0 0 0 1px var(--h-line-strong); font-size: .84em; }
.article-prose mark { background: var(--h-wheat-soft); color: inherit; padding: 0 .15em; border-radius: 3px; }
.article-prose img { max-width: 100%; height: auto; border-radius: 12px; vertical-align: middle; filter: brightness(var(--h-dim)); }
.article-prose figure { max-width: 100%; margin-inline: 0; }
.article-prose figcaption { margin-top: 10px; font: 13.5px/1.6 var(--h-sans); text-align: center; color: var(--h-ink-3); }
.article-prose video { width: 100%; height: auto; max-height: 70svh; border-radius: 12px; }
.article-prose table { display: block; max-width: 100%; width: max-content; overflow: auto; border-collapse: separate; border-spacing: 0; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--h-line); font: 14.5px/1.7 var(--h-sans); }
.article-prose :is(th, td) { min-width: 6em; padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--h-line); }
.article-prose tr:last-child > td { border-bottom: 0; }
.article-prose th { background: var(--h-wheat-soft); font-weight: 700; }
.article-prose tbody tr:nth-child(even) { background: var(--h-paper-2); }
.article-prose hr { height: auto; margin: 2.6em 0; border: 0; text-align: center; color: var(--h-wheat); overflow: visible; }
.article-prose hr::before { content: "◆ ◆ ◆"; font-size: 10px; letter-spacing: 1.4em; padding-left: 1.4em; }
.media-unavailable { display: block; margin-block: 15px; padding: 14px 16px; border: 1.5px dashed var(--h-line-strong); border-radius: 12px; font: 14px/1.8 var(--h-sans); color: var(--h-ink-2); overflow-wrap: anywhere; }
.media-unavailable a { margin-inline-start: .5em; text-decoration: underline; }
.article-prose .wp-block-separator { max-width: 100%; }
.article-prose .has-medium-font-size { font-size: 20px; }.article-prose .has-small-font-size { font-size: 13px; }.article-prose .has-large-font-size { font-size: 36px; }
.article-prose .has-vivid-cyan-blue-color { color: #0878b9; }
.article-prose .aligncenter { display: block; margin-inline: auto; }.article-prose .alignleft { float: left; margin-right: 20px; }.article-prose .alignright { float: right; margin-left: 20px; }
.article-prose .footnotes { clear: both; margin-top: 48px; font-size: 14.5px; color: var(--h-ink-2); }
.article-prose [id^="fn"], .legacy-anchor { scroll-margin-top: 96px; }
.legacy-anchor { display: block; height: 0; }
.article-prose sup .legacy-anchor { display: inline-block; width: 0; }
.article-prose .katex { color: inherit; }.katex .cjk_fallback { font-family: var(--horo-font); }
.article-prose .katex-display { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding-block: 4px; }

/* ---------- Code: a lantern-lit night ---------- */
.codeblock { --code-bg: #1b1f36; margin: 1.6em 0; border-radius: 14px; background: var(--code-bg); box-shadow: 0 14px 34px -16px rgb(15 18 34 / .7); overflow: hidden; color: #e8e6f0; font: 14.5px/1.75 var(--h-mono); }
html[data-appearance=dark] .codeblock { --code-bg: #10132a; box-shadow: 0 0 0 1px var(--h-line); }
.codebar { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 14px; background: rgb(255 255 255 / .04); border-bottom: 1px solid rgb(255 255 255 / .06); }
.code-dots { width: 9px; height: 9px; border-radius: 2px; background: var(--h-wheat); rotate: 45deg; flex: 0 0 auto; }
.code-language { flex: 1; font: 700 12px/38px var(--h-sans); letter-spacing: .08em; color: #f4c463; }
.codebar .copy-code { height: 26px; padding: 0 12px; border-radius: 999px; font: 500 12px/26px var(--h-sans); color: #c9c6d8; background: rgb(255 255 255 / .07); transition: background .2s, color .2s; }
.codebar .copy-code:hover { background: var(--h-apple); color: var(--h-on-apple); }
.code-scroll { display: flex; width: 100%; align-items: stretch; overflow: auto; }
.code-gutter { display: flex; flex-direction: column; flex: 0 0 auto; padding: 12px 10px 12px 14px; text-align: right; color: #6f7598; user-select: none; }
.code-gutter > span { display: block; height: 1.75em; }
.code-source { flex: 1; min-width: 0; }
.code-source > .highlight { min-width: max-content; }
.codeblock pre, .article-prose .codeblock pre { margin: 0; padding: 12px 16px 12px 8px; border: 0; overflow: visible; background: transparent !important; font: inherit; line-height: 1.75; }
.codeblock code { font: inherit; white-space: pre; word-break: normal; overflow-wrap: normal; }
.codeblock code > span { line-height: 1.75; }
/* Lift the pinned Chroma onedark inline colours to normal-text contrast. */
.code-source [style*="color:#e06c75"] { color: #ff8a95 !important; }
.code-source [style*="color:#7f848e"], .code-source [style*="color:#5c6370"] { color: #9aa0bf !important; }

/* ---------- Contents ---------- */
.article-toc { position: absolute; left: calc(100% + 44px); top: 0; bottom: 0; width: 210px; z-index: 10; scroll-margin-top: 80px; font-family: var(--h-sans); }
.article-toc > details { position: sticky; top: 92px; max-height: calc(100svh - 120px); overflow: auto; padding: 14px 14px 12px; border-radius: 18px; background: var(--h-paper); box-shadow: var(--h-lift); }
.article-toc summary { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; font-size: 15px; font-weight: 700; }
.article-toc summary .icon:first-child { color: var(--h-wheat); font-size: 18px; }
.article-toc summary span { flex: 1; }
.article-toc summary .icon:last-child { color: var(--h-ink-3); transition: rotate .2s; }
.article-toc details:not([open]) summary .icon:last-child { rotate: -90deg; }
.article-toc :is(ul, ol) { list-style: none; margin: 0; padding: 0 0 0 12px; }
.article-toc nav > :is(ul, ol) { padding: 0; }
.article-toc li { margin: 0; padding: 0; }
.article-toc a { display: block; padding: 5px 8px; border-radius: 8px; font-size: 13.5px; line-height: 1.55; color: var(--h-ink-2); overflow-wrap: anywhere; transition: background .15s, color .15s; }
.article-toc a:hover { background: var(--h-wheat-soft); color: var(--h-ink); }
.article-toc a[aria-current="location"] { color: var(--h-apple-ink); background: var(--h-apple-soft); font-weight: 600; }
.toc-related { margin-top: 6px; border-top: 1.5px dotted var(--h-line-strong); border-radius: 0 0 8px 8px !important; }

/* ---------- Closing page ---------- */
.related-articles { margin-top: 3em; padding: 18px 22px; border-radius: 16px; background: var(--h-paper-2); box-shadow: inset 0 0 0 1.5px var(--h-line); }
.related-articles h3 { margin: 0 0 .4em; padding-left: 0; font-size: 17px; }
.related-articles h3::before { display: none; }
.related-articles ul { margin: 0; }
.article-functions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 52px; padding-top: 24px; border-top: 1.5px dotted var(--h-line-strong); clear: both; font: 14px/1.6 var(--h-sans); }
.license-badge { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 999px; background: var(--h-paper); box-shadow: inset 0 0 0 1.5px var(--h-line-strong); color: var(--h-ink-2); }
.article-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.article-author img { border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px var(--h-wheat); }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.article-adjacent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 40px 0 0; }
.adjacent-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-height: 168px; padding: 18px 20px; border-radius: 18px; overflow: hidden; color: #fff; background: var(--h-night); isolation: isolate; box-shadow: var(--h-lift); }
.adjacent-card[rel=next] { align-items: flex-end; text-align: right; }
.adjacent-card img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; filter: brightness(var(--h-dim)); transition: transform .6s var(--h-ease); }
.adjacent-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(20 24 41 / .05), rgb(20 24 41 / .78)); }
.adjacent-card:hover { color: #fff; }
.adjacent-card:hover img { transform: scale(1.05); }
.adjacent-label { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 3px 10px; border-radius: 999px; background: rgb(255 255 255 / .2); backdrop-filter: blur(6px); font: 600 12px/1.5 var(--h-sans); }
.adjacent-title { font-size: 17px; font-weight: 800; line-height: 1.5; text-shadow: 0 1px 6px rgb(0 0 0 / .5); overflow-wrap: anywhere; }
.comment-anchor-targets { clear: both; margin: 35px 0; font-size: 14px; color: var(--h-ink-3); scroll-margin-top: 90px; }
.comment-anchor-targets > span { display: block; height: 0; scroll-margin-top: 90px; }

@media (max-width: 1339px) {
  .article-toc { position: static; width: auto; margin: -8px 0 32px; }
  .article-toc > details { position: static; max-height: 56svh; padding: 12px 14px; }
  .article-toc[hidden] { display: none; }
}
@media (max-width: 720px) {
  .article-cover { margin-bottom: 26px; border-radius: 16px; }
  .article-header { margin-bottom: 30px; }
  .article-header::after { margin-top: 22px; }
  .article-prose h2 { font-size: 23px; }
  .article-prose h3 { font-size: 19.5px; }
  .article-prose .has-large-font-size { font-size: 28px; }
  .article-prose blockquote { padding: 16px 20px 16px 44px; }
  .article-prose blockquote::before { left: 8px; font-size: 34px; }
  .codeblock { margin-inline: -4px; border-radius: 12px; font-size: 13.5px; }
  .article-adjacent { grid-template-columns: 1fr; }
  .article-tags { margin-left: 0; }
}
