/*
Theme Name: Dvornichenko 2026
Theme URI: https://dvornichenko.com/
Author: Michael Dvornichenko
Description: Institutional theme for dvornichenko.com — navy chrome, IBM Plex, strict rule-based grid. Multilingual (Polylang), English primary.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dvn
*/

/* ============================================================ tokens === */

:root {
    --navy:        #14243A;
    --navy-deep:   #0D1725;
    --steel:       #3E5C82;
    --ink:         #10141A;
    --ink-body:    #22262D;
    --ink-soft:    #59616D;
    --ink-mute:    #7A828E;
    --ink-faint:   #A6AEBA;
    --paper:       #FFFFFF;
    --surface:     #F5F6F8;
    --rule:        #DDE1E7;
    --rule-soft:   #EDEFF2;
    --on-navy:     #C3CCD9;
    --on-navy-dim: #8C99AB;

    --wrap: 1200px;
    --pad: 40px;

    --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
    --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

/* ============================================================= reset === */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--steel); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.018em; line-height: 1.3; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.25em; }

:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }

.screen-reader-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* =========================================================== helpers === */

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

.lbl {
    font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--ink-mute);
}
.lbl--accent { color: var(--steel); }
.lbl--faint  { color: var(--ink-faint); }

.band { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

.btn {
    display: inline-block; font-size: 15px; font-weight: 500;
    padding: 14px 26px; border: 1px solid var(--navy);
    background: var(--navy); color: #fff; text-align: center;
}
.btn:hover { background: var(--navy-deep); border-color: var(--navy-deep); color: #fff; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink-faint); }
.btn--light { background: #fff; color: var(--navy); border-color: #fff; font-weight: 600; }
.btn--light:hover { background: var(--surface); color: var(--navy); border-color: var(--surface); }

.grid-hair { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.grid-hair > * { background: var(--paper); }

/* ============================================================ header === */

.topbar { background: var(--navy); }
.topbar__inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 34px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.topbar a, .topbar span { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }
.topbar a { color: var(--on-navy-dim); }
.topbar a:hover { color: #fff; text-decoration: none; }

.langs { display: flex; gap: 14px; align-items: center; }
.langs .is-current { color: #fff; }
.topbar__contact { display: flex; gap: 24px; align-items: center; color: var(--on-navy-dim); }

.masthead { background: var(--navy); }
.masthead__inner {
    display: flex; align-items: center; justify-content: space-between; gap: 32px;
    padding-top: 22px; padding-bottom: 22px;
}
.brand { display: flex; flex-direction: column; gap: 3px; }
.brand__name { font-size: 21px; font-weight: 600; color: #fff; letter-spacing: -0.01em; }
.brand__name:hover { color: #fff; text-decoration: none; }
.brand__role { font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-navy-dim); }

.nav { display: flex; gap: 32px; align-items: center; }
.nav a { font-size: 14px; font-weight: 500; color: var(--on-navy); }
.nav a:hover { color: #fff; text-decoration: none; }
.nav .current-menu-item > a,
.nav .current_page_parent > a,
.nav a.is-current { color: #fff; border-bottom: 2px solid #fff; padding-bottom: 3px; }

.nav-toggle {
    display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
    background: none; border: 0; cursor: pointer; padding: 0;
}
.nav-toggle span { display: block; width: 20px; height: 1.7px; background: #fff; margin: 3px 0; }

/* ============================================================== hero === */

.hero { display: grid; grid-template-columns: minmax(0,7fr) minmax(0,5fr); gap: 56px; align-items: center;
        padding-top: 56px; padding-bottom: 44px; }
.hero__text { display: flex; flex-direction: column; gap: 22px; }
.hero__title { font-size: 46px; line-height: 1.16; letter-spacing: -0.022em; text-wrap: pretty; }
.hero__lede { font-family: var(--serif); font-size: 19px; line-height: 1.65; color: #3A414A; max-width: 56ch; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 6px; }
.hero__photo { border: 1px solid var(--rule); }

/* =========================================================== sectors === */

.sectors { display: grid; grid-template-columns: minmax(0,7fr) minmax(0,5fr); gap: 56px; align-items: center;
           padding-top: 28px; padding-bottom: 28px; }
.sectors__text { display: flex; flex-direction: column; gap: 9px; }
.sectors__text p { font-size: 17px; line-height: 1.6; color: var(--ink-body); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { font-size: 13px; color: var(--ink-body); background: var(--paper); border: 1px solid var(--rule); padding: 8px 14px; }

/* ========================================================== sections === */

.section { padding-top: 50px; padding-bottom: 44px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 32px; margin-bottom: 26px; }
.section__head--stack { flex-direction: column; align-items: flex-start; gap: 10px; }
.section h2 { font-size: 26px; }
.section__sub { font-size: 16px; line-height: 1.6; color: var(--ink-soft); max-width: 72ch; }

.cards-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.card { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.card__title { font-size: 18px; font-weight: 600; line-height: 1.35; }
.card p { font-size: 15px; line-height: 1.6; color: var(--ink-soft); }

.cases { display: flex; flex-direction: column; }
.case { padding: 26px 28px; display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 32px; align-items: start; }
.case__meta { display: flex; flex-direction: column; gap: 6px; }
.case__client { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.case__title { font-size: 18px; font-weight: 600; line-height: 1.4; }
.case p { font-size: 15px; line-height: 1.65; color: #3A414A; }
.case__body { display: flex; flex-direction: column; gap: 9px; }

.orgs { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 32px; }
.org { border-top: 2px solid var(--navy); padding-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.org__name { font-size: 18px; font-weight: 600; }
.org p { font-size: 15px; line-height: 1.6; color: var(--ink-soft); }

.bio-note {
    font-family: var(--serif); font-size: 16px; line-height: 1.7; color: var(--ink-soft);
    border-left: 3px solid var(--rule); padding-left: 18px; max-width: 92ch; margin-top: 8px;
}

/* ======================================================= post teaser === */

.teasers { grid-template-columns: repeat(3, minmax(0,1fr)); }
.teaser { padding: 24px; display: flex; flex-direction: column; gap: 11px; }
.teaser__meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.teaser__title { font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.teaser__title:hover { color: var(--steel); }
.teaser p { font-size: 14px; line-height: 1.6; color: var(--ink-soft); }

/* ========================================================== contact === */

.contact { background: var(--navy); }
.contact__inner { display: flex; align-items: center; justify-content: space-between; gap: 48px;
                  padding-top: 44px; padding-bottom: 44px; }
.contact h2 { font-size: 26px; color: #fff; }
.contact p { font-size: 16px; color: #A9B4C4; max-width: 64ch; line-height: 1.6; margin-top: 9px; }

/* =========================================================== footer === */

.footer { background: var(--navy-deep); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 26px;
                 padding-top: 26px; padding-bottom: 26px; }
.footer, .footer span { font-size: 13px; color: #7A879A; }
.footer a { font-size: 13px; color: var(--on-navy); }
.footer a:hover { color: #fff; text-decoration: none; }
.footer__links { display: flex; gap: 26px; flex-wrap: wrap; }

/* ======================================================= blog index === */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 60px;
             padding-top: 46px; padding-bottom: 28px; }
.page-head__text { display: flex; flex-direction: column; gap: 16px; }
.page-head h1 { font-size: 40px; letter-spacing: -0.022em; }
.page-head p { font-size: 16px; line-height: 1.65; color: var(--ink-soft); max-width: 64ch; }
.page-head__count { display: flex; flex-direction: column; gap: 5px; text-align: right; padding-bottom: 4px; }
.page-head__count b { font-size: 36px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }

.filters { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
           border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 13px 0; }
.filters__list { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters a, .filters .is-active { font-size: 14px; padding: 8px 16px; border: 1px solid var(--rule); color: var(--ink); }
.filters .is-active { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 500; }
.filters a:hover { border-color: var(--ink-faint); text-decoration: none; }

.year-rule { display: flex; align-items: center; gap: 18px; padding: 22px 0 8px; }
.year-rule:first-child { padding-top: 14px; }
.year-rule i { flex-grow: 1; height: 1px; background: var(--rule-soft); }

.entry-row { display: grid; grid-template-columns: 100px minmax(0,1fr) 180px; gap: 28px;
             border-bottom: 1px solid var(--rule); padding: 20px 0; align-items: baseline; }
.entry-row--first { border-top: 2px solid var(--navy); }
.entry-row__body { display: flex; flex-direction: column; gap: 7px; }
.entry-row__title { font-size: 19px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.entry-row__title:hover { color: var(--steel); }
.entry-row p { font-size: 14px; line-height: 1.6; color: var(--ink-soft); max-width: 82ch; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
         border-top: 1px solid var(--rule); padding-top: 20px; margin-top: 30px; margin-bottom: 50px; }
.pager .page-numbers { font-size: 14px; padding: 9px 15px; border: 1px solid var(--rule); color: var(--ink); }
.pager .page-numbers.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager .page-numbers:hover { border-color: var(--ink-faint); text-decoration: none; }
.pager .nav-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================================================= post === */

.crumbs { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 18px; }
.crumbs span, .crumbs a { font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.crumbs .sep { color: var(--on-navy); }

.post-head { padding-top: 22px; padding-bottom: 40px; }
.post-head__inner { max-width: 800px; display: flex; flex-direction: column; gap: 20px; }
.post-head h1 { font-size: 40px; line-height: 1.2; letter-spacing: -0.022em; text-wrap: pretty; }
.post-head__lede { font-family: var(--serif); font-size: 20px; color: #4C545F; line-height: 1.6; }
.post-meta { display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
             border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 13px 0; }
.post-meta .sep { color: var(--rule); }

.post-layout { display: grid; grid-template-columns: minmax(0,800px) minmax(0,1fr); gap: 56px;
               align-items: start; padding-bottom: 20px; }

.prose { font-family: var(--serif); font-size: 18px; line-height: 1.75; color: var(--ink-body); }
.prose > * + * { margin-top: 24px; }
.prose h2 { font-family: var(--sans); font-size: 25px; margin-top: 34px; }
.prose h3 { font-family: var(--sans); font-size: 20px; margin-top: 28px; }
.prose img { border: 1px solid var(--rule); }
.prose figure { margin: 0; }
.prose figcaption { font-family: var(--sans); font-size: 13px; color: var(--ink-mute); line-height: 1.5; margin-top: 10px; }
.prose blockquote { margin: 0; border-left: 3px solid var(--navy); background: var(--surface); padding: 18px 22px; }
.prose pre { background: var(--navy-deep); color: #E4E8EE; padding: 20px 22px; overflow-x: auto;
             font-family: var(--mono); font-size: 14px; line-height: 1.7; }
.prose code { font-family: var(--mono); font-size: .92em; background: var(--surface); padding: 2px 5px; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 10px 12px; text-align: left; }
.prose th { background: var(--surface); font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.author-box { border-top: 1px solid var(--rule); margin-top: 16px; padding-top: 22px;
              display: flex; gap: 20px; align-items: flex-start; }
.author-box img { width: 80px; height: 80px; object-fit: cover; border: 1px solid var(--rule); }
.author-box__text { display: flex; flex-direction: column; gap: 6px; }
.author-box__name { font-size: 17px; font-weight: 600; }
.author-box p { font-size: 14px; line-height: 1.6; color: var(--ink-soft); max-width: 58ch; }

.aside { display: flex; flex-direction: column; gap: 28px; position: sticky; top: 24px; }
.aside__block { border-top: 1px solid var(--rule); padding-top: 14px; display: flex; flex-direction: column; gap: 11px; }
.aside__block--lead { border-top: 2px solid var(--navy); }
.aside__block a { font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--ink); }
.aside__block a:hover { color: var(--steel); }
.aside__cta { background: var(--surface); border: 1px solid var(--rule); padding: 20px;
              display: flex; flex-direction: column; gap: 11px; }
.aside__cta strong { font-size: 17px; font-weight: 600; line-height: 1.35; }
.aside__cta p { font-size: 14px; line-height: 1.6; color: var(--ink-soft); }

/* ========================================================= comments === */

.comments { max-width: 800px; padding-top: 36px; }
.comments__head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
                  border-top: 2px solid var(--navy); padding-top: 16px; margin-bottom: 20px; }
.comments__head h2 { font-size: 22px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ul.children { list-style: none; margin: 0 0 0 40px; padding: 0; }
.comment-body { border-bottom: 1px solid var(--rule); padding: 16px 0; display: flex; gap: 16px; }
.comment-body .avatar { width: 40px; height: 40px; flex-shrink: 0; }
.comment-meta { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.comment-author { font-size: 15px; font-weight: 600; }
.comment-content { font-size: 15px; line-height: 1.65; color: #3A414A; }
.comment-content p + p { margin-top: 12px; }
.comment-respond { margin-top: 26px; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url],
.comment-form textarea, .search-field {
    width: 100%; font-family: var(--sans); font-size: 15px; color: var(--ink);
    border: 1px solid var(--rule); background: #fff; padding: 12px 14px;
}
.comment-form textarea { min-height: 120px; }
.comment-form .submit, .search-submit {
    font-family: var(--sans); font-size: 14px; font-weight: 500; cursor: pointer;
    background: var(--navy); color: #fff; border: 1px solid var(--navy); padding: 11px 22px;
}
.comment-form p { margin-top: 14px; }

/* ============================================================ pages === */

.page-body { padding-top: 40px; padding-bottom: 60px; }
.page-body h1 { font-size: 40px; letter-spacing: -0.022em; margin-bottom: 24px; }

.notice { padding: 80px 0; text-align: center; }
.notice h1 { font-size: 40px; margin-bottom: 16px; }
.notice p { color: var(--ink-soft); }

/* ======================================================== responsive === */

@media (max-width: 1080px) {
    .case { grid-template-columns: 1fr; gap: 14px; }
    .post-layout { grid-template-columns: 1fr; gap: 40px; }
    .aside { position: static; }
    .entry-row { grid-template-columns: 92px minmax(0,1fr); }
    .entry-row > .lbl:last-child { grid-column: 2; }
}

@media (max-width: 900px) {
    :root { --pad: 20px; }
    .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 30px; padding-bottom: 28px; }
    .hero__title { font-size: 32px; }
    .hero__lede { font-size: 17px; }
    .sectors { grid-template-columns: 1fr; gap: 16px; }
    .cards-3, .teasers { grid-template-columns: 1fr; }
    .orgs { grid-template-columns: 1fr; gap: 20px; }
    .section { padding-top: 32px; padding-bottom: 28px; }
    .section h2 { font-size: 22px; }
    .section__head { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-head { flex-direction: column; align-items: flex-start; gap: 20px; padding-top: 30px; }
    .page-head h1 { font-size: 30px; }
    .page-head__count { text-align: left; }
    .post-head h1 { font-size: 29px; }
    .post-head__lede { font-size: 17px; }
    .prose { font-size: 17px; }
    .contact__inner, .footer__inner { flex-direction: column; align-items: flex-start; gap: 18px; }
    .masthead__inner { padding-top: 0; padding-bottom: 0; height: 58px; }
    .brand__name { font-size: 16px; }
    .nav {
        display: none; position: absolute; left: 0; right: 0; top: 92px; z-index: 40;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--navy); border-top: 1px solid rgba(255,255,255,.12);
    }
    .nav.is-open { display: flex; }
    .nav a { padding: 15px var(--pad); border-bottom: 1px solid rgba(255,255,255,.1); }
    .nav .current-menu-item > a, .nav a.is-current { border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 15px; }
    .nav-toggle { display: flex; }
    .topbar__contact { gap: 14px; }
    .entry-row { grid-template-columns: 1fr; gap: 8px; }
    .btn { width: 100%; }
    .hero__actions { flex-direction: column; }
}

@media (max-width: 560px) {
    .topbar__contact span { display: none; }
}
