/* Vertical scroll reader; two-column article body */

html {
    background: #fff;
}

/* Keep surrounding canvas plain white; paper texture is scoped to page cards. */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    position: relative;
    background: #fff;
    color: #222;
    isolation: isolate;
}

/* During handoff/bootstrap, never show floating comment UI before article render settles. */
body.reader-loading #comment-screen {
    display: none;
}

.blog {
    position: relative;
    z-index: 1;
    max-width: min(1340px, calc(100vw - 40px));
    margin: 0 auto;
    /* Calibrated handoff offset to avoid visible vertical snap. */
    padding: 9px 20px 56px;
    box-sizing: border-box;
    background: transparent;
}

/* Hide legacy top masthead; title now renders in first content page */
.blog > .article:first-child {
    display: none;
}

.title{
    min-height: auto;
    height: fit-content;
    white-space: normal;
    margin: 0 0 12px 0;
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    line-height: 1.18;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1a1a1a;
}

/* Legacy masthead in blog.html (hidden); kept if referenced elsewhere */
.published{
    margin: 0;
    padding: 0;
    font-size: clamp(0.88rem, 1.02vw, 1rem);
    text-transform: capitalize;
    font-style: italic;
    color: rgba(0, 0, 0, 0.5);
}

.published span{
    font-weight: 700;
    font-style: normal;
}

/* Article spread: single-column reader layout */
:root {
    --spread-gap: clamp(46px, 6vw, 78px);
    --reader-page-height: calc(100dvh - clamp(30px, 4.8vh, 52px));
    --reader-page-width: min(620px, calc(var(--reader-page-height) / 1.41));
    --reader-page-pad-inline: clamp(28px, 3.3vw, 40px);
    --reader-page-pad-block: clamp(24px, 3vh, 34px);
}

#article-body.article-columns {
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 3.2vh, 42px);
    padding: 0 clamp(20px, 2.8vw, 30px);
    box-sizing: border-box;
    background: transparent;
    margin: 0;
}

#article-body .article-spread {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: min(var(--reader-page-width), 100%);
    min-height: var(--reader-page-height);
    margin-inline: auto;
    gap: 0;
    padding-bottom: clamp(18px, 2.2vh, 28px);
    border-bottom: none;
    align-items: start;
    box-sizing: border-box;
}

#article-body .article-spread:last-child {
    padding-bottom: 0;
}

#article-body .article-page {
    min-width: 0;
    min-height: var(--reader-page-height);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    background: #fff;
    overflow: hidden;
    border: 1px solid rgba(20, 20, 20, 0.14);
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.07),
        0 1px 4px rgba(0, 0, 0, 0.045);
    padding: clamp(24px, 2.9vh, 34px) var(--reader-page-pad-inline) var(--reader-page-pad-block);
}

#article-body .article-page-right {
    display: none;
}

#article-body .article-page::before,
#article-body .article-page::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: multiply;
    z-index: 0;
}

#article-body .article-page::after {
    opacity: 0.18;
    background-size: 120px 120px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

#article-body .article-page::before {
    opacity: 0.1;
    background-image: repeating-radial-gradient(rgba(0, 0, 0, 0.14) 0 0.7px, transparent 0.7px 2px);
    background-size: 3.2px 3.2px;
}

#article-body .article-page > * {
    position: relative;
    z-index: 1;
}

#article-body .article-page-body {
    min-width: 0;
}

/*
 * Last block before the footnote strip: its margin-bottom collapses with .article-page-footnotes’
 * margin-top, so the visible gap was ~max(12–18px, footnote margin). Pull the rule up by capping
 * that bottom margin when the next sibling is the footnote area.
 */
#article-body .article-page-body > *:has(+ .article-page-footnotes) {
    margin-bottom: 0 !important;
}

/* Footnotes: full column width rule; text aligns with body (no extra horizontal inset). */
#article-body .article-page-footnotes {
    width: 100%;
    box-sizing: border-box;
    margin-top: clamp(8px, 1.15vw, 16px);
    margin-inline: 0;
    padding-top: clamp(0.35rem, 0.55vw, 0.65rem);
    padding-inline: 0;
    border-top: 1px solid rgba(23, 23, 23, 0.78);
}

#article-body .article-page-footnotes > p[data-variant="footnote"]:first-child {
    margin-top: 0;
}

#article-body .article-page-footnotes > p[data-variant="footnote"]:last-child {
    margin-bottom: 0;
}

/*
 * Reader footnote strip: extra .article-page in the selector so these beat
 * `#article-body .article-page p[data-variant="footnote"] { font-size: 0.86em }` later in the file.
 */
#article-body .article-page .article-page-footnotes p[data-variant="footnote"] {
    position: static;
    font-size: clamp(10.5px, 1.12vw, 12.5px);
    line-height: 1.26;
    margin: 0.05em 0;
    padding: 0;
    text-align: start;
    color: rgba(23, 23, 23, 0.94);
    -webkit-text-fill-color: rgba(23, 23, 23, 0.94);
    background-image: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-stroke: 0;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
}

/* Superscript numeral only (no period), like in-text markers. */
#article-body .article-page .article-page-footnotes p[data-variant="footnote"][data-footnote-n]::before {
    content: attr(data-footnote-n) "\00a0";
    font-size: 0.8em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    vertical-align: super;
    line-height: 0;
    letter-spacing: 0.02em;
    color: rgba(23, 23, 23, 0.88);
    -webkit-text-fill-color: rgba(23, 23, 23, 0.88);
    background: none;
    background-image: none;
}

#article-body .article-page-footnotes:empty {
    display: none;
    padding: 0;
    margin: 0;
    border: none;
}

.article-inline-masthead {
    margin: 0 0 clamp(3px, 0.5vw, 8px);
}

#article-body .article-page.article-page-first {
    height: var(--readerHandoffPageHeight, var(--reader-page-height));
    padding-top: clamp(96px, 12.8vh, 146px);
    min-height: var(--readerHandoffPageHeight, var(--reader-page-height));
    max-height: var(--readerHandoffPageHeight, var(--reader-page-height));
}

#article-body .article-page .article-page-number {
    position: absolute;
    right: clamp(14px, 1.5vw, 20px);
    bottom: clamp(14px, 1.8vh, 20px);
    text-align: right;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(10px, 0.78vw, 11.5px);
    line-height: 1;
    color: rgba(0, 0, 0, 0.42);
    -webkit-text-fill-color: rgba(0, 0, 0, 0.42);
    background: none;
    text-shadow: none;
    pointer-events: none;
    z-index: 2;
}

.article-inline-masthead .title {
    margin: 0 0 clamp(2px, 0.35vw, 5px);
}

/* Masthead: no ink grain — title + byline stay clean vs body columns */
#article-body .article-inline-masthead .title {
    color: #141414;
    -webkit-text-fill-color: #141414;
    background: none;
    background-image: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-stroke: 0;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
    font-family: Georgia, 'Times New Roman', serif;
}

.article-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    /* Flex item boundaries swallow adjacent spaces in some engines when gap was 0 */
    gap: 0.4em;
    margin: 0;
    padding: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(0.74rem, 0.82vw, 0.84rem);
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.article-byline-by {
    color: rgba(0, 0, 0, 0.48);
    font-weight: 400;
    font-style: normal;
}

.article-byline-author {
    font-weight: 600;
    font-style: normal;
}

.article-byline-onthe {
    color: rgba(0, 0, 0, 0.48);
    font-weight: 400;
    font-style: normal;
}

.article-byline-date {
    font-weight: 400;
    font-style: italic;
    color: rgba(0, 0, 0, 0.48);
}

/* First body block after inline masthead: pull text up (margins collapse with masthead bottom). */
#article-body .article-page:has(> .article-inline-masthead) .article-page-body > :first-child {
    margin-top: clamp(2px, 0.35vw, 6px);
}

/* Ink type: match .article-panel p / h2 (larger sizes for full reader) */
#article-body .article-page p,
#article-body .article-page h1,
#article-body .article-page h2,
#article-body .article-page h3,
#article-body .article-page h4,
#article-body .article-page h5,
#article-body .article-page h6 {
    position: relative;
    z-index: 1;
    word-break: break-word;
    margin: clamp(9px, 0.92vw, 12px) 0;
    break-inside: avoid;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.42;
    font-size: clamp(13.6px, 0.84vw, 15.2px);
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-image:
        linear-gradient(#171717, #171717),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='5' stitchTiles='stitch'/><feColorMatrix type='matrix' values='1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 1.2 -0.1'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-size: auto, 48px 48px;
    background-blend-mode: multiply;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-stroke: 0.25px rgba(0, 0, 0, 0.45);
    text-shadow: 0 0 0.45px rgba(0, 0, 0, 0.32);
    -webkit-font-smoothing: none;
}

#article-body .article-page h1 {
    font-size: clamp(1rem, 1.15vw, 1.22rem);
    line-height: 1.2;
    margin-top: 0.35em;
}

/* Inline masthead h1: beat .article-page h1 bottom margin so title sits close to byline. */
#article-body .article-page .article-inline-masthead h1.title {
    font-size: clamp(1.14rem, 1.38vw, 1.42rem);
    line-height: 1.16;
    margin-bottom: clamp(2px, 0.35vw, 5px);
}

#article-body .article-page h2 {
    font-size: clamp(0.95rem, 0.98vw, 1.08rem);
    line-height: 1.25;
}

#article-body .article-page h3 {
    font-size: clamp(0.9rem, 0.88vw, 0.98rem);
}

#article-body .article-page h4,
#article-body .article-page h5,
#article-body .article-page h6 {
    font-size: clamp(0.92rem, 0.92vw, 1rem);
}

#article-body .article-page .article-image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    display: block;
    margin: clamp(12px, 1.5vw, 20px) 0 clamp(18px, 2vw, 28px);
    object-fit: contain;
    break-inside: avoid;
    color: unset;
    -webkit-text-fill-color: unset;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-stroke: 0;
    text-shadow: none;
}

#article-body .article-page img[data-display="block"] {
    display: block;
    max-width: 100%;
    height: auto;
    margin: clamp(12px, 1.5vw, 20px) 0 clamp(18px, 2vw, 28px);
}

#article-body .article-page img[data-display="inline"] {
    display: inline-block;
    vertical-align: middle;
    max-width: 42%;
    height: auto;
    margin: 0 .35rem;
}

#article-body .article-page p[data-variant="poetry"] {
    font-family: Georgia, 'Times New Roman', Times, serif;
    text-align: center;
    max-width: 28em;
    margin-left: auto;
    margin-right: auto;
    white-space: pre-wrap;
    line-height: 1.75;
}

#article-body .article-page p[data-variant="poetry"][style*="text-align: left"],
#article-body .article-page p[data-variant="poetry"][style*="text-align: start"] {
    margin-left: 0;
    margin-right: auto;
}

#article-body .article-page p[data-variant="poetry"][style*="text-align: right"],
#article-body .article-page p[data-variant="poetry"][style*="text-align: end"] {
    margin-left: auto;
    margin-right: 0;
}

#article-body .article-page p[data-variant="poetry"][data-poetry-italic="true"] {
    font-style: italic;
}

#article-body .article-page p[data-variant="poetry-author"] {
    font-family: Georgia, 'Times New Roman', Times, serif;
    text-align: center;
    max-width: 28em;
    margin: 0.65rem auto 0;
    font-size: 0.92em;
    opacity: 0.88;
}

#article-body .article-page p[data-variant="poetry-author"][style*="text-align: left"],
#article-body .article-page p[data-variant="poetry-author"][style*="text-align: start"] {
    margin-left: 0;
    margin-right: auto;
}

#article-body .article-page p[data-variant="poetry-author"][style*="text-align: right"],
#article-body .article-page p[data-variant="poetry-author"][style*="text-align: end"] {
    margin-left: auto;
    margin-right: 0;
}

#article-body .article-page p[data-variant="epigraph"] {
    font-style: italic;
    max-width: 76%;
    margin-left: auto;
    margin-right: 0;
    opacity: 0.92;
}

#article-body .article-page blockquote:not([data-variant]) {
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 3px solid rgba(0, 0, 0, 0.22);
}

#article-body .article-page blockquote p:not([data-variant="attribution"]) {
    white-space: pre-wrap;
}

#article-body .article-page blockquote[data-variant="quote"] {
    border-left: none;
    padding-left: 0;
    margin: 1rem 0;
    font-style: italic;
}

#article-body .article-page blockquote p[data-variant="attribution"] {
    font-size: 0.92em;
    opacity: 0.88;
    margin-top: 0.65rem;
    font-style: normal;
}

/* Lighter ink than body: quotes / poetry / linked footnotes */
#article-body .article-page blockquote p,
#article-body .article-page p[data-variant="poetry"],
#article-body .article-page p[data-variant="poetry-author"],
#article-body .article-page p[data-variant="footnote"][data-footnote-id] {
    color: #1a1a1a;
    -webkit-text-fill-color: #1a1a1a;
    background-image: linear-gradient(#1a1a1a, #1a1a1a);
    background-size: auto;
    background-blend-mode: normal;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-stroke: 0.06px rgba(0, 0, 0, 0.18);
    text-shadow: 0 0 0.18px rgba(0, 0, 0, 0.1);
    -webkit-font-smoothing: antialiased;
}

#article-body .article-page hr[data-variant="dinkus"] {
    border: 0;
    text-align: center;
    margin: 1.5rem 0;
}

#article-body .article-page hr[data-variant="dinkus"]::after {
    content: "✶ ✶ ✶";
    color: rgba(0, 0, 0, 0.55);
    letter-spacing: 0.4rem;
    font-size: 0.9rem;
}

#article-body .article-page p[data-variant="dropcap"]::first-letter {
    float: left;
    font-size: 3.2em;
    line-height: 0.85;
    margin-right: 0.1em;
    font-weight: 700;
}

#article-body .article-page p[data-variant="footnote"] {
    font-size: 0.86em;
    line-height: 1.45;
    opacity: 0.92;
}

#article-body .article-page p[data-variant="footnote"][id^='fn-'] {
    scroll-margin-top: 6rem;
}

#article-body .article-page .footnote-ref {
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    color: rgba(0, 50, 120, 0.92);
    -webkit-text-fill-color: rgba(0, 50, 120, 0.92);
    background: none;
    background-image: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-stroke: 0;
    text-shadow: none;
}

#article-body .article-page .footnote-ref-mark {
    font-size: 0.72em;
    font-weight: 700;
    vertical-align: super;
    line-height: 0;
}

#article-body .article-page p[data-variant="smallcaps"] {
    font-variant: small-caps;
    letter-spacing: 0.04em;
}

/* Preserve inline color/highlight marks from Tiptap output */
#article-body .article-page span[style*="color"] {
    color: inherit;
    -webkit-text-fill-color: currentColor;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
}

#article-body .article-page mark {
    color: #171717;
    -webkit-text-fill-color: #171717;
    background-clip: border-box;
    -webkit-background-clip: border-box;
    padding: 0 .08em;
    border-radius: 2px;
}

#article-body .article-page p[data-variant="intro"] {
    font-style: italic;
}

#article-body .article-page p[data-variant="whisper"] {
    color: rgba(0, 0, 0, 0.68);
    font-style: italic;
}

#article-body .article-page p[data-variant="fieldnotes"] {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.04);
    border-left: 3px solid rgba(0, 0, 0, 0.25);
    padding: 8px 10px;
}

#article-body .article-page img[align="left"] { display: block; margin-right: auto; margin-left: 0; }
#article-body .article-page img[align="center"] { display: block; margin-left: auto; margin-right: auto; }
#article-body .article-page img[align="right"] { display: block; margin-left: auto; margin-right: 0; }

/* Comments: same continuous sheet — no rule above */
.comment-block {
    clear: none;
    padding: clamp(8px, 1vw, 14px) 0 0;
    margin: 0 calc(-1 * var(--reader-page-pad-inline));
    width: calc(100% + (var(--reader-page-pad-inline) * 2));
    background: transparent;
    max-width: none;
}

.annotation-section {
    margin: 0 0 12px;
}

.annotation-heading {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

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

.annotation-empty {
    color: #666;
    font-size: 12px;
}

.annotation-item {
    padding: 8px 10px;
    margin: 6px 0;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 246, 191, 0.25);
    border-radius: 6px;
    cursor: pointer;
}

.annotation-item-active {
    outline: 2px solid rgba(201, 160, 0, 0.45);
}

.annotation-item-head {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.annotation-index {
    font-size: 11px;
    color: #666;
    font-weight: 700;
}

.annotation-quote {
    font-size: 12px;
    font-style: italic;
    color: #222;
}

.annotation-comment {
    margin: 4px 0 0;
    font-size: 12px;
    color: #222;
}

.annotation-toolbar {
    position: absolute;
    z-index: 10000;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    backdrop-filter: none;
}

/* Same MS-style button as .annotation-add-btn; session-hue gradient + border (slightly translucent). */
.annotation-toolbar.annotation-toolbar-toned .annotation-add-btn {
    border-color: var(--ann-session-border, #808080);
    background: linear-gradient(
        to bottom,
        var(--ann-session-fill-hi, #f0f0f0) 0%,
        var(--ann-session-fill-mid, #d0d0d0) 50%,
        var(--ann-session-fill-lo, #b8b8b8) 100%
    );
}

.annotation-toolbar.annotation-toolbar-toned .annotation-add-btn:hover {
    border-color: color-mix(in srgb, var(--ann-session-border, #606060) 72%, #606060);
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, black 7%, var(--ann-session-fill-hi, #e8e8e8)) 0%,
        color-mix(in srgb, black 7%, var(--ann-session-fill-mid, #c8c8c8)) 50%,
        color-mix(in srgb, black 8%, var(--ann-session-fill-lo, #a8a8a8)) 100%
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 0 rgba(0, 0, 0, 0.3);
}

.annotation-toolbar.annotation-toolbar-toned .annotation-add-btn:active {
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, black 12%, var(--ann-session-fill-lo, #b8b8b8)) 0%,
        color-mix(in srgb, black 8%, var(--ann-session-fill-mid, #d0d0d0)) 50%,
        color-mix(in srgb, black 5%, var(--ann-session-fill-hi, #f0f0f0)) 100%
    );
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(1px);
}

.annotation-add-btn {
    padding: 6px 12px;
    border: 1px solid #808080;
    border-radius: 0;
    font-size: 12px;
    font-weight: 400;
    font-family: 'MS Sans Serif', 'Arial', sans-serif;
    cursor: pointer;
    transition: all 0.1s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 60px;
    background: linear-gradient(to bottom, #f0f0f0 0%, #d0d0d0 50%, #b8b8b8 100%);
    color: #000;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 1px 0 rgba(0,0,0,0.2);
}

.annotation-add-btn:hover {
    background: linear-gradient(to bottom, #e8e8e8 0%, #c8c8c8 50%, #a8a8a8 100%);
    border-color: #606060;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 0 rgba(0,0,0,0.3);
}

.annotation-add-btn:active {
    background: linear-gradient(to bottom, #b8b8b8 0%, #d0d0d0 50%, #f0f0f0 100%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.1);
    transform: translateY(1px);
}

.comment-card .reply {
    display: block;
    margin: 0;
    padding: 2px 8px;
    border: 1px solid var(--ann-border, rgba(128, 128, 128, 0.7));
    border-radius: 0;
    font-size: 10px;
    font-weight: 400;
    font-family: 'MS Sans Serif', 'Arial', sans-serif;
    cursor: pointer;
    transition: all 0.1s ease;
    text-decoration: none;
    text-align: center;
    min-width: 44px;
    background: color-mix(in srgb, var(--ann-fill, rgba(232, 232, 232, 0.9)) 62%, white 38%);
    color: #000;
    text-shadow: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 1px 0 rgba(0,0,0,0.12);
    position: static;
    transform: none;
}

.comment-card .reply:hover {
    background: color-mix(in srgb, var(--ann-fill-active, rgba(216, 216, 216, 0.92)) 66%, white 34%);
    border-color: var(--ann-border-active, rgba(96, 96, 96, 0.8));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 0 rgba(0,0,0,0.18);
}

.comment-card .reply:active {
    background: color-mix(in srgb, var(--ann-fill-active, rgba(205, 205, 205, 0.95)) 72%, white 28%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.25), 0 1px 0 rgba(255,255,255,0.1);
    transform: translateY(1px);
}

.annotation-highlight {
    position: absolute;
    border: none;
    padding: 0;
    margin: 0;
    background: var(--ann-fill, rgba(255, 231, 128, 0.38));
    border: none;
    border-radius: 0;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 140ms ease, border-color 140ms ease;
}

.annotation-highlight-active {
    background: var(--ann-fill-active, rgba(255, 214, 79, 0.65));
}

.annotation-highlight.annotation-highlight-pending {
    pointer-events: none;
    cursor: default;
}

#annotation-overlay-root {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

.annotation-comments {
    margin: 0;
    width: 100%;
}

.annotation-card {
    border: none;
    background: color-mix(in srgb, var(--ann-fill, rgba(255, 240, 166, 0.22)) 26%, white 74%);
    border-radius: 0;
    padding: 0;
    transition: background-color 140ms ease, border-color 140ms ease;
    max-width: 100%;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.comment-card.annotation-card {
    padding: 0 !important;
}

.annotation-card:hover {
    background: transparent;
}

.annotation-card > .comment-shell {
    background: color-mix(in srgb, var(--ann-fill, rgba(255, 240, 166, 0.22)) 72%, white 28%);
    padding: 8px 0;
}

.annotation-card:hover > .comment-shell {
    background: color-mix(in srgb, var(--ann-fill-active, rgba(255, 240, 166, 0.3)) 68%, white 32%);
}

.annotation-card::before {
    content: none;
}

.annotation-user {
    color: #7a5b00;
}

.annotation-card .user.annotation-user {
    display: block;
    margin: 0 0 2px 0 !important;
    position: static;
    left: auto;
    padding-left: 6px;
}

.annotation-card .annotation-comment {
    color: rgba(30, 24, 10, 0.96);
    padding: 0 0 0 6px;
    display: block;
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.annotation-card .comment-meat {
    display: block;
}

.annotation-item-active {
    outline: 2px solid var(--ann-border-active, rgba(188, 146, 0, 0.45));
    outline-offset: 1px;
}

.comment-section {
    margin-top: 0;
    break-inside: auto;
    font-size: 12px;
    line-height: 1.35;
    color: #444;
    counter-reset: footnote;
    background: transparent;
    width: 100%;
}


#commentForm {
    background: transparent;
}

#commentForm.annotation-compose {
    margin-top: 4px;
}

#commentInput.annotation-compose-input {
    border-color: var(--ann-compose-border, rgba(120, 90, 0, 0.35));
    background: color-mix(in srgb, var(--ann-compose-fill, rgba(255, 248, 220, 0.35)) 55%, white 45%);
}

#commentInput.annotation-compose-input:focus {
    border-color: var(--ann-compose-border-focus, rgba(100, 75, 0, 0.45));
    background: color-mix(in srgb, var(--ann-compose-fill, rgba(255, 252, 235, 0.5)) 50%, white 50%);
}

.comment-card {
    display: block;
    margin: 0;
    padding: 2px 0;
    width: 100%;
    max-width: none;
    margin-left: 0;
    text-align: left;
    position: relative;
}

.comment-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
    align-items: stretch;
    width: 100%;
}

.comment-main {
    min-width: 0;
    padding-left: calc(var(--thread-depth, 0) * 20px);
}

.comment-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
}

.comment-card::before {
    counter-increment: footnote;
    content: counter(footnote);
    display: inline-block;
    vertical-align: super;
    font-size: 10px;
    line-height: 1;
    color: #666;
    margin-right: 2px;
}

.comment-card.annotation-card::before {
    content: none;
    display: none;
}

.threaded-comment::before {
    content: none;
    display: none;
}

.comment-card .user {
    display: inline;
    margin: 0 6px 0 0;
    font-size: 12px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    color: #333;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    color: #333 !important;
    -webkit-text-fill-color: #333 !important;
    background: none !important;
    background-image: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    filter: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.comment-card .comment-meat {
    display: block;
    padding-right: 0;
}
.comment-card .comment-content {
    display: inline;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    font-weight: 400 !important;
    font-size: 14px;
    line-height: 1.45;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    color: #222 !important;
    -webkit-text-fill-color: #222 !important;
    background: none !important;
    background-image: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    filter: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

#commentList {
    list-style: none;
    margin: 0;
    padding: 0;
}

.threaded-comment {
    padding-left: 0;
}

.comment-children {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
}

.annotation-children {
    margin: 0;
    padding: 0;
}

.annotation-children > .threaded-comment {
    background: color-mix(in srgb, var(--ann-fill, rgba(255, 240, 166, 0.22)) 34%, white 66%);
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.annotation-children > .threaded-comment:hover {
    background: color-mix(in srgb, var(--ann-fill-active, rgba(255, 240, 166, 0.3)) 40%, white 60%);
}

.reply-user {
    opacity: 0.72;
    margin-right: 4px;
}

input[type=text] {
    width: 100%;
    max-width: 520px;
    padding: 12px 16px;
    margin: 8px 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.22);
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
    color: #222;
}

input[type=text]::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

input[type=text]:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.28);
    background: rgba(255, 255, 255, 0.35);
}

.article-content {
    break-inside: auto;
}

.article-content * {
    word-break: break-word;
    margin: 20px 0;
    color: #2d2d2d;
    break-inside: avoid;
}

@media (max-width: 768px) {
    #article-body.article-columns {
        grid-template-columns: 1fr;
        gap: clamp(18px, 3vw, 28px);
    }

    #article-body .article-column-left {
        min-height: 0;
    }
}

/* Loaded inside home mobile iframe (?embed=1). */
html.reader-embed,
body.reader-embed {
    background: #fff;
}

body.reader-embed .blog {
    padding-top: clamp(8px, 1.2svh, 14px);
    padding-bottom: clamp(16px, 2.5svh, 28px);
}

/* Embed: comments sit outside paginated pages (avoid overflow:hidden caret bugs on iOS). */
body.reader-embed .comment-block {
    margin-inline: 0;
    width: 100%;
    padding-top: clamp(12px, 1.8svh, 20px);
}

body.reader-embed #commentForm {
    padding-inline: clamp(14px, 4.5vw, 24px);
    box-sizing: border-box;
}

body.reader-embed #commentInput {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 12px 14px;
    min-height: 44px;
    font-size: 16px;
    line-height: 1.25;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

@media (max-width: 900px) {
    /*
     * Use svh (small viewport) instead of dvh/vh for reader sizing + vertical padding.
     * dvh and vh follow the dynamic toolbar on iOS Safari and change while scrolling,
     * which makes the first page height and vh-based padding “breathe” and reflow body text.
     */
    :root {
        --reader-page-width: calc(100vw - 24px);
        --reader-page-height: calc(100svh - clamp(18px, 3.2svh, 38px));
        --reader-page-pad-inline: clamp(14px, 4.2vw, 20px);
        --reader-page-pad-block: clamp(18px, 2.5svh, 26px);
    }

    .blog {
        max-width: 100vw;
        padding-inline: 0;
    }

    #article-body.article-columns {
        padding-inline: 0;
        gap: clamp(10px, 1.6svh, 18px);
    }

    #article-body .article-spread {
        min-height: 0;
        padding-bottom: clamp(6px, 1svh, 12px);
    }

    #article-body .article-spread:last-child {
        padding-bottom: 0;
    }

    #article-body .article-page:not(.article-page-first) {
        min-height: 0;
    }

    #article-body .article-page {
        padding-top: clamp(16px, 2.2svh, 22px);
        padding-inline: var(--reader-page-pad-inline);
        padding-bottom: clamp(24px, 3.4svh, 36px);
    }

    #article-body .article-page.article-page-first {
        padding-top: clamp(56px, 8.5svh, 104px);
    }

    #article-body .article-page .article-page-number {
        bottom: clamp(12px, 1.6svh, 18px);
    }

    #commentForm {
        padding-inline: clamp(14px, 4.5vw, 24px);
        box-sizing: border-box;
    }

    #commentForm input[type="text"] {
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 12px 14px;
        min-height: 44px;
        font-size: 16px;
        line-height: 1.25;
        font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    }
}

.sub-heading{
    padding: 0 5vw;
    color: #2d2d2d;
    font-weight: 500;
    font-size: 40px;
    margin-top: 80px;
}

#edit-blog-btn {
    background: rgba(0,0,0,0.2);
    display: none;
}

.blogs-section {
    position: relative;
    min-height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f8f8;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.cardcontainer {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.blog-card {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.blog-title {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
