.content-grid-col {
    padding: 30px;
    border-bottom: 1px solid var(--grey);
    border-right: 1px solid var(--grey);
}

.content-grid-col:nth-of-type(3n) { border-right: none; /* Remove right border for rightmost divs */ }

.content-grid-col:nth-last-of-type(-n+3) { border-bottom: none; /* Remove bottom border for last-row divs */ }

.content-grid-entry {
    font-size: 1rem;
    color: var(--main-text-color);
}

img.content-grid-icon {
    display: block;
    width: 110px;
    height: auto;
    object-fit: contain;
    margin-bottom: 1rem;
}

img.content-grid-img {
    max-width: 100%;
    object-fit: cover;
    object-position: center;
    height: auto;
}

.content-grid-heading {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.content-grid-description {
    color: var(--main-text-color);
    font-weight: 400;
    font-size: .75rem;
}

/* VARIANT: 2X2 Grid */
.grid-2x2.content-grid-col:nth-of-type(2n) { border-right: none; }
.grid-2x2.content-grid-col:nth-last-of-type(-n+3) { border-bottom: 1px solid var(--grey); }
.grid-2x2.content-grid-col:nth-last-of-type(-n+2) { border-bottom: none; }
.grid-2x2.content-grid-col:nth-of-type(3n) { border-right: 1px solid var(--grey); }
/* END-VARIANT: 2X2 Grid */

/* VARIANT: 1X4 Grid */
.grid-1x4.content-grid-col { border-bottom: none; }
.grid-1x4.content-grid-col:nth-of-type(3n) { border-right: 1px solid var(--grey); }
.grid-1x4.content-grid-col:nth-of-type(4n) { border-right: none; }
/* END-VARIANT: 1X4 Grid */

/* dark-theme setting */
.dark-theme .content-grid-col {
    border-bottom: 1px solid #334456;
    border-right: 1px solid #334456;
}

.dark-theme .content-grid-col:nth-of-type(3n) { border-right: none; /* Remove right border for rightmost divs */ }

.dark-theme .content-grid-col:nth-last-of-type(-n+3) { border-bottom: none; /* Remove bottom border for last-row divs */ }

.dark-theme .content-grid-entry { color: var(--body-white); }
/* End of dark-theme setting */

@media screen and (max-width: 767px) {
    .content-grid-col {
        border: none !important;
        border-bottom: 1px solid var(--grey) !important;
    }

    .content-grid-col:first-child { padding-top: 10px; }

    .content-grid-col.empty-grid {  display: none; }
    
    .content-grid-col:last-child { border-bottom: none !important; /* Remove bottom border for the second-to-last visible div */ }
}