/* =============================================
   AVR Post Preview – Responsive Grid Styles
   ============================================= */

/* Container UL */
.rig {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 -10px;          /* negative margin to compensate for li padding */
    padding: 0;
}

/* Individual post items */
.rig li {
    box-sizing: border-box;
    padding: 10px;            /* gutters */
}

/* Link block – fill the whole li */
.avrlink {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}
.avrlink:hover {
    opacity: 0.85;
}

/* Image wrapper – keeps aspect ratio & centres the image */
.img-wrapper {
    width: 100%;
    padding-top: 56.25%;      /* 16:9 aspect ratio; adjust if needed */
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: #f0f0f0;
}

.img-wrapper img.avrfeature {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;        /* crop to fill the box */
    display: block;
}

/* Post title */
.rig li h3 {
    margin: 10px 0 0;
    font-size: 1rem;
    line-height: 1.3;
    text-align: center;
    font-weight: 600;
}

/* ---------- Column classes ---------- */
.columns-2 li { flex: 0 0 50%;     max-width: 50%; }
.columns-3 li { flex: 0 0 33.333%; max-width: 33.333%; }
.columns-4 li { flex: 0 0 25%;     max-width: 25%; }
.columns-5 li { flex: 0 0 20%;     max-width: 20%; }
.columns-6 li { flex: 0 0 16.666%; max-width: 16.666%; }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 768px) {
    .columns-2 li,
    .columns-3 li,
    .columns-4 li,
    .columns-5 li,
    .columns-6 li {
        flex: 0 0 50%;         /* 2 columns on tablets */
        max-width: 50%;
    }
}

@media (max-width: 480px) {
    .columns-2 li,
    .columns-3 li,
    .columns-4 li,
    .columns-5 li,
    .columns-6 li {
        flex: 0 0 100%;        /* full width on mobiles */
        max-width: 100%;
    }
}