/* Matte: formelsamling och strategier */

.matte-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.toc { position: sticky; top: var(--s-4); }
.toc h2 { font-size: var(--step--1); color: var(--muted); font-weight: 600; margin-bottom: var(--s-2); }
.toc ol { list-style: none; margin: 0 0 var(--s-4); padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: var(--s-1) var(--s-3); margin-left: -2px; border-left: 2px solid transparent; color: var(--text); text-decoration: none; font-size: var(--step--1); }
.toc a:hover { color: var(--primary); }
.toc a[aria-current="true"] { border-left-color: var(--highlight); font-weight: 700; }

.m-section { scroll-margin-top: var(--s-4); margin-bottom: var(--s-7); max-width: 760px; }
.m-section h2 { font-size: var(--step-3); }
.m-section h3 { font-size: var(--step-1); margin-top: var(--s-5); }

.formulas { display: grid; grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr); gap: 0; margin: 0 0 var(--s-4); border-top: 1px solid var(--line); }
.formulas dt, .formulas dd { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); margin: 0; }
.formulas dt { font-weight: 600; padding-right: var(--s-4); }
.formulas .f, td.f { font-family: var(--font-read); font-size: 1.08rem; }
.tip { background: var(--surface); border-left: 4px solid var(--highlight); padding: var(--s-3) var(--s-4); border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.strategy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-4); max-width: none; }
.strategy { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; }
.strategy h3 { margin: 0 0 var(--s-1); font-size: var(--step-0); }
.sid { display: inline-block; min-width: 2.8em; font-weight: 800; color: var(--primary); }
.rec { color: var(--muted); font-size: var(--step--1); margin-bottom: var(--s-2); }
.strategy ul { padding-left: 1.1em; margin: 0 0 var(--s-4); }
.strategy li { margin-bottom: var(--s-2); }
.strategy .btn { margin-top: auto; align-self: flex-start; }
#strategier { max-width: none; }

@media (max-width: 900px) {
  .matte-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { columns: 2; }
}
@media (max-width: 560px) {
  .formulas { grid-template-columns: 1fr; }
  .formulas dt { border-bottom: 0; padding-bottom: 0; }
  .toc ol { columns: 1; }
}
@media print {
  .toc, #strategier .btn { display: none; }
  .matte-layout { display: block; }
  .m-section { break-inside: avoid-page; margin-bottom: 14pt; }
  .strategy { border-color: #999; }
}
