
.post-page {
    --reader-max-width: 47rem;
    --reader-font-size: 1rem;
    --reader-line-height: 1.55;
    --reader-paragraph-gap: 0.6em;
    --reader-font-family: serif;
    width: min(100%, var(--reader-max-width));
    max-width: var(--reader-max-width);
    margin: 36px auto 48px;
}

.post-header {
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(34, 34, 34, 0.1);
}

.post-eyebrow {
    margin: 0 0 8px;
    color: #7a7a7a;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.post-title {
    margin: 0 0 10px;
    font-size: 2.25rem;
    line-height: 1.2;
}

.post-content a {
    transition: color 160ms ease, text-decoration-color 160ms ease, background-color 160ms ease;
}

.post-content a:link {
    text-decoration: underline dashed grey 1px;
}

.post-content a:hover {
    color: #111;
    text-decoration: underline dashed rgba(17, 17, 17, 0.9) 1.2px;
    background-color: rgba(17, 17, 17, 0.04);
}

.post-content a:focus-visible {
    outline: 2px solid rgba(17, 17, 17, 0.28);
    outline-offset: 2px;
    border-radius: 2px;
}

.article-metadata {
    margin-bottom: 12px;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.post-meta-primary .post-date {
    color: #444;
}

.post-taxonomy {
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    column-gap: 18px;
    row-gap: 4px;
}

.post-taxonomy span {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.15em;
}

.post-content {
    font-family: var(--reader-font-family);
    font-size: var(--reader-font-size);
    line-height: var(--reader-line-height);
    overflow-wrap: break-word;
    text-align: justify;
    text-justify: inter-character;
}

.post-content[data-reader-justify="false"] {
    text-align: left;
    text-justify: auto;
}

.post-content > :first-child {
    margin-top: 0;
}

.post-content > :last-child {
    margin-bottom: 0;
}

.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin: 1.9em 0 0.6em;
    line-height: 1.35;
}

.post-content ul,
.post-content ol {
    margin: 1.1em 0;
    padding-left: 2em;
}

.post-content p {
    margin: var(--reader-paragraph-gap) 0;
    text-indent: 0;
}

.post-content > p {
    text-indent: 2em;
}

.post-content p,
.post-content li,
.article-metadata {
    overflow-wrap: anywhere;
}

.post-content li {
    margin: 0.4em 0;
}

.post-content li p {
    text-indent: inherit;
}

.post-content code {
    background-color: rgba(0, 0, 0, 0.05);
    line-height: 1.5;
    font-size: 85%;
    border-radius: 4px;
}

/* Inline code: p > code, code block: pre > code */
.post-content p > code {
    padding: 1px 6px;
}

.post-content pre {
    overflow-x: auto;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.04);
    -webkit-overflow-scrolling: touch;
}

.post-content pre code {
    display: block;
    padding: 0 !important;
    background: transparent;
}

.post-content img {
    height: auto;
    max-width: 100%;
}

.post-content p > img {
    display: block;
    max-width: min(100%, calc(100% - 2em));
    margin: 20px auto;
    border-radius: 6px;
}

.post-content blockquote {
    margin: 1.4em 0;
    padding: 0.3em 0 0.3em 1.1em;
    border-left: 3px solid rgba(34, 34, 34, 0.2);
    color: #555;
    background: rgba(0, 0, 0, 0.02);
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.post-content thead,
.post-content tfoot {
    background: rgba(0, 0, 0, 0.05);
}

.post-content th,
.post-content td {
    padding: 8px 10px;
    text-align: left;
}

.post-content tbody td {
    border-bottom: solid 1px rgba(0, 0, 0, 0.5);
}

.post-content tbody tr:last-child td {
    border-bottom: 0;
}

.reading-settings {
    position: fixed;
    right: 28px;
    bottom: 26px;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 12px;
}

.reading-settings-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(34, 34, 34, 0.12);
    border-radius: 999px;
    background: rgba(252, 252, 250, 0.94);
    box-shadow: 0 14px 30px rgba(34, 34, 34, 0.1);
    color: #222;
    cursor: pointer;
    backdrop-filter: blur(16px);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.reading-settings-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(34, 34, 34, 0.14);
    border-color: rgba(34, 34, 34, 0.22);
}

.reading-settings-toggle:focus-visible {
    outline-offset: 4px;
}

.reading-settings-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.reading-settings-toggle-icon {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.reading-settings-toggle-icon span {
    display: block;
    width: 18px;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
}

.reading-settings-panel {
    width: min(280px, calc(100vw - 32px));
    padding: 18px 18px 16px;
    border: 1px solid rgba(34, 34, 34, 0.12);
    border-radius: 18px;
    background: rgba(252, 252, 250, 0.96);
    box-shadow: 0 22px 48px rgba(34, 34, 34, 0.12);
    backdrop-filter: blur(18px);
}

.reading-settings-panel[hidden] {
    display: none;
}

.reading-settings-panel-head {
    margin-bottom: 14px;
}

.reading-settings-eyebrow {
    margin: 0;
    color: #2a2a2a;
    font-size: 0.95rem;
    font-weight: 600;
}

.reading-settings-hint {
    margin: 5px 0 0;
    color: #6d6d6d;
    font-size: 0.86rem;
    line-height: 1.55;
}

.reading-settings-control,
.reading-settings-check {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    color: #2a2a2a;
    font-size: 0.93rem;
}

.reading-settings-control input[type="range"] {
    width: 100%;
    accent-color: #222;
}

.reading-settings-check {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
}

.reading-settings-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #222;
}

@media (max-width: 900px) {
    .post-page {
        margin: 32px auto 42px;
        --reader-max-width: 42rem;
        --reader-font-size: 1.0625rem;
        --reader-line-height: 1.78;
    }

    .post-title {
        font-size: 2rem;
    }
}

@media (max-width: 640px) {
    .post-page {
        margin: 28px auto 36px;
        --reader-max-width: 100%;
        --reader-font-size: 1rem;
        --reader-line-height: 1.72;
    }

    .post-eyebrow {
        margin-bottom: 6px;
        font-size: 0.84rem;
    }

    .post-title {
        font-size: 1.8rem;
    }

    .post-header {
        margin-bottom: 22px;
        padding-bottom: 14px;
    }

    .article-metadata {
        margin-bottom: 10px;
        font-size: 0.92rem;
        line-height: 1.55;
    }

    .post-taxonomy {
        column-gap: 10px;
        row-gap: 6px;
    }

    .post-taxonomy span {
        display: block;
        margin-top: 4px;
    }

    .post-content h2,
    .post-content h3,
    .post-content h4,
    .post-content h5,
    .post-content h6 {
        margin: 1.6em 0 0.55em;
        line-height: 1.3;
    }

    .post-content ul,
    .post-content ol {
        margin: 1em 0;
        padding-left: 2em;
    }

    .post-content pre,
    .post-content blockquote {
        margin-left: 0;
        margin-right: 0;
    }

    .post-content pre {
        padding: 12px 14px;
        border-radius: 8px;
    }

    .post-content blockquote {
        padding-left: 0.9em;
    }

    .post-content p > img {
        max-width: 100%;
        margin: 18px auto;
    }

    .post-content th,
    .post-content td {
        min-width: 120px;
        padding: 7px 9px;
    }

    .reading-settings {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        gap: 10px;
    }

    .reading-settings-toggle {
        width: 50px;
        height: 50px;
    }

    .reading-settings-toggle-icon span {
        width: 16px;
    }

    .reading-settings-panel {
        width: min(280px, calc(100vw - 24px));
        padding: 16px 14px 14px;
        border-radius: 16px;
    }

    .reading-settings-control-page-width {
        display: none;
    }
}

@media (max-width: 420px) {
    .post-page {
        margin: 24px auto 32px;
        --reader-font-size: 0.97rem;
        --reader-line-height: 1.68;
    }

    .post-title {
        font-size: 1.62rem;
    }

    .article-metadata {
        font-size: 0.88rem;
    }

    .post-content h2,
    .post-content h3,
    .post-content h4,
    .post-content h5,
    .post-content h6 {
        margin-top: 1.45em;
    }

    .post-content pre {
        padding: 10px 12px;
    }

    .post-content blockquote {
        padding-left: 0.8em;
    }

    .post-content th,
    .post-content td {
        min-width: 110px;
        padding: 6px 8px;
    }

    .reading-settings {
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .reading-settings-toggle {
        width: 46px;
        height: 46px;
    }

    .reading-settings-panel {
        width: min(260px, calc(100vw - 16px));
        padding: 14px 12px 12px;
        border-radius: 14px;
    }

    .reading-settings-control,
    .reading-settings-check {
        gap: 7px;
        margin-top: 10px;
        font-size: 0.9rem;
    }
}
