/* Layout */
:root { --w: 1100px; --gap: 1.25rem; }
*, *::before, *::after { box-sizing: border-box; }
img, iframe, video { max-width: 100%; height: auto; }
.container { max-width: var(--w); margin: 0 auto; padding: 0 var(--gap); }
.screen-reader-text, .skip-link { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link:focus { position: static !important; width: auto; height: auto; clip: auto; padding: .5rem; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.site-title { font-size: 1.6rem; font-weight: 700; text-decoration: none; }
.site-tagline { flex-basis: 100%; margin: 0; order: 3; }
.primary-nav .menu, .footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.primary-nav a { display: inline-block; padding: .5rem .25rem; min-height: 44px; line-height: 28px; }
.nav-toggle { display: none; min-width: 44px; min-height: 44px; background: none; border: 1px solid currentColor; }
.site-main { padding: 1.5rem 0 3rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.card-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-title { font-size: 1.15rem; margin: .5rem 0 .25rem; }
.entry { max-width: 800px; }
.entry-content { line-height: 1.7; }
.entry-content figure { margin: 1.5rem 0; }
.entry-content table { display: block; overflow-x: auto; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.pagination .nav-links { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2rem; }
.pagination .page-numbers { display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; text-align: center; }
.site-footer { padding: 2rem 0; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .primary-nav { flex-basis: 100%; display: none; }
  .primary-nav.open { display: block; }
  .primary-nav .menu { flex-direction: column; }
}

/* keep_markup: страницы прежних версий сайта (старые .htm) — слои с абсолютной позицией в поток страницы */
.legacy [style*="position:absolute"], .legacy [style*="position: absolute"] { position: static !important; width: auto !important; height: auto !important; }
.legacy table, .legacy img { max-width: 100%; }
.legacy img { height: auto; }

:root { --w: 1240px; --bg: #fdfcff; --fg: #24182e; --muted: #5d4f6a; --accent: #7b3fa0; --link: #5f2b80; --hbg: #24182e; --hfg: #fdfcff; --line: #e3dbeb; --r: 0px; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 17px; }
h1, h2, h3, h4, .site-title { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; line-height: 1.25; }
a { color: var(--link); } a:hover { color: var(--accent); }
.site-header { background: var(--hbg); color: var(--hfg); }
.site-header a, .site-title { color: var(--hfg); }
.site-tagline { color: inherit; opacity: .8; font-size: .95rem; }
.primary-nav a { text-decoration: none; }
.primary-nav .sub-menu { list-style: none; padding: .25rem 0; margin: 0; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-footer a { color: var(--muted); }
.entry-content table { border-collapse: collapse; } .entry-content th, .entry-content td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; }
.entry-content th { background: var(--line); }
img, .card, .entry-content table { border-radius: var(--r); }
blockquote { border-left: 3px solid var(--accent); margin: 1.25rem 0; padding: .25rem 1rem; color: var(--muted); }
.site-title { letter-spacing: .02em; }
.card { box-shadow: 0 1px 4px rgba(0,0,0,.12); padding-bottom: .75rem; overflow: hidden; } .card-title, .card p { padding: 0 .75rem; }

/* Подменю шапки: на десктопе — выпадающее по наведению и фокусу, на телефоне — с отступом под пунктом */
@media (min-width: 761px) {
  .primary-nav .menu > li { position: relative; }
  .primary-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 50; min-width: 17rem;
    background: var(--hbg); padding: .35rem 0; box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
  .primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }
  .primary-nav .sub-menu a { display: block; padding: .4rem 1rem; white-space: nowrap; }
  .primary-nav .sub-menu a:hover { background: rgba(255, 255, 255, .08); }
}
@media (max-width: 760px) {
  .primary-nav .sub-menu { padding-left: 1rem; }
}
