body {
  font-family: "Work Sans", sans-serif;
  font-size: 1.6rem;
  line-height: 1.7;
  color: rgb(51 51 51);
  background-color: white;
}

a {
  text-decoration: none;
}

/* ------------------------- Progress Bar Style ------------------------------ */
#read-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--subtle-white);
  z-index: 6;
  display: none;
}

.js {
  #read-progress {
    display: block;
  }
  .progress-bar {
    height: 100%;
    width: 0;
    background-color: var(--impact-color);
    transition: width 0.2s ease-in-out;
  }
}

/*------------------------- Main Article Styles ------------------------------ */
main {
  padding: 1.5rem 2rem;
}

article {
  margin: 2rem auto 3rem;
  padding: 0 2rem;
}

.meta {
  display: flex;
  flex-direction: column;
  margin: 2rem auto;
  font-family: "DM Sans";
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.8;

  & > * {
    display: flex;
    gap: 0.8rem;
  }
}

.js {
  .slide:not(.active) {
    display: none;
  }

  #shift-slides {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0;
  }
}

.content-nav {
  background-color: var(--subtle-white);
  padding: 2rem;
  border-radius: 8px;
  margin: 4rem 0;
  border-left: 4px solid var(--impact-color);

  h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 2.2rem;
    border-bottom: none;
  }

  .nav-ul {
    margin: 0;
    padding-left: 1.5rem;
    font-family: "Work Sans";
    list-style: none;
    line-height: 1.9;

    li {
      margin-bottom: 0.8rem;
    }

    a:focus {
      outline: none;
    }

    a.active-link {
      color: var(--impact-color);
      font-weight: 600;
      padding-left: 1.6rem;

      &:hover {
        text-decoration-color: var(--link-color);
      }

      &::before {
        content: "> ";
      }
    }
  }
}

h1 {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: clamp(2.8rem, 1rem + 4vw, 3.2rem);
  line-height: 1.4;
  color: rgb(61 61 61);
  margin-bottom: 2rem;
}

article > .slide {
  margin-top: 2rem;
  margin-bottom: 4rem;
}

article h2 {
  font-family: "Work Sans", sans-serif;
  font-size: clamp(2.4rem, 1rem + 3vw, 2.7rem);
  line-height: 1.4;
  color: rgb(61 61 61);
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--subtle-bluewhite);
}

article h3,
h4 {
  font-family: "Work Sans", sans-serif;
  font-size: 1.8rem;
  line-height: 1.4;
  color: rgb(51 51 51);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

article h4 {
  font-size: 1.7rem;
}

article p {
  margin-bottom: 2rem;
}

article .inner-section {
  margin: 3.2rem 0;
  p {
    margin-bottom: 1.5rem;
  }
}
article details {
  margin-bottom: 2rem;
  summary {
    font-weight: 500;
  }
  p {
    margin: 1rem;
    padding-left: 1.5rem;
    border-left: 4px solid var(--impact-color);
  }
}

article a {
  color: var(--link-color);
  font-weight: 500;
  text-decoration: underline;
  font-size: 1.585rem;
  text-decoration-thickness: 1.2px;
}

article a:hover {
  text-decoration: underline;
}

article a:focus {
  outline: 2px solid;
  border-radius: 3px;
  outline-offset: 3px;
}

article strong {
  font-weight: 600;
  color: rgb(61 61 61);
}

.content-icon {
  vertical-align: middle;
  margin-left: 3px;
  color: inherit;
  width: 18px;
  height: 18px;
}

.content-imp {
  background-color: rgb(255 255 255);
  padding: 2rem;
  border-radius: 8px;
  margin: 3rem 0;
  border-left: 4px solid var(--imp-color);
}

.content-img {
  margin: 4.5rem auto;
  max-width: 100%;

  img,
  video {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    height: auto;
    background-color: rgb(243 243 243);
    border-radius: 1rem;
    margin: 0 auto;
    display: block;
  }
}

figcaption {
  font-family: "DM Sans", sans-serif;
  font-size: 1.4rem;
  text-align: center;
  margin-top: 1rem;
}

/* List Styles */
.content-ol,
.content-ul {
  margin-left: 2rem;
  margin-top: 1.2rem;
  margin-bottom: 2.5rem;
  padding-left: 2rem;
}

.content-ol li,
.content-ul li {
  margin-bottom: 1.8rem;
  padding-left: 0.5rem;
}

.content-ol li::marker,
.content-ul li::marker {
  color: var(--impact-color);
  font-weight: 600;
}

/* Table Styles */
.content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 3rem 0;
  font-size: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  border-radius: 8px;
  overflow: hidden;
}

.content-table th,
.content-table td {
  border: 1px solid var(--subtle-bluewhite);
  padding: 1.2rem 1.5rem;
  text-align: left;
}

.content-table thead {
  background-color: var(--subtle-white);
}

.content-table th {
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  color: rgb(51 51 51);
}

.content-table td {
  vertical-align: top;
}

.content-table tr:nth-child(even) {
  background-color: var(--subtle-white);
}

code {
  font-family: "Work Sans";
  font-weight: 500;
  letter-spacing: 0.5px;
}

div.code {
  display: block;
  color: ivory;
  margin: 2rem 0;
  font-size: 1.4rem;
  max-height: 500px;
  overflow-y: auto;

  .file-name {
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background-color: var(--btn-color);
    margin: 0;
    position: sticky;
    top: 0;
  }

  pre.code-block {
    color: black;
    padding: 0 2rem;
    white-space: pre-wrap;
    overflow-wrap: break-word;
  }

  code {
    background-color: rgb(51 51 51);
    display: block;
    padding: 2rem;
    font-family: monospace;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: break-word;
  }

  &:has(code) {
    margin-bottom: 2.5rem;
    border-radius: 1rem;
  }
}

/* ------------------------- Update and Share Section ---------------------------- */
#update-share-section {
  display: flex;
  align-items: center;
  margin: 4rem 0 2.5rem;
  padding: 1.5rem 0;
  gap: 1rem;
  justify-content: end;

  img {
    width: 24px;
    height: 24px;
  }
}

/* ------------------------- Like Button Styles ---------------------------- */

.likes {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;

  #like-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
  }

  #like-btn.unliked svg{
    fill: rgb(176 176 176);
  }

  #like-btn.unliked:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);

    svg {
      fill: lightpink;
    }
  }

  #like-btn.unliked:active {
    transform: translateY(0);
    box-shadow: none;
  }

  #like-btn.liked svg{
    fill: rgb(228 74 145);
  }
}

/*------------------------- Media Queries ----------------------------- */
@media only screen and (min-width: 768px) {
  main {
    padding: 2rem 3rem;
    max-width: calc(68ch + 10rem);
    margin: 0 auto;
  }

  article {
    margin: 3rem auto 5rem;
  }

  article > section {
    margin-bottom: 5rem;
  }

  article > section:last-child {
    margin-bottom: 3rem;
  }

  .content-table th,
  .content-table td {
    padding: 1.5rem 1.8rem;
  }
}

@media only screen and (min-width: 1024px) {
  main {
    margin: 3rem auto 5rem;
  }

  h1 {
    font-size: 3.5rem;
  }
}
