/* ========================================================================
   ob-news-card.css : THE news card of the public site (operator 2026-09-25).

   ONE layout everywhere a news card appears : the /blog index grid, the news
   strip of every landing (home, /platform, /academic) and the "Articles for
   you" / related-articles section (blog article pages). The reference is the
   /blog index card : thumbnail, category eyebrow, jurisdiction flag, title,
   2-line blurb, date + read time, 14px radius, dark hover.

   Markup lives in ONE place per render path :
     server : templates/partials/landing/news-card.html (macro news_card)
     client : static/js/ob-news-card.js (ObNewsCard.html, same markup)
   Never restyle a card from a page : change it here or nowhere.

   Self-contained on purpose : the blog pages do not load landing-v3.css, so
   everything below relies on design-tokens.css only.
   ======================================================================== */

/* Radius : the landing v4 card radius (.lv4-about-card, .landing-card family).
   The floor keeps it at 14px while --radius-lg still carries its legacy 4px
   value in design-tokens.css, and follows the token up once it grows. */
.ob-news-card { --ob-news-radius: max(var(--radius-lg), 14px); }

/* Shared grid : one gap for every card grid. A section only picks its column
   count through --ob-news-cols (3 by default, the news strip uses 4). */
.ob-news-grid {
    display: grid;
    grid-template-columns: repeat(var(--ob-news-cols, 3), minmax(0, 1fr));
    gap: var(--space-6);
}

.ob-news-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--ob-news-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.ob-news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(51,136,255,0.15);
    border-color: rgba(51,136,255,0.25);
}
/* Same 600x340 crop the Cloudinary URL asks for : the frame follows the image
   ratio instead of cropping it again to a fixed height. */
.ob-news-card-img {
    width: 100%;
    aspect-ratio: 600 / 340;
    overflow: hidden;
    background: var(--color-surface-hover);
    border-radius: calc(var(--ob-news-radius) - 1px) calc(var(--ob-news-radius) - 1px) 0 0;
    flex-shrink: 0;
}
.ob-news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ob-news-card-body {
    padding: var(--space-4) var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: var(--space-2);
    text-align: left;
    transition: background 0.25s ease, color 0.25s ease;
}
.ob-news-card:hover .ob-news-card-body {
    background: var(--color-dark-bg);
    color: #fff;
}
.ob-news-card-cat {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-accent);
}
.ob-news-card:hover .ob-news-card-cat { color: rgba(179,212,255,0.9); }
.ob-news-card-flag {
    display: inline-block;
    width: 1.2em;
    height: 0.9em;
    border-radius: 2px;
    margin-right: 7px;
    vertical-align: -0.08em;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.14);
    background-size: cover;
    background-position: 50%;
}
.ob-news-card-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    line-height: var(--line-height-tight);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ob-news-card:hover .ob-news-card-title { color: #fff; }
.ob-news-card-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.ob-news-card:hover .ob-news-card-desc { color: rgba(255,255,255,0.8); }
.ob-news-card-meta {
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--color-text-faint);
}
.ob-news-card:hover .ob-news-card-meta {
    color: rgba(255,255,255,0.6);
    border-top-color: rgba(255,255,255,0.2);
}
.ob-news-card-date { display: flex; align-items: center; gap: 4px; }
.ob-news-card-read { white-space: nowrap; flex-shrink: 0; }

@media (max-width: 1024px) {
    .ob-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .ob-news-grid { grid-template-columns: minmax(0, 1fr); }
}
