/* Imports */
@import url("reset.css");
@import url("https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

/* Variables */
:root {
    /* Thème sombre (par défaut) */
    --primary-color: #cecece;
    --secondary-color: #70d2ff;
    --background-color: #3a404b;
    --secondary-background-color: #333742;
    --text-color: #b8b8b8;
    --accent-color: #416bb8;
    --font-retro: "Space Mono", "Press Start 2P", cursive;

    --blue-bright: #007bff;
    --blue-medium: #0056b3;
    --blue-soft: #004085;
    --blue-light: #002e60;

    --sidebar-width: 350px;
    --toc-width: 300px;

    /* Comments variables */
    --block-border-color: var(--primary-color);
    --block-background-color: var(--background-color);

    --mastodon-comment-indent: 20px;
}

/***** Global *****/
/* Body */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 87.5%; /* Base font size: 14px */
    font-family: var(--font-retro);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    text-align: left;
    counter-reset: h2;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: white;
    line-height: 1.1;
    margin-bottom: 0.8em;
}
h3,
h4,
h5,
h6 {
    margin-top: 0.8em;
}

h1 {
    font-size: 2.5em;
    text-shadow: 2px 2px var(--accent-color);
    margin-bottom: 1em;
}

h2 {
    font-size: 1.8em;
    text-shadow: 1px 1px var(--accent-color);
    counter-reset: h3;
}

h3 {
    font-size: 1.5em;
    text-shadow: 1px 1px var(--accent-color);
    counter-reset: h4;
}

h4 {
    font-size: 1.2em;
    counter-reset: h5;
}

h5 {
    font-size: 1em;
    counter-reset: h6;
}

h6 {
    font-size: 0.9em;
}

/* Reset counters for each article */
.entry-content {
    counter-reset: h2;
}

/** put counter result into headings */
.entry-content h2:before {
    counter-increment: h2;
    content: counter(h2) ". ";
}
.entry-content h3:before {
    counter-increment: h3;
    content: counter(h2) "." counter(h3) ". ";
}
.entry-content h4:before {
    counter-increment: h4;
    content: counter(h2) "." counter(h3) "." counter(h4) ". ";
}

hr {
    border: 2px solid #eeeeee;
}

/* Anchors */
a {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--blue-bright);
    text-decoration: none;
    transition: all 0.3s ease;
}

h1 a:hover {
    background-color: inherit;
    color: var(--accent-color) !important;
}

a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

/* Paragraphs */
p {
    margin-bottom: 1.143em;
}
pre {
    background-color: rgba(26, 26, 46, 0.95);
    border: 2px solid var(--primary-color);
    padding: 15px;
    overflow-x: auto;
}

/* Lists */
ul {
    list-style: outside disc;
    margin: 1em 0 1.5em 1.5em;
}
ol {
    list-style: outside decimal;
    margin: 1em 0 1.5em 1.5em;
}

.url {
    color: inherit !important;
}
.url:hover {
    color: #4896df !important;
}
.pull-right {
    float: right;
}

.sidebar {
    background-color: var(--secondary-background-color);
    border-right: 2px solid var(--primary-color);
    position: fixed;
    width: var(--sidebar-width);
    height: 100vh;
    padding-top: 100px;
}

.sidebar .profile-picture {
    margin: 0 auto;
    border-radius: 50%;
    border: 2px solid #5b8da2;
}

.sidebar p {
    margin: 0;
    /* margin-bottom: 1em; */
    text-align: center;
}

.sidebar p#sitetagline {
    font-style: italic;
    margin-bottom: 1em;
}

.sidebar .social {
    text-align: center;
}

.sidebar .social a {
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 0 5px;
    font-size: 1.2em;
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding-left: 20px;
}
.sidebar li {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5em;
}

.sidebar a#author {
    text-decoration: none;
    font-size: 2.5em;
    font-weight: bold;
    color: var(--accent-color);
}
.post-info {
    font-size: 1em;
    width: 100%;
    float: left;
    margin: 0 0 20px 0;
    padding: 5px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
}
.post-info p {
    margin-bottom: 1px;
}

dl {
    margin: 0 0 1.5em 0;
}
dt {
    font-weight: bold;
}
dd {
    margin-left: 1.5em;
}

/* Quotes */
blockquote {
    background-color: rgba(26, 26, 46, 0.5);
    border-left: 4px solid var(--primary-color);
    margin: 20px 0;
    padding-left: 20px;
    font-style: italic;
}
cite {
}

q {
}

div.note {
    float: right;
    margin: 5px;
    font-size: 85%;
    max-width: 300px;
}

/* Tables */
table {
    margin: 0.5em auto 1.5em auto;
    width: 98%;
}

/* Thead */
thead th {
    padding: 0.5em 0.4em;
    text-align: left;
}
thead td {
}

/* Tbody */
tbody td {
    padding: 0.5em 0.4em;
}
tbody th {
}

tbody .alt td {
}
tbody .alt th {
}

/* Tfoot */
tfoot th {
}
tfoot td {
}

/* HTML5 tags */
header,
section,
footer,
aside,
nav,
article,
figure {
    display: block;
}

article img {
    width: 60%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
/***** Layout *****/
.body {
    background: var(--secondary-background-color);
    margin: 2% 0 0 0;
    overflow: hidden;
    padding: 20px;
    border: 1px solid #ccc;
    position: relative;
    z-index: 1;
}
img.right,
figure.right {
    float: right;
    margin: 0 0 2em 2em;
}
img.left,
figure.left {
    float: left;
    margin: 0 2em 2em 0;
}

/*
	Body
*****************/
#content {
    margin-left: calc(var(--sidebar-width) + 100px);
    padding: 20px 80px 20px 00px;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

#content:has(.blogpost) {
    padding-right: calc(var(--toc-width) + 2rem + 80px);
}

@media (max-width: 1600px) {
    #content {
        padding-right: 50px;
        margin-left: calc(var(--sidebar-width) + 50px);
    }

    #content:has(.blogpost) {
        padding-right: calc(var(--toc-width) + 2rem + 10px);
    }
}

/*
	About
******************/
#about {
    text-align: center;
    font-size: 0.8em;
    font-style: normal;
    color: #666;
    overflow: hidden;
    margin-top: 10px;
    border-radius: 10px;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
}

/***** Sections *****/
/* Blog */
.entry-title {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 0px;
    margin-top: 0;
}
.entry-title a:link,
.entry-title a:visited {
    text-decoration: none;
    color: #fff;
}
.entry-content blockquote {
    margin: 10px 20px;
}

/* Blog Index */
#posts-list {
    list-style: none;
    margin-left: 0px;
}
#talks-list {
    list-style: none;
    margin-left: 0px;
}

/* Page */
.page-title {
    font-size: 2em;
    font-weight: bold;
    margin: 0 0 10px 0;
    padding: 5px 5px 10px 5px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

/********* Pagination *********/
.center {
    text-align: center;
}

.pagination {
    margin-top: 20px;
    display: inline-block;
}

/********* Iframe ***********/
.youtube iframe {
    width: 560px;
    height: 315px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
    display: block;
}

/* Menu */
.menu {
    margin-bottom: 30px;
}

.menu .active {
    font-weight: bold;
    color: var(--accent-color);
}

.menu .active:before {
    content: "[";
    margin-right: 5px;
}

.menu .active:after {
    content: "]";
    margin-left: 5px;
}

.menu p {
    margin: 5px 0;
    font-size: 1.2em;
}

.menu a {
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2em;
}

.menu a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

.talk .links {
    margin-top: 20px;
}

.talk .link {
    display: inline-block;
    margin-top: 2px;

    color: black;
    padding: 8px 16px;
    text-decoration: none;
    transition: background-color 0.3s;
    border: 1px solid #ddd;
}

.talk .link:hover {
    background-color: #ddd;
}

/****** Tweet shortcode *******/
.twitter-tweet-rendered {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Read more link */
.read-more {
    margin-top: 20px;
    text-align: right;
}

.read-more-link {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid var(--accent-color);
    font-size: 0.9em;
}

.read-more-link:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/* Entry content */
.entry-content {
    margin-bottom: 20px;
}

.entry-content p {
    margin-bottom: 1em;
}

/* Talks grid */
.talks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.talk-card {
    background-color: var(--secondary-background-color);
    border: 1px solid #ccc;
    padding: 20px;
    transition: all 0.3s ease;
}

.talk-card .entry-title {
    font-size: 1.2em;
    margin-bottom: 15px;
}

.talk-card .summary {
    margin-bottom: 15px;
}

.talk-card .links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.talk-card .link {
    display: inline-block;
    padding: 8px 16px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--accent-color);
}

.talk-card .link:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/* Responsive design */
@media (max-width: 768px) {
    .talks-grid {
        grid-template-columns: 1fr;
    }
}

/* Content columns */
.content-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.column {
    border: 1px solid #ccc;
    background-color: var(--secondary-background-color);
    padding: 20px;
}

.column h2 {
    margin-bottom: 20px;
}

#posts-list,
#talks-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#posts-list li,
#talks-list li {
    display: flex;
    align-items: baseline;
}

#posts-list .date,
#talks-list .date {
    margin-right: 10px;
    font-size: 0.9em;
}

/* Style spécifique pour le lien "Voir tous" */
#posts-list li:last-child,
#talks-list li:last-child {
    margin-top: 10px;
    margin-bottom: 0;
    padding-top: 10px;
}

.content-wrapper {
    display: flex;
    gap: 2rem;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.table-of-contents {
    width: var(--toc-width);
    padding: 1rem;
    position: fixed;
    right: 0%;
    top: 100px;
    z-index: 1;
}

.table-of-contents h3 {
    margin-top: 0;
    font-size: 1.2em;
}

.table-of-contents ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.table-of-contents li {
    margin: 0.5em 0;
    font-size: 0.9em;
}

/* Numérotation des titres */
.table-of-contents #TableOfContents > ul > li {
    counter-increment: toc-h2;
}

.table-of-contents #TableOfContents > ul > li > a::before {
    content: counter(toc-h2) ". ";
    font-weight: bold;
}

.table-of-contents #TableOfContents > ul > li > ul > li {
    counter-increment: toc-h3;
}

.table-of-contents #TableOfContents > ul > li > ul > li > a::before {
    content: counter(toc-h2) "." counter(toc-h3) ". ";
}

.table-of-contents #TableOfContents > ul > li > ul > li > ul > li {
    counter-increment: toc-h4;
}

.table-of-contents #TableOfContents > ul > li > ul > li > ul > li > a::before {
    content: counter(toc-h2) "." counter(toc-h3) "." counter(toc-h4) ". ";
}

/* Indentation pour les différents niveaux */
.table-of-contents ul ul {
    margin-left: 1.5em;
}

.table-of-contents ul ul ul {
    margin-left: 1.5em;
}

.table-of-contents a {
    text-decoration: none;
    transition: all 0.2s;
    display: block;
    padding: 0.2em 0;
}

.table-of-contents a:hover {
    color: #4896df;
}

.table-of-contents a.active {
    color: #4896df;
    font-weight: bold;
}

@media (max-width: 1080px) {
    .content-columns {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }
    #content {
        padding: 0;
        margin: 0 auto;
        float: none;
    }

    .table-of-contents {
        display: none;
    }

    #content,
    .body,
    .main-content,
    .content-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        display: block !important;
        box-sizing: border-box;
        padding: 20px !important;
    }

    .entry-content {
        font-size: 1.1em;
        line-height: 1.6;
    }

    .entry-title {
        font-size: 2em;
    }

    .youtube iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .left,
    .right {
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
    }
}

.mastodon-comment {
    background-color: var(--block-background-color);
    border-radius: var(--block-border-radius);
    border: 1px var(--block-border-color) solid;
    padding: 20px;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    color: var(--font-color);
    font-size: var(--font-size);
}
.mastodon-comment p {
    margin-bottom: 0px;
}
.mastodon-comment .author {
    padding-top: 0;
    display: flex;
}
.mastodon-comment .author a {
    text-decoration: none;
}
.mastodon-comment .author .avatar img {
    margin-right: 1rem;
    min-width: 60px;
    border-radius: 5px;
}
.mastodon-comment .author .details {
    display: flex;
    flex-direction: column;
}
.mastodon-comment .author .details .name {
    font-size: medium;
    font-weight: bold;
}
.mastodon-comment .author .details .user {
    font-size: small;
}
.mastodon-comment .author .date {
    margin-left: auto;
    font-size: small;
}
.mastodon-comment .content {
    margin: 15px 20px;
}
.mastodon-comment .attachments {
    margin: 0px 10px;
}
.mastodon-comment .attachments > * {
    margin: 0px 10px;
}
.mastodon-comment .content p:first-child {
    margin-top: 0;
    margin-bottom: 0;
}
.mastodon-comment .status > div {
    display: inline-block;
    margin-right: 15px;
}
.mastodon-comment .status a {
    color: var(--primary-color);
    text-decoration: none;
}
.mastodon-comment .status .replies.active a {
    color: var(--secondary-color);
}
.mastodon-comment .status .reblogs.active a {
    color: var(--primary-color);
}
.mastodon-comment .status .favourites.active a {
    color: #ca8f04;
}
