/* Shared proportional layout polish for Sigma Trust pages. */

:root{
  --sigma-card-radius:8px;
  --sigma-card-shadow:0 16px 42px rgba(10,10,10,.045);
  --sigma-card-shadow-hover:0 20px 54px rgba(10,10,10,.075);
  --sigma-measure:72ch;
  --sigma-flow-gap:18px;
  --sigma-topic-gap:18px;
}

.article-head,
.crumbs,
.lede-stats,
.article-body,
.sources-block,
.article-footer,
.container,
.article-index,
.related-inner,
.foot,
.notice{
  width:100%;
}

.article-deck,
.section-lead,
.thesis-text{
  text-wrap:pretty;
}

.prose p,
.article-body > p,
.article-body li,
.call-text,
.sc-text,
.score-note,
.stat-note,
.cluster-region,
.library-card p,
.report-summary,
.deck,
.article-deck{
  text-align:justify;
  text-align-last:left;
  hyphens:auto;
  overflow-wrap:break-word;
}

.prose,
.article-body > section,
.article-body > p,
.article-body > h2,
.article-body > h3,
.article-body > h4,
.article-body > .lede,
.article-body > .pull,
.article-body > .alert,
.article-body > .chart-block,
.article-body > .data-tbl,
.article-body > .inline-stat{
  max-width:var(--sigma-measure);
}

.prose{
  max-width:var(--sigma-measure);
}

.prose section,
.article-body > section{
  margin-top:0;
  margin-bottom:var(--sigma-topic-gap);
  padding-bottom:0;
}

.prose section + section,
.article-body > section + section{
  margin-top:var(--sigma-topic-gap);
}

.prose section > *:last-child,
.article-body > section > *:last-child{
  margin-bottom:0;
}

.prose p,
.article-body > p{
  margin-top:0;
  margin-bottom:var(--sigma-flow-gap);
}

.prose p + p,
.article-body > p + p{
  margin-top:0;
}

.section-rule{
  margin-top:0;
  margin-bottom:10px;
}

.section-sub{
  margin-top:0;
  margin-bottom:var(--sigma-flow-gap);
}

.section-title{
  margin-top:0;
}

.prose h2,
.prose h3,
.prose h4,
.article-body > h2,
.article-body > h3,
.article-body > h4{
  margin-top:var(--sigma-topic-gap);
  margin-bottom:var(--sigma-flow-gap);
}

.prose h2 + p,
.prose h3 + p,
.prose h4 + p,
.section-rule + p,
.section-sub + p,
.article-body > h2 + p,
.article-body > h3 + p,
.article-body > h4 + p{
  margin-top:0;
}

.article-body:has(.sidebar){
  grid-template-columns:minmax(0,var(--sigma-measure)) minmax(260px,286px);
  justify-content:space-between;
}

.article-body:not(:has(.sidebar)){
  max-width:calc(var(--sigma-measure) + 64px);
}

.lede-stats{
  align-items:stretch;
}

.lede-stat{
  display:flex;
  min-width:0;
  flex-direction:column;
  justify-content:space-between;
  gap:12px;
}

.lede-stat-label{
  max-width:32ch;
}

.score-grid,
.stat-grid,
.scenario-grid,
.cluster-grid,
.conviction-grid,
.library-grid,
.related-grid,
.conv-list,
.reports-grid,
.stats-grid{
  align-items:stretch;
}

.score-col,
.stat-card,
.scenario-card,
.cluster-card,
.conviction-item,
.sidebar-block,
.related-block,
.related-card,
.library-card,
.conv,
.report-card,
.stat-block{
  border-radius:var(--sigma-card-radius);
}

.scenario-card,
.cluster-card,
.conviction-item,
.related-card,
.library-card,
.report-card{
  display:flex;
  flex-direction:column;
  min-width:0;
  height:100%;
}

.scenario-card .sc-text,
.cluster-card .tags,
.library-card .meta,
.related-card .related-meta{
  margin-top:auto;
}

.score-grid,
.stat-grid,
.scenario-grid,
.cluster-grid,
.conviction-grid,
.related-grid,
.library-grid,
.conv-list{
  gap:16px;
}

.score-grid,
.stat-grid{
  border:0;
  overflow:visible;
  background:transparent;
  box-shadow:none;
}

.score-col,
.stat-card{
  background:#fff;
  border:1px solid var(--line, var(--pearl, #d2d2d7));
  box-shadow:var(--sigma-card-shadow);
}

.score-col,
.stat-card{
  border-right:1px solid var(--line, var(--pearl, #d2d2d7));
}

.score-col:last-child,
.stat-card:last-child{
  border-right:1px solid var(--line, var(--pearl, #d2d2d7));
}

.scenario-card,
.cluster-card,
.conviction-item,
.sidebar-block,
.related-block,
.related-card,
.library-card,
.report-card,
.data-table,
.data-tbl,
.chart-frame{
  box-shadow:var(--sigma-card-shadow);
}

.related-block{
  padding:16px 18px;
}

.rel-item{
  display:grid;
  gap:4px;
}

.rel-item a{
  text-wrap:balance;
}

.data-table,
.data-tbl{
  border-radius:var(--sigma-card-radius);
}

.data-table th,
.data-table td,
.data-tbl th,
.data-tbl td{
  overflow-wrap:break-word;
}

/* Make data tables fill the full width of their card and grow columns
   proportionally instead of shrinking to content. */
.data-table table,
.data-tbl table{
  width:100%;
  border-collapse:collapse;
  table-layout:auto;
}

.data-table th:first-child,
.data-table td:first-child,
.data-tbl th:first-child,
.data-tbl td:first-child{
  width:34%;
}

.library-grid,
.related-grid{
  grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));
}

.scenario-grid{
  grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));
}

.cluster-grid,
.conviction-grid,
.conv-list{
  grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));
}

.library-card,
.related-card,
.scenario-card,
.cluster-card{
  transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.library-card:hover,
.related-card:hover,
.scenario-card:hover,
.cluster-card:hover{
  box-shadow:var(--sigma-card-shadow-hover);
  transform:translateY(-2px);
}

@media (min-width:1180px){
  .article-body{
    gap:72px;
  }
}

@media (max-width:980px){
  .article-body:has(.sidebar){
    grid-template-columns:1fr;
    justify-content:initial;
  }

  .prose,
  .article-body > section,
  .article-body > p,
  .article-body > h2,
  .article-body > h3,
  .article-body > h4{
    max-width:100%;
  }
}

@media (max-width:760px){
  .prose p,
  .article-body > p,
  .article-body li,
  .call-text,
  .sc-text,
  .score-note,
  .stat-note,
  .cluster-region,
  .library-card p,
  .report-summary,
  .deck,
  .article-deck{
    text-align:left;
    hyphens:none;
  }

  .score-grid,
  .stat-grid,
  .scenario-grid,
  .cluster-grid,
  .conviction-grid,
  .related-grid,
  .library-grid,
  .conv-list{
    gap:14px;
  }

  .lede-stat-label{
    max-width:none;
  }
}
