/* Latest News sidebar — news posts only (.single-post) */

/* Desktop: article left, Latest News right sidebar */
.single-post .savvy-single-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-direction: row;
}

.single-post .savvy-single-layout > .savvy-single-article,
.single-post .savvy-single-layout > article.savvy-post {
  order: 1;
  width: 75%;
  max-width: 900px;
  padding-right: 2rem;
  min-width: 0;
}

.single-post .savvy-single-layout > .savvy-single-aside,
.single-post .savvy-single-layout > aside.ps-news-single-sidebar {
  order: 2;
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow: visible;
}

.ps-latest-news-wrap {
  position: relative;
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
}

.ps-latest-news-sidebar {
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
}

.ps-latest-news-sidebar a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ps-latest-news-toggle-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.ps-latest-news-content {
  max-height: none;
  overflow: visible;
  opacity: 1;
}

.ps-latest-news-icon-open,
.ps-latest-news-icon-close {
  display: none;
}

@media (max-width: 1199px) {
  :root {
    --savvy-header-h: 4rem;
  }

  .single-post .savvy-single-layout {
    flex-direction: column !important;
  }

  .single-post .savvy-single-layout > .savvy-single-aside,
  .single-post .savvy-single-layout > aside.ps-news-single-sidebar {
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    position: static !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .single-post .savvy-single-layout > .savvy-single-article,
  .single-post .savvy-single-layout > article.savvy-post {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 0 !important;
  }

  .ps-latest-news-wrap {
    position: fixed;
    top: var(--savvy-header-h);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    z-index: 40;
    transition: top 0.15s ease;
  }

  .ps-latest-news-wrap.ps-latest-news-scrolled {
    top: 0;
  }

  .ps-latest-news-sidebar {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    border-radius: 0;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  .ps-latest-news-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding-top: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease;
  }

  .ps-latest-news-toggle:checked ~ .ps-latest-news-content {
    max-height: 70vh;
    overflow-y: auto;
    opacity: 1;
    padding-top: 8px;
  }

  .ps-latest-news-icon-open {
    display: block;
  }

  .ps-latest-news-icon-close {
    display: none;
  }

  .ps-latest-news-toggle:checked ~ .ps-latest-news-toggle-label .ps-latest-news-icon-open {
    display: none;
  }

  .ps-latest-news-toggle:checked ~ .ps-latest-news-toggle-label .ps-latest-news-icon-close {
    display: block;
  }

  .ps-latest-news-content ul {
    margin-top: 0;
    margin-bottom: 0;
  }

  .ps-latest-news-content li {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .single-post .savvy-single-layout > .savvy-single-aside::before,
  .single-post .savvy-single-layout > aside.ps-news-single-sidebar::before {
    content: "";
    display: block;
    height: 3.25rem;
  }
}
