* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: "montserratBold";
  src: url("/fonts/Montserrat/static/Montserrat-Bold.ttf") format("truetype");
}

@font-face {
  font-family: "openSansRegular";
  src: url("/fonts/Open_Sans/static/OpenSans-Regular.ttf") format("truetype");
}

:root {
  --dark-black-1: hsl(215.56deg 31.03% 17.06%);
  --dark-black-2: hsl(215.38deg 28.47% 26.86%);
  --gray: hsl(217.24deg 21.17% 26.86%);
  --gray-text: hsl(213.6deg 15.53% 68.43%);
  --bg-color: hsl(0, 40%, 5%);
  --white: hsl(0, 40%, 90%);

  --blue: hsl(211, 81%, 75%);
  --black: hsl(180, 38%, 6%);
  --blue-2: hsl(220, 100%, 22%);
  --black-2: hsl(210, 11%, 15%);
  --orage: hsl(17, 83%, 59%);

  /* pagefind searchbar */
  --pagefind-ui-scale: 1;
  --pagefind-ui-primary: var(--orage);
  --pagefind-ui-text: #393939;
  --pagefind-ui-background: #ffffff;
  --pagefind-ui-border: #eeeeee;
  --pagefind-ui-tag: #eeeeee;
  --pagefind-ui-border-width: 2px;
  --pagefind-ui-border-radius: 8px;
  --pagefind-ui-image-border-radius: 8px;
  --pagefind-ui-image-box-ratio: 3 / 2;
  --pagefind-ui-font: openSansRegular;
}
.image-container {
  width: 300px;
  height: 300px;
  overflow: hidden;
  display: flex;
  align-items: flex-start; /* Top align vertically */
  justify-content: center; /* Center horizontally */
  background-color: #f8f8f8; /* Optional: for empty space */
}

.image-container img {
  max-width: 100%;
  height: auto;
  display: block;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
  cursor: pointer;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
button,
strong {
  font-family: "montserratBold";
}

p,
span,
ul,
a {
  font-family: "openSansRegular";
}

ul {
  list-style: none;
}

button {
  width: fit-content;
  border: none;
  outline: transparent;
  cursor: pointer;
}

body {
  background-color: hsl(0, 40%, 98%);
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

section {
  padding: 5rem 5%;
}

.space {
  padding-top: 5rem;
}

nav {
  width: 100%;
  padding: 2rem 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* dropdown */
.dropbtn {
  background-color: var(--orage);
  color: var(--white);
  padding: 1.4rem;
  text-transform: uppercase;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
}

/* The container <div> - needed to position the dropdown content */
.dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown Content (Hidden by Default) */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--orage);
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  right: 0;
}

/* Links inside the dropdown */
.dropdown-content a {
  color: var(--white);
  padding: 12px 16px;
  font-size: 1.6rem;
  text-decoration: none;
  display: block;
}

/* Change color of dropdown links on hover */
.dropdown-content a:hover {
  background-color: hsl(from var(--orage) h s 64%);
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
  display: block;
}

/* Change the background color of the dropdown button when the dropdown content is shown */
.dropdown:hover .dropbtn {
  background-color: hsl(from var(--orage) h s 45%);
}

/* pagefind */
.search-bar-container {
  max-width: 50rem;
  width: 100%;
  margin-inline: 2rem;
}

.pagefind-ui__form {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}

.pagefind-ui__search-input {
  border: none;
  flex: 1;
  outline: 0.2rem solid var(--pagefind-ui-primary);
  padding: 1.5rem;
  font-size: 1.4rem;
  border-radius: 0.8rem;
  font-family: OpenSansRegular;
}

.pagefind-ui__message {
  font-size: 1.3rem;
}

.pagefind-ui__search-clear {
  display: none;
}

.pagefind-ui__drawer {
  position: absolute;
  top: 95%;
  margin-top: 1rem;
  max-width: 95%;
  width: 100%;
  z-index: 50;
  background-color: hsl(from var(--white) h s 96%);
}

.pagefind-ui__results-area {
  height: 35rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 3rem 2rem;
}

.pagefind-ui__results {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pagefind-ui__result {
  display: flex;
  align-items: flex-start;
}

.pagefind-ui__result-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 1.8rem;
}

.pagefind-ui__result-link,
.pagefind-ui__result-excerpt,
.pagefind-ui__message {
  color: var(--black-2);
}

.pagefind-ui__result-excerpt,
.pagefind-ui__result-tags {
  font-size: 1.36rem;
}

.pagefind-ui__result-image {
  --size: 6rem;
  height: var(--size);
  width: var(--size);
  display: none;
}

/* story modal */
#story-modal {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  max-height: 90vh;
  height: 100%;
  width: 90%;
  display: none;
  overflow-y: auto;
  background-color: var(--text-color);
}

#story-modal.show-story-modal {
  display: block;
}

#close-modal {
  position: absolute;
  top: 2%;
  right: 2%;
  z-index: 100;
  border: none;
  background-color: orange;
  color: var(--text-color);
  cursor: pointer;
  padding: 1rem;
}

dialog {
  margin: auto;
  width: 100%;

  #closeStoryModal {
    padding: 0.5rem 2rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    border: none;
    outline: none;
    background-color: orange;
  }
}

iframe {
  height: 90vh;
  width: 100%;
}

main {
  width: 100%;
}

.hero {
  width: 100%;
  min-height: 60vh;
  height: 100%;
  display: flex;
  gap: 2rem;
  position: relative;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: url("/images/banner.webp");
  background-blend-mode: multiply;
  background-size: cover;
  background-position: center center;

  h1 {
    font-size: 4rem;
    color: hsl(from var(--white) h s 99%);
    text-align: center;
  }

  p {
    text-align: center;
    max-width: 70ch;
    font-size: 1.8rem;
    font-weight: 200;
    color: var(--white);
  }
}


.story-btn {
  --story-btn-size: 12rem;
  height: var(--story-btn-size);
  width: var(--story-btn-size);

  position: absolute;
  bottom: -10%;
  left: 5%;

  border-radius: 50%; 
  background-color: #ffffff; 

  border-radius: 8rem;
  cursor: pointer;
  transition: transform 0.2s ease-in;
  outline: 10px solid #ffffff;
  object-fit: cover; /* optional: keeps image shape clean */

  /* optional: adds background on hover if needed */
}

.story-btn:hover {
  transform: scale(1.05);
}




#stories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
}

.story__grid {
  grid-column: 1/4;
  grid-row: 1;
  display: grid;
  gap: 3rem 2rem;
  grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr));
}

.story__grid_2 {
  grid-column: 1/4;
  grid-row: 1;
  display: grid;
  gap: 3rem 2rem;
  grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr));
  /* grid-template-columns: repeat(3, 1fr); */
}

.remote_img {
  object-fit: fill;
  height: 30rem;
  width: 30rem;
}

.story__card {
  --border-radius: 0.8rem;
  display: flex;
  flex-direction: column;
  justify-content: start;
  background-color: hsl(from var(--white) h s 98%);
  transition: background-color 0.2s ease-in, box-shadow 0.3s ease-in-out;

  &:hover {
    background-color: hsl(0, 40%, 95%);
    box-shadow: 0.4rem 0.2rem 0.26rem 0.2rem hsl(0, 0%, 30%, 0.16);
  }
}

.story__coverImg {
  --size: 25rem;
  width: var(--size);
  height: var(--size);
  display: block;
  object-fit: cover;
  object-position: center;
  transition: scale 0.2s ease-in;
}

.story__card__details {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem 0;
}

.card__title {
  color: var(--black);
  font-size: 2.2rem;
  margin-block: 0.5rem 1rem;

  &:hover {
    color: var(--orage);
  }
}

.card__description {
  color: hsl(0, 0%, 40%);
  font-size: 1.4rem;
  line-height: 1.4;
  margin-block: 0.8rem;
}

.story__card__icon {
  height: 1.5rem;
  width: auto;
  filter: invert(60%);
}

.card_tags_list,
.card_category_list {
  display: flex;
  align-items: center;
  justify-content: start;
  flex-wrap: wrap;
  gap: 0.5rem;

  li {
    font-size: 1.3rem;
    word-break: keep-all;
    width: fit-content;
    margin-inline-end: 0.5rem;
  }
}

.category__chip {
  background-color: var(--orage);
  padding: 0.2rem 0.6rem;
  color: var(--white);
}

.tag__chip {
  color: var(--gray);

  &:hover {
    color: var(--orage);
  }
}

.hastag {
  font-size: 1.8rem;
  margin-right: 0.2rem;
}

.publish__date {
  font-size: 1rem;
  color: hsl(0, 0%, 50%);
  text-transform: uppercase;
  letter-spacing: 0.6ch;
  font-weight: 600;
}

.author__reading_time {
  display: flex;
  align-items: center;
  justify-content: space-between;

  .author,
  .timeToRead {
    font-size: 1.3rem;
    color: var(--orage);
    font-weight: 600;
  }

  .timeToRead {
    color: hsl(0, 0%, 50%);
  }
}

.card_author__name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tags_categories {
  grid-column: 4/5;
  grid-row: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.tags_list,
.category_list {
  width: 100%;
  padding: 2rem 4rem;

  ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
  }
}

.block_heading_container {
  width: 100%;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 2rem;

  p {
    font-size: 2rem;
    text-transform: uppercase;
    font-weight: 400;
    letter-spacing: 0.2ch;
    color: var(--gray-text);
  }

  img {
    filter: invert(25%);
    height: 2rem;
  }
}

.chip {
  font-size: 1.2rem;
  color: var(--white);
  text-decoration: none;
  text-transform: capitalize;
  padding: 0.4rem 1rem;
  border-radius: 0.4rem;
}

.category_list .chip {
  background-color: var(--blue-2);

  &:hover {
    background-color: hsl(from var(--blue) h s 40%);
  }
}

.tags_list .chip {
  color: var(--blue-2);
  background-color: var(--white);
  border-radius: 1rem;

  &:hover {
    background-color: hsl(from var(--blue) h s 40%);
    color: var(--white);
  }
}

/* styling for single post / post details page */
.single-page {
  padding: 4% 4rem;
  font-size: 1.6rem;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;

  .article__content {
    grid-column: 1/4;

    .article__header {
      h1 {
        font-size: 4rem;
        line-height: 1.2;
        color: var(--black-2);
      }

      .author__name {
        font-size: 1.4rem;
        color: var(--blue-2);
        margin-top: 1rem;
      }

      .publish__date {
        font-size: 1.4rem;
        letter-spacing: normal;
        font-weight: 500;
        margin-top: 0.2rem;
        text-transform: capitalize;
      }

      .article__tags_categories {
        margin-block: 2rem;

        ul:first-child {
          margin-bottom: 1rem;
        }

        ul {
          display: flex;
          align-items: center;
          flex-wrap: wrap;
          gap: 0.8rem;
          padding: unset;

          li {
            font-size: 1.2rem;
            font-weight: 600;
          }

          .article__category {
            background-color: var(--blue-2);
            color: hsl(from var(--blue) h s 90%);
            padding: 0.2rem 1rem;
          }

          .article__tag {
            background-color: var(--blue);
            color: var(--blue-2);
            padding: 0.2rem 1rem;
          }
        }
      }
    }

    article {
      line-height: 1.8;

      h2,
      h3,
      h4,
      h5,
      h6 {
        color: var(--black);
        margin-block: 1rem;
        font-family: "montserratBold";
      }

      p {
        color: var(--black-2);
        font-family: "openSansRegular";
      }

      ul ::marker {
        content: "▶ ";
        color: var(--gray-text);
      }

      hr {
        margin-block: 2rem;
      }
    }
  }

  #TableOfContents {
    width: 100%;
    padding: 2rem 1.7rem;
    background-color: var(--white);

    ul {
      display: flex;
      flex-direction: column;
      justify-content: start;
      gap: 1.8rem;

      li {
        color: var(--blue-2);
        font-family: "openSansRegular";
      }
    }
  }

  img,
  video,
  svg,
  picture {
    max-height: 50rem;
    width: 100%;
    margin: 4rem auto;
    display: block;
    object-fit: cover;
    border-radius: 1rem;
  }

  ul,
  ol {
    padding-block: 2rem;
  }

  li {
    font-size: 1.8rem;
    list-style-position: inside;
  }

  p {
    font-size: 1.8rem;
  }
}

.mobile_toc {
  display: none;
}

footer {
  width: 100%;
  min-height: 20rem;
  padding: 5rem 5% 2rem 5%;
  background-color: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 3rem;

  .footer_links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    font-size: 1.3rem;
    margin-bottom: 3rem;
  }

  .copyright {
    font-size: 1.4rem;
  }
}

@media (width<=1024px) {
  .pagefind-ui__result-image {
    --size: 4rem;
  }
}

/* media queries */
@media (width<=768px) {
  section {
    padding-inline: 2rem;
  }

  .dropbtn {
    font-size: 1.2rem;
    padding: 1rem;
    margin-left: 0.5rem;
  }

  .dropdown-content a {
    font-size: 1.4rem;
  }

  .hero {
    h1 {
      font-size: 3.5rem;
    }

    p {
      font-size: 1.8rem;
    }

    .btn_container {
      flex-direction: column;
    }
  }

  .tags_list,
  .category_list {
    padding: 3rem 2rem;
  }

  #stories {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .story__grid {
    grid-template-columns: repeat(auto-fill, minmax(23rem, 1fr));
    justify-items: center;
  }

  .card__title {
    font-size: 2rem;
  }

  .card__tags_categories ul li {
    font-size: 1.2rem;
  }

  .hastag {
    font-size: 1.5rem;
  }

  .publish__date {
    font-size: 1.1rem;
  }

  .author,
  .timeToRead {
    font-size: 1.2rem;
  }

  .single-page {
    display: flex;
    flex-direction: column-reverse;

    .article__content {
      .article__header {
        h1 {
          font-size: 3rem;
        }
      }
    }

    .desktop_toc {
      display: none;
    }

    .mobile_toc {
      width: 100%;
      display: block;
    }
  }
}

@media (width<=640px) {
  .story-btn {
    --story-btn-size: 11rem;
    font-size: 1.3rem;
  }

  .story__grid,
  .story__grid_2 {
    grid-template-columns: 1fr;
  }

  .single-page {
    padding: 5rem 2rem;

    .article__content {
      width: 100%;
    }
  }

  article {
    img,
    svg,
    picture,
    video {
      border-radius: 0.2rem;
    }
  }

  .article__heading {
    font-size: 1.8rem;
  }

  footer {
    .footer_links {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 1rem;

      li {
        width: fit-content;
      }

      .copyright {
        font-size: 1.4rem;
      }
    }
  }
}

@media (width<=425px) {
  .story__coverImg {
    --size: 20rem;
  }
}

