/* Articles: the listing pages (/articles/, /articles/<category>/) and article pages (/articles/<slug>).
   Article bodies come from Markdown (src/articles/*.md) and use the shared .prose layout. */

/* ---- page header (listing and article) */
.art-hero { display: grid; justify-items: center; gap: var(--space-4); max-width: 860px; margin-inline: auto; }
.art-hero h1 { margin-top: 0; font-weight: 700; text-wrap: balance; word-break: auto-phrase; }
.art-hero__crumb { font-size: 13px; color: var(--ink-muted); }
.art-hero__crumb a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.art-hero__lead { max-width: var(--text-max); color: var(--ink); line-height: 1.9; text-wrap: pretty; }
.art-hero__meta { font-size: 13px; color: var(--ink-muted); }

/* ---- listing: category links and cards */
.art-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-2); }
.art-chips a { padding: 8px 18px; border: 1px solid var(--line); border-radius: var(--radius-full); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; transition: background-color .2s ease-out, border-color .2s ease-out; }
.art-chips a:hover { border-color: var(--royal-blue); }
.art-chips a[aria-current="page"] { background: var(--royal-blue); border-color: var(--royal-blue); color: var(--on-blue); }

.art-list { padding-bottom: var(--space-24); }
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-6); margin: 0; padding: 0; list-style: none; }
.art-card a { display: grid; grid-template-rows: auto 1fr; height: 100%; overflow: hidden; border: 1px solid var(--line-soft); border-radius: var(--radius-xl); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.art-card a:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.art-card__media { aspect-ratio: 16 / 9; background: var(--blue-tint); }
.art-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art-card__body { display: grid; align-content: start; gap: var(--space-2); padding: var(--space-5) var(--space-6) var(--space-6); }
.art-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); font-size: 13px; color: var(--ink-muted); }
.art-card__cat { color: var(--royal-blue); font-weight: 700; }
.art-card :is(h2, h3) { font-size: 18px; line-height: 1.5; font-weight: 700; text-wrap: pretty; word-break: auto-phrase; }
.art-card p:last-child { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.7; color: var(--ink-muted); }
/* related articles under an article */
.art-related { padding-bottom: var(--space-24); }
.art-related::before { content: ""; display: block; height: 1px; margin-bottom: var(--space-12); background: var(--line); }  /* divider from the article's end */
.container:has(+ .art-related) > .prose { padding-bottom: var(--space-16); }  /* less space above the divider than the page's usual end gap */
.art-related > h2 { margin-bottom: var(--space-6); font-size: clamp(20px, 2.2vw, 24px); font-weight: 700; text-align: center; }
.art-related .art-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 360px)); justify-content: center; }  /* 1–2 cards sit centred */
.art-empty { padding: var(--space-12) 0; text-align: center; color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) { .art-card a { transition: none; } .art-card a:hover { transform: none; } }

/* ---- article body */
.art :is(ul, ol) { margin: 0; padding-left: 1.4em; }
.art li + li { margin-top: var(--space-2); }
.art a:not(.btn) { color: var(--royal-blue); text-decoration: underline; text-underline-offset: 3px; }
.art p, .art li { line-height: 1.9; }

/* table of contents */
.art-toc { display: grid; gap: var(--space-3); padding: var(--space-6); border: 1px solid var(--blue-tint); border-radius: var(--radius-xl); }
.art-toc h2 { font-size: 15px; }

/* numbered steps: the number sits in a blue circle beside each step heading */
.art-steps { counter-reset: step; list-style: none; padding-left: 0 !important; display: grid; gap: var(--space-6); }
.art-steps > li { counter-increment: step; position: relative; padding-left: 52px; margin-top: 0 !important; }
.art-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--royal-blue); color: var(--on-blue); font-family: var(--font-heading); font-weight: 700; }
.art-steps h3 { margin-top: 6px; margin-bottom: var(--space-1); font-size: 16px; }

/* FAQ: question as a heading, answer below */
.art-faq { display: grid; gap: var(--space-5); }
.art-faq h3 { margin-top: 0; font-size: 16px; }
.art-faq h3::before { content: "Q. "; color: var(--royal-blue); }

/* photos */
.art-figure { display: grid; gap: var(--space-2); margin: 0; }
.art-figure img { width: 100%; height: auto; border-radius: var(--radius-xl); }
.art-figure figcaption { font-size: 13px; color: var(--ink-muted); text-align: center; }

/* contact banner at the end of an article: blue panel (as on IT Services), message and buttons, then the licence facts */
.prose .art-cta { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: var(--space-8); margin-top: var(--space-4); padding: clamp(28px, 5vw, 44px); border-radius: var(--radius-xl); color: var(--on-blue); box-shadow: var(--shadow-md);
  background:
    radial-gradient(60% 80% at 100% 0%, #3b7be04d 0%, transparent 70%),
    radial-gradient(50% 60% at 0% 100%, #7397d240 0%, transparent 70%),
    linear-gradient(135deg, var(--royal-blue-deep) 0%, var(--royal-blue) 60%, #0a5cc8 100%); }
.art-cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(#ffffff2e 1px, transparent 1.4px); background-size: 22px 22px; -webkit-mask-image: radial-gradient(80% 70% at 100% 0%, #000 0%, transparent 75%); mask-image: radial-gradient(80% 70% at 100% 0%, #000 0%, transparent 75%); }
.art-cta__main { display: grid; gap: var(--space-4); justify-items: start; }
.art-cta__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--mist-light); }
.prose .art-cta h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.4; color: var(--on-blue); text-wrap: balance; word-break: auto-phrase; }
.art .art-cta p { line-height: 1.8; color: var(--on-blue-muted); }
.art .art-cta a:not(.btn) { color: var(--on-blue); text-decoration-color: #ffffff80; }
.art-cta__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.art-cta .btn { text-decoration: none; }
.art-cta .btn--primary { background: var(--surface); color: var(--royal-blue-deep); }
.art-cta .btn--primary:hover { background: var(--blue-tint); }
.art-cta .btn--outline { border-color: #ffffff8c; color: var(--on-blue); }
.art-cta .btn--outline:hover { background: #ffffff1a; }
.art-cta a:focus-visible { box-shadow: var(--focus-ring-inverse); }
/* facts: three cells separated by thin lines; they stack on narrow screens */
.art-cta__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); margin: 0; border-top: 1px solid #ffffff33; }
.art-cta__facts > div { display: grid; grid-template-rows: 1fr auto; gap: 2px; padding: var(--space-5) var(--space-4) 0 0; }  /* labels may wrap; values line up */
.art-cta__facts dt { font-size: 12px; line-height: 1.5; color: var(--on-blue-muted); }
.art-cta__facts dd { margin: 0; font-size: 15px; font-weight: 700; color: var(--on-blue); }

.art-sources { font-size: 14px; }
.art-sources li { line-height: 1.7; }

/* Tables (Markdown pipe tables in articles): scroll sideways on narrow screens instead of squeezing */
.art-table { margin-block: var(--space-6); overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.art-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.7; }
.art-table th, .art-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.art-table th { background: var(--cream); font-weight: 700; white-space: nowrap; }
.art-table tbody tr:last-child td { border-bottom: 0; }
.art-table td:first-child { font-weight: 700; }
