*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:Arial,Helvetica,sans-serif;
    background:#eef2f5;
}

header{
    background:#00B600; 
    color:black;
    padding:30px;
    text-align:center;
}

/* ================================
   MAIN CONTENT GRID
   ================================ */
h1 {
 display:inline;
}
h2 {
 display:inline;
}
a:hover {
  background-color: yellow;
}
.grid{
    display:grid;
    /* Fits 4 columns when the container is at least ~1168px wide (including gaps) */
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
    gap:25px;
    /* Constrains the grid so 4 columns sit neatly side-by-side on desktop */
    max-width:1400px;
    margin:auto;
    padding:30px;

    /* Prevents short cards from stretching */
    align-items:start;
}

.card{
    width: fit-content;
    max-width: 300px;
    background:white;
    border-radius:10px;
    padding:20px;
    box-shadow:0 3px 12px rgba(0,0,0,.15);
justify-items: left; 
}

/* ================================
   ADVERTISING
   ================================ */

.ad-container{
    width:100%;
    max-width:1200px;
    margin-left:auto;
    margin-right:auto;
    text-align:center;
    box-sizing:border-box;
}

/* Advertisement below the header */
.ad-top{
    margin-top:20px;
    margin-bottom:5px;
    padding:0 20px;
}

/* Advertisement after the main content */
.ad-middle{
    margin-top:10px;
    margin-bottom:30px;
    padding:0 20px;
}

/* Advertisement immediately above footer */
.ad-bottom{
    margin-top:30px;
    margin-bottom:25px;
    padding:0 20px;
}

/* ================================
   FOOTER
   ================================ */

footer{
    background:#00B600;
    color:black;
    text-align:center;
    padding:20px;
}

/* ================================
   MOBILE
   ================================ */

@media (max-width:600px){

    header{
        padding:20px 15px;
    }

    .grid{
        padding:20px 15px;
        gap:20px;
    }

    .card{
        padding:18px;
    }

    .ad-container{
        padding:0 10px;
    }

}