/* /assets/prose.css — article/post styles */

/* anchors */
article [id] { scroll-margin-top: 16px; }
:target { animation: anchor-flash 4000ms ease-out 1; border-radius: 8px; }
@keyframes anchor-flash {
  from { background: rgba(255,214,10,.25); box-shadow: 0 0 0 2px rgba(255,214,10,.35) inset; }
  to   { background: transparent;            box-shadow: 0 0 0 0   transparent     inset; }
}

/* basics */
.muted { color: var(--muted); }
article { padding: 24px 0; }
article img { max-width: 100%; height: auto; }

pre {
  overflow: auto; padding: 12px;
  background: var(--surface, #0a0a0a);
  border: 1px solid var(--border, #222);
  border-radius: 10px;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

hr { border: 0; border-top: 1px solid var(--rule, #161616); margin: 22px 0; }

.toc { padding-left: 18px; margin: 8px 0; }

blockquote {
  margin: 12px 0; padding-left: 14px;
  border-left: 3px solid var(--border, #222);
  color: var(--muted);
}

/* figures */
figure { margin: 16px 0; }
figcaption { color: var(--muted); font-size: 0.95em; margin-top: 6px; }

/* citations */
sup a { text-decoration: none; border-bottom: 1px dotted #444; padding: 0 2px; }
sup a:hover { text-decoration: underline; }
#references li { margin: 6px 0; }
#references a.back { margin-left: 8px; font-size: 0.9em; color: var(--muted); }

/* --- Light theme tweaks for prose bits --- */
:root[data-theme="light"] pre { background:#f6f6f6; border-color:#e5e5e5; }
:root[data-theme="light"] blockquote { border-left-color:#e5e5e5; }
:root[data-theme="light"] hr { border-top-color:#e5e5e5; }

/* --- Acknowledgements / callout box --- */
.ack{
  margin:12px 0 22px; padding:14px 16px;
  background: var(--surface, #0a0a0a);
  border:1px solid var(--border, #222);
  border-radius:12px;
}
.ack .eyebrow{
  display:inline-block; font-size:12px; letter-spacing:.08em;
  text-transform:uppercase; color:var(--muted); margin-bottom:6px;
}
.ack p{ margin:6px 0 8px }
.ack ul{ margin:6px 0 0 1.1em; padding-left:0 }
.ack li{ margin:4px 0 }
.ack a{ text-decoration:underline; text-underline-offset:2px }
:root[data-theme="light"] .ack{ background:#f5f5f5; border-color:#e5e5e5; }

/* --- Collapsible sections (<details class="collapsible">) --- */
details.collapsible{
  border:1px solid var(--border, #222);
  border-radius:10px; background:var(--surface, #0b0b0b);
  margin:14px 0;
}
details.collapsible > summary{
  cursor:pointer; padding:12px 14px; list-style:none; user-select:none; font-weight:600;
}
details.collapsible > summary::-webkit-details-marker{ display:none }
details.collapsible > summary::after{
  content:"▸"; float:right; color:var(--muted); transition:transform .2s ease;
}
details.collapsible[open] > summary::after{ content:"▾"; transform:translateY(1px) }
details.collapsible .collapsible-body{ padding:0 14px 14px }
:root[data-theme="light"] details.collapsible{ background:#fafafa; border-color:#e5e5e5 }

/* --- Tables (theme-aware) --- */
.table-wrap{ overflow:auto; margin:14px 0 22px }

/* tokens (use theme.css vars if present) */
:root{
  --table-bg: transparent;
  --table-head-bg: rgba(0,0,0,.6);
  --table-border: #161616;
  --table-hover-bg: #0a0a0a;
}
:root[data-theme="light"]{
  --table-head-bg: rgba(255,255,255,.85);
  --table-border: #e5e5e5;
  --table-hover-bg: #f6f6f6;
}

/* default tables */
table{ width:100%; border-collapse:collapse; margin:12px 0; background:var(--table-bg); }
th, td{ border:1px solid var(--table-border); padding:8px; text-align:left; }
th{ background:var(--table-head-bg); color:var(--muted); }
caption{ caption-side:bottom; color:var(--muted); padding-top:6px; }

/* TON/TRON table variant */
table.tron-ton{
  border-collapse:collapse; font-variant-numeric:tabular-nums; background:var(--table-bg);
}
table.tron-ton th, table.tron-ton td{
  padding:10px 12px; border-bottom:1px solid var(--table-border); vertical-align:middle;
}
table.tron-ton th{ color:var(--muted); font-weight:600; text-align:left; letter-spacing:.2px }
table.tron-ton td.num{ text-align:right; white-space:nowrap }
table.tron-ton tr:hover{ background:var(--table-hover-bg) }

/* sticky head */
table.tron-ton thead th{
  position:sticky; top:0;
  background:var(--table-head-bg);
  backdrop-filter:saturate(140%) blur(2px);
}

/* smooth local color change during theme switch (optional) */
.theme-animating table,
.theme-animating table *{
  transition: background-color .25s ease, border-color .25s ease, color .25s ease !important;
}
