/* «Формулы по физике» (templates/public/formulas.html). Префикс fm-.
   Цвет предмета — --sub / --sub-deep из каталога. */
.fm { --fm-soft: color-mix(in srgb, var(--sub) 10%, #fff); padding-bottom: 72px; }
.fm h1, .fm h2, .fm h3, .fm p, .fm ul { margin: 0; }
.fm ul { padding: 0; list-style: none; }

.fm-hd { display: grid; gap: 16px; max-width: 860px; padding: 8px 0 34px; }
.fm-hd h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; }
.fm-hd h1 em { font-style: normal; color: var(--sub-deep); }
.fm-lead { font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.fm-years { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-years a { padding: 8px 14px; border-radius: 999px; font-weight: 650; font-size: 15px; color: var(--sub-deep); background: var(--fm-soft); text-decoration: none; }
.fm-years a:hover { background: color-mix(in srgb, var(--sub) 18%, #fff); }

.fm-year + .fm-year { margin-top: 64px; }
.fm-yh { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.025em; margin-bottom: 20px; }
.fm-yh a { color: inherit; text-decoration: none; }
.fm-yh a:hover { color: var(--sub-deep); }

.fm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; }
.fm-card { display: grid; align-content: start; gap: 14px; padding: 22px 22px 18px; border-radius: 22px; background: var(--surface); box-shadow: 0 14px 30px -20px rgba(25, 30, 80, .32), 0 1px 3px rgba(25, 30, 80, .05); }
.fm-card h3 { font-size: 19px; line-height: 1.3; letter-spacing: -.015em; }
.fm-card h3 a { color: inherit; text-decoration: none; }
.fm-card h3 a:hover { color: var(--sub-deep); }
.fm-list { display: grid; gap: 8px; }
.fm-list li { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--fm-soft); }
.fm-fx { display: flex; flex-wrap: wrap; gap: 2px 22px; font-size: 21px; font-weight: 650; line-height: 1.35; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fm-list small { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.fm-go { justify-self: start; font-weight: 650; font-size: 15px; color: var(--sub-deep); text-decoration: none; }
.fm-go:hover { text-decoration: underline; }

.fm-units { margin-top: 28px; padding: 26px 26px 22px; border-radius: 22px; background: var(--surface); box-shadow: 0 14px 30px -20px rgba(25, 30, 80, .32); }
.fm-units h2 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 16px; }
.fm-tab-w { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border-2); }
.fm-units table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.fm-units th, .fm-units td { padding: 10px 14px; text-align: left; border-top: 1px solid var(--border-2); }
.fm-units thead th { border-top: 0; font-size: 14px; font-weight: 750; color: var(--sub-deep); background: var(--fm-soft); }
.fm-units tbody th { font-weight: 600; }
.fm-more { margin-top: 18px; font-size: 16px; color: var(--ink-2); }

.fm-how { margin-top: 64px; display: grid; gap: 18px; justify-items: start; max-width: 860px; }
.fm-how h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.025em; }
.fm-how ul { display: grid; gap: 12px; }
.fm-how li { font-size: 16.5px; line-height: 1.65; color: var(--ink-2); }
.fm-how b { color: var(--ink); }

@media (max-width: 760px) {
  .fm-lead { font-size: 16px; }
  .fm-card { padding: 18px 16px 14px; border-radius: 18px; }
  .fm-fx { font-size: 18.5px; }
  .fm-units { padding: 20px 8px 12px; }
  .fm-units table { font-size: 14px; }
  .fm-units th, .fm-units td { padding: 9px 8px; }
  .fm-how .btn { width: 100%; justify-content: center; text-align: center; }
}
