/* Mithavo Journal — article detail page
   Reuses tokens, header, breadcrumb-strip, footer, chips from main.css + blog.css.
*/

/* ---------- Article hero ---------- */
.article-hero {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--hairline);
}
.article-hero .container { max-width: 880px; }
.article-hero .eyebrow { margin-bottom: 20px; }

.article-cats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.article-cats .chip-static { margin: 0; }

.article-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--foreground);
  margin: 0 0 20px;
}

.article-deck {
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted-foreground);
  max-width: 720px;
  margin: 0 0 28px;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}
.byline-author {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.byline-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  color: var(--background);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-soft);
}
.byline-meta { line-height: 1.35; }
.byline-name { font-weight: 600; color: var(--foreground); font-size: 14px; }
.byline-role { font-size: 12.5px; color: var(--muted-foreground); }

.byline-sep {
  width: 1px; height: 24px;
  background: var(--hairline);
}
.byline-fact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted-foreground);
}
.byline-fact strong { color: var(--foreground); font-weight: 600; }

.byline-actions { margin-left: auto; display: inline-flex; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline);
  background: #fff;
  border-radius: 8px;
  color: var(--muted-foreground);
  transition: all .2s ease;
}
.icon-btn:hover { color: var(--foreground); border-color: color-mix(in oklab, var(--foreground) 22%, var(--hairline)); }

/* ---------- Cover ---------- */
.article-cover {
  padding: 28px 0 0;
}
.article-cover .container { max-width: 1080px; }
.cover-frame {
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: #fff;
  box-shadow: var(--shadow-elev);
  overflow: hidden;
  padding: 28px;
  min-height: 320px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 760px) {
  .cover-frame { grid-template-columns: 1.1fr 1fr; padding: 36px; min-height: 380px; }
}
.cover-vis {
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--muted) 50%, #fff), #fff);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cover-vis .art-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--hairline);
}
.cover-side {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 18px;
}
.cover-side h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 6px;
  color: var(--foreground);
}
.cover-side p {
  margin: 0;
  font-size: 14px;
  color: var(--muted-foreground);
  line-height: 1.55;
}
.cover-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.cover-tags .chip-static { margin: 0; }

/* ---------- Layout (2-column: prose + right rail) ---------- */
.article-layout {
  padding: 56px 0 80px;
}
.article-layout .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  max-width: 1120px;
}
@media (min-width: 980px) {
  .article-layout .container {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 64px;
  }
}

/* TOC (now inside right rail) */
.toc-card { padding: 18px 20px; }
.toc-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: var(--muted-foreground);
  margin: 0 0 12px;
}
.toc-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  border-left: 1px solid var(--hairline);
}
.toc-list a {
  display: block;
  padding: 5px 12px;
  color: var(--muted-foreground);
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.4;
  font-size: 13px;
  transition: color .2s ease, border-color .2s ease;
}
.toc-list a:hover { color: var(--foreground); }
.toc-list a.is-active {
  color: var(--foreground);
  border-left-color: var(--primary);
  font-weight: 600;
}


/* Prose (article body) */
.prose {
  color: var(--foreground);
  font-size: 17.5px;
  line-height: 1.72;
  max-width: 720px;
}
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-top: 2em;
  scroll-margin-top: 160px;
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin-top: 1.6em;
  scroll-margin-top: 160px;
}
.prose p { color: color-mix(in oklab, var(--foreground) 88%, var(--muted-foreground)); }
.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose strong { color: var(--foreground); font-weight: 600; }

.prose blockquote {
  margin: 1.4em 0;
  padding: 18px 22px;
  border-left: 3px solid var(--primary);
  background: color-mix(in oklab, var(--primary) 5%, #fff);
  border-radius: 0 10px 10px 0;
  font-size: 17px;
  color: var(--foreground);
  font-style: normal;
}
.prose blockquote cite {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted-foreground);
  font-style: normal;
}

.callout {
  margin: 1.6em 0;
  padding: 20px 22px;
  border: 1px solid var(--hairline);
  background: #fff;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  box-shadow: var(--shadow-soft);
}
.callout-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: color-mix(in oklab, var(--primary) 12%, #fff);
  color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
}
.callout h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}
.callout p { margin: 0; font-size: 14.5px; color: var(--muted-foreground); }

.figure {
  margin: 1.8em 0;
}
.figure .frame {
  border: 1px solid var(--hairline);
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.figure .cell {
  height: 64px;
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--muted) 65%, #fff), #fff);
  border: 1px solid var(--hairline);
}
.figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted-foreground);
  text-align: center;
}

.divider-soft {
  border: 0;
  border-top: 1px dashed var(--hairline);
  margin: 2em 0;
}

/* Article footer (tags + share) */
.article-end {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.tag-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.share-row { display: inline-flex; gap: 8px; align-items: center; }
.share-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: var(--muted-foreground);
}

/* Right rail (sidebar) */
.rail {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@media (min-width: 980px) {
  .rail { position: sticky; top: 160px; align-self: start; }
}
.rail-card {
  border: 1px solid var(--hairline);
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}
.rail-card h4 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
}
.rail-card p { margin: 0 0 14px; font-size: 13.5px; color: var(--muted-foreground); line-height: 1.55; }
.rail-card .btn { width: 100%; justify-content: center; }
.rail-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.rail-list a {
  display: block;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--foreground);
  font-weight: 500;
}
.rail-list a:hover { color: var(--primary); }
.rail-list .rl-meta {
  display: block;
  font-size: 11.5px;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Author block */
.author-block {
  margin-top: 64px;
  padding: 28px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  align-items: start;
}
.author-block .byline-avatar { width: 64px; height: 64px; font-size: 20px; }
.author-block h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}
.author-block .author-role { font-size: 13px; color: var(--muted-foreground); margin-bottom: 10px; }
.author-block p { margin: 0; font-size: 14.5px; color: var(--muted-foreground); line-height: 1.6; }

/* Related */
.related-section { padding: 64px 0 32px; border-top: 1px solid var(--hairline); }

/* Mobile spacing */
@media (max-width: 759px) {
  .article-hero { padding: 36px 0 24px; }
  .article-layout { padding: 36px 0 56px; }
  .article-layout .container { gap: 32px; }
  .author-block { grid-template-columns: 1fr; }
}
