/*
 * SmartJots article reading system
 *
 * Shared, content-neutral presentation for every published analysis post.
 * Article-specific answers, default-open sections, evidence, embeds, and
 * affiliate destinations remain owned by each post. The normal-experience
 * pilot stylesheet loads after this file and keeps its bespoke enhancements.
 */

body.post-template .single-post .post-content .cv-root {
  --sja-ink: var(--ink, #0b0d21);
  --sja-copy: var(--ink2, #343b5c);
  --sja-muted: var(--muted, #68708f);
  --sja-line: var(--line, rgba(74, 79, 139, 0.16));
  --sja-panel: var(--surface, #ffffff);
  --sja-soft: var(--plane, #f7f8ff);
  --sja-accent: var(--accent, #2368e8);
  --sja-accent-2: var(--accent-2, #45a9d4);
  --sja-shadow: 0 16px 42px rgba(50, 76, 101, 0.08);
}

body.post-template .single-post > .post-hero-split {
  overflow: hidden;
  border-radius: clamp(24px, 3vw, 36px);
}

body.post-template .single-post .post-title {
  max-width: 18ch;
  font-size: clamp(2.2rem, 4vw, 3.75rem);
  letter-spacing: -0.05em;
  line-height: 1.04;
}

body.post-template .single-post .post-excerpt {
  max-width: 62rem;
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.62;
}

body.post-template .single-post .post-content-area {
  margin-top: clamp(28px, 4vw, 48px);
}

body.post-template .single-post .post-content {
  min-width: 0;
}

body.post-template .single-post .post-content .cv-root {
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  border-radius: clamp(22px, 3vw, 34px);
}

body.post-template .single-post .post-content .cv-root .cv-wrap {
  width: 100%;
  max-width: 1180px !important;
  padding: clamp(18px, 3.4vw, 42px) !important;
}

/* Search remains close at hand on long reports without covering the answers. */
body.post-template .single-post .post-content .cv-root .ledger-tools {
  position: sticky;
  top: 10px;
  z-index: 4;
  gap: 10px;
  margin: 0 0 18px !important;
  padding: 7px;
  border: 1px solid var(--sja-line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--sja-panel) 94%, transparent);
  box-shadow: 0 9px 28px rgba(50, 76, 101, 0.09);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.post-template .single-post .post-content .cv-root .ledger-search {
  min-height: 46px;
  padding: 11px 15px !important;
  border: 0 !important;
  color: var(--sja-ink) !important;
  background: transparent !important;
  font-size: 0.94rem !important;
}

body.post-template .single-post .post-content .cv-root .ledger-match-count {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--sja-accent-2) !important;
  background: color-mix(in srgb, var(--sja-accent-2) 9%, transparent);
  font-size: 0.76rem !important;
  font-weight: 800;
}

/* The index is navigation, not a compressed cloud of labels. */
body.post-template .single-post .post-content .cv-root .index-map {
  margin: 0 0 24px !important;
  padding: clamp(18px, 3vw, 28px) !important;
  border: 1px solid var(--sja-line) !important;
  border-radius: 22px !important;
  background:
    linear-gradient(
      132deg,
      color-mix(in srgb, var(--sja-accent) 7%, transparent),
      color-mix(in srgb, var(--sja-accent-2) 7%, transparent)
    ),
    var(--sja-soft) !important;
  box-shadow: none !important;
}

body.post-template .single-post .post-content .cv-root .index-map-title {
  margin: 0 0 16px !important;
  color: var(--sja-ink) !important;
  font-size: clamp(1.28rem, 2.2vw, 1.8rem) !important;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

body.post-template .single-post .post-content .cv-root .index-map-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

body.post-template .single-post .post-content .cv-root .index-map-group {
  min-width: 0;
  margin: 0 !important;
  padding: 16px !important;
  border: 1px solid var(--sja-line) !important;
  border-radius: 16px !important;
  background: var(--sja-panel) !important;
  box-shadow: 0 7px 22px rgba(50, 76, 101, 0.055);
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .index-map-group
  > a {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  min-height: 30px;
  color: var(--sja-ink) !important;
  font-size: 0.94rem !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
  text-decoration-line: underline !important;
  text-decoration-color: color-mix(
    in srgb,
    var(--sja-accent) 48%,
    transparent
  ) !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 3px;
  transition:
    color 280ms ease,
    text-decoration-color 280ms ease,
    text-decoration-thickness 280ms ease;
  overflow-wrap: anywhere;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .index-map-group
  > a:not(.index-map-category)::before {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 0.42em;
  border-radius: 50%;
  background: var(--sja-accent);
  content: "";
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .index-map
  .index-map-group
  > ul {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0.18rem !important;
  margin: 0.7rem 0 0 !important;
  padding-inline-start: 1.3rem !important;
  list-style: disc outside !important;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .index-map
  .index-map-group
  > ul
  > li {
  display: list-item !important;
  min-width: 0;
  margin: 0.2rem 0 !important;
  padding: 0 !important;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .index-map
  .index-map-group
  > ul
  > li::marker {
  color: var(--sja-accent-2);
  font-size: 0.92em;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .index-map
  .index-map-group
  > ul
  > li
  > a {
  display: block !important;
  min-height: 30px;
  padding: 3px 0 !important;
  color: var(--sja-copy) !important;
  font-size: 0.86rem !important;
  line-height: 1.5 !important;
  text-decoration-line: underline !important;
  text-decoration-color: color-mix(
    in srgb,
    var(--sja-accent) 45%,
    transparent
  ) !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 3px;
  transition:
    color 280ms ease,
    text-decoration-color 280ms ease,
    text-decoration-thickness 280ms ease;
  overflow-wrap: anywhere;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .index-map-group
  a:hover,
body.post-template
  .single-post
  .post-content
  .cv-root
  .index-map-group
  a:focus-visible {
  color: var(--sja-accent-2) !important;
  text-decoration-color: var(--sja-accent-2) !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px;
}

/* Put the article-specific answer and its next steps in a distinct layer. */
body.post-template .single-post .post-content .cv-root .reader-answer {
  margin-bottom: 22px !important;
  padding: clamp(21px, 3.4vw, 36px) !important;
  border: 1px solid
    color-mix(in srgb, var(--sja-accent-2) 24%, transparent) !important;
  border-radius: 22px !important;
  background:
    linear-gradient(
      126deg,
      color-mix(in srgb, var(--sja-accent) 8%, transparent),
      color-mix(in srgb, var(--sja-accent-2) 8%, transparent)
    ),
    var(--sja-panel) !important;
}

body.post-template .single-post .post-content .cv-root .reader-summary-hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr) !important;
  gap: clamp(24px, 4.5vw, 56px) !important;
  align-items: end;
  margin: 0 0 28px !important;
  padding: clamp(28px, 4.5vw, 52px) !important;
  border-radius: clamp(24px, 3vw, 36px) !important;
  background:
    radial-gradient(
      circle at 100% 0,
      color-mix(in srgb, #2bd783 14%, transparent),
      transparent 42%
    ),
    radial-gradient(
      circle at 0 100%,
      color-mix(in srgb, var(--sja-accent) 16%, transparent),
      transparent 46%
    ),
    var(--sja-panel) !important;
  box-shadow: var(--sja-shadow);
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .reader-summary-copy,
body.post-template
  .single-post
  .post-content
  .cv-root
  .reader-summary-next {
  min-width: 0;
}

body.post-template .single-post .post-content .cv-root .reader-answer h2 {
  max-width: 28ch;
  font-size: clamp(1.65rem, 3vw, 2.45rem) !important;
  letter-spacing: -0.04em;
  line-height: 1.12 !important;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .reader-summary-hero
  h2 {
  max-width: 21ch;
  font-size: clamp(2rem, 4.4vw, 4rem) !important;
  letter-spacing: -0.052em;
  line-height: 1.02 !important;
}

body.post-template .single-post .post-content .cv-root .reader-answer > p {
  max-width: 76ch;
  color: var(--sja-copy) !important;
  font-size: 0.98rem !important;
  line-height: 1.68 !important;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .reader-summary-copy
  > p {
  max-width: 62rem;
  margin: 18px 0 0 !important;
  color: var(--sja-copy) !important;
  font-size: clamp(0.98rem, 1.35vw, 1.12rem) !important;
  line-height: 1.68 !important;
}

body.post-template .single-post .post-content .cv-root .reader-focus-list,
body.post-template .single-post .post-content .cv-root .reader-focus {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 8px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

body.post-template .single-post .post-content .cv-root .reader-focus-list li,
body.post-template .single-post .post-content .cv-root .reader-focus li {
  position: relative;
  margin: 0 !important;
  padding: 10px 11px 10px 30px !important;
  border: 1px solid var(--sja-line);
  border-radius: 10px;
  color: var(--sja-copy) !important;
  background: var(--sja-panel);
  font-size: 0.84rem !important;
  font-weight: 700;
  line-height: 1.45;
}

body.post-template .single-post .post-content .cv-root .reader-focus-list li::before,
body.post-template .single-post .post-content .cv-root .reader-focus li::before {
  position: absolute;
  top: 7px;
  left: 12px;
  color: var(--sja-accent);
  content: "•";
  font-size: 1.1rem;
  line-height: 1;
}

/* Comfortable answer cards, regardless of the article's chosen archetype. */
body.post-template .single-post .post-content .cv-root .primary-view {
  margin-bottom: 24px !important;
  padding: clamp(14px, 2.5vw, 24px) !important;
  border-radius: 18px !important;
}

body.post-template .single-post .post-content .cv-root .primary-heading {
  font-size: clamp(1.3rem, 2.3vw, 1.75rem) !important;
  letter-spacing: -0.025em;
}

body.post-template .single-post .post-content .cv-root .primary-intro {
  color: var(--sja-copy) !important;
  font-size: 0.92rem !important;
  line-height: 1.6 !important;
}

body.post-template .single-post .post-content .cv-root .primary-grid {
  gap: 12px !important;
}

body.post-template .single-post .post-content .cv-root .primary-card {
  padding: 17px !important;
  border-radius: 14px !important;
  box-shadow: 0 5px 18px rgba(50, 76, 101, 0.045);
}

body.post-template
  .single-post
  .post-content
  .cv-root
  :is(.primary-card h4, .primary-card-title) {
  font-size: 1.04rem !important;
  line-height: 1.38 !important;
}

body.post-template .single-post .post-content .cv-root .primary-detail {
  color: var(--sja-copy) !important;
  font-size: 0.88rem !important;
  line-height: 1.58 !important;
}

body.post-template .single-post .post-content .cv-root .primary-buy {
  min-height: 38px;
  padding: 9px 14px !important;
  font-size: 0.8rem !important;
}

/* Deep-dive groups remain visible when editorial review marked them open. */
body.post-template .single-post .post-content .cv-root .evidence-groups {
  gap: 12px !important;
  padding: 10px !important;
  border-radius: 18px;
}

body.post-template .single-post .post-content .cv-root .evidence-group {
  margin: 0 !important;
  border-radius: 16px !important;
  box-shadow: 0 6px 20px rgba(50, 76, 101, 0.045);
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .evidence-group
  > summary {
  min-height: 58px;
  padding: 16px 52px 16px 17px !important;
  font-size: 0.98rem !important;
  line-height: 1.4;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .evidence-subgroup
  > summary {
  min-height: 52px;
  font-size: 0.9rem !important;
}

/* The company directory keeps filters and buttons, but its category browser
 * gains the same unmistakable one-idea-per-line hierarchy. */
body.post-template
  .single-post
  .post-content
  .cv-root
  .insider-subtopic-grid {
  gap: 12px !important;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .insider-subtopic-card {
  padding: 15px !important;
  border-radius: 14px !important;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .insider-subtopic-card
  > strong {
  margin-bottom: 9px !important;
  color: var(--sja-ink) !important;
  font-size: 0.92rem !important;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .insider-subtopic-list {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0.18rem !important;
  margin: 0 !important;
  padding-inline-start: 1.3rem !important;
  list-style: disc outside !important;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .insider-subtopic-list
  > li {
  display: list-item !important;
  margin: 0.2rem 0 !important;
  padding: 0 !important;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .insider-subtopic-list
  > li::marker {
  color: var(--sja-accent-2);
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .insider-subtopic-list
  button {
  display: block !important;
  width: 100%;
  min-height: 32px;
  padding: 4px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--sja-copy) !important;
  background: transparent !important;
  font-size: 0.84rem !important;
  line-height: 1.5 !important;
  text-align: left;
  text-decoration-line: underline;
  text-decoration-color: color-mix(
    in srgb,
    var(--sja-accent) 45%,
    transparent
  );
  text-underline-offset: 3px;
  transition:
    color 280ms ease,
    text-decoration-color 280ms ease;
  overflow-wrap: anywhere;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  .insider-subtopic-list
  button:hover {
  color: var(--sja-accent) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.post-template .single-post .post-content .cv-root .insider-secret h5 {
  font-size: 1rem !important;
}

body.post-template .single-post .post-content .cv-root .insider-report {
  font-size: 0.88rem !important;
  line-height: 1.62 !important;
}

body.post-template .single-post .post-content .cv-root .insider-action {
  font-size: 0.84rem !important;
  line-height: 1.55 !important;
}

body.post-template
  .single-post
  .post-content
  .cv-root
  :where(a, button, input, select, summary):focus-visible {
  outline: 3px solid var(--sja-accent-2) !important;
  outline-offset: 3px !important;
}

@media (min-width: 1180px) {
  body.post-template .single-post .post-content .cv-root .index-map-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  body.post-template .single-post .post-content {
    padding: clamp(0.75rem, 3vw, 1.2rem);
  }

  body.post-template .single-post .post-content .cv-root .cv-wrap {
    padding: 14px !important;
  }

  body.post-template .single-post .post-content .cv-root .ledger-tools {
    position: static;
    align-items: stretch;
    flex-direction: column;
    border-radius: 15px;
  }

  body.post-template .single-post .post-content .cv-root .ledger-match-count {
    align-self: flex-start;
  }

  body.post-template .single-post .post-content .cv-root .index-map-grid,
  body.post-template .single-post .post-content .cv-root .reader-summary-hero,
  body.post-template .single-post .post-content .cv-root .reader-focus-list,
  body.post-template .single-post .post-content .cv-root .reader-focus {
    grid-template-columns: 1fr !important;
  }

  body.post-template .single-post .post-content .cv-root .reader-summary-hero {
    gap: 20px !important;
    padding: 22px !important;
    border-radius: 22px !important;
  }

  body.post-template .single-post .post-content .cv-root .index-map {
    padding: 14px !important;
    border-radius: 18px !important;
  }

  body.post-template .single-post .post-content .cv-root .index-map-group {
    padding: 14px !important;
  }

  body.post-template .single-post .post-content .cv-root .primary-card {
    padding: 15px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.post-template .single-post .post-content .cv-root * {
    scroll-behavior: auto !important;
  }

  body.post-template
    .single-post
    .post-content
    .cv-root
    :where(.index-map-group a, .insider-subtopic-list button) {
    transition: none !important;
  }
}
