/* Global Sidebar/Layout Fixes for non-home pages */

/* Desktop/tablet: content left, sidebar right (default) */
@media (min-width: 993px) {
  body:not(.home) .site-content {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 360px !important;
    gap: 32px !important;
    align-items: start !important;
  }
  body:not(.home) .site-content #primary,
  body:not(.home) .site-content .content-area {
    grid-column: 1 !important;
    float: none !important;
    width: auto !important;
  }
  body:not(.home) .site-content #secondary,
  body:not(.home) .site-content .widget-area {
    grid-column: 2 !important;
    float: none !important;
    width: 360px !important;
  }
}

/* OVERRIDE: Use custom centered layout on Single and Right Sidebar Page template */
@media (min-width: 993px) {
  body.single .site-content,
  body.page-template-page-right-sidebar .site-content {
    display: block !important; /* disable the 2-col wrapper grid */
  }
}

/* Mobile: stack with content first and sidebar below */
@media (max-width: 992px) {
  body:not(.home) .site-content {
    display: block !important;
  }
  body:not(.home) .site-content #primary,
  body:not(.home) .site-content .content-area,
  body:not(.home) .post-layout-content {
    width: 100% !important;
    float: none !important;
  }
  body:not(.home) .site-content #secondary,
  body:not(.home) .site-content .widget-area,
  body:not(.home) .post-layout-sidebar,
  body:not(.home) aside[role="complementary"] {
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin-top: 16px !important;
  }
}