/* Articles: X-style feed + reader on black. Builds on home.css tokens. */
.xa { --x-text: #E7E9EA; --x-muted: #71767B; --x-line: #2F3336; --x-card: #000; }
.xa body, body.xa { color: var(--x-text); }

/* top bar */
.xa-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 16px;
  background: rgba(0,0,0,.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.xa-top .a-back { width: 38px; height: 38px; }
.xa-top__title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: #fff; }

.xa-wrap { max-width: 600px; margin: 0 auto; min-height: 100vh; }

/* author row */
.x-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.x-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.x-author__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; min-width: 0; line-height: 1.25; }
.x-author__name { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 15px; color: var(--x-text); }
.x-badge { width: 18px; height: 18px; color: #1D9BF0; }
.x-author__handle { font-size: 15px; color: var(--x-muted); }

/* feed */
.x-post { padding: 10px 16px; }
.xa-feed .x-post:first-of-type { padding-top: 18px; }
.x-card { display: block; border: 1px solid var(--x-line); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; transition: background-color .2s, border-color .2s; }
.x-card:hover { background: #080808; border-color: #3E4144; }
.x-card__media { position: relative; display: block; aspect-ratio: 5 / 2; background: #111; }
.x-card__media img { width: 100%; height: 100%; object-fit: cover; }
.x-card__badge { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.75); color: #fff; font-size: 13px; font-weight: 700; }
.x-card__badge::before { content: "𝕏"; font-weight: 400; }
.x-card__body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.x-card__meta { font-size: 13px; color: var(--x-muted); }
.x-card__title { font-size: 17px; font-weight: 800; line-height: 1.3; color: #fff; }
.x-card__preview { font-size: 15px; line-height: 1.4; color: var(--x-text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }

/* reader */
.x-article { padding: 0 16px 24px; }
.x-cover { display: block; width: calc(100% + 32px); max-width: none; margin: 0 -16px; aspect-ratio: 5 / 2; object-fit: cover; background: #111; }
.x-title { margin: 22px 0 16px; font-family: var(--font-body); font-weight: 800; font-size: clamp(28px, 6.5vw, 36px); line-height: 1.15; letter-spacing: -0.02em; color: #fff; }
.x-article > .x-author { padding-bottom: 18px; margin-bottom: 8px; border-bottom: 1px solid var(--x-line); }

.x-body { font-size: 17px; line-height: 1.65; color: var(--x-text); overflow-wrap: anywhere; }
.x-body p, .x-body ul, .x-body ol, .x-body blockquote { margin: 0 0 18px; }
.x-body h2 { margin: 34px 0 12px; font-family: var(--font-body); font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -0.015em; color: #fff; }
.x-body h3 { margin: 30px 0 10px; font-family: var(--font-body); font-size: 22px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; color: #fff; }
.x-body h4 { margin: 24px 0 8px; font-size: 19px; font-weight: 700; color: #fff; }
.x-body strong { color: #fff; font-weight: 700; }
.x-body ul, .x-body ol { padding-left: 24px; }
.x-body li { margin-bottom: 6px; }
.x-body blockquote { padding-left: 16px; border-left: 3px solid #fff; color: #fff; }
.x-body a { color: #fff; text-decoration: underline; text-decoration-color: #555; text-underline-offset: 3px; }
.x-body a:hover { text-decoration-color: #fff; }

.x-figure { margin: 20px 0; }
.x-figure img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--x-line); background: #0A0A0A; }

.x-embed { display: flex; justify-content: space-between; align-items: center; margin: 16px 0; padding: 14px 16px; border: 1px solid var(--x-line); border-radius: 14px; font-size: 15px; font-weight: 600; color: #fff !important; text-decoration: none !important; }
.x-embed:hover { background: #0A0A0A; }

/* product button (replaces raw affiliate URLs; href keeps the exact ref link) */
.x-body .x-product {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 6px 0 22px; padding: 14px 16px;
  background: #fff; color: #000; border-radius: 16px;
  text-decoration: none; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s;
}
.x-body .x-product:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px #fff, 0 12px 36px -10px rgba(255,255,255,.3); }
.x-product__text { display: grid; gap: 1px; min-width: 0; }
.x-product__name { font-weight: 700; font-size: 16px; line-height: 1.25; color: #000; }
.x-product__domain { font-size: 13px; color: #5C5C5C; }
.x-product__cta { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; background: #000; color: #fff; font-size: 14px; font-weight: 600; }
.x-product__cta svg { width: 16px; height: 16px; }

.x-onx { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--x-muted); text-decoration: none; }
.x-onx:hover { color: #fff; }

/* newsletter band */
.xa-band { margin: 8px 16px 32px; padding: 26px 22px; border: 1px solid #fff; border-radius: 20px; display: grid; gap: 10px; }
.xa-feed .xa-band { margin-top: 28px; }
.xa-band h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; letter-spacing: .02em; text-transform: uppercase; color: #fff; }
.xa-band p { color: #A3A3A3; font-size: 15px; }
.xa-band .h-input { background: #0B0B0B; color: #fff; border: 1px solid #333; }
.xa-band .h-input:focus { border-color: #fff; box-shadow: none; }
.xa-band .h-submit { background: #fff; color: #000; }
.xa-band .h-submit:hover { background: #E6E6E6; }
.xa-band .form-status { font-size: 13px; color: #CFCFCF; }
.xa-band .form-status[data-state="ok"], .xa-band .form-status[data-state="error"] { color: #fff; }

.xa-foot { max-width: 600px; margin: 0 auto; padding: 24px 16px 40px; font-size: 12px; line-height: 1.6; color: #6B6B6B; text-align: center; }

/* reading progress (thin white line under the top bar) */
.xa-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.08); }
.xa-progress span { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(0); }

/* article meta + table of contents */
.x-meta { margin: -6px 0 18px; font-size: 14px; color: var(--x-muted); }
.x-toc { margin: 0 0 26px; border: 1px solid var(--x-line); border-radius: 16px; background: #050505; }
.x-toc summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center;
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #A3A3A3; }
.x-toc summary::-webkit-details-marker { display: none; }
.x-toc summary::after { content: "+"; font-size: 18px; color: #fff; transition: transform .25s; }
.x-toc[open] summary::after { transform: rotate(45deg); }
.x-toc ol { margin: 0; padding: 0 16px 14px 36px; display: grid; gap: 6px; }
.x-toc li { font-size: 15px; line-height: 1.4; color: #71767B; }
.x-toc li.toc-h3 { margin-left: 14px; font-size: 14px; }
.x-toc a { color: #E7E9EA; text-decoration: none; }
.x-toc a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.x-body h2, .x-body h3 { scroll-margin-top: 72px; }
