/*
Theme Name: Nsoniki
Theme URI: https://github.com/10GUNXANG01/nsoniki-web
Author: Nsoniki
Description: Kinshasa sign painting on a woven ground: one earth-brown wall, cream lettering, heavy black outlines, square corners. The site theme for Nsoniki Mandombe. Use it with the Nsoniki Mandombe plugin, which supplies the zita, the interactive blocks and the pages.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nsoniki
Tags: block-styles, full-site-editing, one-column, custom-colors
*/

/* Layout: Kinshasa sign painting on a woven ground. One earth-brown wall, cream lettering,
   heavy black outlines; gold marks the Pakundungu family and red the Pelekete family,
   as in the Nsoniki reference drawings. One deliberate look; no light theme. */
:root {
  --paper: var(--wp--preset--color--paper, #4A2C1D);
  --surface: var(--wp--preset--color--surface, #3A2216);
  --wash: var(--wp--preset--color--wash, #573525);
  --ink: var(--wp--preset--color--ink, #E8DCC0);
  --ink-soft: var(--wp--preset--color--ink-soft, #D8C8AA);
  --muted: var(--wp--preset--color--muted, #BFA98D);
  --rule: var(--wp--preset--color--rule, #6E4A35);
  --line: var(--wp--preset--color--line, #171512);
  --gold: var(--wp--preset--color--gold, #D4A72C);
  --gold-2: var(--wp--preset--color--gold-2, #F2D88A);
  --red: var(--wp--preset--color--red, #FF4433);
  --red-2: var(--wp--preset--color--red-2, #FF9C8F);
  --green: var(--wp--preset--color--green, #395E3C);
  --gold-hover: #E6BC48;
  --display: var(--wp--preset--font-family--display, "Alfa Slab One", Rockwell, Georgia, serif);
  --body: var(--wp--preset--font-family--body, Archivo, "Helvetica Neue", Arial, sans-serif);
  --code: var(--wp--preset--font-family--code, ui-monospace, Menlo, Consolas, monospace);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow-x: clip;
}
.wrap { max-width: 1120px; margin: 0 auto; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-hover); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.05; text-wrap: balance; margin: 0; letter-spacing: 0; color: var(--ink); }
h1 { font-size: clamp(40px, 6vw, 66px); }
h2 { font-size: clamp(32px, 4.4vw, 50px); }
h3 { font-size: 22px; }
p { margin: 0; }
img { max-width: 100%; }
code { font: 400 15px var(--code); }
em { font-style: italic; }

/* citations: the [1]–[5] references, set as small superscript links */
sup { font: 600 11px var(--body); vertical-align: super; line-height: 0; }
sup a { text-decoration: none; color: var(--gold-2); margin-left: 1px; }
sup a:hover { color: var(--gold); }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.top .wp-block-navigation { font: 800 16px var(--body); }
.top .wp-block-navigation .wp-block-navigation__container { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; }
.top .wp-block-navigation .wp-block-navigation-item__content { color: var(--ink); text-decoration: none; padding: 4px 0; display: block; }
.top .wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--gold); }
.top .wp-block-navigation .wp-block-navigation-item__content[aria-current="page"] { color: var(--gold); box-shadow: inset 0 -4px 0 var(--gold); }
.top .wp-block-navigation .app-link .wp-block-navigation-item__content { background: var(--gold); color: var(--line); padding: 6px 14px; }
.top .wp-block-navigation .app-link .wp-block-navigation-item__content[aria-current="page"] { box-shadow: 4px 4px 0 var(--line); }
.top .wp-block-navigation .app-only .wp-block-navigation-item__content { color: var(--gold); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); gap: 56px; align-items: center; padding-block: 40px 56px; }
.hero h1 { font-size: clamp(44px, 7vw, 82px); color: var(--ink); text-shadow: 5px 5px 0 var(--red); }
body .lede { font-size: 19px; font-weight: 500; color: var(--ink-soft); max-width: 32em; margin-top: 22px; }

/* buttons: square, black outline, hard shadow */
.wp-block-buttons.actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.wp-block-button .wp-block-button__link, .wp-element-button {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; font: 800 17px/1.2 var(--body);
  text-decoration: none; border: 3px solid var(--line); border-radius: 0; color: var(--line); background: var(--ink); cursor: pointer; box-shadow: 4px 4px 0 var(--line);
}
.wp-block-button .wp-block-button__link:hover, .wp-element-button:hover { color: var(--line); background: #FFF6E0; }
.wp-block-button .wp-block-button__link:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); }
.wp-block-button.primary .wp-block-button__link, .wp-block-button.is-style-primary .wp-block-button__link { background: var(--gold); color: var(--line); }
.wp-block-button.primary .wp-block-button__link:hover, .wp-block-button.is-style-primary .wp-block-button__link:hover { background: var(--gold-hover); }

/* jump links */
.jump { display: flex; gap: 6px 22px; flex-wrap: wrap; padding-block: 18px; font: 800 16px var(--body); }
.jump a { color: var(--ink); text-decoration: none; }
.jump a:hover { color: var(--gold); }

/* ---------- sections ---------- */
section.wp-block-group, .site-main section { padding-block: 64px; border-top: 3px solid var(--line); }
body .sec-head { display: grid; gap: 14px; max-width: 42em; margin-bottom: 34px; }
.sec-head h2 { font-size: clamp(32px, 4.4vw, 50px); color: var(--ink); }
.sec-head p { color: var(--ink-soft); }
.two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.prose { display: grid; gap: 16px; max-width: 38em; color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 800; }
.eyebrow { font: 600 15px/1.4 var(--body); color: var(--ink-soft); }
.hint { font-size: 14px; color: var(--muted); }
.wp-block-group > p.hint, .entry-content > p.hint { margin-top: 12px; }
body .subhead { font-size: 26px; margin: 40px 0 16px; }
body .legend { margin-top: 14px; font-size: 15px; color: var(--ink-soft); }

/* origin: photo above the drawn wall */
.side { display: grid; gap: 22px; min-width: 0; }
.wp-block-image.photo { margin: 0; border: 4px solid var(--line); overflow: hidden; background: var(--surface); }
.wp-block-image.photo img { display: block; width: 100%; height: auto; }
.wp-block-image.photo figcaption { margin: 0; padding: 10px 14px; font-size: 14px; text-align: left; color: var(--ink-soft); border-top: 3px solid var(--line); }

/* construction chain */
.chain { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 3px solid var(--line); background: var(--surface); overflow: hidden; }
.chain > .link { padding: 20px 18px 22px; display: grid; gap: 10px; align-content: start; border-right: 3px solid var(--line); }
.chain > .link:last-child { border-right: 0; }
.link h3 { font-size: 21px; }
.link .op { font: 800 14px var(--body); color: var(--gold-2); }
.link p { font-size: 15px; color: var(--ink-soft); }
.chain + .notes { margin-top: 36px; }

/* notes */
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 30px 44px; }
body .notes h3 { font-size: 22px; margin-bottom: 8px; }
.notes p { color: var(--ink-soft); font-size: 16px; }
.notes strong { color: var(--ink); font-weight: 800; }

/* references */
.sources { display: grid; gap: 20px; counter-reset: src; }
.sources > .source { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; }
.sources > .source::before { counter-increment: src; content: "[" counter(src) "]"; font: 400 18px var(--display); color: var(--gold); grid-row: 1 / span 2; }
.sources > .source > * { grid-column: 2; }
.sources p { font-size: 16px; color: var(--ink-soft); }
.sources p b, .sources p strong { color: var(--ink); font-weight: 800; }
body .sources .use { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ---------- other pages ---------- */
.view-head { display: grid; gap: 14px; padding-block: 44px 30px; max-width: 46em; }
.view-head h1 { font-size: clamp(40px, 6vw, 66px); text-shadow: 4px 4px 0 var(--red); }
body .view-head .lede { margin-top: 0; }
.site-main.view { padding-bottom: 64px; }
.nsoniki-codex + p.hint { margin-top: 16px; }

/* posts and the 404 page */
.page-title { padding-block: 44px 30px; text-shadow: 4px 4px 0 var(--red); }

/* ---------- footer ---------- */
.site-foot { padding-block: 28px 40px; font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- App page: the app fills the window under the header ---------- */
.site-main.view-app { padding: 0; }

@media (max-width: 860px) {
  .chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chain > .link:nth-child(2) { border-right: 0; }
  .chain > .link:nth-child(-n+2) { border-bottom: 3px solid var(--line); }
}
@media (max-width: 760px) {
  .hero, .two { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero { padding-block: 28px 48px; }
  .hero h1, .view-head h1 { line-height: 1.1; text-shadow: 3px 3px 0 var(--red); }
  .top { flex-wrap: wrap; row-gap: 12px; padding-block: 14px 10px; }
  .top .wp-block-navigation { order: 2; width: 100%; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; font-size: 16px; }
  .top .wp-block-navigation .wp-block-navigation__container { flex-wrap: nowrap; gap: 20px; }
  .top .wp-block-navigation .wp-block-navigation-item__content { white-space: nowrap; }
}
@media (max-width: 480px) {
  .chain { grid-template-columns: minmax(0, 1fr); }
  .chain > .link { border-right: 0; border-bottom: 3px solid var(--line); }
  .chain > .link:last-child { border-bottom: 0; }
}
