.grid { position: absolute; display: grid; gap: 3.5rem; grid-template-columns: repeat(3, 20rem); grid-template-rows: 18rem 18rem; justify-self: center; justify-content: center; margin-top: 5rem; } .grid-item { background-color: #235573; padding: 1rem; border-radius: .4rem; box-shadow: 1rem 1rem 0rem #000000; } .grid-item:hover { transform: scale(1.01); } body #div-content { height: 42rem; position: relative; background-color: #1B4056; z-index: 2; padding-bottom: 10rem; } @media screen and (max-width: 1024px) { .grid { grid-template-columns: repeat(2, 20rem); grid-template-rows: repeat(3, 18rem); gap: 2.5rem; } .grid-item { box-shadow: 0.6rem 0.6rem 0rem #000000; } body #div-content { height: 64rem; } } @media screen and (max-width: 768px) { .grid { position: relative; grid-template-columns: minmax(0, 90%); grid-template-rows: auto; gap: 1.5rem; margin-top: 0rem; padding: 0 1rem; } .grid-item { min-height: 8rem; box-shadow: 0.45rem 0.45rem 0rem #000000; } body #div-content { height: auto; min-height: 30rem; padding-bottom: 5rem; } } @media screen and (max-width: 480px) { .grid { gap: 1rem; } .grid-item { box-shadow: 0.3rem 0.3rem 0rem #000000; } body #div-content { padding-bottom: 0rem; } } /* --- Ultrawide / Grand écran --- */ @media screen and (min-width: 1920px) { .grid { grid-template-columns: repeat(3, 26rem); grid-template-rows: auto; gap: 4.5rem; } body #div-content { height: auto; min-height: 55rem; padding-bottom: 12rem; } } @media screen and (min-width: 2560px) { .grid { grid-template-columns: repeat(3, 32rem); gap: 5rem; } body #div-content { min-height: 68rem; } } @media screen and (min-width: 3440px) { .grid { grid-template-columns: repeat(3, 38rem); gap: 6rem; } body #div-content { min-height: 82rem; } } /* Samsung Odyssey G9 — 5120x1440 */ @media screen and (min-width: 5120px) { .grid { grid-template-columns: repeat(3, 48rem); gap: 7rem; } body #div-content { min-height: 105rem; } }