* {
  box-sizing: border-box;
}
:root {
  --primary-color: hsl(30, 40%, 2%);
  --secondary-color: #c8df7b;
  --font-primary: hsl(45, 2%, 38%);
  --font-secondary: rgb(133, 124, 122);
  --secondary-background: hsl(338, 14%, 73%);
  --text-xxs: 0.4rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 5rem;
}
body {
  min-height: 100vh;
  background-image: linear-gradient(120deg, #fdfaf8 0%, #e1e1e1 100%);
  font-size: var(--text-base);
  color: var(--font-primary);;
  font-family: "Inter", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button{
  padding: 0 1rem;
}
header {
  margin-top: 2rem;
  position: -webkit-sticky;
  position: sticky;
  top: 2rem;
}
span {
  margin-left: 0.25rem;
}
h1 {
  color: var(--primary-color);
}
h3 {
  font-weight: 400;
}
h4 {
  font-weight: 300;
}
img,
picture {
  max-width: 100%;
  display: block;
}
i {
  margin-left: 0.5rem;
}
.tooltip-container {
  margin:0 auto;
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  padding: 6px 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%; /* sopra il bottone */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip-container.show-tooltip .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/***********************/
/********homepage******/
/*********************/

/*-----navbar section-----*/
html {
  interpolate-size: allow-keywords;
}

nav {
  width: fit-content;
  margin: 3rem auto;
  background: hsla(0, 1%, 79%, 0.8);
  padding: 0.25rem;
  isolation: isolate;

  anchor-name: --hovered-link;

  li:hover {
    anchor-name: --hovered-link;
  }

  &::before,
  &::after {
    content: "";
    content: "";
    position: absolute;
    top: calc(anchor(bottom) - 10px);
    left: calc(anchor(left) + 1rem);
    right: calc(anchor(right) + 1rem);
    bottom: calc(anchor(bottom) + 5px);
    border-radius: 10px;

    position-anchor: --hovered-link;

    transition: 500ms
      linear(
        0,
        0.029 1.6%,
        0.123 3.5%,
        0.651 10.6%,
        0.862 14.1%,
        1.002 17.7%,
        1.046 19.6%,
        1.074 21.6%,
        1.087 23.9%,
        1.086 26.6%,
        1.014 38.5%,
        0.994 46.3%,
        1
      );
  }

  &::before {
    z-index: -1;
    background: rgb(0 0 0 / 0.2);
    backdrop-filter: blur(2px);
  }

  &::after {
    z-index: -2;
    background-attachment: fixed;
  }

  &:has(a:hover)::before,
  &:has(a:hover)::after {
    top: anchor(top);
    left: anchor(left);
    right: anchor(right);
    bottom: anchor(bottom);

    @supports (corner-shape: squircle) {
      corner-shape: squircle;
      border-radius: 50%;
    }
  }

  &:has(li:first-of-type a:hover)::before,
  &:has(li:first-of-type a:hover)::after {
    @supports (corner-shape: squircle) {
      border-radius: 32px;
    }
  }

  &:has(li:last-of-type a:hover)::before,
  &:has(li:last-of-type a:hover)::after {
    @supports (corner-shape: squircle) {
      border-radius: 50% 32px 32px 50%;
    }
  }

  @supports (corner-shape: squircle) {
    border-radius: 24px;
    corner-shape: squircle;
  }

  > ul {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
  }

  a {
    display: block;
    padding: 1rem;
    text-decoration: none;
    color: white;
  }
}

/*-----main section-----*/

.main-wrapper {
  max-width: 40rem;
  margin: auto;
  padding-top: 3rem;
  padding-bottom: 3rem;
  color: var(--primary-color);
  text-decoration: none;
}

main {
  max-width: 40rem;
  margin: auto;
}

main p{
  line-height: 160%;
  text-align: justify;
}


main a {
  text-decoration: none;
  color: var(--font-primary);
  border-bottom: 1px solid var(--primary-color);
  padding: 0.125rem;
}

main a:hover {
  text-decoration: none;
  color: var(--font-primary);
  border-bottom: 1px solid var(--primary-color);
  padding: 0.125rem;
  background-color: rgb(65, 255, 192);
}

.current-date{
  background-image: linear-gradient(120deg, #fbf7f4 0%, #f5f5f5 100%);
  border: 1px solid hsla(11, 4%, 50%, 0.6);
  border-radius: 2rem;
  box-shadow: 19px 26px 66px -21px rgba(133, 124, 122, 1);
  -webkit-box-shadow: 19px 26px 66px -21px rgba(133, 124, 122, 1);
  -moz-box-shadow: 19px 26px 66px -21px rgba(133, 124, 122, 1);
  max-width: 6rem;
  padding: 0.5rem 1rem;
  text-align: center;
  margin: auto;
  margin:2rem;
  position: absolute;
  bottom: 0%;
}
/******Footer******/
footer {
  max-width: inherit;
  justify-content: center;
}
.footer-divider {
  width: 40%;
  height: 1px;
  background-color: var(--font-primary);
  margin: auto;
  margin-top: 4rem;
}
.social-wrapper {
  max-width: 45rem;
  display: flex;
  margin: auto;
  margin-top: 3rem;
  align-items: center;
  justify-content: center;
}
.social-icon {
  margin-right: 1rem;
}

/*****************************/
/******** About Page**********/
/*****************************/
.layout-wrapper {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100%;
}
.about-img {
  max-width: 45rem;
  margin: auto;
  margin-top: 2rem;
  border-radius: 1rem;
}

.main {
  display: flex;
  padding-bottom: 2rem;
  flex-direction: column;
  padding-left: 1rem;
  padding-right: 1rem;
  min-width: 0;
  max-width: 35rem;
  margin-left: auto;
  margin-right: auto;
  align-items: center;
}
.main h1 {
  margin-bottom: 1.5rem;
}
.about h1 {
  margin-bottom: 2rem;
}
.contact-link{
  text-decoration: none;
  color: var(--font-primary);
  border-bottom: 2px solid var(--secondary-color);
}

/*****************************/
/******** All-Blogs page******/
/*****************************/

.blog-main {
  display:flex;
  margin: 0 auto;
  
}
.post-list__heading {
  font-size: var(--text-xl);
}
.post-list {
}
.post-list__tag{
  margin-right: 1rem;
  background-color: rgb(216, 234, 250);
  max-width: fit-content;
  padding: 0 1rem;
  border-radius: 1rem;
}
}
.post-list__item {
  margin-bottom: 2rem;
  padding: 1.5rem 1.5rem;
  border-radius: 0.5rem;
}
.post-list__title {
  font-family: "Inter", sans-serif;
  font-size: var(--text-2xl);
  color: var(--primary-color);
  font-weight: 500;
}

.post-list__meta {
  font-size: 0.875rem;
  font-size: var(--text-sm);
  color: #757575;
}
.post-list__meta > * + * {
  margin-left: 1rem;
}

.post-list__more {
  text-align: center;
  font-size: 0.75rem;
  text-transform: capitalize;
  text-decoration: none;
  padding: 0.5rem 0.1rem ;
  max-width:3rem;
  border-radius: 0.5rem;
  background-color:var(--secondary-color);
  margin-bottom: 2rem;
}
.post-list__more:hover {
  transition: transform 0.4s;
  transform: translate(0, -5px);
}

/**********************/
/****Article page*****/
/********************/
.divider {
  height: 1px;
  width: 3rem;
  background-color: var(--primary-color);
}
.article-wrapper {
  max-width: 40rem;
  margin: auto;
  align-items: center;
}
article {
  margin-bottom: 6rem;
  justify-items: center;
}
.article-button{
  background-color: rgb(216, 234, 250);
  max-width: fit-content;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  border-style: none;
  
}
code {
  margin-left: 1rem;
}
blockquote {
  margin-left: 1rem;
  color: var(--font-primary);
  border-left: 3px solid var(--primary-color);
  padding-left: 0.875rem;
}

.header {
  max-width: 40rem;
  text-align: left;
  margin: 6rem auto;

  color: var(--primary-color);
  position: relative;
  z-index: -1;
}

.h1 {
  font-family: "Rubik", sans-serif;
  font-weight: 500;
  font-size: var(--text-3xl);
  line-height: 0.9;
  margin-top:2rem;
}

.subtitle {
  font-size: var(--text-2xl);
  line-height: 1.2;
  color: var(--primary-color);
  margin-top: 1.5rem;
}

.lead {
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.3;
}

.container {
  justify-items: center;
  align-items: center;
  margin-top: 12rem;
  color: var(--primary-color);
  text-align: justify
}
.container p {
  margin-top: 1.5rem;
  line-height: 1.6;
}
.container a {
  text-decoration: none;
  color: var(--font-primary);
  border-bottom: 2px solid var(--secondary-color);
}
.container h1{
  text-align: center;
}
.container h3{
  text-align: center;
}

#top-btn {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 99;
  font-size: 0.8rem;
  background-image: linear-gradient(
    120deg,
    hsl(30, 5%, 76%) 0%,
    hsl(338, 14%, 73%) 100%
  );
  color: var(--font-primary);
  cursor: pointer;
  padding:1rem;
  border: 1px solid var(--font-primary);
  border-radius: 12rem;
}

/************************/
/****Mobile Styling*****/
/**********************/

@media screen and (max-width: 768px) {
  .nav-wrapper {
    max-width: 30rem;
  }
  .main-wrapper {
    max-width: 30rem;
  }
  main {
    padding-left: 1rem;
  }
  .nav-wrapper .nav-item {
    margin-left: 0.75rem;
  }
  body {
    font-size: var(--text-sm);
  }
}

@media screen and (max-width: 576px) {
  }
  body {
    font-size: var(--text-base);
  }
  .about-img {
    max-width: 35rem;
    margin: auto;
  }
  .main-wrapper {
    max-width: 35rem;
  }
  .blog-main {
    max-width: 35rem;
  }
  .container {
    max-width: 35rem;
    margin: auto;
  }
  .article-wrapper {
    padding-right: 1rem;
    padding-left: 1rem;
  }
  .post-list{
    display:flex;
    flex-direction: column;
  }
  .post-list__read-more:hover {
    transition: transform 0.4s;
    transform: translate(0, -5px);
  }
}
