/* Articles listing, article card, Technical Area tab switcher and the single
   article page. Design tokens are copied from .project-item (css/projects.css)
   so a card in the articles grid reads as the same object as a project card.

   This file is linked before global.css and ux.css (header.php), so every
   selector here is scoped under .article-card / .ffj-tabs / .articles-pagination
   / .single-article__* and never relies on winning a specificity tie with them.
   Custom properties resolve regardless of sheet order. */

.article-card {
    background-color: #fff;
    border: 1px solid #eef1f4;
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

@media (min-width: 992px) {
    .article-card:hover {
        box-shadow: 0 12px 28px rgba(28, 83, 113, 0.12);
        border-color: #dce6ee;
    }
}

.article-card__thumb {
    display: block;
    background: var(--ffj-grey-02);
    overflow: hidden;
}

.article-card__thumb img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* Keeps rows level when an article has no featured image. */
.article-card__thumb--empty {
    height: 220px;
}

.article-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 0;
}

.article-card__date {
    display: block;
    margin-bottom: 8px;
    color: #7a7f99;
    font-size: 12px;
    line-height: 1.4;
}

.article-card__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
}

.article-card__title a {
    color: #24262b;
    text-decoration: none !important;
    line-height: 1.35;
}

.article-card__title a:hover {
    color: var(--ffj-blue-01);
}

/* A <div>, not a <p>: global.css gives every `.article p` a 20px bottom margin,
   which would open a gap at the foot of the card body. */
.article-card__excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    color: #4a5073;
    font-size: 14px;
    line-height: 1.5;
}

.article-card .card-footer {
    padding: 16px 20px 20px;
    background-color: transparent;
    border-top: none;
}

.article-card .card-footer .btn {
    display: block;
    width: 100%;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    padding: 11px 18px;
}

.article-card .card-footer .btn:hover {
    transform: none;
}

@media (max-width: 575.98px) {
    .article-card__thumb img,
    .article-card__thumb--empty {
        height: 180px;
    }
}

/* Tab switcher. .ffj-nav-pills (css/header.css) already paints the active pill
   brand red and Bootstrap supplies the white text, so only spacing and a focus
   ring are needed. The ring has to be a box-shadow: global.css kills every
   outline with `outline: none !important`, which no later sheet can undo.
   :focus-visible, not :focus - keyboard users get the ring, a mouse click
   does not flash it. */
.ffj-tabs {
    margin-bottom: 2rem;
}

.ffj-tabs .nav-link {
    padding: 10px 22px;
    font-weight: 700;
}

.ffj-tabs .nav-link:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(28, 83, 113, 0.25);
}

/* Paginator. Ported from css/pagination.scss - which has never been compiled or
   linked - with the nesting flattened, the literal #00334e swapped for the
   variable, and everything scoped so it cannot reach other pagination. */
.articles-pagination {
    margin-top: 2.5rem;
}

.articles-pagination .page-link {
    line-height: 1;
    color: var(--ffj-blue-02);
}

.articles-pagination .page-link:hover {
    color: var(--ffj-blue-02);
    opacity: 0.75;
}

.articles-pagination .page-link:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(28, 83, 113, 0.25);
}

.articles-pagination .page-item.active .page-link {
    color: #fff;
    background-color: var(--ffj-blue-02);
    border-color: var(--ffj-blue-02);
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}

.articles-pagination .page-item.disabled .page-link {
    color: #7a7f99;
}

/* Single article */
.single-article__date {
    display: block;
    margin-bottom: 1.5rem;
    color: #7a7f99;
    font-size: 14px;
}

.single-article__thumb {
    margin-bottom: 2rem;
    border-radius: 14px;
    overflow: hidden;
}

.single-article__thumb img {
    display: block;
    width: 100%;
    height: auto;
}

/* --- Article body (the_content on single.php) ---------------------------- */

/* Scoped to .single-article__body (the wrapper around the_content in single.php)
   so article typography cannot reach the h2/h3 of the documents page, the
   Why-KMEW pages or the panel/project templates, which all sit inside .article
   too. Rules that compete with global.css's `.article p` (0,1,1) additionally go
   through .article for the extra class - global.css loads later and would win a
   tie on source order. */

.single-article__body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 26px;
    font-weight: 700;
    color: var(--ffj-blue-02);
}

.single-article__body h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    font-size: 19px;
    font-weight: 700;
    color: #24262b;
}

.article .single-article__body p a {
    color: var(--ffj-blue-01);
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.article .single-article__body p a:hover {
    color: var(--ffj-red-01);
}

/* Callout boxes — single-cell tables in the source document. */
.article-note,
.article-cta {
    display: block;
    margin: 2rem 0;
    padding: 20px 24px;
    border-radius: 14px;
    background: var(--ffj-grey-02);
    border-left: 4px solid var(--ffj-blue-01);
}

.article-cta {
    background: #fff;
    border: 1px solid #eef1f4;
    border-left: 4px solid var(--ffj-red-01);
}

.article .article-note p,
.article .article-cta p {
    margin-bottom: 10px;
}

.article .article-note p:last-child,
.article .article-cta p:last-child {
    margin-bottom: 0;
}

.article .article-note__title,
.article .article-cta__title {
    font-weight: 700;
    color: var(--ffj-blue-02);
}

.article .article-cta__title {
    font-size: 20px;
}

/* Comparison table. Bootstrap's .table supplies borders and padding; only the
   header band, the row labels and a readable size are added here. */
.article-table {
    margin: 2rem 0;
    background: #fff;
}

.article-table th,
.article-table td {
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.5;
    vertical-align: top;
    border-color: #eef1f4;
}

.article-table thead th {
    background: var(--ffj-grey-02);
    color: var(--ffj-blue-02);
    border-bottom-width: 1px;
    white-space: nowrap;
}

.article-table tbody th {
    width: 22%;
    color: #24262b;
    font-weight: 700;
}

/* Source list and the editorial note. */
.article p.article-small {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.55;
    color: #4a5073;
}

@media (max-width: 575.98px) {
    .single-article__body h2 {
        font-size: 22px;
    }

    .article-table thead th {
        white-space: normal;
    }
}
