:root {
    --paper: #f5f1e8;
    --paper-deep: #ebe5d9;
    --ink: #171713;
    --muted: #665f55;
    --line: #cfc6b6;
    --accent: #8c2f27;
    --accent-dark: #5f1e19;
    --white: #fffdf8;
}

html { box-sizing: border-box; scroll-behavior: smooth; }
*, *:before, *:after { box-sizing: inherit; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.75 "Source Serif 4", Georgia, serif; }
a { color: var(--accent-dark); text-underline-offset: .18em; }
a:hover, a:focus { color: var(--accent); text-decoration-thickness: 2px; }
.skip-link { position: fixed; left: 12px; top: -100px; z-index: 100; padding: 10px 14px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(245,241,232,.97); backdrop-filter: blur(10px); }
.site-header__inner { max-width: 1480px; margin: 0 auto; padding: 16px 28px 12px; }
.site-brand { display: block; margin-bottom: 12px; }
.site-brand__logo-link { display: flex; flex: 0 0 auto; }
.site-brand__logo { display: block; width: 300px; max-width: 82vw; height: auto; }
.site-title { color: var(--ink); font: 700 2.15rem/1 "Rubik", sans-serif; letter-spacing: -.045em; text-decoration: none; }
.site-tagline { margin: 7px 0 0; color: var(--muted); font: 400 .92rem/1.35 "Rubik", sans-serif; }

.top-nav { display: flex; align-items: center; gap: 8px 18px; border-top: 1px solid var(--line); padding-top: 10px; font: 500 .88rem/1.25 "Rubik", sans-serif; }
.top-nav > a, .nav-group__link, .nav-group__menu a { color: #49443d; text-decoration: none; }
.top-nav > a, .nav-group__link { display: block; padding: 7px 0; white-space: nowrap; }
.top-nav .active > .nav-group__header .nav-group__link, .top-nav > a.active { color: var(--accent-dark); font-weight: 700; }
.top-nav-toggle, .nav-group__toggle { display: none; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.nav-group { position: relative; }
.nav-group__header { display: flex; align-items: center; gap: 6px; }
.nav-group__menu { position: absolute; left: -14px; top: 100%; display: none; min-width: 363px; padding: 10px 14px; border: 1px solid var(--line); background: var(--white); box-shadow: 0 20px 40px rgba(40,30,20,.13); }
.nav-group:hover > .nav-group__menu, .nav-group:focus-within > .nav-group__menu { display: block; }
.nav-group__menu > a { display: block; padding: 8px; }
.nav-group__menu a:hover, .nav-group__menu a:focus { color: var(--accent-dark); background: var(--paper-deep); }
.nav-group__menu a.active { color: var(--accent-dark); background: transparent; font-weight: 700; }
.nav-subgroup { position: relative; border-bottom: 1px solid #e9e1d4; }
.nav-subgroup:last-child { border: 0; }
.nav-subgroup__link { display: flex; justify-content: space-between; gap: 20px; padding: 11px 8px; font-weight: 700; }
.nav-subgroup:hover > .nav-subgroup__link, .nav-subgroup:focus-within > .nav-subgroup__link { color: var(--accent-dark); background: var(--paper-deep); }
.nav-subgroup__link.active, .nav-subgroup:hover > .nav-subgroup__link.active, .nav-subgroup:focus-within > .nav-subgroup__link.active { color: var(--accent-dark); background: transparent; font-weight: 700; }
.nav-subgroup__menu { position: absolute; left: calc(100% + 14px); top: -11px; display: none; width: 410px; max-height: 70vh; overflow-y: auto; padding: 10px 14px; border: 1px solid var(--line); background: var(--white); box-shadow: 0 20px 40px rgba(40,30,20,.13); }
.nav-subgroup:hover .nav-subgroup__menu, .nav-subgroup:focus-within .nav-subgroup__menu { display: block; }
.nav-subgroup__menu a { display: block; padding: 8px; line-height: 1.35; }
.nav-subgroup__menu a:hover, .nav-subgroup__menu a:focus { color: var(--accent-dark); background: var(--paper-deep); }
.nav-subgroup__menu a.active { color: var(--accent-dark); background: transparent; font-weight: 700; }

.layout { max-width: 1040px; margin: 0 auto; padding: 52px 28px 86px; }
.article-header { min-width: 0; margin-bottom: 32px; overflow-wrap: break-word; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font: 700 .76rem/1.2 "Rubik", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.article-header h1 { max-width: 900px; margin: 0 0 18px; font: 700 clamp(2.55rem, 7vw, 5.5rem)/.98 "Rubik", sans-serif; letter-spacing: -.055em; }
.article-header--group h1 { font-size: clamp(2.5rem, 6vw, 4.8rem); }
.article-summary { max-width: 820px; margin: 0; color: #39342e; font-size: 1.23rem; line-height: 1.6; }
.article-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; color: var(--muted); font: 400 .84rem/1.45 "Rubik", sans-serif; }
.context-note { min-width: 0; margin: 0 0 36px; padding: 15px 18px; border-left: 5px solid var(--accent); background: var(--paper-deep); font: 400 .91rem/1.55 "Rubik", sans-serif; overflow-wrap: break-word; }

.article-body { color: #25211d; font-size: 1.08rem; }
.article-body > * { max-width: 820px; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4 { clear: both; margin: 54px 0 18px; color: var(--ink); font-family: "Rubik", sans-serif; line-height: 1.12; letter-spacing: -.035em; }
.article-body h2 { font-size: 2.15rem; }
.article-body h3 { font-size: 1.5rem; }
.article-body p, .article-body ul, .article-body ol, .article-body blockquote, .table-wrap { margin: 0 0 23px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote { padding: 2px 0 2px 20px; border-left: 4px solid var(--accent); color: #484037; font-size: 1.08em; }
.article-body hr { margin: 42px 0; border: 0; border-top: 1px solid var(--line); }
.article-body sup a { color: var(--accent); font-family: "Rubik", sans-serif; font-weight: 700; text-decoration: none; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { padding: 11px 13px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--paper-deep); font-family: "Rubik", sans-serif; font-size: .88rem; }
.article-figure--right { float: right; width: min(40%, 380px); margin: 5px 0 24px 30px; }
.article-figure--full { max-width: 100%; margin: 32px 0; }
.article-body figure img { display: block; max-width: 100%; height: auto; }
.article-body figcaption { margin-top: 8px; color: var(--muted); font: 400 .82rem/1.5 "Rubik", sans-serif; }
.article-body figcaption p { margin: 0; }
.article-embed { position: relative; max-width: 820px; height: 0; margin: 30px 0; padding-bottom: 56.25%; background: #111; }
.article-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.group-section { max-width: 100%; margin-bottom: 56px; }
.group-section h2 { margin-bottom: 8px; }
.group-section__description { color: var(--muted); }
.article-cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; max-width: 100%; margin: 24px 0 0; padding: 1px; list-style: none; background: var(--line); }
.article-cards li { margin: 0; padding: 22px; background: var(--white); }
.article-card__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; color: var(--accent); font: 700 .7rem/1.35 "Rubik", sans-serif; letter-spacing: .055em; text-transform: uppercase; }
.article-card__title { display: inline-block; margin-bottom: 8px; color: var(--ink); font: 700 1.12rem/1.25 "Rubik", sans-serif; text-decoration: none; }
.article-cards p { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.55; }

.footnotes { margin-top: 58px; padding-top: 28px; border-top: 2px solid var(--ink); }
.footnotes h2 { margin: 0 0 22px; font: 700 1.8rem/1.1 "Rubik", sans-serif; }
.footnotes ol { padding-left: 25px; }
.footnotes li { margin-bottom: 14px; color: #514a41; font-size: .92rem; }
.footnote-backref { color: var(--accent); text-decoration: none; }

.article--homepage .article-body > h1:first-child { max-width: 900px; margin-top: 0; font: 700 clamp(3.3rem, 8vw, 6.8rem)/.92 "Rubik", sans-serif; letter-spacing: -.065em; }
.article--homepage .article-body > p:first-of-type { max-width: 820px; color: #39342e; font-size: 1.3rem; }
.site-footer { border-top: 1px solid var(--line); background: var(--ink); color: #ece6dc; }
.site-footer__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 30px; max-width: 1480px; margin: 0 auto; padding: 34px 28px; font: 400 .84rem/1.5 "Rubik", sans-serif; }
.site-footer p { margin: 0; }
.site-footer__logo-link { display: inline-flex; align-items: center; justify-content: center; justify-self: center; }
.site-footer__logo { display: block; max-width: 100%; width: auto; height: 28px; }
.site-footer__formacja-link { display: inline-flex; flex: 0 0 auto; align-items: center; justify-self: end; gap: 11px; text-decoration: none; }
.site-footer__formacja-link img { display: block; flex: 0 0 auto; object-fit: contain; }
.site-footer__formacja-symbol { width: 37.02px; height: 35.04px; }
.site-footer__formacja-wordmark { width: auto; height: 33px; transform: translateY(3.97px); }
.site-footer a { color: #fff; }

@media (max-width: 980px) {
    .site-header__inner { padding: 13px 18px; }
    .site-brand { margin-bottom: 6px; }
    .site-tagline { max-width: 720px; }
    .top-nav-toggle { display: block; padding: 8px 0 2px; font: 700 .88rem "Rubik", sans-serif; }
    .top-nav { display: none; margin-top: 8px; padding-top: 10px; }
    .top-nav.is-open { display: block; max-height: 70vh; overflow-y: auto; }
    .nav-group__header { justify-content: space-between; }
    .nav-group__toggle { position: relative; display: block; width: 34px; height: 34px; }
    .nav-group__toggle:before, .nav-group__toggle:after { content: ''; position: absolute; left: 11px; top: 16px; width: 12px; height: 2px; background: currentColor; }
    .nav-group__toggle:after { transform: rotate(90deg); }
    .nav-group__toggle[aria-expanded="true"]:after { display: none; }
    .nav-group__menu, .nav-subgroup__menu { position: static; display: none; width: auto; min-width: 0; max-height: none; margin: 0; padding: 2px 0 8px 12px; border: 0; background: transparent; box-shadow: none; }
    .nav-group:hover > .nav-group__menu, .nav-group:focus-within > .nav-group__menu { display: none; }
    .nav-group.is-open > .nav-group__menu, .nav-group.is-open .nav-subgroup__menu { display: block; }
    .nav-subgroup__link { padding-left: 0; }
    .nav-subgroup__link span { display: none; }
    .nav-subgroup__menu a { padding-left: 10px; }
    .layout { padding: 34px 18px 60px; }
}

@media (max-width: 680px) {
    body { font-size: 16px; }
    .site-brand__logo { width: 250px; height: auto; }
    .site-tagline { font-size: .78rem; }
    .article-header h1 { font-size: clamp(2.35rem, 14vw, 4rem); }
    .article-summary { font-size: 1.08rem; }
    .article-body h2 { font-size: 1.75rem; }
    .article-cards { grid-template-columns: 1fr; }
    .article-figure--right { float: none; width: 100%; margin: 30px 0; }
    .site-footer__inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .site-footer__logo-link, .site-footer__formacja-link { justify-self: center; margin-top: 22px; }
}

@media (max-width: 390px) {
    .site-footer__formacja-link { gap: 9.17px; }
    .site-footer__formacja-symbol { width: 31.73px; height: 30.03px; }
    .site-footer__formacja-wordmark { height: 28.29px; transform: translateY(3.4px); }
}
