/* Written analyses: the article page, its cards in lists, and the editor.
   Reading text sits in a single 42rem column; the call panel and labels keep
   the mono micro-label role the rest of the ledger uses. */

/* Lexxy ships a light theme on :root. Re-pointed here, on the elements that
   hold editor or content, so the editor and rendered articles sit on the
   ledger's charcoal rather than white. */
.article-sheet,
.article-body {
  --lexxy-color-ink: var(--text-bright);
  --lexxy-color-ink-medium: var(--text);
  --lexxy-color-ink-light: var(--text-muted);
  --lexxy-color-ink-lighter: var(--border);
  --lexxy-color-ink-lightest: var(--bg-highlight);
  --lexxy-color-ink-inverted: var(--bg-surface);
  --lexxy-color-accent-dark: var(--primary);
  --lexxy-color-accent-medium: var(--success);
  --lexxy-color-accent-light: color-mix(in srgb, var(--primary) 35%, transparent);
  --lexxy-color-accent-lightest: color-mix(in srgb, var(--primary) 18%, transparent);
  --lexxy-color-canvas: var(--bg-surface);
  --lexxy-color-text: var(--text-bright);
  --lexxy-color-text-subtle: var(--text-muted);
  --lexxy-color-link: var(--success);
  --lexxy-color-code-bg: var(--bg-darker);
  --lexxy-color-table-header-bg: var(--bg-highlight);
  --lexxy-color-table-cell-border: var(--border);
  --lexxy-font-base: inherit;
  --lexxy-font-mono: var(--font-mono);
  --lexxy-focus-ring-color: var(--primary);
  --lexxy-radius: 2px;
  --lexxy-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

/* ============ Shared marks ============ */
.article-ticker {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-bright);
  text-decoration: none;
}
a.article-ticker:hover { color: var(--success); }

.article-stance,
.article-state {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.4;
  color: var(--text-muted);
}
.article-stance--buy { border-color: var(--success); color: var(--success); }
.article-stance--sell { border-color: var(--danger); color: var(--danger); }

.article-state--draft { border-color: var(--secondary); color: var(--secondary); }
.article-state--hidden { border-color: var(--danger); color: var(--danger); }
.article-state--live { border-color: var(--success); color: var(--success); }

/* ============ Article page ============ */
.article-page {
  padding: 2.25rem 0 4.5rem;
}

.article {
  max-width: 42rem;
  margin: 0 auto;
}

.article-owner-bar {
  max-width: 42rem;
  margin: 0 auto 2rem;
  padding: 0.9rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.article-owner-state {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
}
.article-owner-state a { color: var(--success); }
.article-owner-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.article-owner-tools form { margin: 0; }
.article-delete { color: var(--danger); }

.article-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
.article-asset-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.article-title {
  margin: 0.9rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 5.5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0.005em;
  color: var(--text-bright);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
@media (max-width: 768px) {
  .article-title {
    font-size: clamp(2.25rem, 9vw, 3.25rem);
    line-height: 1.05;
  }
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.article-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-highlight);
  display: grid;
  place-items: center;
}
.article-avatar img { width: 100%; height: 100%; object-fit: cover; }
.article-avatar-initial {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-bright);
}
.article-byline-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.article-author {
  font-weight: 600;
  color: var(--text-bright);
  text-decoration: none;
}
a.article-author:hover { color: var(--success); }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* The call this article stands behind, scored like every other call. */
.article-call {
  margin-top: 1.75rem;
  padding: 1.25rem 1.75rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.article-call-claim {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
}
.article-call-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.5rem;
  margin: 0.8rem 0 0;
}
.article-call-figures dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.article-call-figures dd {
  margin: 0.2rem 0 0;
  font-family: var(--font-mono);
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1.1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-bright);
}
.article-call-figures dd.positive { color: var(--success); }
.article-call-figures dd.negative { color: var(--danger); }
.article-call-figures dd.is-waiting,
.article-call-figures dd.is-absent {
  font-size: 1rem;
  color: var(--text-muted);
}
.article-call-basis,
.article-call-pending {
  margin: 0.75rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.article-call-pending {
  margin-top: 1.75rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--border);
  font-family: inherit;
  font-size: 1rem;
}

.article-body {
  margin-top: 2rem;
  font-size: 1.06rem;
  line-height: 1.72;
  color: var(--text-bright);
}
.article-body .lexxy-content h2,
.article-body .lexxy-content h3,
.article-body .lexxy-content h4 {
  margin-top: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
}
.article-body .lexxy-content a { color: var(--success); }
.article-body .lexxy-content blockquote {
  margin-inline: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text);
}

.article-foot {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.article-disclaimer {
  flex: 1 1 20rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ============ Share ============ */
.article-share {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.article-share-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.article-share-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.article-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.article-share-btn:hover,
.article-share-btn:focus-visible {
  color: var(--text);
  border-color: currentColor;
}
.article-share-btn--x:hover,        .article-share-btn--x:focus-visible        { color: var(--text); }
.article-share-btn--linkedin:hover, .article-share-btn--linkedin:focus-visible { color: #0a66c2; }
.article-share-btn--facebook:hover, .article-share-btn--facebook:focus-visible { color: #0866ff; }
.article-share-btn--whatsapp:hover, .article-share-btn--whatsapp:focus-visible { color: #25d366; }
.article-share-btn--telegram:hover, .article-share-btn--telegram:focus-visible { color: #26a5e4; }
.article-share-btn--reddit:hover,   .article-share-btn--reddit:focus-visible   { color: #ff4500; }
.article-share-btn.is-done {
  color: var(--success);
  border-color: var(--success);
}
.article-share-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--success);
}

/* ============ Lists ============ */
.article-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.article-list-sub {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}
.article-list-sub .trader-url { margin-left: 0.25rem; }

.article-list-section {
  padding: 1.5rem 0 3rem;
}

.article-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color 0.15s ease;
}
.article-card:hover { border-color: var(--text-dim); }
.article-card-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.article-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}
.article-card-title a {
  color: var(--text-bright);
  text-decoration: none;
}
.article-card-title a:hover { color: var(--success); }
.article-card-excerpt {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-meta {
  margin: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ============ Editor ============ */
.article-form-shell {
  max-width: 48rem;
}

.call-stance-options.article-stance-options {
  grid-template-columns: repeat(3, 1fr);
}
.call-stance-option--neutral:has(input:checked) {
  border-color: var(--text-muted);
  color: var(--text-bright);
  background: var(--bg-highlight);
}

.article-title-input {
  font-size: 1.1rem;
  font-weight: 600;
}

.article-fixed-claim {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

.article-sheet lexxy-editor {
  display: block;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg-surface);
  color: var(--text-bright);
}
.article-sheet lexxy-editor:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.article-sheet lexxy-editor .lexxy-editor__content {
  min-height: 22rem;
  padding: 1rem;
  line-height: 1.65;
}
.article-sheet lexxy-toolbar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

/* ── Comments ─────────────────────────────────────────────────────────── */
/* The comment styles themselves live with the video analysis comments in
   home.css; this sets the section on the article's measure and adds the
   author's edit/delete controls. */
.article-comments {
  max-width: 42rem;
  margin: 3rem auto 0;
}

.comment-owner-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.comment-owner-tools .comment-reply-btn {
  margin-left: 0;
}

.comment-owner-tools > :first-child.comment-reply-btn {
  margin-left: -0.5rem;
}

.comment-delete-form {
  display: inline;
}

.comment-delete-btn:hover {
  color: var(--danger);
}

.comment-edited {
  margin-top: 0.45rem;
  margin-right: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.comment-edit-form {
  margin-top: 0.5rem;
}

.comment-edit-form .comment-composer-foot .btn {
  margin: 0;
}
