/* ==========================================================================
   Related Articles Section
   Location: css/related-articles.css
   Include on any article page that uses incl/related_articles.php
   ========================================================================== */

/* ── Container ──────────────────────────────────────────────────────────── */
.related-articles {
    margin: 2.5rem 0;
    padding: 0;
    background-color: #f5f6f7;
    border: 1px solid #e0e2e6;
    border-left: 4px solid #16a34a;   /* accent: matches site green */
    border-radius: 8px;
    overflow: hidden;
}

/* ── Header bar ─────────────────────────────────────────────────────────── */
.related-articles__header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1.25rem;
    background-color: #edf0f2;
    border-bottom: 1px solid #e0e2e6;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #374151;
}

.related-articles__icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: #16a34a;
}

/* ── List ───────────────────────────────────────────────────────────────── */
.related-articles__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-articles__item {
    border-bottom: 1px solid #e0e2e6;
}

.related-articles__item:last-child {
    border-bottom: none;
}

/* ── Link row ───────────────────────────────────────────────────────────── */
.related-articles__link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.18s ease;
}

.related-articles__link:hover,
.related-articles__link:focus-visible {
    background-color: #eaf4ee;
    outline: none;
}

.related-articles__link:focus-visible {
    box-shadow: inset 0 0 0 2px #16a34a;
}

/* ── Thumbnail ──────────────────────────────────────────────────────────── */
.related-articles__thumb-wrap {
    flex-shrink: 0;
    width: 100px;
    height: 68px;
    border-radius: 5px;
    overflow: hidden;
    background-color: #dde0e4;
}

.related-articles__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.related-articles__link:hover .related-articles__thumb {
    transform: scale(1.05);
}

/* ── Body ───────────────────────────────────────────────────────────────── */
.related-articles__body {
    flex: 1;
    min-width: 0;
}

.related-articles__tag {
    display: inline-block;
    margin-bottom: 0.3rem;
    padding: 0.15rem 0.55rem;
    background-color: #dcfce7;
    color: #15803d;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.related-articles__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    color: #111827;
	text-decoration: none;
}

.related-articles__link:hover .related-articles__title {
    color: #16a34a;
}

.related-articles__desc {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #6b7280;

    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ── Arrow ──────────────────────────────────────────────────────────────── */
.related-articles__arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: #9ca3af;
    transition: color 0.18s ease, transform 0.18s ease;
}

.related-articles__link:hover .related-articles__arrow {
    color: #16a34a;
    transform: translateX(3px);
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .related-articles__link {
        gap: 0.75rem;
        padding: 0.8rem 1rem;
    }

    .related-articles__thumb-wrap {
        width: 76px;
        height: 52px;
    }

    .related-articles__title {
        font-size: 0.87rem;
    }

    .related-articles__desc {
        display: none;   /* hide on very small screens to keep it tidy */
    }

    .related-articles__arrow {
        display: none;
    }
}



/* ==========================================================================
   Related Articles — Column Layout Variant  (.ra-cols)
   Location: css/related-articles.css  (append below existing .related-articles rules)

   Desktop  (>960px):  side-by-side vertical cards (thumbnail top, text bottom)
   Mobile  (≤960px):  stacked rows (thumbnail left, text right)
   ========================================================================== */

/* ── Container ──────────────────────────────────────────────────────────── */
.ra-cols {
    margin: 2.5rem 0;
    background-color: #f5f6f7;
    border: 1px solid #e0e2e6;
    border-left: 4px solid #16a34a;
    border-radius: 8px;
    overflow: hidden;
}

/* ── Header bar ─────────────────────────────────────────────────────────── */
.ra-cols__header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1.25rem;
    background-color: #edf0f2;
    border-bottom: 1px solid #e0e2e6;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #374151;
}

.ra-cols__icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: #16a34a;
}

/* ── List — desktop: equal-width columns ────────────────────────────────── */
.ra-cols__list {
    list-style: none;
    margin: 0;
    padding: 1rem;
    display: flex;
    flex-direction: row;         /* columns side by side */
    flex-wrap: wrap;
    gap: 1rem;
}

/* ── Each card — desktop ────────────────────────────────────────────────── */
.ra-cols__item {
    flex: 1 1 180px;             /* grow equally; min 180px before wrapping */
    min-width: 0;
}

/* ── Link — desktop: vertical card ─────────────────────────────────────── */
.ra-cols__link {
    display: flex;
    flex-direction: column;      /* thumbnail on top, body below */
    height: 100%;
    text-decoration: none;
    color: inherit;
    background-color: #fff;
    border: 1px solid #e0e2e6;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.ra-cols__link:hover,
.ra-cols__link:focus-visible {
    border-color: #16a34a;
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.12);
    outline: none;
}

.ra-cols__link:focus-visible {
    box-shadow: 0 0 0 2px #16a34a;
}

/* ── Thumbnail — desktop: full-width, fixed height ──────────────────────── */
.ra-cols__thumb-wrap {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background-color: #dde0e4;
    flex-shrink: 0;
}

.ra-cols__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ra-cols__link:hover .ra-cols__thumb {
    transform: scale(1.04);
}

/* ── Card body — desktop ────────────────────────────────────────────────── */
.ra-cols__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.85rem 1rem 1rem;
}

.ra-cols__tag {
    display: inline-block;
    margin-bottom: 0.4rem;
    padding: 0.15rem 0.55rem;
    background-color: #dcfce7;
    color: #15803d;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    align-self: flex-start;
}

.ra-cols__title {
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    color: #111827;
}

.ra-cols__link:hover .ra-cols__title {
    color: #16a34a;
}

.ra-cols__desc {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #6b7280;
    flex: 1;                     /* push read-more to bottom of card */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* "Read article →" label — desktop only ---------------------------------- */
.ra-cols__read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #16a34a;
    margin-top: auto;
    transition: gap 0.18s ease;
}

.ra-cols__link:hover .ra-cols__read-more {
    gap: 7px;
}

/* Row-mode arrow — hidden on desktop ─────────────────────────────────────── */
.ra-cols__row-arrow {
    display: none;
}

/* ==========================================================================
   ≤ 960px — collapse to row layout (thumbnail left, text right)
   ========================================================================== */
@media (max-width: 960px) {

    .ra-cols__list {
        flex-direction: column;  /* stack items vertically */
        padding: 0;
        gap: 0;
    }

    .ra-cols__item {
        flex: none;
        width: 100%;
        border-bottom: 1px solid #e0e2e6;
    }

    .ra-cols__item:last-child {
        border-bottom: none;
    }

    /* Link becomes a horizontal row ─────────────────────────────────────── */
    .ra-cols__link {
        flex-direction: row;     /* thumbnail left, body right */
        align-items: center;
        gap: 1rem;
        padding: 0.9rem 1.25rem;
        border: none;
        border-radius: 0;
        background-color: transparent;
        box-shadow: none;
    }

    .ra-cols__link:hover,
    .ra-cols__link:focus-visible {
        background-color: #eaf4ee;
        border-color: transparent;
        box-shadow: none;
    }

    .ra-cols__link:focus-visible {
        box-shadow: inset 0 0 0 2px #16a34a;
    }

    /* Thumbnail shrinks to row-mode size ─────────────────────────────────── */
    .ra-cols__thumb-wrap {
        width: 100px;
        height: 68px;
        flex-shrink: 0;
        border-radius: 5px;
    }

    /* Body loses column flex, becomes normal block ─────────────────────── */
    .ra-cols__body {
        padding: 0;
        flex: 1;
        display: block;
    }

    /* Hide the "Read article" inline label — arrow takes over ────────────── */
    .ra-cols__read-more {
        display: none;
    }

    /* Show row-mode arrow ─────────────────────────────────────────────────── */
    .ra-cols__row-arrow {
        display: block;
        flex-shrink: 0;
        width: 16px;
        height: 16px;
        color: #9ca3af;
        transition: color 0.18s ease, transform 0.18s ease;
    }

    .ra-cols__link:hover .ra-cols__row-arrow {
        color: #16a34a;
        transform: translateX(3px);
    }

    .ra-cols__desc {
        -webkit-line-clamp: 2;
        margin-bottom: 0;
    }
}

/* ── Very small screens ─────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .ra-cols__link {
        gap: 0.75rem;
        padding: 0.8rem 1rem;
    }

    .ra-cols__thumb-wrap {
        width: 76px;
        height: 52px;
    }

    .ra-cols__title {
        font-size: 0.87rem;
    }

    .ra-cols__desc {
        display: none;
    }

    .ra-cols__row-arrow {
        display: none;
    }
}
