.elementor-kit-6 {
  --e-global-color-text: rgb(61, 61, 70) !important;
}

.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: 1440px;
  margin: 0 auto;
}

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

.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;

  &.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;
    }
  }
}

#featured {
  background: #f8f9fa;

  .posts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 24px;
    padding-top: clamp(20px, 3vw, 80px);

    .post-wrapper {
      position: relative;
      border-radius: 16px;
      overflow: hidden;

      &:first-child {
        grid-row: span 2;

        .post-content {
          .title {
            a {
              font-size: clamp(1.625rem, 3vw, 2.375rem);
            }
          }
        }
      }

      &:hover {
        .post-bg-image {
          filter: brightness(80%);
          transform: scale(1.03);
        }
      }

      .post-bg-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: 1;
        transition: all 0.3s;
      }

      .post-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(
          1deg,
          rgba(0, 0, 0, 0.8) 0%,
          rgba(0, 0, 0, 0) 53.51%
        );
        z-index: 2;
      }

      .post-content {
        position: relative;
        padding: 24px;
        display: flex;
        flex-direction: column;
        justify-content: end;
        color: #fff;
        min-height: 290px;
        height: 100%;
        z-index: 3;

        .title {
          font-size: 1.625rem;
          font-weight: 700;
          color: #fff;
          line-height: normal;
        }

        .meta {
          display: flex;
          gap: 24px;

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

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

          .author span {
            color: #fff;
            font-size: 1rem;
            font-weight: 500;
          }

          .date span {
            color: #fff;
            font-size: 0.875rem;
            font-weight: 500;
          }
        }
      }
    }
  }
}

#search {
  &.input-bar {
    width: 50%;
    margin: clamp(25px, 5vw, 90px) auto 25px auto;
    border: 1px solid #cfcfd7;
    border-radius: 30px;
    padding: 4px;
    display: flex;

    .original-select {
      display: none;
    }

    .custom-select {
      position: relative;
      cursor: pointer;
      width: 30%;
      padding: 10px clamp(8px, 1.8vw, 16px) 10px clamp(16px, 1.8vw, 32px);
      font-size: 1rem;
      color: #3d3d46;
      background: #f3f3f3;
      border: 1px solid #f3f3f3;
      border-radius: 30px 0 0 30px;
      transition: background 0.3s;

      &:hover {
        background: #ecedf0;
      }

      &.open {
        .custom-options {
          opacity: 1;
          visibility: visible;
          pointer-events: all;
        }
      }

      .custom-select__trigger {
        position: relative;
        transition: all 0.3s ease;
        display: flex;
        justify-content: space-between;
        gap: 10px;

        .arrow {
          align-self: center;
        }
      }

      .custom-options {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.16);
        border-radius: 4px;
        margin-top: 12px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 100;
        overflow-y: auto;
        transition: all 0.3s ease;

        .custom-option {
          position: relative;
          padding: 12px 16px;
          font-size: 1rem;
          transition: all 0.3s ease;

          &:hover {
            background: #f5f5f5;
          }

          &.selected {
            color: #0066cc;
            background: rgba(0, 102, 204, 0.05);
          }

          &.disabled {
            color: #999;
            background: #f9f9f9;
            cursor: not-allowed;
          }
        }
      }
    }

    #search-term {
      width: 50%;
      font-size: 1rem;
      font-weight: 500;
      margin-left: 16px;
      border: none;

      &:focus-visible {
        outline: none;
      }
    }

    .search-button {
      border-radius: 30px;
      background: #54b2d3;
      padding: 12px;
      display: flex;
      align-items: center;
      margin-left: auto;
      cursor: pointer;
      transition: background 0.3s;

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

#articles {
  background: #f8f9fa;

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

    .heading {
      font-size: clamp(2rem, 4vw, 3rem);
      color: #3d3d46;
      padding: clamp(20px, 3vw, 80px) 0;
      text-wrap: balance;
    }

    .original-select {
      display: none;
    }

    .custom-select {
      position: relative;
      width: 170px;
      cursor: pointer;
      padding: 12px 24px;
      font-size: 1rem;
      color: #3d3d46;
      background: #fcfdfd;
      border: 1px solid #cfcfd7;
      border-radius: 30px;
      transition: background 0.3s;

      &:hover {
        background: #ecedf0;
      }

      &.open {
        .custom-options {
          opacity: 1;
          visibility: visible;
          pointer-events: all;
        }
      }

      .custom-select__trigger {
        position: relative;
        transition: all 0.3s ease;
        display: flex;
        justify-content: space-between;
        gap: 10px;
      }

      .custom-options {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 170px;
        background: #fff;
        box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.16);
        border-radius: 4px;
        margin-top: 12px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 100;
        overflow-y: auto;
        transition: all 0.3s ease;

        .custom-option {
          position: relative;
          padding: 12px 16px;
          font-size: 1rem;
          transition: all 0.3s ease;

          &:hover {
            background: #f5f5f5;
          }

          &.selected {
            color: #0066cc;
            background: rgba(0, 102, 204, 0.05);
          }

          &.disabled {
            color: #999;
            background: #f9f9f9;
            cursor: not-allowed;
          }
        }
      }
    }
  }
}

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

  .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 {
        color: #40a0c1;
      }
    }

    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 {
      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: 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;
  }
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 !important;
  padding: clamp(30px, 3vw, 100px) 0;

  span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    background: #ecedf0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;

    &:hover {
      background: #e4e6ea;
    }

    &.active {
      background: #54b2d3;
      color: white;
    }

    &.disabled {
      opacity: 0.5;
    }
  }
}

.page-single-post {
  background: #f8f9fa;

  .back-button {
    position: sticky;
    top: 123px;
    display: flex;
    width: fit-content;
    align-items: center;
    background: none;
    color: #3d3d46 !important;
    gap: 4px;
    font-size: 16px;
    padding: 20px 0;
  }
}

.post {
  display: flex;
  gap: 80px;

  .left-sidebar,
  .right-sidebar {
    width: 20%;
    position: sticky;
    top: 187px;
    align-self: flex-start;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #e4e6ea;
    background: #fff;
  }

  .main-content {
    width: 60%;

    h1 {
      font-size: 48px;
      font-weight: 700;
    }
  }

  .toc {
    padding: 12px 24px 24px 24px;

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

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

  .toc h3 {
    color: #3d3d46;
    font-size: 22px;
    font-weight: 700;
  }

  .meta {
    display: flex;
    align-items: center;
    margin-top: 48px;
    gap: 24px;
    margin-bottom: 24px;
    color: var(--e-global-color-text);

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

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

      .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: var(--e-global-color-text);
        transition: color 0.3s;
      }
    }

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

      span {
        font-size: 0.875rem;
        font-weight: 500;
      }
    }
  }

  .right-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgb(0 0 0 / 0.1);
    text-align: center;
  }

  .right-card .content {
    padding: 24px;

    h4 {
      font-weight: 700;
    }

    p {
      font-size: 16px;
    }
  }

  .right-card .learn-more {
    display: flex;
    align-items: center;
    color: #121d36;
    font-weight: 400;
    width: fit-content;
    margin: auto;
    border-radius: 100px;
    border: 1px solid #121d36;
    padding: 8px 16px;
    gap: 2px;
    line-height: normal;
    transition: all 0.3s;

    &:hover {
      color: #fff;
      background: #54b2d3;
      border-color: #54b2d3;

      svg {
        transform: rotate(45deg);
        transition: all 0.3s;
      }
    }
  }

  .vote-card {
    background-color: #121d36;
    border-radius: 8px;
  }

  .top-section {
    position: relative;
    text-align: center;
    padding: 48px 24px;

    .bottom-left {
      position: absolute;
      bottom: 12px;
      left: 12px;
    }

    .top-right {
      position: absolute;
      top: 12px;
      right: 12px;
    }
  }

  .top-section h2 {
    font-size: 28px;
    color: #fff;
  }

  .top-section p {
    margin-top: 8px;
    font-size: 1rem;
    color: #fff;
  }

  .vote-button {
    margin-top: 25px;
    padding: 16px 24px;
    border: 1px solid white;
    border-radius: 100px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;

    svg {
      transition: 0.3s;
    }

    &:hover,
    &.voted {
      background-color: #65cd98;
      border-color: #65cd98;
    }
  }

  .vote-button .vote-icon {
    display: inline-block;
    transition: transform 0.3s ease;
  }

  .vote-button .vote-icon.rotate {
    animation: rotate-icon 0.3s ease;
  }

  .bottom-section {
    background-color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 45px;
  }

  .social-icons {
    display: flex;
    gap: 12px;
  }

  .social-icons a {
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: filter 0.3s;

    &:hover {
      filter: saturate(1.5) brightness(1.2);
    }

    &.facebook {
      border-radius: 22px;
      background: linear-gradient(68deg, #36528b 0%, #577cc8 92.36%);
    }

    &.x {
      border-radius: 22px;
      background: linear-gradient(68deg, #000 0%, #313131 92.36%);
    }

    &.linked-in {
      border-radius: 22px;
      background: linear-gradient(68deg, #006aa1 0%, #0094e1 92.36%);
    }

    &.mail {
      border-radius: 22px;
      background: linear-gradient(68deg, #d13c2f 0%, #f86356 92.36%);
    }
  }
}

@keyframes rotate-icon {
  0% {
    transform: rotate(0deg);
  }

  40% {
    transform: rotate(-20deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

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

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

/* Author Page Styles */
.author-page {
  .info {
    display: flex;
    align-items: center;
  }

  .author-avatar {
    margin-right: 20px;
    flex: 0 0 auto;
  }

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

  .details {
    width: 70%;

    .author-name {
      font-size: 2em;
      line-height: normal;
    }

    .author-bio {
      font-size: 1.1em;
      color: var(--e-global-color-text);
      margin-top: 10px;
    }
  }

  .heading {
    padding: 40px 0;
  }
}

@media (max-width: 1500px) {
  #search {
    &.input-bar {
      width: 65%;
    }
  }
}

@media (max-width: 1200px) {
}

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

  #featured {
    .posts {
      grid-template-columns: 1fr;
      grid-template-rows: repeat(3, 1fr);

      .post-wrapper {
        &:first-child {
          grid-row: span 1;
        }
      }
    }
  }
}

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

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

  #search {
    &.input-bar {
      width: 100%;

      .custom-select {
        padding: 10px 10px 10px 20px;
        width: 35%;

        .custom-select__trigger {
          font-size: 0.875rem;
        }
      }

      #search-term {
        margin-left: 10px;
      }
    }
  }

  .pagination {
    span {
      &.disabled {
        display: none;
      }
    }
  }

  .page-single-post {
    .left-sidebar,
    .right-sidebar,
    .back-button {
      display: none;
    }

    .post {
      .main-content {
        width: 100%;
        padding-top: 20px;

        & .bottom-section {
          flex-direction: column;
          gap: 25px;
        }
      }
    }
  }

  .author-page {
    .info {
      flex-direction: column;
      text-align: center;
    }

    .author-avatar {
      margin-right: 0;
    }

    .details {
      width: 100%;
    }
  }
}
