/* inter latin italic */
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(/common/fonts/inter_italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* inter latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/common/fonts/inter_regular.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --page-background: #fcfbfa;
    --borders: #e2e8f0;
    
    --cube-primary: #ffe0f0;
    --cube-secondary: #ffb6d5;
    
    --site-title: #007bff;

    --h2text: #ea2264;
    --h3text: #7a3ff2;
    --h4text: #1e90ff;
    
    --keyword: #f39237;
    --primary-text: #333333;
    --secondary-text: #1a202c;
    --tertiary-text: #666666;
    
    --primary-accent: #007bff;
    --secondary-accent: #4e5b72;

    --tags-background: #e2e8f0;

    --code-background: #f2f2f2;
    --code-sidelight: #8ae1fc;
    --code-border: #dddddd;

    --toc-background: #f9f9f9;

    --header-height: 80px;
    --footer-height: 60px;
    --page-max-width: min(1100px, 100vw);
    --card-max-width: 800px;
    --blog-post-max-width: min(1000px, 100vw);
}

/* Global styles */

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

body {
    background-color: var(--page-background);
    color: var(--primary-text);
    font-family: 'Inter', ui-sans-serif, sans-serif;
    font-optical-sizing: auto;
    line-height: 1.6;
    min-height: 100vh;
}

h1,
h2,
h3,
h4 {
    line-height: 1.4;
    margin: 0.5rem 0;
    scroll-margin-top: 7rem;
}

/* h2 {
  color:var(--h2text);
}

h3 {
  color: var(--h3text);
}

h4 {
  color: var(--h4text);
} */

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--primary-text);
}

p a,
li a {
    text-decoration: underline;
}

a:hover {
    color: var(--primary-accent);
}

ul,
ol {
    padding-left: 3rem;
    margin-bottom: 1rem;
}

ul ol,
ul ul,
ol ul,
ol ol {
    margin-bottom: 0;
}

li::marker {
    color: var(--primary-accent);
    font-weight: 500;
}

pre {
    background-color: var(--code-background);
    border: 1px solid var(--code-border);
    border-left: 3px solid var(--code-sidelight);
    border-radius: 0 4px 4px 0;;
    line-height: 1.3rem;
    margin: 0.5rem 0 1rem 0;
    padding: 0.5rem 1rem;
    overflow: auto;
    word-wrap: break-word;
    page-break-inside: avoid;
}

code {
    font-family: "Courier New", "Consolas", sans-serif;
    font-size: 0.9rem;
    background-color: var(--code-background);
    padding: 0.1rem 0rem;
    border-radius: 4px;
}

.limit-width {
    max-width: var(--page-max-width);
    margin: 0 auto;
    padding: 0 0.5rem;
}

.content-container {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
}

.no-indent {
    padding-left: 0;
}

.keyword {
    color: var(--keyword);
}

/* Blog listing page classes */

.blog-card {
    display: block;
    padding: 1rem;
    margin-bottom: 1rem;
    width: 100%;
    max-width: var(--card-max-width);
}

.blog-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: initial;
}

.blog-card-title {
    display: flex;
    justify-content: space-between;
}

.blog-card-title h3 {
    margin-top: 0px;
    color: var(--primary-text);
}

.blog-card:hover .blog-card-title h3 {
    color: var(--primary-accent);
}

.blog-card-title span {
    white-space: nowrap;
}

.blog-tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    background-color: var(--tags-background);
    color: var(--secondary-text);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

/* Blog post specific classes */
.blog-header {
    text-align: center;
    margin-bottom: 2rem;
}

.blog-content {
    max-width: var(--blog-post-max-width);
    line-height: 1.8;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

/* .blog-content h2::before {
    content: "# ";
    position: absolute;
    left: -1.5rem;
    color: var(--anchor-tag);
} */

.blog-content figure {
    text-align: center;
    width: 90%;
    margin: 1rem auto;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--borders); 
}

.blog-content figcaption {
    font-size: 0.9rem;
    color: var(--tertiary-text);
    margin-top: -0.2rem;
    font-style: italic;
}


/* Header specific classes */

header {
    background-color: var(--page-background);
    border-bottom: 1px solid var(--borders);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-title > a {
    text-decoration: none;
    color: var(--primary-accent);
    font-size: 2.25rem;
    font-weight: 700;
}

header nav {
    display: flex;
    gap: 20px;
}

header nav a {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Table of contents specific classes */
.toc {
    background: var(--toc-background);
    border: 1px solid var(--borders);
    border-radius: 8px;
    position: fixed;
    top: 8rem;
    left: calc(50vw + var(--page-max-width) / 2 - 1rem);
    max-height: 60vh;
    overflow-y: auto;
    padding: 0 2rem 0 1rem;
}

.blog-content .toc h2 {
    color: var(--primary-accent);
}

.toc ul {
    list-style: none;
    padding-left: 1rem;
}

.toc li a {
    text-decoration: none;
}

.toc-h1 a,
.toc-h2 a {
    font-size: 1rem;
    padding-left: 0;
    font-weight: 600;
}

.toc-h3 a {
    font-size: 0.9rem;
    padding-left: 1rem;
}

.toc-h4 a {
    font-size: 0.8rem;
    padding-left: 2rem;
}

/* Footer specific classes */

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: var(--footer-height);
    max-width: 33vw;
    margin: 0 auto;

    box-shadow: inset 0 1px 0 0 var(--borders);
    padding-top: 1rem;
}

.footer-icons {
    display: flex;
    gap: 1rem;
}

.footer-icons a {
    transition: color 0.2s;
}

.footer-icons a:hover {
    color: var(--secondary-accent);
}

/* Front page specific classes */
.front-page-content {
    justify-content: center;
    padding-bottom: min(15rem, 20vh);
}

.front-page-terminal {
    font-family: "Courier New", "Consolas", monospace;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.front-page-terminal span:nth-of-type(-n + 3) {
    font-weight: bold;
}

/* Media queries */
@media (max-width: 1000px) {
    .blog-content h2::before {
        position: inherit;
        left: inherit;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 0.85rem;
    }

    .tag {
        font-size: 0.75rem;
    }

    .front-page-content {
        text-align: center;
    }

    .front-page-terminal {
        font-size: 0.85rem;
    }

    pre {
        font-size: 0.85rem;
        /* word-wrap: break-word; */
        /* line-break:strict; */
        /* white-space: pre-wrap; */
    }
}

@media (max-width: 1600px) {
  .toc {
    display: none; /* or move it above content */
  }
}

