/**
 * @file
 * Styling for WCG Article Navigation blocks.
 */

/* Align sidebar with article body content on article pages - dynamically set via JS */
.main--with-sidebar .main-sidebar {
  margin-top: 0;
}

@media (max-width: 920px) {
  .main--with-sidebar .main-sidebar {
    margin-top: 0 !important;
  }
}

/* Highlighted Articles Block */
#block-wcg-highlighted-articles-sidebar,
.block-highlighted-articles-block {
  border-left: 2px solid #d3d3d3;
}

/* Heading styling - padding-top only when heading exists (has content) */
#block-wcg-highlighted-articles-sidebar h2,
.block-highlighted-articles-block h2 {
  font-size: 1.6rem;
  margin: 0 0 1em 0;
  padding-top: 2.5rem;
  padding-left: 2rem;
}

/* Content wrapper */
#block-wcg-highlighted-articles-sidebar .view-content,
.block-highlighted-articles-block .view-content {
  margin: 0;
  padding: 0;
}

/* Node spacing */
#block-wcg-highlighted-articles-sidebar .node--view-mode-headline,
.block-highlighted-articles-block .node--view-mode-headline {
  margin-bottom: 1.5rem;
}

#block-wcg-highlighted-articles-sidebar .node--view-mode-headline:last-child,
.block-highlighted-articles-block .node--view-mode-headline:last-child {
  margin-bottom: 0;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {

  #block-wcg-highlighted-articles-sidebar,
  .block-highlighted-articles-block {
    margin-bottom: 1.5rem;
    padding-left: 15px;
  }
}

/* Sidebar Promotion Block - default padding-top for when it's first or after empty highlighted articles */
.sidebar-promotion {
  padding: 2rem 2rem 0.5rem 1.5rem;
  margin: 0 0 2rem 0;
  background: #f8f9fa;
  border-left: 2px solid #d3d3d3;
}

/* When sidebar promotion follows highlighted articles that has an h2 (has content) */
/* Apply margin to the block wrapper to create space between the borders */
#block-wcg-highlighted-articles-sidebar:has(h2)+#block-wcg-sidebar-promotion {
  margin-top: 2rem;
}

/* Remove padding-top from inner element when it follows highlighted articles with content */
#block-wcg-highlighted-articles-sidebar:has(h2)+#block-wcg-sidebar-promotion .sidebar-promotion {
  padding-top: 0;
}

.sidebar-promotion__body {
  color: var(--c-text, #555);
  line-height: 1.6;
}

.sidebar-promotion__body h3,
.sidebar-promotion__body h4 {
  margin-top: 0;
  color: var(--c-text, #333);
}