/* ==========================================================
   CapitalistME – Modern article layout
   Scoped under .am-page so no other page is affected.
   Load AFTER style.css
   ========================================================== */

.am-page {
  --am-ink: #111827;
  --am-text: #1f2937;
  --am-muted: #6b7280;
  --am-line: #e5e7eb;
  --am-soft: #f6f7f9;
  --am-navy: #212f5c;
  --am-red: #b30938;
  --am-red-soft: #fdf0f3;
  --am-amber: #b45309;
  --am-amber-soft: #fff7ed;
  --am-green: #047857;
  --am-green-soft: #ecfdf5;
  --am-radius: 16px;
  --am-serif: "GB", Georgia, "Times New Roman", serif;
  --am-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #fff;
}

.am-page main {
  margin: 0;
}

.am-page .am-wrap,
.am-page .am-wrap *:not(i) {
  font-family: var(--am-sans);
}

.am-page .am-wrap a,
.am-page .am-wrap main a {
  font-family: inherit;
}

/* Keep Font Awesome icon fonts intact (carried over from the site's icon setup) */
.am-page .am-wrap .fab,
.am-page .am-wrap .fa-brands {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400;
}
.am-page .am-wrap .fa-solid,
.am-page .am-wrap .fas {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900;
}
.am-page .am-wrap .fa-regular,
.am-page .am-wrap .far {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 400;
}

/* ---------- reading progress ---------- */
.am-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: transparent;
  z-index: 98;
  pointer-events: none;
}
.am-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--am-red), #df4a2c);
  transition: width 0.1s linear;
}

/* ---------- layout ---------- */
.am-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.am-hero {
  max-width: 820px;
  margin: 0 auto;
}

.am-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  margin-top: 28px;
}

@media (min-width: 1024px) {
  .am-hero { max-width: 996px; }
  .am-title { max-width: 900px; }
  .am-wrap { padding-top: 44px; }
  .am-grid {
    grid-template-columns: 220px minmax(0, 720px);
    justify-content: center;
    gap: 56px;
    margin-top: 40px;
  }
  .am-aside { order: -1; }
}

/* ---------- breadcrumb + tags ---------- */
.am-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--am-muted);
  margin-bottom: 18px;
}
.am-crumbs a { color: var(--am-muted) !important; }
.am-crumbs a:hover { color: var(--am-red) !important; }
.am-crumbs i { font-size: 9px; opacity: 0.6; }

.am-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.am-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--am-red);
  color: #fff !important;
}
.am-tag.alt {
  background: var(--am-soft);
  color: var(--am-navy) !important;
  border: 1px solid var(--am-line);
}

/* ---------- headline ---------- */
.am-title {
  font-family: var(--am-serif) !important;
  font-weight: 700;
  font-size: clamp(1.85rem, 4.6vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--am-ink);
  margin: 0 0 16px;
  text-wrap: balance;
}
.am-dek {
  font-family: var(--am-serif) !important;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  line-height: 1.5;
  color: #4b5563;
  margin: 0 0 26px;
}

/* ---------- byline ---------- */
.am-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--am-line);
  border-bottom: 1px solid var(--am-line);
}
.am-author {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.am-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--am-line);
}
.am-author-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--am-ink);
  margin: 0;
}
.am-author-name a { color: var(--am-navy) !important; }
.am-author-name a:hover { color: var(--am-red) !important; }
.am-author-sub {
  font-size: 13px;
  color: var(--am-muted);
  margin: 2px 0 0;
}
.am-dot { margin: 0 6px; opacity: 0.5; }

.am-share {
  display: flex;
  align-items: center;
  gap: 8px;
}
.am-share a,
.am-share button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--am-line);
  background: #fff;
  color: var(--am-navy) !important;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.am-share a:hover,
.am-share button:hover {
  background: var(--am-navy);
  border-color: var(--am-navy);
  color: #fff !important;
  transform: translateY(-2px);
}
.am-share button.copied {
  background: var(--am-green);
  border-color: var(--am-green);
  color: #fff !important;
}

/* ---------- hero image ---------- */
.am-figure {
  margin: 28px 0 0;
}
.am-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--am-radius);
  box-shadow: 0 18px 40px -18px rgba(17, 24, 39, 0.35);
  background: var(--am-soft);
}

/* ---------- sidebar / TOC ---------- */
.am-aside { min-width: 0; }
.am-toc {
  position: sticky;
  top: 20px;
}
.am-toc-label {
  display: none;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--am-muted);
  margin: 0 0 12px;
}
.am-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.am-toc ol::-webkit-scrollbar { display: none; }
.am-toc li { flex: none; }
.am-toc a {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--am-soft);
  border: 1px solid var(--am-line);
  color: var(--am-text) !important;
  transition: all 0.18s ease;
}
.am-toc a.active,
.am-toc a:hover {
  background: var(--am-navy);
  border-color: var(--am-navy);
  color: #fff !important;
}

@media (min-width: 1024px) {
  .am-toc-label { display: block; }
  .am-toc ol {
    flex-direction: column;
    gap: 2px;
    overflow: visible;
    border-left: 2px solid var(--am-line);
  }
  .am-toc a {
    white-space: normal;
    background: transparent;
    border: 0;
    border-radius: 0;
    margin-left: -2px;
    padding: 8px 0 8px 16px;
    border-left: 2px solid transparent;
    color: var(--am-muted) !important;
    font-size: 14px;
    line-height: 1.35;
  }
  .am-toc a.active,
  .am-toc a:hover {
    background: transparent;
    border-left-color: var(--am-red);
    color: var(--am-ink) !important;
  }
}

/* ---------- body copy ---------- */
.am-body {
  min-width: 0;
  font-family: var(--am-serif) !important;
}
.am-body p {
  font-family: var(--am-serif) !important;
  font-size: clamp(1.125rem, 2.2vw, 1.24rem);
  line-height: 1.8;
  color: var(--am-text);
  margin: 0 0 1.35em;
  overflow-wrap: anywhere;
}
.am-body .am-lede::first-letter {
  float: left;
  font-family: var(--am-serif);
  font-size: 4.2em;
  line-height: 0.82;
  font-weight: 700;
  padding: 0.06em 0.1em 0 0;
  color: var(--am-red);
}
.am-body h2 {
  font-family: var(--am-serif) !important;
  font-size: clamp(1.45rem, 3.4vw, 1.9rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--am-ink);
  margin: 2em 0 0.7em;
  padding-top: 0.2em;
  scroll-margin-top: 24px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.am-body h2::before {
  content: "";
  flex: none;
  width: 6px;
  height: 0.9em;
  border-radius: 3px;
  background: var(--am-red);
  transform: translateY(0.1em);
}
.am-body a {
  color: var(--am-red) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- key figures ---------- */
.am-figures {
  margin: 30px 0 34px;
}
.am-body .am-figures-title {
  font-family: var(--am-sans);
  font-size: 11.5px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--am-muted);
  margin: 0 0 12px;
}
.am-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .am-stats { grid-template-columns: 1fr 1fr; }
}
.am-stat {
  border: 1px solid var(--am-line);
  border-radius: var(--am-radius);
  padding: 20px 20px 18px;
  background: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px -12px rgba(17, 24, 39, 0.25);
}
.am-stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--am-green);
}
.am-stat.unverified::before { background: var(--am-amber); }
.am-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--am-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--am-green-soft);
  color: var(--am-green);
}
.am-stat.unverified .am-badge {
  background: var(--am-amber-soft);
  color: var(--am-amber);
}
.am-stat-num {
  font-family: var(--am-serif);
  font-size: clamp(2.2rem, 7vw, 2.9rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--am-ink);
  margin: 14px 0 4px;
}
.am-stat-num small {
  font-size: 0.42em;
  font-weight: 600;
  color: var(--am-muted);
  margin-left: 4px;
}
.am-body .am-stat-desc {
  font-family: var(--am-sans) !important;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--am-muted);
  margin: 0;
}
.am-body .am-stat-src {
  font-family: var(--am-sans) !important;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--am-muted);
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--am-line);
}

/* ---------- pull quote ---------- */
.am-pull {
  margin: 1.8em 0;
  padding: 22px 24px;
  border-radius: var(--am-radius);
  background: var(--am-red-soft);
  border-left: 5px solid var(--am-red);
}
.am-pull p {
  margin: 0 !important;
  font-size: clamp(1.2rem, 3vw, 1.5rem) !important;
  line-height: 1.5 !important;
  font-style: italic;
  color: var(--am-ink) !important;
}

/* ---------- sources ---------- */
.am-sources {
  margin-top: 2.4em;
  padding: 20px;
  border-radius: var(--am-radius);
  background: var(--am-soft);
  border: 1px solid var(--am-line);
}
.am-sources h2 {
  font-size: 1.05rem !important;
  margin: 0 0 12px !important;
  font-family: var(--am-sans) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--am-muted);
}
.am-sources h2::before { display: none; }
.am-sources a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--am-sans) !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  word-break: break-word;
  color: var(--am-navy) !important;
}
.am-sources a:hover { color: var(--am-red) !important; }

/* ---------- author card ---------- */
.am-section {
  max-width: 820px;
  margin: 56px auto 0;
}
.am-card-author {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px;
  border-radius: var(--am-radius);
  border: 1px solid var(--am-line);
  background: #fff;
  box-shadow: 0 10px 30px -18px rgba(17, 24, 39, 0.3);
}
.am-card-author img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.am-card-author .label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--am-red);
  margin: 0 0 4px;
}
.am-card-author h3 {
  font-size: 1.25rem;
  margin: 0 0 8px;
}
.am-card-author h3 a { color: var(--am-ink) !important; }
.am-card-author h3 a:hover { color: var(--am-red) !important; }
.am-card-author p.bio {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--am-muted);
  margin: 0 0 14px;
}
.am-card-author .social {
  display: flex;
  gap: 8px;
}
.am-card-author .social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--am-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--am-navy) !important;
  font-size: 14px;
  transition: all 0.18s ease;
}
.am-card-author .social a:hover {
  background: var(--am-navy);
  border-color: var(--am-navy);
  color: #fff !important;
}
.am-card-author .social img { width: 16px; height: 16px; }

/* ---------- related ---------- */
.am-sec-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--am-ink);
  margin: 0 0 20px;
}
.am-sec-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--am-line);
}
.am-related {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 640px) {
  .am-related { grid-template-columns: 1fr 1fr; }
}
.am-rel-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--am-radius);
  border: 1px solid var(--am-line);
  overflow: hidden;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.am-rel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px -18px rgba(17, 24, 39, 0.4);
}
.am-rel-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.am-rel-info { padding: 16px 18px 20px; }
.am-rel-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--am-red);
  margin: 0 0 8px;
}
.am-rel-info h3 {
  font-family: var(--am-serif);
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 0 0 8px;
}
.am-rel-info h3 a { color: var(--am-ink) !important; }
.am-rel-card:hover h3 a { color: var(--am-red) !important; }
.am-rel-info p.desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--am-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- comments ---------- */
.am-comment {
  padding: 24px;
  border-radius: var(--am-radius);
  background: var(--am-soft);
  border: 1px solid var(--am-line);
}
.am-comment h3 {
  font-size: 1.25rem;
  margin: 0 0 16px;
  color: var(--am-ink);
}
.am-comment form {
  display: grid;
  gap: 12px;
}
.am-comment .row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .am-comment .row { grid-template-columns: 1fr 1fr; }
}
.am-comment textarea,
.am-comment input {
  width: 100%;
  font-size: 16px; /* prevents iOS zoom */
  padding: 13px 14px;
  border: 1px solid var(--am-line);
  border-radius: 12px;
  background: #fff;
  color: var(--am-ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.am-comment textarea { min-height: 130px; resize: vertical; }
.am-comment textarea:focus,
.am-comment input:focus {
  border-color: var(--am-navy);
  box-shadow: 0 0 0 3px rgba(33, 47, 92, 0.15);
}
.am-comment button {
  justify-self: start;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--am-red);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.am-comment button:hover {
  background: #8d0730;
  transform: translateY(-1px);
}

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  .am-wrap { padding: 20px 16px 48px; }
  .am-byline { align-items: flex-start; }
  .am-share { width: 100%; }
  .am-card-author {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 22px 18px;
  }
  .am-card-author .social { justify-content: center; }
  .am-pull { padding: 18px; }
  .am-section { margin-top: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .am-progress, .am-aside, .am-share, .am-comment { display: none !important; }
}
