/*
Theme Name: Ternit
Theme URI: https://ternit.ru/
Author: Ternit
Description: Blog theme matching the static ternit.ru pages: cool paper, institutional navy, amber kept for measured numbers. Self-hosted fonts, no external requests.
Version: 2.0
Requires at least: 6.0
Requires PHP: 7.4
License: proprietary
Text Domain: ternit
*/

/* The shared look lives in assets/base.css - a generated copy of the site
   stylesheet, loaded first by functions.php. Keep it in step with
   sync-from-site.ps1; never edit it by hand. Everything below is what
   WordPress markup needs on top of it. */

/* ── post list ──────────────────────────────────────────────────────────── */

.posts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.post-card {
  display: grid; gap: .5rem; padding: 1.5rem 1.6rem;
  background: var(--bg); text-decoration: none; color: inherit;
  transition: background-color .18s var(--ease);
}
@media (min-width: 48rem) {
  .post-card { grid-template-columns: 7rem minmax(0, 1fr) 1.5rem; gap: 2rem; align-items: baseline; }
}
.post-card:hover { background: var(--bg-2); }
.post-date { font-size: .8125rem; color: var(--ink-3); }
.post-card-title { display: block; font-size: 1.0625rem; font-weight: 700; line-height: 1.3; letter-spacing: -.018em; }
.post-card-lede { display: block; margin-top: .4rem; color: var(--ink-2); font-size: .9375rem; }
.post-card-go { color: var(--brand); justify-self: end; }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.pager a { font-size: .9375rem; text-decoration: none; font-weight: 600; }
.pager a:hover { text-decoration: underline; }

/* ── the post itself ────────────────────────────────────────────────────── */

.post { max-width: 42rem; }

.post-body > * { max-width: 42rem; }
.post-body p { margin: 0 0 1.3rem; }
.post-body h2 { font-size: 1.3rem; font-weight: 700; margin: 2.6rem 0 .8rem; }
.post-body h3 { font-size: 1.0625rem; font-weight: 700; margin: 2rem 0 .5rem; }
.post-body ul,
.post-body ol { margin: 0 0 1.5rem; padding-left: 1.25rem; color: var(--ink-2); }
.post-body li { margin-bottom: .6rem; }
.post-body img,
.post-body iframe { max-width: 100%; height: auto; border-radius: 5px; }
.post-body figure { margin: 2rem 0; }
.post-body figcaption { margin-top: .5rem; font-size: .875rem; color: var(--ink-3); }
.post-body blockquote {
  margin: 2rem 0; padding: .1rem 0 .1rem 1.4rem;
  border-left: 2px solid var(--brand); color: var(--ink-2);
}
.post-body code {
  font-family: var(--mono); font-size: .9em;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; padding: .1em .4em;
}
.post-body pre {
  font-family: var(--mono); font-size: .875rem;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px;
  padding: 1.15rem 1.25rem; overflow-x: auto; max-width: 100%;
}
.post-body pre code { background: none; border: 0; padding: 0; }
.post-body table { border-collapse: collapse; width: 100%; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.post-body table th,
.post-body table td { border: 1px solid var(--line); padding: .6rem .9rem; text-align: left; }
.post-body table th { background: var(--bg-2); font-weight: 600; }
.post-body a { color: var(--brand); }

.table-scroll { overflow-x: auto; }

.post-sign {
  margin: 2.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line);
  max-width: 42rem; font-size: .9375rem; color: var(--ink-2);
}
.post-sign::before { content: "—"; color: var(--brand); margin-right: .5em; }

/* ── neighbour entries ──────────────────────────────────────────────────── */

.post-nav {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 1.5rem;
}
@media (min-width: 42rem) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav-side { background: var(--bg); min-height: 100%; }
.post-nav-link {
  display: grid; gap: .35rem; height: 100%; padding: 1.25rem 1.4rem;
  text-decoration: none; color: inherit;
  transition: background-color .18s var(--ease);
}
.post-nav-link:hover { background: var(--bg-2); }
.post-nav-label {
  font-family: var(--mono); font-size: .6875rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--brand);
}
.post-nav-date { font-size: .75rem; color: var(--ink-3); }
.post-nav-title { font-size: .9375rem; line-height: 1.35; text-wrap: balance; }
@media (min-width: 42rem) { .post-nav-right .post-nav-link { text-align: right; } }
.post-nav-all { margin: 0; }

/* ── the admin bar must not cover the sticky header ─────────────────────── */

body.admin-bar .top { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar .top { top: 46px; } }
