/* dm-serif-display-regular - latin */
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/dm-serif-display-v4-latin-regular.eot'); /* IE9 Compat Modes */
  src: local('DM Serif Display Regular'), local('DMSerifDisplay-Regular'),
       url('../fonts/dm-serif-display-v4-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('../fonts/dm-serif-display-v4-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
       url('../fonts/dm-serif-display-v4-latin-regular.woff') format('woff'), /* Modern Browsers */
       url('../fonts/dm-serif-display-v4-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
       url('../fonts/dm-serif-display-v4-latin-regular.svg#DMSerifDisplay') format('svg'); /* Legacy iOS */

  font-display: swap; /* Add font-display */
}

/* inter-regular - latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/inter-v2-latin-regular.eot'); /* IE9 Compat Modes */
  src: local(''),
       url('../fonts/inter-v2-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('../fonts/inter-v2-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
       url('../fonts/inter-v2-latin-regular.woff') format('woff'), /* Modern Browsers */
       url('../fonts/inter-v2-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
       url('../fonts/inter-v2-latin-regular.svg#Inter') format('svg'); /* Legacy iOS */

  font-display: swap; /* Add font-display */
}

html {
  overflow: auto;
}

img {
  max-width: 100%;
  -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.6);
  -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.6);
  margin-bottom: 1%;
}

@media (min-width: 550px) {
  /*
  Side by side gallery
  use with </> alignment
  e.g.
  [_gallery >](imgages/test.jpg)
  */
  img[alt~="_gallery"] {
    max-width: 49.5%;
  }

  /* Aligned to the right */
  img[alt$=">"] {
    float: right;
  }

  /* Aligned to the left */
  img[alt$="<"] {
    float: left;
  }

  /* Centered image */
  img[alt$="><"] {
    display: block;
    margin: auto;
    float: none !important;
  }
}

.center {
  text-align: center;
}

.left {
  margin-left: 0;
}

.lit {
  font-size: 1.5rem;
  font-weight: 300;
}

.little-svg {
  fill: #fff;
}

.ml-0 {
  margin-left: 0.7rem;
}

.ml {
  margin-left: 2rem;
}

.ml-1 {
  margin-left: 5rem;
}

.bottom {
  margin-block-start: 0px;
  margin-block-end: 0px;
  margin-bottom: 0px;
}

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

.mb-2 {
  margin-bottom: 5px;
}

.mb-3 {
  margin-bottom: 20px;
}

.mr {
  margin-right: 32px;
}

.mt-0 {
  margin-top: 0px;
}

.mt-2 {
  margin-top: 3rem;
}

.mt-3 {
  margin-top: 4rem;
}

.mx-auto {
  margin: auto;
}

.mode {
  position: absolute;
  display: block;
  cursor: pointer;
  -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Old versions of Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

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

.text-right {
  text-align: right;
}

.tag-link {
  margin-right: 10px;
}

.about {
  width: 150px;
  height: 150px;
  border-radius: 50%;
}

code:not(pre code) {
  background-color: rgb(230, 230, 230);
  border-radius: 5px;
  padding: 0px 2px;
  font-size: 85%;
}

body.darkmode code:not(pre code) {
  background-color: rgb(65, 65, 65);
}

/* blockquote */
blockquote {
  font-family: 'Inter';
  background-color: rgba(148, 148, 149, 0.08) ;
  margin: 1.5em 0px;
  padding: 1.1em 20px 1px 20px;
  font-style: italic;
}

blockquote footer {
  font-family: 'Inter';
  font-size: 16px;
  padding-bottom: 10px;
  margin-top: -10px;
}

blockquote footer cite:before {
  content: "—";
  padding: 0 0.5em;
}

/* Scroll bar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgb(128 128 128 / 70%);
}
::-webkit-scrollbar-thumb:window-inactive {
  background: rgb(128 128 128 / 20%);
}

::-webkit-scrollbar-thumb:active {
  background-color: rgb(128 128 128 / 100%);
}

/* Footer */
a.footer-link:hover,
a.footer-link:focus {
  cursor: pointer;
}

.svg-hov {
  transition: all .2s ease-in-out;
}
.svg-hov:hover {
  transform: translateY(-3px);
  transition: all .2s ease-in-out;

}

.hexo {
  fill: #03adfc;
  vertical-align: middle;
  padding-bottom: 4px;
}

.github {
  fill: #63636F;
}
.linkedin {
  fill: #0073b1;
}
.twitter {
  fill: #1DA1F2;
}
.instagram {
  fill: #E4405F
}
.stackoverflow {
  fill: #ca7516;
}
.nanobar {
  left: 0;
}

body {
  position: absolute;
  top: 10px;
  left: 10px;
  bottom: 10px;
  right: 10px;
  padding: 5px;
  overflow-y: scroll;
  overflow-x: hidden;
  transition: all 0.3s ease-in-out;
}

body.darkmode {
  background: rgb(34, 34, 38);
  color: rgb(230, 230, 230);
}

.trans {
  animation: transitionPlay 0.7s;
}

@keyframes transitionPlay {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.hidden {
  display: none;
}

#comments {
  text-align: center;
}

#madewith {
  text-align: center;
}

.posisi {
  text-align: center;
}

@media (min-width: 550px) {
  .posisi {
    text-align: right;
  }

  #comments {
    text-align: left;
  }

  #madewith {
    text-align: left;
  }

}

/* Table of Contents */
.post-content {
  max-width: none; /* Allow content to use more width */
}

.toc-wrapper {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  z-index: 100;
  max-height: calc(100vh - 40px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toc-toggle {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background-color: rgba(148, 148, 149, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toc-toggle:hover {
  background-color: rgba(148, 148, 149, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.toc-toggle-icon {
  font-size: 1.2rem;
  color: inherit;
}

.toc-toggle.hidden {
  opacity: 0;
  pointer-events: none;
}

.post-toc {
  padding: 1.5rem;
  background-color: rgba(148, 148, 149, 0.08);
  border-radius: 8px;
  font-size: 1.6rem;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  position: sticky;
  top: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.post-toc.toc-collapsed {
  transform: translateX(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.toc-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.toc-close:hover {
  background-color: rgba(148, 148, 149, 0.2);
}

body.darkmode .post-toc {
  background-color: rgba(148, 148, 149, 0.15);
}

.toc-title {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0;
  color: inherit;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 0.7rem;
  line-height: 1.6;
}

.toc-list a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
  display: block;
}

.toc-list a:hover {
  color: #0FA0CE;
}

.toc-list a.active {
  color: #0FA0CE;
  font-weight: 600;
}

.toc-list .toc-child {
  margin-left: 1rem;
  margin-top: 0.3rem;
}

.toc-list .toc-level-1 {
  font-weight: 600;
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
}

.toc-list .toc-level-2 {
  font-size: 1.6rem;
  margin-bottom: 0.7rem;
}

.toc-list .toc-level-3 {
  font-size: 1.6rem;
  opacity: 0.9;
  margin-bottom: 0.6rem;
}

.toc-list .toc-level-4,
.toc-list .toc-level-5,
.toc-list .toc-level-6 {
  font-size: 1.6rem;
  opacity: 0.8;
  margin-bottom: 0.6rem;
}

/* Adjust layout for medium screens */
@media (max-width: 1200px) {
  .toc-wrapper {
    display: none;
  }
  
  .post-content {
    width: 100% !important;
    padding-right: 0 !important;
  }
}

/* Hide TOC on mobile */
@media (max-width: 550px) {
  .post-toc {
    display: none;
  }
  
  .post-content {
    width: 100% !important;
  }
}
