@import url("https://fonts.googleapis.com/css2?family=Fira+Code&display=swap");
@import url("https://fonts.bunny.net/css?family=victor-mono:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i");

:root {
    --body-vertical-padding: 3rem;
    --body-horizontal-padding: 3rem;

    --font: "Victor Mono", monospace;

    --code-font-size: 0.9rem;
    --code-font-family: "Fira Code", monospace;

    --h1-size: 2.5rem;
    --h2-size: 2rem;
    --h3-size: 1.5rem;
    --line-height: 1.5;

    --post-header-margin-bottom: 3rem;

    --profile-picture-size: 10rem;
    --main-content-max-size: 50rem;

    --link-transition-time: 0.35s;
    --link-transition-function: cubic-bezier(0.25, 0.1, 0, 2.05);

    --background-color: #ffffff;
    --font-color: #4c4f69;
    --main-color: #f493eb;
    --accent-color: #f493eb;
    --selection-color: #f493eb;
    --code-background-color: #2b2d44;
    --blockquote-background-color: #fffbe9;
    --bsky-embed-background-color: #0a7aff15;
    --bsky-embed-link-color: #0a7aff40;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1e1e2e;
        --font-color: #cdd6f4;
        --main-color: #f493eb;
        --accent-color: #f493eb;
        --selection-color: #52598c40;
        --code-background-color: #52598c40;
        --blockquote-background-color: #52598c40;
        --bsky-embed-background-color: #0a7aff15;
    }
}

@media screen and (min-width: 992px) {
    :root {
        --body-horizontal-padding: 5rem;
        --h1-size: 3rem;
    }
}

@media screen and (min-width: 1200px) {
    :root {
        --body-horizontal-padding: 10rem;
        --h1-size: 3rem;
    }
}

::selection {
    background: var(--selection-color);
}

::-moz-selection {
    background: var(--selection-color);
}

/* --- RESET SOME PROPERTIES ------------------------------------------------ */

* {
    margin: 0;
    padding: 0;
    font-family: var(--font) !important;
    color: var(--font-color);
}

ul,
ol,
dl {
    list-style: none;
    padding-inline: 0;
}

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* --- BODY AND BASE ELEMENTS STYLING --------------------------------------- */

body {
    overflow-x: hidden;
    padding: var(--body-vertical-padding)
        max(
            var(--body-horizontal-padding),
            calc(env(safe-area-inset-left) + 1rem),
            calc(env(safe-area-inset-right) + 1rem)
        );
    background-color: var(--background-color);
    line-height: var(--line-height);
}

h1 {
    font-size: var(--h1-size);
    font-style: italic;
    text-wrap: balance;
    line-height: 1.1;
}

h2 {
    font-size: var(--h2-size);
    font-style: italic;
    color:#f493eb
}

h3 {
    font-size: var(--h3-size);
}

.limit-max-width-and-center {
    max-width: var(--main-content-max-size);
    margin-left: auto;
    margin-right: auto;
}

img {
    object-fit: contain;
    align-self: center;
    width: 100%;

    @media screen and (min-width: 992px) {
        width: 80%;
        margin-left: 10%;
    }
}

.skeet-embed {
    width: 80%;
    margin-left: 10%;
    margin-top: var(--line-height);
    margin-bottom: var(--line-height);
    display: flex;
    justify-content: center;
}

hr {
    margin-top: 2rem;
    margin-bottom: 2rem;
    color: var(--blockquote-background-color);
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    border: solid 1px;
    box-shadow: none;
}

/* --- LINKS ---------------------------------------------------------------- */

a > h1,
a > h2,
a > h3,
a > h4,
a > h5,
a > h6 {
    /* This is needed to display nice titles with the same undeline effect
     * as normal text */
    display: inline;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

a:not(:has(> *)) {
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

a {
    text-decoration-style: wavy;
    text-decoration-color: var(--accent-color);
    font-weight: 700;
}

a:not(.no-highlight) { 
    text-decoration-style: wavy;
    text-decoration-color: var(--accent-color);
}

a:not(.no-highlight).bsky-embed-link {
    background-image: linear-gradient(to right, var(--bsky-embed-link-color), var(--bsky-embed-link-color));
}

a:not(.no-highlight):hover {
    text-decoration: none;
}

/* --- HOMEPAGE ------------------------------------------------------------- */

#homepage-header {
    margin-bottom: calc(var(--h1-size) * 2);
    text-align: center;
}

#homepage-profile-picture {
    height: var(--profile-picture-size);
    width: var(--profile-picture-size);
    border-radius: 50%;
    margin-bottom: 1rem;
}

#homepage-title {
    margin-bottom: 1rem;
}

#homepage-subtitle {
    font-style: italic;
    font-weight: lighter;
}

#pink {
    font-style: italic;
    color: var(--accent-color);
}

footer {
 position: fixed;
   left: 2.5rem;
   bottom: 0;
   width: 100%;
   text-align: center;
}

/* --- PREVIEWS ------------------------------------------------------------- */

#posts-previews {
    /* Add a little space in the tag preview page between breadcrumbs
     * and previews */
    margin-top: var(--h3-size);
}

#posts-previews .post-preview:not(:last-child) {
    margin-bottom: calc(1.5 * var(--h1-size));
}

/* --- TAGS ----------------------------------------------------------------- */

.post-tags {
    display: inline;
    line-height: calc(1.3 * var(--line-height));
}

.post-tag {
    display: inline;
    background-color: var(--accent-color);
    font-size: 0.9rem;
    border-radius: 1rem;
    padding: 0.2rem 0.5rem;
    margin-right: 0.3rem;
    font-style:italic;
}

.post-tag > a {
    background-image: none;
    color:#4c4f69;
}

/* --- BLUESKY EMBEDS ------------------------------------------------------- */

.bsky-embed {
    width: calc(100% - 4rem);
    @media screen and (min-width: 992px) {
        width: calc(80% - 4rem);
        margin-left: 10%;
    }

    padding: 2rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    background-color: var(--bsky-embed-background-color);

    video {
        width: 100%;
    }
}

.bsky-embed-account {
    display: flex;
    flex-direction: row;
    align-items: end;
    gap: 1rem;
    line-height: 1.1;
}

.bsky-embed-logo {
    height: 2rem;
    width: 2rem;
    margin: 0;
}

/* --- BREADCRUMBS ---------------------------------------------------------- */

.breadcrumbs {
    margin-bottom: var(--line-height);
}

/* --- POSTS ---------------------------------------------------------------- */

/* All titles in posts should be aligned with the start of the line */
.post h1,
.post h2,
.post h3,
.post h4,
.post h5,
.h1-title,
.h2-title,
.h3-title,
.h4-title,
.h5-title,
.h6-title {
    text-align: start;
}

.post-title,
.tag-title {
    margin-left: -100%;
    margin-right: -100%;
    margin-bottom: var(--h1-size);
    margin-top: -100%;
    padding-bottom: calc(var(--h1-size) / 2);
    padding-top: calc(100% + var(--h2-size));
    padding-left: 100%;
    padding-right: 100%;
    color:#4c4f69;
    background-color: var(--main-color);
}

.post-title::selection {
    background: var(--background-color);
}

.post-title::-moz-selection {
    background: var(--background-color);
}

.tag-title::selection {
    background: var(--background-color);
}

.tag-title::-moz-selection {
    background: var(--background-color);
}

.post header {
    margin-bottom: var(--post-header-margin-bottom);
}

.post-subtitle {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    row-gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.post-date {
    font-style: none;
}

.post-preview-abstract,
.post-body {
    text-align: justify;
}

.post pre {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 2rem;

    background-color: var(--code-background-color);
    overflow-x: scroll;
}

.post pre code {
    font-family: var(--code-font-family);
    font-size: var(--code-font-size);
}

.post pre code span {
    font-family: var(--code-font-family);
    font-size: var(--code-font-size);
}

.post p code {
    font-family: var(--code-font-family);
    font-size: var(--code-font-size);
    padding: 0 0.2rem;
    background-color: var(--blockquote-background-color);
}

.post blockquote {
    padding-left: 2rem;
    padding-right: 2rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-left: solid 0.8rem var(--main-color);
    background-color: var(--blockquote-background-color);
}

.post p {
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
    hyphens: auto;
}

.post-body ul {
    list-style: "-> " outside;
    padding-inline-start: 2rem;
    text-align: left;
}

.post-body ul li {
    font-family: var(--code-font-family);
}

/* Drop hyphenation on big screens */
@media screen and (min-width: 992px) {
    .post p {
        hyphens: none;
    }
}

@media screen and (min-width: 1200px) {
    .post p {
        hyphens: none;
    }
}

.post-heading > * {
    display: inline;
}

.h2-title {
    margin-top: 4rem;
    margin-bottom: 2rem;
}

.h3-title {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* --- CODE HIGHLIGHT ------------------------------------------------------- */

.hljs-number {
    color: #c8ffa7;
}

.hljs-string {
    color:#c8ffa7;
}

.hljs-comment {
    color:#d4d4d4;font-style: italic
}

.hljs-built_in {color:#9ce7ff}


.hljs-operator {
    color:#ffaff3;
}

.hljs-keyword {color:#ffd596}

.hljs-title {
    color:#9ce7ff;
}

.hljs-variable {
    color:#ffddfa;
}

.hljs-addition {
    background-color: rgb(94, 173, 94, 0.4);
}

.hljs-deletion {
    background-color: rgb(255, 69, 138, 0.4);
}
