/* Article styles are scoped so the landing's existing dialogs stay independent. */
:root {
  --article-surface: #fff;
  --article-text: #17242d;
  --article-muted: #58636c;
  --article-border: #e6e2df;
  --article-accent: #c94600;
  --article-soft: #fff3eb;
  --article-radius: 16px;
}
.articles-section { padding-block: 56px 24px; scroll-margin-top: 88px; }
.articles-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.articles-kicker { margin: 0 0 10px; color: var(--article-accent); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.articles-heading h2 { margin: 0; font-size: 36px; line-height: 1.15; color: var(--article-text); }
.articles-intro { max-width: 410px; margin: 0; color: var(--article-muted); font-size: 16px; line-height: 1.6; }
.articles-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.article-card { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--article-border); border-radius: var(--article-radius); background: var(--article-surface); overflow: hidden; transition: border-color .2s, transform .2s; }
.article-card:hover { border-color: var(--article-accent); transform: translateY(-3px); }
.article-card-button { padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; letter-spacing: inherit; cursor: pointer; }
.article-card-button::after { content: ''; position: absolute; inset: 0; border-radius: var(--article-radius); }
.article-card-button:focus-visible { outline: none; }
.article-card-button:focus-visible::after { outline: 3px solid var(--article-accent); outline-offset: -4px; }
.article-card img { display: block; width: 100%; height: 170px; object-fit: cover; }
.article-card-body { display: flex; flex-direction: column; flex: 1; padding: 22px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 12px; line-height: 1.5; color: var(--article-muted); }
.article-meta span:first-child { color: var(--article-accent); font-weight: 750; }
.article-card h3 { color: var(--article-text); margin: 14px 0 10px; font-size: 22px; font-weight: 800; line-height: 1.28; letter-spacing: -.025em; }
.article-card p { margin: 0 0 22px; color: var(--article-muted); font-size: 15px; line-height: 1.6; }
.article-read { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; color: var(--article-accent); font-size: 14px; font-weight: 800; }
.article-read span { font-size: 22px; line-height: 1; }
.articles-note { color: var(--article-muted); margin: 16px 0 0; font-size: 12px; line-height: 1.6; }
html.article-open { overflow: hidden; }
#article-dialog { width: min(780px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid var(--article-border); border-radius: var(--article-radius); background: var(--article-surface); color: var(--article-text); overflow: auto; overscroll-behavior: contain; box-shadow: 0 24px 100px #0005; }
#article-dialog::backdrop { background: #030914bb; backdrop-filter: blur(6px); }
.article-toolbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 8px 18px 8px 30px; background: var(--article-surface); border-bottom: 1px solid var(--article-border); color: var(--article-muted); font-size: 13px; font-weight: 700; }
.article-close { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; padding: 0; border: 1px solid var(--article-border); border-radius: 50%; background: var(--article-surface); color: var(--article-text); font-size: 30px; line-height: 1; cursor: pointer; }
.article-close:hover { background: var(--article-soft); }
.article-close:focus-visible { outline: 3px solid var(--article-accent); outline-offset: 2px; }
.article-cover { display: block; width: 100%; height: 240px; object-fit: cover; }
.article-content { padding: 32px 44px 40px; }
.article-content h2 { margin: 16px 0 24px; font-size: clamp(26px, 4vw, 36px); line-height: 1.18; letter-spacing: -.035em; color: var(--article-text); }
.article-content h3 { margin: 28px 0 10px; font-size: 22px; line-height: 1.35; color: var(--article-text); }
.article-content p, .article-content li { color: var(--article-text); font-size: 17px; line-height: 1.75; }
.article-content p { margin: 0 0 16px; }
.article-content ul { display: block; list-style: disc; padding-left: 22px; margin: 12px 0 24px; }
.article-content li { display: list-item; margin-bottom: 8px; }
.article-content .article-example { padding: 20px; background: var(--article-soft); border-left: 3px solid var(--article-accent); border-radius: 0 8px 8px 0; }
.article-content .article-editor-note { padding-top: 20px; margin: 30px 0 0; border-top: 1px solid var(--article-border); color: var(--article-muted); font-size: 13px; }
@media (max-width: 800px) {
  .articles-heading { align-items: start; flex-direction: column; gap: 14px; }
  .articles-intro { max-width: 550px; }
  .articles-grid { gap: 14px; }
  .article-card-body { padding: 18px; }
  .article-card h3 { font-size: 20px; }
}
@media (max-width: 650px) {
  .articles-section { padding-block: 36px 12px; }
  .articles-heading h2 { font-size: 30px; }
  .articles-grid { grid-template-columns: 1fr; gap: 18px; }
  .article-card img { height: 180px; }
  .article-card h3 { font-size: 23px; }
  .article-card-body { padding: 20px; }
  #article-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 12px; }
  .article-toolbar { padding-left: 20px; }
  .article-cover { height: 170px; }
  .article-content { padding: 24px 22px 30px; }
  .article-content p, .article-content li { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .article-card { transition: none; } .article-card:hover { transform: none; } }

.articles-status { padding: 24px 0; color: var(--article-muted); font-size: 16px; }
.articles-status[hidden] { display: none; }
.article-loading { padding-block: 24px; color: var(--article-muted); }
.article-retry { padding: 12px 18px; min-height: 44px; border: 1px solid var(--article-accent); border-radius: 8px; background: var(--article-soft); color: var(--article-text); font: inherit; cursor: pointer; }
.article-retry:focus-visible { outline: 3px solid var(--article-accent); outline-offset: 3px; }
.article-markdown { line-height: 1.8; overflow-wrap: anywhere; min-width: 0; }
.article-markdown h2, .article-markdown h3 { line-height: 1.3; margin: 1.6em 0 .7em; }
.article-markdown p, .article-markdown ul, .article-markdown ol { margin: 0 0 1.1em; }
.article-markdown ul, .article-markdown ol { padding-left: 1.5em; }
.article-markdown li { margin: .4em 0; }
.article-markdown blockquote { margin: 1.5em 0; padding: .8em 1.2em; border-left: 3px solid currentColor; background: #789b8210; border-radius: 0 12px 12px 0; }
.article-markdown blockquote p:last-child { margin-bottom: 0; }
.article-markdown table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.4em 0; font-size: .92em; }
.article-markdown th, .article-markdown td { padding: .7em .9em; border: 1px solid #82998c55; text-align: left; min-width: 110px; }
.article-markdown th { background: #789b8215; font-weight: 700; }
.article-markdown pre { overflow: auto; padding: 1em; border-radius: 12px; background: #789b8215; }
.article-markdown hr { border: 0; border-top: 1px solid #82998c55; margin: 2em 0; }
.article-figure { margin: 1.8em 0; }
.article-figure img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; border-radius: 14px; }
.article-figure figcaption { margin: .65em 0 0; font-size: .85em; line-height: 1.5; opacity: .7; }
