body {
  min-height: 100vh;
  margin: 0;

  display: grid;
  
  grid-template:
    "header header" auto
    "sidebar main" 1fr
    "footer footer" auto
    / 180px 1fr;
}

/* 180px → 80px */
@media (max-width: 74em) {
  body {
    grid-template-columns: 80px 1fr;
  }
}

/* Sidebar moves below main */
@media (max-width: 35em), (orientation: portrait) {
  body {
    grid-template:
      "header" auto
      "main"   1fr
      "sidebar" auto
      "footer" auto
      / 1fr;
  }
}