.holy-grail-layout { display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto auto auto; /* Header, Left, Main, Right, Footer for mobile */ grid-template-areas: "header" "left-sidebar" /* Stacked for mobile */ "main" "right-sidebar" /* Stacked for mobile */ "footer"; min-height: 100vh; } .header { grid-area: header; background-color: #f0f0f0; padding: 20px; } .main-content { grid-area: main; background-color: #fff; padding: 20px; } .left-sidebar { grid-area: left-sidebar; background-color: #e0e0e0; padding: 20px; } .right-sidebar { grid-area: right-sidebar; background-color: #d0d0d0; padding: 20px; } .footer { grid-area: footer; background-color: #f0f0f0; padding: 20px; } @media (min-width: 768px) { .holy-grail-layout { grid-template-areas: "header header header" "left-sidebar main right-sidebar" "footer footer footer"; grid-template-columns: 200px 1fr 200px; /* Example: fixed sidebars, flexible main */ grid-template-rows: auto 1fr auto; /* Only 3 rows for desktop */ } }