.container {
  --bs-gutter-x: 1.5rem;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  max-width: 1320px;
  margin: 0 auto;
}

h2 {
  scroll-margin-top: 123px; /* Same as header height */
}

.e-con {
  padding: 0 !important;
  margin: 0 !important;
}

.copy-link-popup {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

  &.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.category {
  padding: 4px 16px;
  border-radius: 30px;
  width: fit-content;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  background: #f5f5f5;
  color: #666666;
  transition: background 0.3s, color 0.3s;

  &.marketing-and-revenue {
    background: #f8eaf0;
    color: #ee5d9f;
  }

  &.patient-engagement-and-experience {
    background: #eff8f4;
    color: #36a36b;
  }

  &.pabau {
    background: #eef7fb;
    color: #40a0c1;
  }

  &.efficiency {
    background: #ffefef;
    color: #ff6b6b;
  }

  &.compliance-and-security {
    background: #edf1fb;
    color: #4a70f2;
  }

  &.new-businesses {
    background: #fff5e6;
    color: #ac813f;
  }

  &.compare {
    background: #efe9ff;
    color: #764eed;
  }

  &:hover {
    &.marketing-and-revenue {
      background: #ffdeec;
      color: #ee5d9f;
    }

    &.patient-engagement-and-experience {
      background: #d3ffeb;
      color: #36a36b;
    }

    &.pabau {
      background: #d7f3ff;
      color: #40a0c1;
    }

    &.efficiency {
      background: #ffdede;
      color: #ff6b6b;
    }

    &.compliance-and-security {
      background: #d9e4ff;
      color: #4a70f2;
    }

    &.new-businesses {
      background: #ffebcd;
      color: #ac813f;
    }

    &.compare {
      background: #e9e1ff;
      color: #764eed;
    }
  }
}

h1 {
  color: #3d3d46 !important;
  font-size: clamp(2rem, 5vw, 5rem) !important;
  font-weight: 700 !important;
  line-height: 120% !important;
  letter-spacing: -0.8px;
}

.socials {
  display: flex;
  gap: 12px;

  .item {
    display: flex;
    border: 1px solid #3d3d46;
    border-radius: 50%;
    padding: 10px;
    color: #3d3d46;
    transition: all 0.3s ease;

    &:hover {
      background-color: #3d3d46;
      color: #fff;
    }
  }
}

.top-section {
  background: linear-gradient(179deg, #54b2d3 -120.52%, #fff 31.55%);
  padding: clamp(20px, 3vw, 40px) 0;
  color: #3d3d46;

  .container {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 3vw, 40px) 0;

    .breadcrumb {
      font-size: 1rem;

      a {
        color: #6b7280 !important;
        font-weight: 500 !important;
      }

      .breadcrumb_last {
        color: #1e1b18;
      }
    }

    .header {
      width: 80%;
    }

    .info {
      display: flex;
      flex-direction: column;
      gap: 25px;

      .meta {
        display: flex;
        align-items: center;
        gap: 24px;

        span,
        .author {
          color: #6b7280;
          font-weight: 500;
        }

        .author,
        .date {
          display: flex;
          align-items: center;
          gap: 8px;
        }

        .author {
          .avatar {
            border-radius: 50%;
          }

          span {
            font-weight: 400;
          }

          &:hover {
            text-decoration: underline;
          }
        }

        .vl {
          border-left: 1px solid #cfcfd7;
          height: 42px;
        }

        .reviewed {
          a:hover {
            color: #6b7280;
            text-decoration: underline;
          }
        }
      }
    }
  }
}

.post {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 50px;

  aside {
    order: 2;

    .sticky-sidebar {
      position: sticky;
      top: 134px;
      display: flex;
      flex-direction: column;
      gap: 20px;

      .toc {
        display: flex;
        flex-direction: column;
        gap: 24px;
        padding: 12px 24px 24px 24px;
        border: 1px solid #cfcfd7;
        border-radius: 8px;

        .header {
          display: flex;
          justify-content: space-between;
          align-items: center;
          cursor: pointer;
          user-select: none;

          h3 {
            font-size: 18px !important;
            margin: 0 !important;
            font-weight: 700;
            line-height: normal;
          }

          .toggle {
            transition: transform 0.3s ease;
            font-size: 16px;
            color: #3d3d46;
          }
        }

        &.collapsed {
          .toggle {
            transform: rotate(-90deg);
          }

          .content {
            max-height: 0 !important;
          }
        }

        .content {
          overflow: hidden;
          transition: max-height 0.3s ease;

          ul {
            display: flex;
            flex-direction: column;
            gap: 12px;
            line-height: normal;

            li {
              margin-left: 16px;
              padding: 0;

              &::marker,
              a {
                color: #3d3d46;
                font-size: 14px;
                font-weight: 500;
                font-style: normal;
                line-height: normal;
              }

              &:hover {
                &::marker,
                a {
                  color: #40a0c1;
                }
              }
            }
          }
        }
      }

      .book-a-demo-cta {
        display: flex;
        flex-direction: column;
        border-radius: 8px;

        .top-img {
          border-radius: 8px 8px 0 0;
          background: linear-gradient(
            48deg,
            #24bee1 -1.32%,
            #037cd2 54.29%,
            #132d6c 127.51%
          );
          padding: 30px 45px 0 45px;
          height: 180px;

          img {
            height: 100%;
            object-fit: contain;
          }
        }

        .content {
          padding: 16px 24px 24px 24px;
          border-right: 1px solid #cfcfd7;
          border-bottom: 1px solid #cfcfd7;
          border-left: 1px solid #cfcfd7;
          border-radius: 0 0 8px 8px;

          h4 {
            font-size: 22px;
            font-weight: 700px;
            margin-top: 0;
            margin-bottom: 8px;
          }

          p {
            font-size: 16px;
            color: #3d3d46;
          }

          form {
            display: flex;
            flex-direction: column;
            gap: 16px;

            .hs-error-msgs {
              display: none !important;
            }

            label {
              display: none;
            }

            input[type="email"] {
              border-color: #e4e6ea;
              border-radius: 100px;
              color: #9292a3;
            }

            input[type="submit"] {
              border-radius: 100px;
              border: 1px solid #3d3d46;
              background: #fff;
              padding: 8px 16px;
              color: #121d36;
              font-size: 16px;
              font-weight: 500;

              &:hover {
                border-radius: 100px;
                border: 1px solid #3d3d46;
                background: #fff;
              }
            }
          }
        }
      }
    }
  }

  article {
    display: flex;
    flex-direction: column;
    gap: 40px;
    overflow: auto;

    footer {
      display: flex;
      flex-direction: column;
      gap: 16px;
      color: #3d3d46;

      .author {
        display: flex;
        align-items: center;
        gap: 8px;

        img {
          border-radius: 50%;
        }

        .info {
          display: flex;
          flex-direction: column;

          .name {
            font-size: 18px;
            color: #3d3d46;
          }

          .role {
            font-size: 16px;
            color: #9292a3;
          }
        }
      }
    }

    hr {
      color: #cfcfd757;
    }
  }
}

#related-articles {
  padding: clamp(40px, 8vw, 80px) 0;

  .heading {
    font-size: 36px;
    margin-bottom: 40px;
  }
}

#related-guides {
  padding: clamp(40px, 8vw, 80px) 0;

  .heading {
    font-size: 36px;
    margin-bottom: 40px;
  }

  .tag-container{
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .category {
    padding: 4px 16px;
    border-radius: 30px;
    width: fit-content;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #f5f5f5;
    /* color: #666666; */
    transition: background 0.3s, color 0.3s;

    /* Aesthetics & Beauty */
    &.medspa { background: #7c3aed !important; color: white; }
    &.aesthetic-clinic { background: #ec4899 !important; color: white; }
    &.dermatology { background: #06b6d4 !important; color: white; }
    &.cosmetic-surgery { background: #f97316 !important; color: white; }
    &.skin-clinic { background: #8b5cf6 !important; color: white; }
    &.laser-clinic { background: #d946ef !important; color: white; }
    &.hair-transplant-clinic { background: #f472b6 !important; color: white; }
    &.spa { background: #fb923c !important; color: white; }

    /* Primary & Preventive Care */
    &.private-practice-private-gp { background: #0ea5e9 !important; color: white; }
    &.wellness { background: #10b981 !important; color: white; }
    &.longevity { background: #eab308 !important; color: white; }
    &.functional-medicine { background: #14b8a6 !important; color: white; }
    &.integrative-medicine { background: #84cc16 !important; color: white; }
    &.iv-therapy { background: #22d3ee !important; color: white; }
    &.weight-loss { background: #a855f7 !important; color: white; }
    &.metabolic-health { background: #3b82f6 !important; color: white; }

    /* Reproductive & Sexual Health */
    &.fertility { background: #fbbf24 !important; color: white; }
    &.ivf-gynecology { background: #f43f5e !important; color: white; }
    &.mens-health { background: #0284c7 !important; color: white; }
    &.hormone-replacement-therapy-hrt { background: #be123c !important; color: white; }
    &.sexual-health { background: #dc2626 !important; color: white; }
    &.pelvic-health { background: #db2777 !important; color: white; }

    /* Musculoskeletal & Pain Management */
    &.physical-therapy { background: #16a34a !important; color: white; }
    &.sports-medicine { background: #ea580c !important; color: white; }
    &.chiropractic { background: #1e40af !important; color: white; }
    &.osteopathy { background: #0d9488 !important; color: white; }
    &.regenerative-medicine { background: #059669 !important; color: white; }
    &.prp-therapy { background: #f59e0b !important; color: white; }

    /* Mental Health & Therapy */
    &.mental-health-therapy { background: #38bdf8 !important; color: white; }
    &.mental-health { background: #90d4f1 !important; color: white; }
    &.psychology { background: #6366f1 !important; color: white; }
    &.therapy-counseling { background: #a78bfa !important; color: white; }
    &.category.adhd-assessment { background: #e11d48 !important; color: white; }
    &.psychiatry { background: #4f46e5 !important; color: white; }
    &.coaching { background: #0891b2 !important; color: white; }
    &.speech-therapy { background: #c026d3 !important; color: white; }
    &.occupational-therapy { background: #2563eb !important; color: white; }
  }
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  gap: 25px;

  .post-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e4e6ea;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;

    &:hover {
      box-shadow: 0 12px 56px 0 rgba(6, 28, 61, 0.1);

      .post-image > img {
        filter: brightness(80%);
        transform: scale(1.03);
      }

      .title {
        text-decoration: underline;
      }
    }

    a {
      height: 100%;
      display: flex;
      flex-direction: column;
    }

    .badge-wrapper {
      position: absolute;
      padding: 24px;
      width: 100%;
      display: flex;
      justify-content: flex-end;

      &:has(.badge:first-child:nth-last-child(2)) {
        justify-content: space-between;
      }

      .badge {
        color: #212529;
        font-size: 14px;
        font-weight: 500;
        padding: 4px 12px;
        z-index: 99;
        border-radius: 30px;
        background: #fff;
        box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
        display: flex;
        gap: 8px;
        align-items: center;
      }
    }

    .post-image {
      display: none;
      aspect-ratio: 4/3;
      /* height: 200px; */
      overflow: hidden;

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: all 0.3s;
      }
    }
  }

  .post-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;

    .badges {
      display: flex;
      justify-content: space-between;
    }

    .title {
      margin: 24px 0 12px 0;
      font-size: 1.5rem;
      font-weight: 700;
      color: #212529;
      line-height: normal;
      transition: color 0.3s;
    }

    .excerpt {
      color: #5c6570;
      margin-bottom: 24px;
      font-size: 1.125rem;
      font-weight: 500;
    }

    .meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-top: 15px;
      margin-top: auto;

      .author-info {
        display: flex;
        align-items: center;
        gap: 8px;

        .avatar {
          width: 24px;
          height: 24px;
          border-radius: 50%;
          overflow: hidden;

          img {
            width: 100%;
            height: 100%;
            object-fit: cover;
          }
        }

        .name {
          font-size: 1rem;
          font-weight: 500;
          color: #868e96;
          transition: color 0.3s;

          &:hover {
            color: #40a0c1;
          }
        }
      }

      .date {
        display: flex;
        align-items: center;
        gap: 8px;

        span {
          color: #868e96;
          font-size: 0.875rem;
          font-weight: 500;
        }
      }
    }
  }

  .loading,
  .no-results {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #7f8c8d;
    grid-column: span 3;
  }
}

@media (max-width: 1400px) {
  .container {
    max-width: 1140px;
  }
}

@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
}

@media (max-width: 992px) {
  .container {
    max-width: 720px;
  }
}

@media (max-width: 768px) {
  .container {
    max-width: 540px;
  }

  .top-section {
    .container {
      .header {
        width: 100%;
      }
      .info {
        .meta {
          flex-wrap: wrap;

          .vl {
            display: none;
          }
        }
      }
    }
  }

  .post {
    grid-template-columns: 1fr;
  }

  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}

