/* =============================================================================
   The /Article/ section - index, category listings and the plain article page

   Rides on the tf- shell in tyres-for.css (head band, alternating sections,
   tokens) and adds the .art- pieces: the card grid, the category chips, the
   year archive, and the reading layout with its contents rail, author card
   and tyre card. Mobile first; the rail only appears from 992px.
   ========================================================================== */

.art { --art-rail: 300px; --art-main: 780px; }

/* Measured things sit in the mono face like everywhere else on the shell. */
.art-card__meta,
.art-year__y,
.art-year__n,
.art-year__date,
.art-cat__n,
.art-tyre__n,
.art-chip b,
.art-pager__of,
.art-byline__item { font-family: var(--tf-mono); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Category chips (head band and article footer)
   ========================================================================== */

.art-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 0;
}

.art-chips--head { margin: 0 0 12px; }

.art-chip,
.art-chip:link,
.art-chip:visited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    color: #e6ecf1;
    text-decoration: none;
    white-space: nowrap;
}

.art-chip b { font-weight: 500; color: var(--tf-muted-on-ink); font-size: 0.74rem; }

.art-chip:hover,
.art-chip:focus { border-color: var(--tf-cyan); color: #fff; text-decoration: none; }

/* Chips on paper (the "filed under" line). */
.art-chip--ink,
.art-chip--ink:link,
.art-chip--ink:visited { border-color: var(--tf-line); color: var(--tf-text); }
.art-chip--ink:hover,
.art-chip--ink:focus { border-color: var(--tf-cyan); color: var(--tf-text); }

/* ==========================================================================
   Cards
   ========================================================================== */

.art-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 18px;
}

a.art-card,
a.art-card:link,
a.art-card:visited {
    display: flex;
    flex-direction: column;
    background: var(--tf-paper);
    border: 1px solid var(--tf-line);
    border-radius: 6px;
    overflow: hidden;
    color: var(--tf-text);
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

a.art-card:hover,
a.art-card:focus {
    border-color: var(--tf-cyan);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(14, 18, 22, 0.08);
    text-decoration: none;
    color: var(--tf-text);
}

.art-card__shot {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--tf-mist);
    overflow: hidden;
}

.art-card__shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* A card with no picture: the text carries it, on the mist ground. */
a.art-card--text,
a.art-card--text:link,
a.art-card--text:visited { background: var(--tf-mist); justify-content: center; }
.art-card--text .art-card__body { padding: 18px 18px 20px; }
.art-card--text .art-card__title { font-size: 1.12rem; }
.art-card__kind { color: var(--tf-mid); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.art-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
}

.art-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 0.72rem;
    color: var(--tf-muted);
    letter-spacing: 0.01em;
}

.art-card__cat { color: var(--tf-cyan); font-weight: 600; }

.art-card__title {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--tf-text);
}

a.art-card:hover .art-card__title { color: var(--tf-cyan); }

.art-card__sum {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--tf-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* The lead card in the latest strip. */
.art-card--lead .art-card__title { font-size: 1.25rem; }
.art-card--lead .art-card__sum { -webkit-line-clamp: 4; }

@media (min-width: 560px) {
    .art-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .art-grid--latest .art-card--lead { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
    .art-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
    .art-grid--latest { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .art-grid--latest .art-card--lead { grid-column: 1 / 3; grid-row: 1 / 3; }
    .art-card--lead .art-card__shot { aspect-ratio: 16 / 9; flex: 1 1 auto; }
    .art-card--lead .art-card__body { padding: 18px 20px 20px; }
    .art-card--lead .art-card__title { font-size: 1.5rem; }
    .art-grid--related { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
    .art-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .art-grid--latest { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .art-grid--latest .art-card--lead { grid-column: 1 / 3; grid-row: 1 / 3; }
}

/* ==========================================================================
   Section heads with an "all N" button, the site-page links
   ========================================================================== */

.art-sec__head {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

a.art-sec__all,
a.art-sec__all:link,
a.art-sec__all:visited {
    align-self: flex-start;
    padding: 9px 16px;
    font-size: 0.86rem;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .art-sec__head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; }
    a.art-sec__all { align-self: flex-end; }
}

.art-links {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 18px;
}

a.art-link,
a.art-link:link,
a.art-link:visited {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--tf-line);
    border-radius: 6px;
    background: var(--tf-paper);
    color: var(--tf-text);
    font-weight: 700;
    text-decoration: none;
}

a.art-link:hover,
a.art-link:focus { border-color: var(--tf-cyan); color: var(--tf-cyan); text-decoration: none; }

@media (min-width: 560px) { .art-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .art-links { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ==========================================================================
   The year archive
   ========================================================================== */

.art-years { margin-top: 18px; border-top: 1px solid var(--tf-line); }

.art-year { border-bottom: 1px solid var(--tf-line); }

.art-year > summary {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 14px 4px;
    cursor: pointer;
    list-style: none;
}

.art-year > summary::-webkit-details-marker { display: none; }

.art-year__y { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.03em; color: var(--tf-text); }
.art-year__n { font-size: 0.78rem; color: var(--tf-muted); }
.art-year > summary .fa { margin-left: auto; color: var(--tf-muted); transition: transform 0.15s; }
.art-year[open] > summary .fa { transform: rotate(180deg); }

.art-year__list {
    list-style: none;
    margin: 0;
    padding: 0 4px 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px 24px;
}

.art-year__list li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0;
    border-top: 1px dashed var(--tf-line);
    font-size: 0.92rem;
    line-height: 1.4;
}

.art-year__list a { color: var(--tf-text); text-decoration: none; }
.art-year__list a:hover { color: var(--tf-cyan); text-decoration: underline; }
.art-year__date { font-size: 0.72rem; color: var(--tf-muted); }

@media (min-width: 768px) {
    .art-year__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   Category page: pagination, category tiles
   ========================================================================== */

.art-page-of { margin: 0; }
.art-empty { margin: 18px 0 0; color: var(--tf-muted); }

.art-pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
}

.art-pager__of { font-size: 0.8rem; color: var(--tf-muted); text-align: center; }
a.art-pager__prev { justify-self: start; }
a.art-pager__next { justify-self: end; }
a.art-pager__prev, a.art-pager__next { padding: 10px 16px; font-size: 0.9rem; }

.art-cats {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 18px;
}

a.art-cat,
a.art-cat:link,
a.art-cat:visited {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--tf-line);
    border-radius: 6px;
    background: var(--tf-paper);
    color: var(--tf-text);
    text-decoration: none;
}

a.art-cat:hover,
a.art-cat:focus { border-color: var(--tf-cyan); text-decoration: none; color: var(--tf-text); }
a.art-cat:hover .art-cat__name { color: var(--tf-cyan); }

.art-cat__name { font-weight: 700; font-size: 1rem; }
.art-cat__n { font-size: 0.74rem; color: var(--tf-muted); }
.art-cat__desc { font-size: 0.85rem; line-height: 1.45; color: var(--tf-muted); }

@media (min-width: 560px) { .art-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .art-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.art-back { margin: 22px 0 0; font-size: 0.92rem; }
.art-back a { color: var(--tf-text); font-weight: 700; text-decoration: none; }
.art-back a:hover { color: var(--tf-cyan); text-decoration: underline; }

/* ==========================================================================
   Single article: the head band
   ========================================================================== */

.art-head { padding-bottom: 26px; }
.art-head__title { max-width: 900px; font-size: 1.75rem; }
.art-head__lede { max-width: min(var(--tr-measure), 760px); font-size: 1.05rem; }

.art-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

a.art-byline__who,
a.art-byline__who:link,
a.art-byline__who:visited {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}

.art-byline__who img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, 0.25); }
.art-byline__who > span { display: flex; flex-direction: column; line-height: 1.2; }
.art-byline__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tf-muted-on-ink); }
.art-byline__who b { font-size: 0.95rem; }
a.art-byline__who:hover b { text-decoration: underline; }

.art-byline__item { font-size: 0.78rem; color: #cfd8de; white-space: nowrap; }
.art-byline__item .fa { color: var(--tf-muted-on-ink); margin-right: 3px; }

@media (min-width: 768px) {
    .art-head { padding-bottom: 32px; }
    .art-head__title { font-size: 2.4rem; }
}

/* Reading progress, under the sticky site nav. */
.art-progress {
    position: sticky;
    top: 0;
    z-index: 5;
    height: 3px;
    background: transparent;
    pointer-events: none;
}

.art-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--tf-cyan);
    transition: width 0.08s linear;
}

/* ==========================================================================
   Single article: the reading layout
   ========================================================================== */

.art-read { padding: 0; }

.art-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: 24px;
    padding-bottom: 36px;
}

.art-main { min-width: 0; }

@media (min-width: 992px) {
    .art-layout {
        grid-template-columns: minmax(0, var(--art-main)) var(--art-rail);
        justify-content: space-between;
        gap: 48px;
        padding-top: 34px;
        padding-bottom: 48px;
    }
    .art-layout--solo { grid-template-columns: minmax(0, var(--art-main)); justify-content: start; }
    .art-side__stick { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 18px; }
}

/* The body. Articles are CKEditor HTML, sometimes with Bootstrap rows and
   figures inside, so this styles the typography and leaves the layout
   classes alone. */
.art-body {
    max-width: var(--tr-measure);
    font-size: 1.04rem;
    line-height: 1.75;
    color: var(--tf-text);
    overflow-wrap: break-word;
}

.art-body > p,
.art-body section > p { margin: 0 0 22px; }

.art-body h2,
.art-body h3,
.art-body h4 {
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.2;
    color: var(--tf-text);
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    background: none;
    scroll-margin-top: 90px;
}

.art-body h2 { font-size: 1.5rem; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--tf-line); }
.art-body h3 { font-size: 1.2rem; margin-top: 30px; }
.art-body h4 { font-size: 1.05rem; margin-top: 24px; }
.art-body > h2:first-child, .art-body > span:first-child + h2 { margin-top: 0; padding-top: 0; border-top: 0; }

.art-body a:not([class]) { color: var(--tf-text); text-decoration: underline; text-decoration-color: var(--tf-cyan); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.art-body a:not([class]):hover { color: var(--tf-cyan); }

.art-body img { max-width: 100%; height: auto; border-radius: 4px; }
.art-body > p > img:only-child { display: block; margin: 0 auto; }
.art-body figure { margin: 24px 0; max-width: 100%; }
.art-body figure.image { display: block; }
.art-body figcaption { font-size: 0.82rem; line-height: 1.45; color: var(--tf-muted); margin-top: 8px; }

.art-body ul, .art-body ol { margin: 0 0 22px; padding-left: 26px; }
.art-body li { margin: 0 0 6px; }
.art-body li > p { margin-bottom: 6px; }

.art-body blockquote {
    margin: 26px 0;
    padding: 4px 0 4px 18px;
    border-left: 3px solid var(--tf-cyan);
    font-size: 1.08rem;
    color: var(--tf-muted);
}

.art-body hr { border: 0; border-top: 1px solid var(--tf-line); margin: 32px 0; }

.art-body .art-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 22px; }
.art-body table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.art-body th, .art-body td { padding: 8px 10px; border-bottom: 1px solid var(--tf-line); text-align: left; vertical-align: top; }
.art-body th { font-weight: 700; background: var(--tf-mist); }

.art-body iframe { max-width: 100%; }
.art-body .youtube-embed, .art-body .ratio { margin: 0 0 22px; }

.art-foot { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--tf-line); }
.art-foot__filed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 0.85rem; color: var(--tf-muted); }

/* ==========================================================================
   Contents: folded above the body on narrow screens, a rail beside it on wide
   ========================================================================== */

.art-toc__list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.art-toc__list li { border-top: 1px solid var(--tf-line); }
.art-toc__list li:first-child { border-top: 0; }
.art-toc__list a { display: block; padding: 7px 0; font-size: 0.9rem; line-height: 1.4; color: var(--tf-text); text-decoration: none; }
.art-toc__list a:hover { color: var(--tf-cyan); }
.art-toc__list .art-toc__l3 a { padding-left: 16px; font-size: 0.84rem; color: var(--tf-muted); }
.art-toc__list a.is-active { color: var(--tf-cyan); font-weight: 700; }

.art-toc--fold {
    margin: 0 0 22px;
    border: 1px solid var(--tf-line);
    border-radius: 6px;
    background: var(--tf-mist);
}

.art-toc--fold > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.art-toc--fold > summary::-webkit-details-marker { display: none; }
.art-toc--fold > summary .fa:first-child { color: var(--tf-cyan); }
.art-toc__caret { margin-left: auto; color: var(--tf-muted); transition: transform 0.15s; }
.art-toc--fold[open] .art-toc__caret { transform: rotate(180deg); }
.art-toc--fold .art-toc__list { padding: 0 14px 10px; }

.art-toc--rail { display: none; }

@media (min-width: 992px) {
    .art-toc--fold { display: none; }
    .art-toc--rail { display: block; max-height: calc(100vh - 60px); overflow-y: auto; padding-bottom: 8px; }
    .art-toc__title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--tf-muted); margin-bottom: 8px; }
    .art-toc--rail .art-toc__list li { border-top: 0; }
    .art-toc--rail .art-toc__list a { padding: 5px 0 5px 12px; border-left: 2px solid var(--tf-line); font-size: 0.86rem; }
    .art-toc--rail .art-toc__list .art-toc__l3 a { padding-left: 24px; }
    .art-toc--rail .art-toc__list a.is-active { border-left-color: var(--tf-cyan); }
}

/* ==========================================================================
   Rail cards: the author, the tyre
   ========================================================================== */

.art-author,
.art-tyre {
    border: 1px solid var(--tf-line);
    border-radius: 6px;
    background: var(--tf-paper);
    padding: 16px;
}

.art-author__label,
.art-tyre__label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--tf-muted); margin-bottom: 12px; }

.art-author__who { display: flex; align-items: center; gap: 12px; }
.art-author__who img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.art-author__who div { display: flex; flex-direction: column; line-height: 1.25; }
.art-author__who b { font-size: 1rem; }
.art-author__who span { font-size: 0.8rem; color: var(--tf-muted); }
.art-author__blurb { margin: 12px 0 0; font-size: 0.88rem; line-height: 1.55; color: var(--tf-muted); }

.art-author__social { display: flex; gap: 8px; margin-top: 12px; }
.art-author__social a { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--tf-line); border-radius: 50%; color: var(--tf-text); text-decoration: none; }
.art-author__social a:hover { border-color: var(--tf-cyan); color: var(--tf-cyan); }

a.art-author__more { display: inline-block; margin-top: 12px; font-size: 0.88rem; font-weight: 700; color: var(--tf-text); text-decoration: none; }
a.art-author__more:hover { color: var(--tf-cyan); }

a.art-tyre__main,
a.art-tyre__main:link,
a.art-tyre__main:visited { display: flex; align-items: center; gap: 12px; color: var(--tf-text); text-decoration: none; }
a.art-tyre__main:hover .art-tyre__name { color: var(--tf-cyan); }
.art-tyre__img { width: 72px; height: 72px; object-fit: contain; flex: 0 0 auto; }
.art-tyre__name { font-size: 1rem; line-height: 1.3; }

.art-tyre__facts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.art-tyre__facts li { display: flex; flex-direction: column; border-left: 2px solid var(--tf-cyan); padding-left: 10px; font-size: 0.74rem; color: var(--tf-muted); line-height: 1.3; }
.art-tyre__n { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.04em; color: var(--tf-text); line-height: 1.1; margin-bottom: 2px; }

a.art-tyre__btn { display: block; margin-top: 14px; padding: 10px 14px; font-size: 0.88rem; text-align: center; }
a.art-tyre__brand { display: inline-block; margin-top: 10px; font-size: 0.82rem; color: var(--tf-muted); }
a.art-tyre__brand:hover { color: var(--tf-cyan); }

/* Site pages (About, Legal Notice) keep the head band and the column, with
   nothing beside them. */
.art-layout--solo .art-body { max-width: var(--tr-measure); }

/* Who has cited or reported this article (tr_recognition_box): the same box
   the test pages carry, on the tf- tokens. */
.art .ta-cited { margin: 28px 0 26px; padding: 14px 18px; background: var(--tf-paper); border: 1px solid var(--tf-line); border-left: 3px solid var(--tf-cyan); border-radius: 6px; }
.art .ta-cited .ta-eyebrow { margin: 0 0 4px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tf-cyan); }
.art .ta-cited__sub { margin: 10px 0 6px; color: var(--tf-muted); font-size: .72rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.art .ta-cited__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.art .ta-cited__list li { margin: 0; padding: 0; font-size: .88rem; line-height: 1.45; }
.art .ta-cited__who { font-weight: 700; }
.art .ta-cited__what { margin-left: 6px; color: var(--tf-muted); font-size: .78rem; }
.art .ta-cited__list a { display: block; font-weight: 600; }
.art .ta-cited__more { display: inline-block; margin-top: 12px; font-size: .82rem; font-weight: 650; }

