/* ==========================================================================
   Flavor Affiliate — Internal Links (Related Posts Cards)
   ========================================================================== */

/* --- z-index tokens --- */
:root {
    --flv-z-related-card: 1;
}

/* --- Related Posts Section --- */
.flavor-related-posts {
    margin: 2.5em 0 1em;
    padding: 0;
    clear: both;
}

.flavor-related-posts__heading {
    font-size: 1.15em;
    font-weight: 700;
    margin: 0 0 .9em;
    padding: .5em .8em;
    background: #f7f7f7;
    border-left: 4px solid var(--color_main, #2563EB);
    line-height: 1.4;
}

.flavor-related-posts__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .85em;
}

.flavor-related-card {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s ease, transform .15s ease;
}

.flavor-related-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
    transform: translateY(-2px);
}

.flavor-related-card__img {
    flex: 0 0 140px;
    min-height: 100px;
    overflow: hidden;
    background: #f0f0f0;
}

.flavor-related-card__img img,
.flavor-related-card__img .flavor-related-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.flavor-related-nothumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75em;
    color: #aaa;
    background: #f5f5f5;
}

.flavor-related-card__body {
    flex: 1;
    padding: .75em 1em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.flavor-related-card__title {
    font-size: .95em;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: .35em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flavor-related-card__excerpt {
    font-size: .8em;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 600px) {
    .flavor-related-posts__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .flavor-related-posts__grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .flavor-related-card {
        flex-direction: column;
    }
    .flavor-related-card__img {
        flex: 0 0 auto;
        height: 140px;
    }
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
    .flavor-related-posts__heading {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    .flavor-related-card {
        background: #1e1e1e;
        border-color: #333;
        color: #e0e0e0;
    }
    .flavor-related-card__img {
        background: #2a2a2a;
    }
    .flavor-related-nothumb {
        background: #2a2a2a;
        color: #555;
    }
    .flavor-related-card__excerpt {
        color: #9ca3af;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .flavor-related-card {
        transition: none;
    }
    .flavor-related-card:hover {
        transform: none;
    }
}
