/* Global Styles */

* {
  box-sizing: border-box;
}

html:focus-within {
  scroll-behavior: smooth;
}

::selection {
  background-color: hsla(355, 100%, 91%, 0.3);
}

/* Body Styles */

body {
  font-family: var(--texts-font);
  display: grid;
  justify-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 4rem 0 8rem;
  color: var(--light-primary);
  background-color: var(--light-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "diga";
  font-variant-ligatures: "discretionary-ligatures";
}

p {
  padding: 0;
  text-align: left;
  line-height: 1.5em;
}

h1, h2, h3 {
  font-family: var(--titles-font);
}

/* Header Styles */

header {
  max-width: 95%;
  margin: auto;
}

header h1 {
  font-variant-ligatures: normal;
  color: var(--light-primary);
  font-size: 2rem;
  margin-bottom: 0;
  text-align: center;
}

header h2 {
  font-size: 1.3rem;
  color: var(--light-primary);
  margin: 0 0 1rem;
  text-align: center;
  font-weight: 400;
}

/* Link Styles */

a {
  position: relative;
  color: inherit;
  transition: color 0.5s ease-in;
}

a:hover {
  color: var(--light-links);
}

/* Main Section Styles */

main {
  max-width: 90%;
  margin: auto;
}

/* Titles Scales */

.e-content > h1 {
  font-size: 1.3rem;
}

/* Ensure Fluid Elements Inside Container */

.h-entry img, .h-entry iframe, .h-entry table, .h-entry object, .h-entry code, .h-entry pre {
  max-width: 100%;
  display: block;
}

.h-entry pre, .h-entry code {
  overflow-x: scroll;
  overflow-wrap: break-word;
}

/* Display for Code Blocks */

main pre {
  background-color: rgba(0, 0, 0, 0.2);
  white-space: pre-wrap;
}

main pre code {
  padding: 0.4rem;
}

/* About Block Styles */

.about-me {
  max-width: 50ch;
  display: flex;
}

hr {
  color: rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
}

.about-me {
  margin-top: 1.5rem;
}

.about-me .author-image {
  float: left;
  background-color: white;
  border-radius: 100px;
  margin-right: 2rem;
  display: column;
}

.about-me .author-infos {
  display: column;
}

.about-me .author-infos h3 {
  margin-top: 0;
}

.about-me .author-image:after {
  content: "";
  display: table;
  clear: both;
}

/* Navigation Styles */

nav {
  display: block;
  text-align: center;
  font-size: 1rem;
}

nav > span {
  display: block;
  margin-bottom: 1rem;
}

nav a {
  text-decoration: none;
}

nav a:hover,
nav a:active {
  text-decoration: underline;
}

nav .block {
  margin: 1em 0;
  display: inline-block;
}

nav a.network {
  padding: 0 0.2em;
}

nav a.network:hover {
  text-decoration: none;
}

nav a.network .icon {
  fill: var(--light-primary);
  transition: fill 0.5s ease-in;
}

nav a.network:hover .icon {
  fill: var(--light-links);
}

/* Article Styles */

article {
  font-size: 1rem;
  max-width: 50ch;
  margin-bottom: 3rem;
  text-align: justify;
  scroll-margin-top: 5rem;
  line-height: 1.5rem;
}

article > h1 {
  font-size: 1.3rem;
  display: block;
  margin-bottom: 2rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

article h2 {
  font-size: 1.3rem;
}

article h3 {
  font-size: 1.1rem;
}

article a.permalink {
  display: block;
  pointer-events: all;
  margin: 2rem 0;
}

/* Webmentions Styles */

#webmentions {
  padding: 0.8rem 0.8rem 0 0.8rem;
  max-width: 50ch;
}

#webmentions h2 {
  font-size: 0.90rem;
  display: block;
  margin-top: 0;
  margin-bottom: 2rem;
  text-align: left;
  font-variant: small-caps;
  font-style: normal;
}

#webmentions ul {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

#webmentions ul.comments li {
  display: block;
  min-height: 3em;
  margin-bottom: 1em;
}

#webmentions li a img {
  display: block;
  float: left;
  height: 3em;
  border-radius: 100%;
  margin-right: 1em;
}

#webmentions ul.reacts a {
  width: 3em;
  height: 3em;
  overflow: hidden;
  display: inline-block;
  margin-right: 1em;
  border-radius: 100%;
}

#webmentions ul.reacts a img {
  width: 100%;
  height: 100%;
}

/* Kudos Styles */

#kudos {
  text-align: center;
  position: relative;
  margin: 2em 0;
}

#kudos button {
  border-radius: 100%;
  margin: auto;
  padding: 0.5em 0.5em 0.3em 0.5em;
  background-color: var(--light-bg);
  border: 2px solid var(--light-primary);
  color: var(--light-bg);
  transition: all ease-in 0.25s;
  cursor: pointer;
}

#kudos button:hover, #kudos button.activated {
  background-color: var(--light-primary) !important;
}

#kudos button:hover .heart > path, #kudos button.activated .heart > path {
  stroke: var(--light-bg);
}

.heart > path  {
  stroke: var(--light-primary);
  stroke-width: 2;
  fill: transparent;
  transition: fill 0.25s ease-in;
}

#kudos .counter {
  display: block;
  position: absolute;
  font-family: system-ui,sans-serif;
  top: -0.5rem;
  left: 52%;
  background-color: var(--light-primary);
  color: var(--light-bg);
  border: solid 1px var(--light-bg);
  font-weight: bold;
  padding: 0.3rem 0.5rem 0.3rem 0.5rem;
  border-radius: 100%;
  line-height: 0.8rem;
  font-size: 0.8rem;
}

/* Dark Mode Styles */

@media (prefers-color-scheme: dark) {
  body {
    color: var(--dark-primary);
    background-color: var(--dark-bg);
  }

  a:hover {
    color: var(--dark-links);
  }

  nav a.network .icon {
    fill: var(--dark-links);
  }

  header h2, header h1 {
    color: var(--dark-primary);
  }

  nav a.network .icon {
    fill: var(--dark-primary);
  }

  article h1 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  #kudos button {
    background-color: var(--dark-bg);
    border: 2px solid var(--dark-primary);
    color: var(--dark-bg);
  }

  #kudos button:hover, #kudos button.activated {
    background-color: var(--dark-primary) !important;
  }


  #kudos button:hover .heart > path, #kudos button.activated .heart > path {
    stroke: var(--dark-bg);
  }

  .heart > path {
    stroke: var(--dark-primary);
  }

  #kudos .counter {
    background-color: var(--dark-primary);
    color: var(--dark-bg);
    border: solid 1px var(--dark-bg);
  }
}