/* Prevent image stretching: override main.css which sets width:100% without height:auto */
.image.fit img,
.image.main img {
    height: auto;
}

/* Social icon images in nav and footer */
.social-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-icon {
    width: 1.25em;
    height: 1.25em;
    object-fit: contain;
    display: block;
}

/* Posts grid layout inside auto-list-block */
.auto-list-block .posts {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    text-align: center;
    width: 100%;
    padding: 0;
}

.auto-list-block .posts > article {
    width: 50%;
    padding: 4rem;
    border-color: #eeeeee;
    border-left-width: 2px;
    border-style: solid;
    border-top-width: 2px;
    text-align: center;
}

.auto-list-block .posts > article > :last-child {
    margin-bottom: 0;
}

.auto-list-block .posts > article:nth-child(2n - 1) {
    border-left-width: 0;
}

.auto-list-block .posts > article:nth-child(-n + 2) {
    border-top-width: 0;
}

@media screen and (max-width: 980px) {
    .auto-list-block .posts > article {
        padding: 2.5rem;
        width: 50%;
    }
}

@media screen and (max-width: 736px) {
    .auto-list-block .posts > article {
        padding: 2rem;
        width: 100%;
    }

    .auto-list-block .posts > article:nth-child(2n - 1) {
        border-left-width: 2px;
    }

    .auto-list-block .posts > article:nth-child(-n + 2) {
        border-top-width: 2px;
    }

    .auto-list-block .posts > article:nth-child(n) {
        border-left-width: 0;
    }

    .auto-list-block .posts > article:nth-child(-n + 1) {
        border-top-width: 0;
    }
}

.list-section-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 2rem;
}

.list-section-grid .list-item {
    display: flex;
    flex-direction: column;
}

/* Specific adjustments for cards if needed */
.list-section-grid .list-item > * {
    width: 100%;
}

/* List Item Component */
.list-item-card {
    display: flex;
    gap: 2.25rem;
    align-items: flex-start;
}

.list-item-image {
    width: 25%;
    flex-shrink: 0;
}

.list-item-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px; /* Optional enhancement */
}

.list-item-content {
    flex-grow: 1;
}

@media screen and (max-width: 736px) {
    .list-item-image {
        width: 33.33333%;
    }
}

@media screen and (max-width: 480px) {
    .list-item-card {
        flex-direction: column;
    }
    
    .list-item-image {
        width: 100%;
        margin-bottom: 1.5rem;
    }
}
