/* DGK RC1 — header-only finishing pass.
   Deep forest-to-navy green and a restrained circuit motif. The header starts
   in normal document flow, then the measured JS hook fixes it without overlap. */
.site-header,
header:has(> .navrow) {
  background-color: #103a36;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 760 120'%3E%3Cg fill='none' stroke='%2375c8af' stroke-width='1' stroke-linecap='round' stroke-linejoin='round' opacity='.25'%3E%3Cpath d='M-15 18H106L127 39H191L211 19H286M-15 90H57L83 64H146L162 80H239L260 59H322M356 120V95L374 77H443L465 55H536L559 32H775M410 0V19L425 34H486L507 13H593L615 35H678L697 16H775M563 120V97L578 82H656L682 56H775M-15 111H97L128 96H170'/%3E%3C/g%3E%3Cg fill='%2390ddbf' opacity='.30'%3E%3Ccircle cx='106' cy='18' r='2.1'/%3E%3Ccircle cx='191' cy='39' r='2.1'/%3E%3Ccircle cx='286' cy='19' r='2.2'/%3E%3Ccircle cx='146' cy='64' r='2.1'/%3E%3Ccircle cx='322' cy='59' r='2.2'/%3E%3Ccircle cx='443' cy='77' r='2.1'/%3E%3Ccircle cx='536' cy='55' r='2.2'/%3E%3Ccircle cx='615' cy='35' r='2.1'/%3E%3Ccircle cx='682' cy='56' r='2.2'/%3E%3Ccircle cx='170' cy='96' r='2.1'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(108deg, #123b34 0%, #17433d 42%, #123941 100%);
  background-size: 760px 120px, 100% 100%;
  background-repeat: repeat-x, no-repeat;
  background-position: center center, center;
  border-bottom: 1px solid #47796f;
  box-shadow: 0 2px 10px #092d3026;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #f5fbf8;
  padding-top: var(--dgk-safe-top, env(safe-area-inset-top, 0px));
}
/* Keep the top bar's exact size and its spacer on the same native CSS
   calculation. Unlike asynchronous JS measurements this is synchronous
   on every breakpoint, safe-area and orientation change. */
:root {
  --dgk-header-row-height: 76px;
  --dgk-fixed-header-height: calc(var(--dgk-header-row-height) + var(--dgk-safe-top, env(safe-area-inset-top, 0px)) + 1px);
}
@media(max-width:1000px){:root{--dgk-header-row-height:68px}}
@media(max-width:640px){:root{--dgk-header-row-height:64px}}
html.dgk-fixed-header-ready .dgk-fixed-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  width: auto;
  max-width: none;
  block-size: var(--dgk-fixed-header-height);
  min-block-size: var(--dgk-fixed-header-height);
  box-sizing: border-box;
  margin: 0;
  z-index: 70;
}
html.dgk-fixed-header-ready .dgk-fixed-header .nav-wrap,
html.dgk-fixed-header-ready .dgk-fixed-header > .navrow {
  block-size: var(--dgk-header-row-height);
  min-block-size: var(--dgk-header-row-height);
  padding-block: 0;
  flex-wrap: nowrap;
}
html.dgk-fixed-header-ready body {
  padding-block-start: var(--dgk-fixed-header-height);
}
html.dgk-fixed-header-ready {
  scroll-padding-block-start: calc(var(--dgk-fixed-header-height) + 12px);
}
html.dgk-fixed-header-ready .reader-side {
  top: calc(var(--dgk-fixed-header-height) + 16px);
  max-height: max(0px,calc(var(--dgk-usable-vh, 100vh) - var(--dgk-fixed-header-height) - 36px));
}
@media(max-width:800px),(max-height:540px){html.dgk-fixed-header-ready .reader-side{max-height:none}}

/* Static article and archive top bars use the same compact brand + hamburger.
   Existing navigation and locale nodes are moved, not re-created, to the
   accessible dialog. No MPA route or language preference is modified. */
header.dgk-static-header > .navrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
header.dgk-static-header .brand { min-width: 0; gap: 10px; color: #f5fbf8; }
header.dgk-static-header .brand-logo { flex-shrink:0; }
header.dgk-static-header .brand > span { min-width:0; overflow-wrap:anywhere; }
header.dgk-static-header .menu {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid #78a89d;
  background: #113b3e;
  color: #f4fbf9;
  border-radius: 10px;
  padding: 0 12px;
  font: 700 14px/1.2 system-ui,sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
header.dgk-static-header .menu svg, .dgk-static-nav-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
@media(max-width:640px){
  header.dgk-static-header .menu{padding:0;width:46px;height:46px}
  header.dgk-static-header .menu .dgk-menu-label{display:none}
}
@media(max-width:350px){
  header.dgk-static-header > .navrow{gap:6px}
  header.dgk-static-header .brand{gap:6px;font-size:13px;line-height:1.15}
  header.dgk-static-header .brand-logo{width:52px;height:40px}
}
.dgk-static-nav:not([open]){display:none}
.dgk-static-nav {
  position: fixed;
  inset-block: 0;
  inset-inline-start: auto;
  inset-inline-end: 0;
  width: min(540px, 100%);
  max-width: 100%;
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  border: 0;
  border-left: 1px solid #47796f;
  border-radius: 0;
  color: #eef9f5;
  background: linear-gradient(135deg,#123a35,#102f39);
}
@supports(height:100dvh){.dgk-static-nav{height:100dvh;max-height:100dvh}}
.dgk-static-nav::backdrop{background:#061c25b8}
.dgk-static-nav-inner {
  padding-block-start: max(20px,var(--dgk-safe-top, env(safe-area-inset-top,0px)));
  padding-block-end: max(24px,var(--dgk-safe-bottom, env(safe-area-inset-bottom,0px)));
  padding-inline-start: max(18px,var(--dgk-safe-left, env(safe-area-inset-left,0px)));
  padding-inline-end: max(18px,var(--dgk-safe-right, env(safe-area-inset-right,0px)));
}
.dgk-static-nav-head {
  position: sticky;
  top: var(--dgk-safe-top,env(safe-area-inset-top,0px));
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #123b35;
  padding: 8px 0 14px;
  border-bottom: 1px solid #659187;
  margin-bottom: 18px;
}
.dgk-static-nav-head h2{font:750 23px/1.25 system-ui,sans-serif;margin:0;overflow-wrap:anywhere}
.dgk-static-nav-close{
  display:grid;place-items:center;flex:none;width:46px;height:46px;border:1px solid #78a89d;
  background:#164844;color:#fff;border-radius:9px;cursor:pointer;touch-action:manipulation;
}
.dgk-static-nav nav,.dgk-static-nav .locales{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 20px;align-items:stretch;
}
.dgk-static-nav nav a,.dgk-static-nav .locales a,.dgk-static-nav .locales strong{
  display:flex;align-items:center;justify-content:flex-start;min-height:44px;min-width:0;padding:10px 12px;
  border:1px solid #5b8a83;background:#19443f;border-radius:9px;color:#f4fcfa;
  overflow-wrap:anywhere;font:650 14px/1.4 system-ui,sans-serif;text-decoration:none;
}
.dgk-static-nav .locales strong{background:#a7dfcd;color:#153f35}
.dgk-static-nav-label{font:700 13px/1.4 system-ui,sans-serif;letter-spacing:.03em;color:#bfe5d8;margin:0 0 9px}
@media(max-width:350px){.dgk-static-nav nav,.dgk-static-nav .locales{grid-template-columns:minmax(0,1fr)}}
html.dgk-static-menu-open,html.dgk-static-menu-open body{overflow:hidden;overscroll-behavior:none}

/* RC2: prevent elastic/rubber-band scrolling from separating the fixed bar
   and the content. Keep normal scrolling and pinch zoom available. A matching
   root background also avoids a white flash on engines that still rubber-band. */
html.dgk-fixed-header-ready {
  overscroll-behavior-y: none;
  background-color: #103a36;
}
html.dgk-fixed-header-ready body { overscroll-behavior-y: none; }
html.dgk-fixed-header-ready .dgk-fixed-header {
  top: 0;
  inset-block-start: 0;
  transform: none;
  transition: none;
}
html.dgk-fixed-header-ready body:has(.site-header) > main {
  margin-block-start: 0;
}
