/* CSS Custom Properties Definitions */

:root {
  --maxWidth-none: "none";
  --maxWidth-xs: 20rem;
  --maxWidth-sm: 24rem;
  --maxWidth-md: 28rem;
  --maxWidth-lg: 32rem;
  --maxWidth-xl: 36rem;
  --maxWidth-2xl: 42rem;
  --maxWidth-3xl: 48rem;
  --maxWidth-4xl: 56rem;
  --maxWidth-5xl: 64rem;
  --maxWidth-full: "100%";
  --maxWidth-wrapper: var(--maxWidth-5xl);
  --spacing-px: "1px";
  --spacing-0: 0;
  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-5: 1.25rem;
  --spacing-6: 1.5rem;
  --spacing-8: 2rem;
  --spacing-10: 2.5rem;
  --spacing-12: 3rem;
  --spacing-16: 4rem;
  --spacing-20: 5rem;
  --spacing-24: 6rem;
  --spacing-32: 8rem;
  --fontFamily-sans: Montserrat, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --fontFamily-serif: "Merriweather", "Georgia", Cambria, "Times New Roman",
    Times, serif;
  --fontFamily-raleway: 'Barlow', sans-serif;
  --font-body: var(--fontFamily-raleway);
  --font-heading: var(--fontFamily-raleway);
  --fontWeight-normal: 400;
  --fontWeight-medium: 500;
  --fontWeight-semibold: 600;
  --fontWeight-bold: 700;
  --fontWeight-extrabold: 800;
  --fontWeight-black: 900;
  --fontSize-root: 16px;
  --lineHeight-none: 1;
  --lineHeight-tight: 1.1;
  --lineHeight-normal: 1.5;
  --lineHeight-relaxed: 1.625;
  /* 1.200 Minor Third Type Scale */
  --fontSize-0: 0.833rem;
  --fontSize-1: 1rem;
  --fontSize-2: 1.2rem;
  --fontSize-3: 1.44rem;
  --fontSize-4: 1.728rem;
  --fontSize-5: 2.074rem;
  --fontSize-6: 2.488rem;
  --fontSize-7: 2.986rem;
  --color-primary: #ea4444;
  --color-text: #1a2c3d;
  --color-text-light: #4f5969;
  --color-heading: #1a202c;
  --color-heading-black: black;
  --color-accent: #d1dce5;
  --color-background: #fefcf8;
  --color-link: #3e8ec8;
  --color-bg-highlight: #f3efe5;

}

/* HTML elements */

*,
:after,
:before {
  box-sizing: border-box;
}

html {
  line-height: var(--lineHeight-normal);
  font-size: var(--fontSize-root);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  --color-background: #fefcf8;

  font-family: var(--font-body);
  font-size: var(--fontSize-2);
  font-weight: var(--fontWeight-medium);
  color: var(--color-text);
  background-color: var(--color-background);
  transition: all 1s ease 0s;
}

body.dark {
  -webkit-font-smoothing: antialiased;

  --color-background: #1a2c3d;
  --color-text: #fefcf8;
  --color-text-light: #d1dce5;
  --color-heading-black: #ea4444;
  --color-heading: #ea4444;
}


footer {
  font-size: var(--fontSize-1);
  padding: var(--spacing-6) var(--spacing-0);
}

hr {
  background: var(--color-accent);
  height: 1px;
  border: 0;
}

/* Heading */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  margin-top: var(--spacing-12);
  margin-bottom: var(--spacing-6);
  line-height: var(--lineHeight-tight);
  letter-spacing: -0.025em;
}

h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--fontWeight-bold);
  color: var(--color-heading);
}

h1 {
  font-weight: var(--fontWeight-black);
  font-size: var(--fontSize-6);
  color: var(--color-heading-black);
}

h2 {
  font-size: var(--fontSize-5);
}

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

h4 {
  font-size: var(--fontSize-3);
}

h5 {
  font-size: var(--fontSize-2);
}

h6 {
  font-size: var(--fontSize-1);
}

h1 > a {
  color: inherit;
  text-decoration: none;
}

h2 > a,
h3 > a,
h4 > a,
h5 > a,
h6 > a {
  text-decoration: none;
  color: inherit;
}

/* Prose */

p {
  line-height: var(--lineHeight-relaxed);
  --baseline-multiplier: 0.179;
  --x-height-multiplier: 0.35;
  margin: var(--spacing-0) var(--spacing-0) var(--spacing-8) var(--spacing-0);
  padding: var(--spacing-0);
}

ul,
ol {
  margin-left: var(--spacing-8);
  margin-right: var(--spacing-0);
  padding: var(--spacing-0);
  margin-bottom: var(--spacing-8);
  list-style-position: outside;
  list-style-image: none;
}

ul li,
ol li {
  padding-left: var(--spacing-0);
  margin-bottom: calc(var(--spacing-8) / 2);
}

li > p {
  margin-bottom: calc(var(--spacing-8) / 2);
}

li *:last-child {
  margin-bottom: var(--spacing-0);
}

li > ul {
  margin-left: var(--spacing-8);
  margin-top: calc(var(--spacing-8) / 2);
}

blockquote {
  color: var(--color-text-light);
  margin-left: calc(-1 * var(--spacing-6));
  margin-right: var(--spacing-8);
  padding: var(--spacing-0) var(--spacing-0) var(--spacing-0) var(--spacing-6);
  border-left: var(--spacing-1) solid var(--color-primary);
  font-size: var(--fontSize-2);
  font-style: italic;
  margin-bottom: var(--spacing-8);
}

blockquote > :last-child {
  margin-bottom: var(--spacing-0);
}

blockquote > ul,
blockquote > ol {
  list-style-position: inside;
}

table {
  width: 100%;
  margin-bottom: var(--spacing-8);
  border-collapse: collapse;
  border-spacing: 0.25rem;
}

table thead tr th {
  border-bottom: 1px solid var(--color-accent);
}

/* Link */

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

a:hover,
a:focus {
  text-decoration: none;
}

/* Utility classes */

.mb-0 {
  margin-bottom: 0;
}

.d-flex {
  display: flex;
}

.w-16 {
  width: 16px;
}

.h-16 {
  height: 16px;
}

.pl-12 {
  padding-left: 12px;
}

/* Custom classes */

.global-wrapper {
  margin: var(--spacing-0) auto;
  max-width: var(--maxWidth-wrapper);
  padding: var(--spacing-10) var(--spacing-5);
}

.global-wrapper[data-is-root-path="true"] .bio {
  margin-bottom: var(--spacing-20);
}

.global-header {
  display: flex;
  align-items: flex-end;
  border-bottom: 2px solid;
  margin-bottom: var(--spacing-12);

}

.main-heading {
  font-size: var(--fontSize-7);
  margin: 0;
}

.post-list-item {
  margin-bottom: var(--spacing-8);
  margin-top: var(--spacing-8);
}

.post-list-item p {
  margin-bottom: var(--spacing-0);
}

.post-list-item h2 {
  font-size: var(--fontSize-4);
  color: var(--color-primary);
  margin-bottom: var(--spacing-2);
  margin-top: var(--spacing-0);
}

.post-list-item header {
  margin-bottom: var(--spacing-4);
}

.header-link-home {
  font-weight: var(--fontWeight-bold);
  font-family: var(--font-heading);
  text-decoration: none;
  font-size: var(--fontSize-5);
}

.bio {
  display: flex;
}

.bio p {
  margin-bottom: var(--spacing-0);
}

.bio-avatar {
  margin-right: var(--spacing-4);
  margin-bottom: var(--spacing-0);
  min-width: 50px;
  border-radius: 100%;
}

.blog-post header h1 {
  margin: var(--spacing-0) var(--spacing-0) var(--spacing-4) var(--spacing-0);
}

.blog-post header p {
  font-size: var(--fontSize-2);
  font-family: var(--font-heading);
}

.blog-post-nav ul {
  margin: var(--spacing-0);

  li.blog-post-nav-prev {
    margin-bottom: 0;
    width: 50%;
    text-align: left;
  }

  li.blog-post-nav-next {
    margin-bottom: 0;
    width: 50%;
    text-align: right;
  }
}

.gatsby-highlight {
  margin-bottom: var(--spacing-8);
  font-size: 1rem !important;

  pre {
    background-color: var(--color-bg-highlight) !important;
  }
}

.language-text {
  padding-left: 10px !important;
  padding-right: 10px !important;
  font-size: 16px !important;
  background-color: var(--color-bg-highlight) !important;
}

/* Media queries */

@media (max-width: 42rem) {
  blockquote {
    padding: var(--spacing-0) var(--spacing-0) var(--spacing-0) var(--spacing-4);
    margin-left: var(--spacing-0);
  }
  ul,
  ol {
    list-style-position: inside;
  }
}


/* Pagniation */

.pagination {
  display: flex;

  &__prev {
    width: 50%;
    text-align: left;
    text-decoration: none;

    &-link {
      font-size: 26px;
      font-weight: bold;

      &:hover,
      &:focus {
        color: var(--color-primary);
      }

      &--disable {
        color: gray;
        pointer-events: none;
      }
    }
  }

  &__next {
    width: 50%;
    text-align: right;
    text-decoration: none;

    &-link {
      font-size: 26px;
      font-weight: bold;

      &:hover,
      &:focus {
        color: var(--color-primary);
      }

      &--disable {
        color: gray;
        pointer-events: none;
      }
    }
  }
}

.blog-list {
  list-style: none;
  margin-left: 0;

  .blog-list-item {
    margin-bottom: 0;
    display: flex;
    align-items: center;

    .title {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
}

.copyright-text {
  width: 50%;
  text-align: left;
}

.footer-icon-group {
  width: 50%;
  text-align: right;
}

.footer-social-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  stroke-width: 0;
  stroke: var(--color-text);
  fill: var(--color-text);
  font-style: normal;
  font-weight: normal;
  margin-right: .2em;
  text-align: center;
  font-variant: normal;
  text-transform: none;
  line-height: 1em;
  margin-left: .2em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  &:hover {
    fill: currentColor;
  }
}

.current-page-info {
  display: flex;
  justify-content: flex-end;
  font-size: var(--fontSize-0)
}

@media (max-width: 800px) {
  .blog-list-item{
    display: flex;
    flex-direction: column;

    a {
      width: 100%;
      text-align: center;
    }
  }
  .header-link-home{
    width: 70%;
    text-align: left;
  }

  .main-heading {
    width: 70%;
    text-align: left;
  }

  .header-nav-link{
    width: 15%;
    text-align: right;
  }

  .container {
    align-items: flex-start;
    width: 15%;
  }
}

@media (min-width: 801px) {
  .title {
    width: 80%;
    text-align: left;
  }

  .date {
    width: 20%;
    text-align: right;
  }

  .header-link-home, .main-heading{
    width: 75%;
    text-align: left;
  }

  .header-actions {
    display: flex;
    width: 100%;
    justify-content: flex-end;

    .header-nav-link{
      width: 15%;
      text-align: right;
    }
  }
}

@media (max-width: 350px) {
  .global-header {
    flex-direction: column;
  }

  .header-link-home, .main-heading {
    text-align: center;
    width: 100%;
  }

  .header-nav-link {
    text-align: center;
    width: 100%;
  }

  .header-actions {
    display: flex;
    width: 100%;
    justify-content: flex-end;

    .toggle-button {
      margin-top: 5px;
      margin-bottom: 10px;
      width: 100%;
      text-align: center;
    }
  }
}

.header-actions {
  display: flex;
  width: 100%;
  justify-content: flex-end;

  .toggle-button {
    width: 40px;
    border: medium none;
    background: transparent none repeat scroll 0% 0%;
    cursor: pointer;
    outline: none;
  }

  .sun-moon:hover{
    opacity: 1;
  }

  .sun-moon{
    height: 22px;
  }
}
