:where(#sidebar .ct-sidebar) { background:var(--lwd-sidebar-bg,#fff); }
/* Sidebar presentation only: no widths, editorial content or module behaviour changed. */
body #sidebar#sidebar .ct-sidebar {
   padding:0!important;
  border-radius:0; box-shadow:none; gap:14px!important; container-type:inline-size;
}
body #sidebar#sidebar .ct-sidebar > .ct-widget { margin:0!important; box-shadow:none; }
body #sidebar#sidebar :is(.lwd-sidebar-promo,.lwd-sidebar-switch-ad,.lwd-regiolinks-banner) {
  box-sizing:border-box; border-radius:10px; box-shadow:none!important;
}
/* Content cards can grow when text or browser font sizes require it. */
body #sidebar#sidebar :is(.lwd-sidebar-newsletter,.lwd-sidebar-subscription:not(.lwd-sidebar-latest-posts),.lwd-sidebar-pel,.lwd-sidebar-switch-ad) {
  aspect-ratio:4 / 3; width:100%!important; max-width:100%!important; min-height:0;
}
body #sidebar#sidebar :is(.lwd-sidebar-newsletter,.lwd-sidebar-subscription:not(.lwd-sidebar-latest-posts)) .lwd-promo-card-link {
  box-sizing:border-box; min-height:100%; padding:18px; display:flex; flex-direction:column; justify-content:center; gap:0;
}
body #sidebar#sidebar :is(.lwd-sidebar-newsletter,.lwd-sidebar-subscription:not(.lwd-sidebar-latest-posts)) .lwd-promo-card-link > * { margin-block:0; }
body #sidebar#sidebar :is(.lwd-sidebar-newsletter,.lwd-sidebar-subscription:not(.lwd-sidebar-latest-posts)) .lwd-promo-card-link > .lwd-promo-title { margin-block:5px 8px; }
body #sidebar#sidebar :is(.lwd-sidebar-newsletter,.lwd-sidebar-subscription:not(.lwd-sidebar-latest-posts)) .lwd-promo-card-link > p:not(.lwd-promo-title) { margin-bottom:14px; }
body #sidebar#sidebar :is(.lwd-sidebar-newsletter,.lwd-sidebar-subscription:not(.lwd-sidebar-latest-posts)) .lwd-sidebar-button { margin-top:auto; }
/* The complete Stadsblad cover occupies the full sidebar width again. */
body #sidebar#sidebar .lwd-sidebar-image-only { padding:0; aspect-ratio:auto; background:transparent; border:0; box-shadow:0 5px 18px rgba(0,0,0,.08)!important; }
body #sidebar#sidebar .lwd-sidebar-image-only .lwd-sidebar-cover { display:block; width:100%; height:auto; margin:0; background:transparent; }
body #sidebar#sidebar .lwd-sidebar-image-only img { display:block; width:100%; height:auto; max-height:none; object-fit:contain; margin:0; border-radius:0; }
body #sidebar#sidebar :is(.lwd-sidebar-newsletter,.lwd-sidebar-subscription:not(.lwd-sidebar-latest-posts)) {
  display:block; padding:0; aspect-ratio:auto; min-height:75cqw; overflow:visible;
}
body #sidebar#sidebar :is(.lwd-sidebar-newsletter,.lwd-sidebar-subscription:not(.lwd-sidebar-latest-posts)) .lwd-promo-card-link { min-height:inherit; height:auto; }
/* Advertising uses its natural proportions without a padded grey frame. */
body #sidebar#sidebar figure.lwd-home-ad { width:100%!important; max-width:100%!important; margin:0!important; }
body #sidebar#sidebar .lwd-home-ad-link { box-sizing:border-box; display:flex; align-items:center; justify-content:center; aspect-ratio:auto; padding:0; background:transparent; border:0; border-radius:0; }
body #sidebar#sidebar .lwd-home-ad-image { width:100%!important; height:auto; max-height:none; object-fit:contain; }
body #sidebar#sidebar :is(.lwd-sidebar-latest-posts,.lwd-regiolinks-banner) { height:auto; }
@media(max-width:689.98px){
 body #sidebar#sidebar :is(.lwd-sidebar-newsletter,.lwd-sidebar-subscription:not(.lwd-sidebar-latest-posts),.lwd-sidebar-pel) { aspect-ratio:auto; min-height:220px; }
}

/* Keep coloured accents, remove neutral outlines and prevent extra widget margins. */
body #sidebar#sidebar .lwd-sidebar-subscription { border-left:0; border-right:0; border-bottom:0; }
body #sidebar#sidebar .ct-sidebar > .ct-widget > .liw-placement,
body #sidebar#sidebar .liw-enhancement > :is(.lwd-sidebar-ad-wrap,.lwd-sidebar-promo,.lwd-banner-combination,.lwd-regiolinks-banner) { margin-block:0!important; }

/* Shared reading edge, matching the newsletter and subscription cards. */
body #sidebar#sidebar .ct-sidebar { --liw-sidebar-inset:18px; }
body #sidebar#sidebar .lwd-sidebar-latest-posts { padding-inline:var(--liw-sidebar-inset); }
body #sidebar#sidebar :is(.lwd-sidebar-newsletter,.lwd-sidebar-subscription:not(.lwd-sidebar-latest-posts)) .lwd-promo-card-link { padding-inline:var(--liw-sidebar-inset); }
/* Account for the existing 3px blue border. */
body #sidebar#sidebar :is(.lwd-regiolinks-banner-head,.lwd-regiolinks-banner-categories) { padding-inline:calc(var(--liw-sidebar-inset) - 3px); }
/* The printed cover already contains a white page margin; only a small supplement is needed. */
body #sidebar#sidebar .lwd-sidebar-image-only { padding-inline:6px; }

/* Align sidebar advertisement artwork with the shared text inset. */
body #sidebar#sidebar .lwd-home-ad-link { padding-inline:var(--liw-sidebar-inset,18px); }
body #sidebar#sidebar .lwd-sidebar-pel .lwd-promo-card-link { padding-inline:var(--liw-sidebar-inset,18px); }

/* A single vertical gap when the sidebar follows the main column. */
@media(max-width:999.98px){
 body.home.home.home #main > .ct-container:has(> #sidebar),
 body #main > .ct-container:has(> #sidebar) { row-gap:14px!important; }
 body #main > .ct-container:has(> #sidebar) > article { margin-bottom:0!important; padding-bottom:0!important; }
 body #main > .ct-container > #sidebar { margin-top:0!important; padding-top:0!important; }
 body.home.home.home #main .entry-content > :last-child { margin-bottom:0!important; }
 body.home.home.home #main .entry-content { padding-bottom:0!important; }
}

/* Match the homepage's quarter-width hero rail on every desktop sidebar.
   Both templates use the same capped outer container; retain other pages' gutter. */
@layer liwwadders-desktop-home {
 @media(min-width:1000px){
  body:not(.home) #main > .ct-container:has(> #sidebar) {
   grid-template-columns:minmax(0,1fr) calc((100% - 4px) / 4)!important;
  }
  body:not(.home) #main > .ct-container > #sidebar {
   width:100%!important;max-width:none!important;min-width:0!important;
  }

 }
}

/* A grid's automatic min-content track can exceed its constrained outer box,
 * especially while final-domain images are unavailable before DNS cutover.
 * Constrain the actual track and each grid item; never conceal the overflow. */
body #sidebar#sidebar .ct-sidebar {
 grid-template-columns:minmax(0,1fr)!important;
 min-width:0!important;max-width:100%!important;
}
body #sidebar#sidebar .ct-sidebar > .ct-widget,
body #sidebar#sidebar :is(.liw-placement,.liw-enhancement,.liw-native-placement) {
 min-width:0!important;max-width:100%!important;width:100%;box-sizing:border-box;
}
