:root {
    --color-background-hsl: 40, 8%, 80%;
    --color-contentbackground-hsl: 40, 8%, 84%;
    --color-sidebar-hsl: 40, 5%, 2%;
    --color-text-hsl: 40, 10%, 15%;
    --color-accent-hsl: 45, 100%, 52%;
    --color-text-accent-hsl: 45, 100%, 25%;
    --color-headings-hsl: 40, 10%, 5%;
    --paragraph-bottom-margin: 1.25rem;
    --text-size: 15px;
    --max-page-width: 720px;
    --baseline: 1.6rem;
    --font-family: system-ui, sans-serif;
    --sidebar-height: 44vh;
    /* Dynamically set from JS to account for actual rendered height */
    --menu-height: var(--sidebar-height);

    box-sizing: border-box;
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
}

html {
    min-height: 100vh;
    background-color: hsl(var(--color-background-hsl));
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.1) 0px,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px,
            transparent 20px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.1) 0px,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px,
            transparent 20px
        );
    background-size: 20px 20px;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 350;
    line-height: var(--baseline);
    color: hsl(var(--color-text-hsl));
    position: relative;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.sidebar-pushed {
    padding-top: var(--menu-height);
    transition: padding-top 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

@supports (height: 100dvh) {
    body {
        min-height: 100dvh;
    }
}

@media (min-width: 740px) {
    body {
        font-size: 17px;
    }
}

::selection {
    background-color: hsla(var(--color-text-hsl), 0.99);
    color: hsl(var(--color-background-hsl));
}

h1,
h2,
h3 {
    font-weight: 500;
    color: hsl(var(--color-headings-hsl));
    line-height: 1.3;
    padding-bottom: calc(0.7 * var(--baseline));
}

h1:not(:first-of-type) {
    padding-top: calc(1.5 * var(--baseline));
}

h1 {
    font-size: 1.38em;
}

h2 {
    font-size: 1.3em;
}

h3 {
    font-size: 1.21em;
}

h4 {
    font-size: 1.14em;
}

h5 {
    font-size: 1.07em;
}

small,
.text-size-small {
    font-size: 0.88em;
}

h1 + h2 {
    margin-top: var(--baseline);
}

p + p {
    margin-top: var(--baseline);
}

p + h2,
p + h3,
p + h4 {
    margin-top: var(--baseline);
}

strong {
    font-weight: 600;
}

blockquote {
    margin: 0;
    padding: 0;
}

blockquote + p {
    margin-top: var(--baseline);
}

blockquote p {
    color: hsla(var(--color-text-hsl), 0.9);
    margin: 0;
    border-left: 1px solid hsla(var(--color-text-hsl), 0.1);
    padding-left: var(--baseline);
    line-height: var(--baseline);
}

/*@supports (hanging-punctuation: first) {
    blockquote p {
        text-indent: 0;
        hanging-punctuation: first;
    }
}

blockquote p::before {
    content: open-quote;
}
blockquote p::after {
    content: close-quote;
}*/

a,
a:hover,
a:visited {
    color: hsl(var(--color-text-hsl));
    cursor: default;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-thickness: 0.5px;
    text-decoration-color: hsla(var(--color-text-hsl), 0.4);
    text-underline-offset: 4px;
    transition: text-decoration 0.124s cubic-bezier(0, 0.55, 0.45, 1);
}

a:hover {
    color: hsl(var(--color-text-accent-hsl));
    text-decoration-color: hsla(var(--color-text-hsl), 0);
}

.donation-icon {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: hsl(var(--color-text-hsl));
    transition: all 0.2s ease;
    vertical-align: baseline;
    transform: translateY(2px);
    margin: 0 0.25em;
    border: 1px solid hsla(var(--color-text-hsl), 0.1);
    border-radius: 1px;
    padding: 2px;
}

.donation-icon:hover {
    opacity: 1;
    color: hsl(var(--color-text-accent-hsl));
    text-decoration: none;
}

.donation-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.stripe-card-container {
    display: flex;
    margin: var(--baseline) 0;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    padding-top: var(--baseline);
    border: 1px solid hsla(var(--color-text-hsl), 0.1);
}

strike,
s {
    text-decoration: none;
    background-image: linear-gradient(
        transparent 10px,
        hsla(var(--color-text-hsl), 0.5) 10px,
        hsla(var(--color-text-hsl), 0.5) 11px,
        transparent 11px
    );
}

ul {
    margin: calc(var(--baseline) / 2) 0;
    padding-left: 1.5em;
    list-style: disc;
}

.single-page ul:not(.post-sources__list),
.single-page ol:not(.post-sources__list) {
    background-color: hsla(var(--color-text-hsl), 0.03);
    padding: calc(var(--baseline) / 8) calc(var(--baseline) / 2)
        calc(var(--baseline) / 8) var(--baseline);
}

ul ul {
    margin: 0;
}

li {
    margin: calc(var(--baseline) / 2) calc(var(--baseline) / 8);
    padding: 0;
    line-height: var(--baseline);
}

li > ul {
    margin-top: 0;
    margin-bottom: 0;
}

li::marker {
    color: hsla(var(--color-text-hsl), 0.4);
    font-size: 0.8em;
}

.logo:hover {
    opacity: 0.6;
}

code {
    background-color: hsla(var(--color-text-hsl), 0.1);
    padding: 2px 4px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 0.9em;
}

/* Code blocks */
pre {
    background-color: hsla(var(--color-text-hsl), 0.1);
    border: 1px solid hsla(var(--color-text-hsl), 0.2);
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.875em;
    line-height: 1.5;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875em;
    line-height: 1.3;

    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: calc(var(--baseline) * 2) 0;
}

thead,
tbody {
    display: table-row-group;
}

tr {
    display: table-row;
}

th,
td {
    display: table-cell;
}

thead {
    background-color: hsla(var(--color-text-hsl), 0.3);
}

th {
    text-align: left;
    font-weight: bold;
    padding: 8px 16px 8px 8px;
    white-space: nowrap;
}

tbody tr:nth-of-type(even) {
    background-color: hsla(var(--color-text-hsl), 0.05);
}

td {
    text-align: left;
    vertical-align: top;
    padding: 8px 16px 8px 8px;
    border-bottom: 1px solid hsla(var(--color-text-hsl), 0.1);
}

@media screen and (max-width: 740px) {
    td {
        min-width: 14rem;
    }
}

main {
    margin: 0 auto;
    max-width: var(--max-page-width);
}

.main-content {
    margin: 0 auto;
}

.main-content article {
    padding: calc(var(--baseline) / 2.5) calc(var(--baseline) / 2)
        calc(var(--baseline) * 1) calc(var(--baseline) / 2);
    position: relative;
    background-color: hsl(var(--color-contentbackground-hsl));
    margin: 0 0 calc(var(--baseline) * 1.25) 0;
    width: 100%;
    box-sizing: border-box;
    box-shadow:
        inset 1px 1px 0 0 hsla(0, 0%, 100%, 0.3),
        inset -1px -1px 0 0 hsla(0, 0%, 0%, 0.05);
}

.main-content article::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 16px;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: hsl(var(--color-text-hsl), 0)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='3' height='4'%3E%3Ccircle cx='2.5' cy='2.5' r='.5' fill='%23050505'/%3E%3C/svg%3E")
        repeat right bottom;
}

@media (min-width: 740px) {
    .main-content article {
        padding: calc(var(--baseline) * 1.25) calc(var(--baseline) * 1.5)
            calc(var(--baseline) * 1.5) calc(var(--baseline) * 1.5);
    }
    .main-content article::before {
        top: 16px;
        left: 16px;
    }
}

.main-content article img:not(.microblog_avatar) {
    background-color: hsl(var(--color-contentbackground-hsl));
    width: 100%;
    display: block;
    max-width: 100%;
    aspect-ratio: attr(width) / attr(height);
    border: 1px solid hsla(var(--color-text-hsl), 0.1);
    box-sizing: border-box;
    position: relative;
    min-height: 300px;
    max-height: 50vh;
    object-fit: cover;
    object-position: center;
}

.main-content article hr {
    border: none;
    border-top: 1px solid hsla(var(--color-text-hsl), 0.1);
    height: 0;
}

.lite-light img {
    padding: 0 !important;
}

.lite-light img::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 16px;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: hsl(var(--color-text-hsl), 0)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='3' height='4'%3E%3Ccircle cx='2.5' cy='2.5' r='.5' fill='%23050505'/%3E%3C/svg%3E")
        repeat right bottom;
}

.main-content article video,
.main-content article iframe {
    position: relative;
    width: 100%;
    aspect-ratio: attr(width) / attr(height);
    border: 1px solid hsla(var(--color-text-hsl), 0.1);
}

.main-content article video {
    height: auto;
}

.main-content article p:has(video),
.main-content article p:has(iframe),
.main-content article p:has(img) {
    position: relative;
    z-index: auto;
}

.main-content article p:has(video)::before,
.main-content article p:has(iframe)::before,
.main-content article p:has(img)::before {
    content: "";
    position: absolute;
    top: 1px;
    right: 0;
    left: 12px;
    bottom: 0;
    width: calc(100% - 24px);
    height: 100%;
    background: hsl(var(--color-text-hsl), 0)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='3' height='4'%3E%3Ccircle cx='2.5' cy='2.5' r='.5' fill='%23050505'/%3E%3C/svg%3E")
        repeat right bottom;
}

.post__title {
    margin-bottom: 0;
    padding-bottom: 0;
}

.page-title.floating {
    margin-left: calc(var(--baseline) / 2);
}

.post__metadata,
.post__metadata a {
    color: hsla(var(--color-text-hsl), 0.7);
    margin-top: calc(var(--baseline) * 1);
    /*margin-bottom: calc(var(--baseline) * 1);*/
    font-size: 0.88rem;
}

.post__metadata {
    text-align: right;
}

.microblog_conversation {
    position: relative;
    margin-top: calc(var(--baseline) * 2);
    border-top: 1px dotted hsl(var(--color-sidebar-hsl));
    padding-top: calc(var(--baseline) * 1.5);
}

.microblog_conversation::before {
    content: "";
    position: absolute;
    top: 0; /* align with border-top */
    left: 0; /* or adjust horizontally as needed */
    width: 24px; /* icon width */
    height: 24px; /* icon height */
    padding-right: 0.5rem;
    background-color: hsl(var(--color-contentbackground-hsl));
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square-reply-icon lucide-message-square-reply"><path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"/><path d="m10 8-3 3 3 3"/><path d="M17 14v-1a2 2 0 0 0-2-2H7"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    color: hsl(var(--color-sidebar-hsl));
    transform: translateY(-50%);
}

.microblog_reply_signin {
    font-weight: 600;
}

.microblog_reply_textarea textarea {
    width: 100%;
}

.microblog_reply_button {
    margin-top: 0;
}

.microblog_reply_button input {
    position: relative;
    padding-left: 30px; /* Add space for the icon */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-send-icon lucide-send"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/></svg>');
    background-repeat: no-repeat;
    background-position: 8px center;
    background-size: 16px 16px;
}

.microblog_reply_button input:disabled,
.microblog_reply_textarea textarea:disabled {
    opacity: 0.3;
}

.microblog_user {
    display: flex;
    font-size: 0.88rem;
}

.microblog_user-link {
    display: flex;
    text-decoration: none;
}

.microblog_user-link:hover {
    text-decoration: underline;
}

.microblog_fullname::after {
    content: "•";
    display: inline-block;
    margin: 0 0.15rem;
    color: hsla(var(--color-text-hsl), 0.7);
}

.microblog_avatar {
    margin-right: 0.5rem;
    display: inline-block;
    border: 1px solid hsl(var(--color-text-hsl), 0.2);
}

.microblog_post {
    /*border-left: 1px solid hsl(var(--color-text-hsl), 0.1);*/
    margin-bottom: calc(var(--baseline) * 2);
    /*padding-left: var(--baseline);*/
}

/*.microblog_text {
    border-left: 1px solid hsl(var(--color-text-hsl), 0.1);
    padding-left: var(--baseline);
}*/

.microblog_text p:last-of-type {
    margin-bottom: 0.2rem;
}

.microblog_text p:first-of-type {
    margin-top: calc(var(--baseline) / 4);
}

.microblog_time a {
    font-size: 0.88rem;
    text-decoration: none;
    color: hsla(var(--color-text-hsl), 0.7);
}

.microblog_time a:hover {
    text-decoration: underline;
}

#microblog-conversation__wrapper {
    overflow: hidden;
    height: 0;
    transition: height 0.35s 0.8s cubic-bezier(0.33, 1, 0.68, 1);
}

.sidebar-bio {
    width: 100vw;
    z-index: 4;
    margin-bottom: calc(var(--baseline) * 2);
}

.sidebar__content {
    max-width: var(--max-page-width);
    margin: 0 auto;
}

/*@media (min-width: 740px) {
    .sidebar__content {
        display: flex;
        gap: 3rem;
        align-items: flex-start;
    }
}*/

.sidebar-bio__inner {
    background-color: hsl(var(--color-sidebar-hsl));
    padding: var(--baseline);
    color: hsl(var(--color-contentbackground-hsl));
}

.sidebar__profile-picture {
    margin-top: var(--baseline);
    border: 1px solid hsla(var(--color-text-hsl), 0.8);
}

.page-links .nav-item {
    margin-right: 1rem;
}

.sidebar-bio__inner a,
.sidebar-bio__inner a:hover,
.sidebar-bio__inner a:visited {
    color: hsl(var(--color-background-hsl));
    cursor: default;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-thickness: 0.5px;
    text-decoration-color: hsla(var(--color-background-hsl), 0.4);
    text-underline-offset: 4px;
    transition: text-decoration 0.124s cubic-bezier(0, 0.55, 0.45, 1);
}

.sidebar-bio__inner a:hover {
    color: hsl(var(--color-text-accent-hsl));
    text-decoration-color: hsla(var(--color-text-hsl), 0);
}

.sidebar-bio__inner a[href^="http"]:not([href*="geff.re"])::after {
    content: "";
    background: none;
}

.navigation-lists {
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.page-links {
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    list-style: none;
    padding: 0;
}

.socials {
    list-style: none;
    padding: 0;
    display: flex;
    margin: 0;
}

.socials__icon {
    width: 20px;
    height: 20px;
}

.socials__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid hsla(var(--color-background-hsl), 0.1);
}

.socials__item {
    margin: calc(var(--baseline) / 8) calc(var(--baseline) / 8);
}

.about_me {
    margin: calc(var(--baseline) / 2) calc(var(--baseline) / 8);
    font-size: 0.88em;
    line-height: 1.4;
}

form {
    /* margin: var(--baseline) auto; */
    padding: 0;
}

form div {
    margin-bottom: 1em;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}

input,
textarea,
select,
form button,
.donate-button {
    padding: 0.5rem;
    border: 1px solid hsla(var(--color-text-hsl), 0.3);
    background-color: transparent;
    font-size: 1em;
    color: inherit;
    font-family: inherit;
    box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: hsla(var(--color-text-hsl), 1);
}

form button,
.donate-button {
    background: hsl(var(--color-text-hsl));
    color: hsl(var(--color-background-hsl));
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

form button:hover,
.donate-button:hover {
    background: #444;
}

.donate-button:visited {
    color: hsl(var(--color-background-hsl));
}

.sidebar-bio input:focus,
.sidebar-bio textarea:focus,
.sidebar-bio select:focus {
    outline: none;
    border-color: hsla(var(--color-background-hsl), 1);
}

.sidebar-bio form input,
.sidebar-bio form textarea,
.sidebar-bio form select,
.sidebar-bio form button {
    width: 100%;
    border: 1px solid hsla(var(--color-background-hsl), 0.3);
    margin-bottom: 12px;
}

.feed-nav__ul {
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0;
}

footer {
    padding: var(--baseline);
    text-align: center;
    font-size: 0.88rem;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: block;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid hsla(var(--color-text-hsl), 0.1);
    border-top-color: solid hsla(var(--color-text-hsl), 1);
    animation: spinner 500ms linear infinite;
}

@keyframes spinner-fade-out {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0);
    }
}

.spinner-container {
    margin-top: var(--baseline);
    position: absolute;
    display: inline-block;
}

.spinner-container.fade-out {
    animation: spinner-fade-out 620ms cubic-bezier(0.64, 0, 0.78, 0) forwards;
}

.microblog-error {
    display: flex;
    align-items: center;
    margin-top: var(--baseline);
    text-decoration: italic;
    color: hsla(var(--color-text-hsl), 0.6);
}
