/* ==========================================================================
   ATXVisit Internal Link Manager — Frontend Related Posts Styles
   ========================================================================== */

/* ── Bottom Card Grid ───────────────────────────────────────────────────── */

.ail-related-posts {
    margin: 48px 0 24px;
    padding-top: 32px;
    border-top: 2px solid #e8e8e8;
    clear: both;
}

.ail-related-heading {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #333;
    margin: 0 0 20px;
}

.ail-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.ail-related-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    background: #fff;
}

.ail-related-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

.ail-related-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ail-related-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f5f5f5;
}

.ail-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.ail-related-card:hover .ail-related-thumb img {
    transform: scale(1.04);
}

.ail-related-card-body {
    padding: 14px 16px 16px;
}

.ail-related-card-body h4 {
    font-size: .95rem;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.4;
    color: #1a1a1a;
}

.ail-related-card-body p {
    font-size: .82rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* ── Inline "Read Next" Callout ─────────────────────────────────────────── */

.ail-read-next {
    /* Reset any inherited theme styles that could bleed in */
    all: initial;
    display: block;
    box-sizing: border-box;
    font-family: inherit;
    /* Actual styles */
    margin: 28px 0 !important;
    border-left: 4px solid #0073aa !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    background: #f7fbff !important;
    border-radius: 0 8px 8px 0 !important;
    overflow: hidden !important;
    clear: both !important;
    width: 100% !important;
}

.ail-read-next-label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #0073aa;
    padding: 10px 16px 0;
}

.ail-read-next-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px 14px;
    text-decoration: none;
    color: inherit;
}

.ail-read-next-inner:hover {
    background: #edf5fc;
}

.ail-read-next-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
}

.ail-read-next-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ail-read-next-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ail-read-next-text strong {
    font-size: .95rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

.ail-read-next-text span {
    font-size: .82rem;
    color: #666;
    line-height: 1.5;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .ail-related-grid {
        grid-template-columns: 1fr;
    }
    .ail-read-next-thumb {
        width: 56px;
        height: 56px;
    }
}
