/* AgroFakt — Related articles widget. */

.afss-related {
    /* Hard reset position — żeby żaden sticky-sidebar JS / theme rule nie przykleił widgetu */
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: auto !important;

    clear: both;
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff5f0;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    border-top: 3px solid #dc1900;
    color: #222;
    overflow: hidden;
}

.afss-related * {
    box-sizing: border-box;
}

.afss-related__title {
    margin: 0 0 1.25rem 0;
    padding: 0;
    border: 0;
    color: #222;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
}

.afss-related__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.afss-related__item {
    margin: 0;
    padding: 0;
    display: block;
}

.afss-related__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.afss-related__card:hover,
.afss-related__card:focus-visible {
    transform: translateY(-2px);
    border-color: #dc1900;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
}

.afss-related__image-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 5 / 3;
    background: #eee;
    overflow: hidden;
    margin: 0;
}
.afss-related__image-wrap--empty {
    background: linear-gradient(135deg, #eee 0%, #ddd 100%);
}

.afss-related__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    margin: 0;
}
.afss-related__card:hover .afss-related__image {
    transform: scale(1.04);
}

.afss-related__title-text {
    display: block;
    padding: 0.7rem 0.8rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    color: #222;
    flex: 1;
}

@media (max-width: 900px) {
    .afss-related__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .afss-related {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    .afss-related__title {
        font-size: 1.1rem;
        margin-bottom: 0.85rem;
    }
    .afss-related__title-text {
        font-size: 0.85rem;
        padding: 0.55rem 0.65rem 0.75rem;
    }
}
