/*
Theme Name: Money Geek
Theme URI: https://money-geek.ru/
Description: Личный блог о финансовой грамотности: «бухгалтерская книга» — бумага, линейки, зелёный баланс, жёлтый маркер. Spectral + Martian Mono. Калькуляторы 50/30/20, подушки, сложного процента. Mobile-first, без jQuery.
Version: 1.0.0
Author: Money Geek
Text Domain: moneygeek
Requires PHP: 7.4
*/

:root {
	--paper: #f7f6f1;
	--sheet: #ffffff;
	--ink: #16181d;
	--text: #2a2d33;
	--muted: #6b6f78;
	--rule: #dcdad2;
	--rule-2: #ecebe5;
	--green: #1f6f4a;
	--green-bg: #e6f1eb;
	--marker: #ffe55c;
	--red: #c2412d;
	--blue: #2f5d9e;
	--r: 4px;
	--f-text: "Spectral", Georgia, "Times New Roman", serif;
	--f-mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 19px/1.62 var(--f-text); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { background: var(--marker); }
h1, h2, h3 { font-family: var(--f-text); font-weight: 700; color: var(--ink); line-height: 1.2; margin: 1.5em 0 .5em; }
p, ul, ol { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--ink); color: #fff; padding: 6px 10px; z-index: 99; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.btn { display: inline-block; font: 600 14px var(--f-mono); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r); text-decoration: none; }
.btn:hover { background: var(--green); color: #fff; }
.empty { color: var(--muted); }

/* ---------- Шапка ---------- */
.hd { background: var(--sheet); border-bottom: 2px solid var(--ink); }
.hd__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 12px; }
.logo { display: inline-flex; flex-direction: column; text-decoration: none; }
.logo:hover { background: none; }
.logo__w { font: 600 18px/1 var(--f-mono); color: var(--ink); letter-spacing: -.02em; }
.logo__u { color: var(--green); }
.logo__c { display: inline-block; width: .55em; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--marker); animation: blink 1.1s steps(1) infinite; }
.logo__s { font: 400 12px/1.4 var(--f-mono); color: var(--muted); margin-top: 4px; }
@keyframes blink { 50% { opacity: 0; } }
.hd__nav { display: none; }
.hd__l { list-style: none; margin: 0; padding: 0; }
.hd__l a { font: 400 14px var(--f-mono); text-decoration: none; }
.hd__menu { position: relative; }
.hd__menu summary { list-style: none; cursor: pointer; font: 600 13px var(--f-mono); border: 1.5px solid var(--ink); padding: 7px 12px; border-radius: var(--r); }
.hd__menu summary::-webkit-details-marker { display: none; }
.hd__menu[open] summary { background: var(--ink); color: #fff; }
.hd__menu nav { position: absolute; right: 0; top: calc(100% + 8px); width: min(300px, calc(100vw - 32px)); background: var(--sheet); border: 1.5px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 12px; z-index: 20; }
.hd__menu .hd__l li { border-bottom: 1px solid var(--rule-2); }
.hd__menu .hd__l a { display: block; padding: 9px 2px; }
.hd__menu .finder { margin-top: 12px; }
@media (min-width: 921px) {
	.hd__menu { display: none; }
	.hd__nav { display: block; }
	.hd__nav .hd__l { display: flex; gap: 22px; }
	.hd__nav .current-menu-item a { background: var(--marker); }
}

/* ---------- Главная ---------- */
.hero { border-bottom: 1px solid var(--rule); background:
	linear-gradient(var(--rule-2) 1px, transparent 1px) 0 0 / 100% 32px, var(--paper); }
.hero .wrap { padding-top: 34px; padding-bottom: 26px; }
.hero__k { font: 400 13px var(--f-mono); color: var(--green); margin: 0 0 8px; }
.hero__t { margin: 0 0 10px; font-size: clamp(30px, 6vw, 50px); max-width: 16ch; }
.hero__d { max-width: 56ch; color: var(--text); }
.sec { padding-top: 30px; padding-bottom: 6px; }
.sec__t { margin: 0 0 10px; font-size: clamp(24px, 3.6vw, 30px); }
.sec__d { color: var(--muted); max-width: 60ch; font-size: 17px; }

.sheet { background: var(--sheet); border: 1.5px solid var(--ink); }
.sheet__r { display: grid; grid-template-columns: 34px 1fr; border-bottom: 1px solid var(--rule); }
.sheet__r:last-child { border-bottom: 0; }
.sheet__n { grid-row: span 2; font: 400 12px var(--f-mono); color: var(--muted); background: var(--rule-2); text-align: center; padding-top: 16px; border-right: 1px solid var(--rule); }
.sheet__q { padding: 14px 14px 4px; }
.sheet__t { display: block; font-size: 23px; font-weight: 700; text-decoration: none; }
.sheet__q small { font: 400 12px var(--f-mono); color: var(--green); }
.sheet__l { list-style: none; margin: 0; padding: 4px 14px 14px; font-size: 16px; }
.sheet__l li { padding: 3px 0; }
.sheet__l li::before { content: "→ "; font-family: var(--f-mono); color: var(--green); }
@media (min-width: 921px) {
	.sheet__r { grid-template-columns: 40px 1fr 1.2fr; }
	.sheet__n { grid-row: auto; }
	.sheet__q { padding: 18px; }
	.sheet__l { padding: 18px; border-left: 1px solid var(--rule-2); }
}

.two { display: grid; gap: 30px; }
@media (min-width: 921px) { .two { grid-template-columns: 1.25fr 1fr; gap: 44px; } }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 18px; }
.steps li::before { content: "0" counter(s); font: 600 14px var(--f-mono); color: var(--green); }
.steps span { color: var(--muted); }

/* Лента-журнал */
.feed { border-top: 2px solid var(--ink); }
.row { display: grid; grid-template-columns: 1fr; gap: 2px 18px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.row__d { font: 400 12px var(--f-mono); color: var(--muted); }
.row__t { margin: 2px 0 4px; font-size: 21px; }
.row__t a { text-decoration: none; }
.row__ex { margin: 0; color: var(--muted); font-size: 16px; }
.row__c { justify-self: start; font: 400 11px var(--f-mono); text-decoration: none; border: 1px solid currentColor; padding: 2px 7px; border-radius: 99px; margin-top: 6px; color: var(--green); }
.row__c--nakopleniya { color: var(--blue); }
.row__c--investicii { color: var(--red); }
@media (min-width: 561px) {
	.row { grid-template-columns: 96px 1fr auto; align-items: start; }
	.row__d { padding-top: 8px; }
	.row__c { margin-top: 8px; }
}

/* ---------- Шапка рубрики ---------- */
.ph { padding: 28px 0 18px; border-bottom: 1px solid var(--rule); }
.ph__k { margin: 0; font: 400 12px var(--f-mono); color: var(--green); }
.ph__t { margin: 6px 0 8px; font-size: clamp(28px, 5vw, 42px); }
.ph__d { color: var(--muted); max-width: 62ch; font-size: 17px; }

/* ---------- Статья ---------- */
.art__head, .art__body, .art__cover { max-width: 760px; }
.art__head { padding-top: 28px; }
.art__cat { font: 600 12px var(--f-mono); color: var(--green); text-decoration: none; text-transform: lowercase; }
.art__t { margin: 8px 0 10px; font-size: clamp(30px, 5.4vw, 44px); letter-spacing: -.01em; }
.art__meta { font: 400 12px var(--f-mono); color: var(--muted); }
.art__meta span { margin: 0 8px; }
.art__cover { margin-top: 8px; }
.art__cover img { border: 1.5px solid var(--ink); }
.art__body { padding-bottom: 20px; }
.toc { margin: 18px 0 8px; background: var(--sheet); border: 1.5px solid var(--ink); }
.toc__h { margin: 0; padding: 7px 12px; font: 600 12px var(--f-mono); background: var(--ink); color: #fff; }
.toc ol { list-style: none; counter-reset: t; margin: 0; padding: 0; font-size: 16px; }
.toc li { counter-increment: t; display: grid; grid-template-columns: 34px 1fr; border-top: 1px solid var(--rule-2); }
.toc li::before { content: counter(t); font: 400 11px var(--f-mono); color: var(--muted); background: var(--rule-2); text-align: center; padding-top: 8px; }
.toc a { display: block; padding: 6px 10px; text-decoration: none; }

.content h2 { font-size: clamp(25px, 3.8vw, 31px); scroll-margin-top: 14px; }
.content h3 { font-size: 22px; }
.content li { margin: 5px 0; }
.content strong { font-weight: 700; color: var(--ink); }
.content mark, .content em strong { background: linear-gradient(transparent 55%, var(--marker) 55%); }
.content blockquote { margin: 1.3em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--green); font-style: italic; }
.content code { font: 400 .8em var(--f-mono); background: var(--rule-2); padding: 1px 5px; }
.content img { border: 1px solid var(--rule); }
.content figcaption { font: 400 12px var(--f-mono); color: var(--muted); margin-top: 6px; }
.tbl { overflow-x: auto; margin: 1.3em 0; border: 1.5px solid var(--ink); background: var(--sheet); }
.tbl table { border-collapse: collapse; width: 100%; font-size: 16px; min-width: 440px; counter-reset: row; }
.tbl th { font: 600 12px/1.3 var(--f-mono); background: var(--rule-2); color: var(--ink); text-align: left; padding: 9px 10px; border-bottom: 1.5px solid var(--ink); border-right: 1px solid var(--rule); }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--rule-2); border-right: 1px solid var(--rule-2); vertical-align: top; }
.tbl td.num { font: 400 14px var(--f-mono); text-align: right; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.sum { margin: 1.8em 0; padding: 2px 18px 8px; background: var(--green-bg); border-left: 4px solid var(--green); }
.sum h2 { margin-top: .7em; font-size: 22px; }

.author { display: grid; grid-template-columns: 52px 1fr; gap: 14px; margin: 30px 0 10px; padding: 16px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.author__m { width: 52px; height: 52px; display: grid; place-items: center; background: var(--ink); color: var(--marker); font: 600 15px var(--f-mono); }
.author p { margin: 0; font-size: 16px; }

.mgk-slot { margin: 22px 0; }
.mgk-offer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px; background: var(--sheet); border: 1.5px solid var(--ink); box-shadow: 4px 4px 0 var(--green); }
.mgk-offer__note { font: 400 11px var(--f-mono); color: var(--muted); }
.mgk-offer__title { font-weight: 700; margin: 2px 0; }
.mgk-offer__text { margin: 0; font-size: 16px; }
.mgk-offer__btn { font: 600 13px var(--f-mono); background: var(--green); color: #fff; padding: 10px 14px; text-decoration: none; }

/* ---------- Калькуляторы ---------- */
.calc { margin: 1.3em 0; background: var(--sheet); border: 1.5px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); font-size: 16px; }
.calc__h { margin: 0; padding: 8px 12px; font: 600 12px var(--f-mono); background: var(--ink); color: #fff; }
.calc__in { display: grid; gap: 10px; padding: 14px; }
.calc label { display: grid; gap: 4px; font: 400 12px var(--f-mono); color: var(--muted); }
.calc input, .calc select { font: 400 16px var(--f-mono); padding: 9px 10px; border: 1px solid var(--rule); background: var(--paper); border-radius: var(--r); width: 100%; color: var(--ink); }
.calc input:focus, .calc select:focus { outline: 2px solid var(--marker); border-color: var(--ink); }
.calc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc__out { border-top: 1px solid var(--rule); }
.calc__row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--rule-2); }
.calc__row b { font: 600 15px var(--f-mono); color: var(--ink); white-space: nowrap; }
.calc__row--total { background: var(--green-bg); }
.calc__row--total b { color: var(--green); }
.calc__bar { display: flex; height: 12px; margin: 0 14px 14px; border: 1px solid var(--ink); }
.calc__bar i { display: block; height: 100%; }
.calc__bar i:nth-child(1) { background: var(--green); }
.calc__bar i:nth-child(2) { background: var(--marker); }
.calc__bar i:nth-child(3) { background: var(--blue); }
.calc__note { margin: 0; padding: 0 14px 14px; font-size: 14px; color: var(--muted); }
.calc__btn { font: 600 13px var(--f-mono); background: var(--green); color: #fff; border: 0; padding: 11px 14px; cursor: pointer; border-radius: var(--r); }
.calc table { width: 100%; border-collapse: collapse; font: 400 13px var(--f-mono); }
.calc th, .calc td { padding: 6px 10px; border-bottom: 1px solid var(--rule-2); text-align: right; }
.calc th:first-child, .calc td:first-child { text-align: left; }
.calc__scroll { overflow-x: auto; max-height: 280px; }

/* ---------- Поиск, страница, 404 ---------- */
.finder { display: flex; gap: 6px; max-width: 520px; }
.finder input { flex: 1; min-width: 0; font: 400 15px var(--f-mono); padding: 10px 12px; border: 1.5px solid var(--ink); background: var(--sheet); border-radius: var(--r); }
.finder button { font: 600 13px var(--f-mono); border: 0; background: var(--ink); color: #fff; padding: 0 14px; border-radius: var(--r); cursor: pointer; }
.pg { max-width: 760px; padding-top: 28px; padding-bottom: 30px; }
.pg__t { margin-top: 0; font-size: clamp(30px, 5vw, 42px); }
.nf { max-width: 700px; padding-top: 44px; padding-bottom: 44px; }
.nf__cell { display: inline-flex; flex-direction: column; border: 1.5px solid var(--ink); background: var(--sheet); padding: 12px 18px; box-shadow: 4px 4px 0 var(--red); }
.nf__cell span { font: 600 40px/1 var(--f-mono); color: var(--red); }
.nf__cell small { font: 400 12px var(--f-mono); color: var(--muted); margin-top: 6px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0; font-family: var(--f-mono); font-size: 13px; }
.page-numbers { padding: 6px 11px; border: 1px solid var(--rule); background: var(--sheet); text-decoration: none; }
.page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Подвал ---------- */
.ft { margin-top: 44px; border-top: 2px solid var(--ink); background: var(--sheet); }
.ft__row { display: grid; gap: 12px; padding-top: 24px; padding-bottom: 14px; }
.ft__t { margin: 0; font-size: 16px; color: var(--muted); max-width: 56ch; }
.ft__c { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; padding-top: 12px; padding-bottom: 20px; border-top: 1px solid var(--rule); font: 400 12px var(--f-mono); color: var(--muted); }
.ft__l { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ft__l a { color: var(--ink); }
@media (min-width: 921px) { .ft__row { grid-template-columns: auto 1fr; align-items: center; gap: 40px; } }
@media (prefers-reduced-motion: reduce) { .logo__c { animation: none; } }
