:root {
    --body-bg: white;
    --body-primary: #303030;
    --body-secondary: #3f3f3f;
    --accent: #ebe9e5;
    --root-padding: 0rem;
    font-family: "Inter", sans-serif;
}

header {
    color: var(--body-bg);
    gap: 0.25rem;
    display: flex;
    align-items: flex-start;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    overflow-y: hidden;
}

header,
footer {
    width: calc(100% - 0.5rem);
    padding: 0.25rem;
    margin: 0;
}

header > * {
    background: var(--body-secondary);
    border-radius: 0.5rem;
    padding: 0.2rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    display: grid;
    place-items: center;
    height: calc(100% - 0.5rem);
}

header a {
    text-decoration: none;
    color: inherit;
    width: 2rem;
}

header h1 > a {
    width: unset;
}

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.heading-1,
.heading-2,
.heading-3,
.heading-4,
.heading-5,
.heading-6 {
    font-weight: bold;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.heading-1 {
    font-size: 1.6rem;
}

.heading-2 {
    font-size: 1.4rem;
}

.heading-3 {
    font-size: 1.2rem;
}

.heading-4 {
    font-size: 1.1rem;
}

.heading-5 {
    font-size: 1rem;
}

.heading-6 {
    font-size: 0.9rem;
}

pre {
    overflow-x: auto;
}

body {
    background-color: var(--body-bg);
    max-width: 70ch;
    width: 100%;
    min-height: max(100vh, 100%);
    padding: 0;
    margin: 0 auto;
    color: var(--body-primary);
    border-radius: 0;
    line-height: 1.6;
    display: flex;
    align-items: center;
    flex-direction: column;
}

body > *:not(header):not(footer) {
    max-width: 60ch;
}

blockquote {
    border-left: 3px solid #aaa;
    padding-left: 0.5rem;
    margin-left: 0.5rem;
}

html {
    background-color: var(--accent);
    width: calc(100% - var(--root-padding) * 2);
    min-height: calc(100% - var(--root-padding) * 2);
    margin: 0;
    padding: var(--root-padding);
}

h1 {
    font-size: inherit;
    margin: 0;
}

img {
    object-position: center;
    object-fit: contain;
    max-height: 100%;
    max-width: 100%;
}

.img-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.invert {
    background-color: var(--body-secondary);
    color: var(--body-bg);
}

.small {
    font-size: 0.8rem;
    color: var(--body-secondary);
}

.btn {
    border-radius: 0.25rem;
    display: grid;
    place-items: center;
    border: 2px solid var(--body-secondary);
    padding: 0.4rem;
    padding-left: 2rem;
    padding-right: 2rem;
    text-decoration: none;
}

.cta-links {
    display: flex;
    align-items: center;
    flex-direction: column;
}

.cta-links p {
    margin: unset;
}

h2,
h3 {
    font-size: 1.6rem;
}

h2 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

summary {
    padding: 0.5rem;
    width: 100%;
    transform: translateX(-0.5rem);
}

summary.invert {
    background-color: var(--accent);
    color: var(--body-secondary);
}

details {
    border: 2px solid var(--body-secondary);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin: 0.5rem;
    width: calc(100% - 4rem);
    border-radius: 0.25rem;
}

a {
    color: inherit;
}

footer ul {
    padding-inline-start: 0;
    display: flex;
    list-style-type: none;
    gap: 0.5rem;
    margin: 0;
}

.footer-socials .btn {
    border: none;
    font-size: 2rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.footer-socials {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    margin-top: auto;
}

button,
input,
label {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5rem;
}

input:not([type="radio"]):not([type="checkbox"]),
button,
textarea {
    border: 2px solid var(--body-secondary);
    border-radius: 0.25rem;
    background-color: transparent;
    color: inherit;
    min-width: 12ch;
}

select {
    border: 2px solid;
    border-radius: 0.25rem;
    background-color: inherit;
    padding: 0.25rem;
    height: 2rem;
}

button {
    border: 2px solid var(--body-secondary);
    border-radius: 0.25rem;
}

input[type="submit"],
button {
    cursor: pointer;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 80%;
}

.form-group {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.submit-group {
    justify-content: flex-end;
    margin-top: 1rem;
}

.nag {
    background: var(--accent);
    padding: 0.5rem;
    border: 2px solid var(--body-primary);
    width: calc(100% - 1rem);
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.textarea-group {
    flex-direction: column;
    margin: 0.5rem;
}

.textarea-group textarea {
    resize: none;
    width: calc(100% - 0.8rem);
    line-height: 1.2;
    font-size: 1rem;
    padding: 0.4rem;
}

.textarea-group label {
    text-align: left;
    width: 100%;
}

section {
    width: 100%;
}

.tag {
    border-radius: 0.5rem;
    font-size: 0.9rem;
    padding: 0.2rem;
    font-weight: bold;
}

.tag a {
    text-decoration: none;
}

.danger {
    background-color: rgb(174, 41, 41);
    color: var(--body-bg);
}

.post-tags {
    display: flex;
    gap: 0.4rem;
    width: 100%;
    justify-content: center;
    margin-top: 0.6rem;
}

details > form {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
}

cap-widget {
    --cap-background: #fdfdfd;
    --cap-border-color: var(--body-primary);
    --cap-border-radius: 0.25rem;
    --cap-checkbox-margin: 4px;
    --cap-credits-font-size: 10px;
    --cap-font: "Inter", sans-serif;
    margin: 1rem;
}

form .submit-group {
    gap: 1rem;
}

@media (max-aspect-ratio: 1/1) {
    :root {
        --root-padding: 0;
    }

    ul {
        padding-inline-start: 0;
        margin: 1.2rem;
    }

    body {
        max-width: 100vw;
    }

    details {
        max-width: 100%;
        width: calc(100% - 2rem);
    }

    h1 {
        font-size: 1.6rem;
    }

    h1,
    h2,
    h3 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    header > * {
        min-height: 3rem;
    }

    footer ul {
        flex-direction: column;
        align-items: center;
        gap: 0;
        margin-bottom: 0.25rem;
    }

    html {
        min-height: 100%;
        display: block;
    }

    p {
        margin-left: 0.4rem;
        margin-right: 0.4rem;
    }
}
