/* ==========================================================================
   Signalas — URC 2021 Karo Žinios
   Design language: "field dispatch". Situation-room grid, mono timestamps,
   dispatch numbers, signal amber + steel blue. No external requests.
   ========================================================================== */

/* ---------- Fonts (self-hosted, Latin + Lithuanian subset, OFL) ---------- */
@font-face {
	font-family: "Bitter";
	src: url("../fonts/bitter-var.woff") format("woff");
	font-weight: 500 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Source Sans 3";
	src: url("../fonts/sourcesans3-var.woff") format("woff");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Source Sans 3";
	src: url("../fonts/sourcesans3-italic-var.woff") format("woff");
	font-weight: 400 700;
	font-style: italic;
	font-display: swap;
}
/* Metric-adjusted fallbacks reduce layout shift while fonts load. */
@font-face { font-family: "Bitter Fallback"; src: local("Georgia"); size-adjust: 104%; ascent-override: 92%; descent-override: 24%; }
@font-face { font-family: "Source Sans Fallback"; src: local("Arial"); size-adjust: 92%; ascent-override: 104%; descent-override: 29%; }

/* ---------- Tokens ---------- */
:root {
	--f-head: "Bitter", "Bitter Fallback", "Iowan Old Style", Georgia, serif;
	--f-body: "Source Sans 3", "Source Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--f-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

	--bg: #0b0e11;
	--bg-2: #12171c;
	--bg-3: #19212a;
	--line: #232e38;
	--line-2: #33424e;
	--ink: #e9edf0;
	--ink-2: #a8b3bd;
	--ink-3: #75828e;
	--acc: #f5b700;
	--acc-ink: #f5b700;
	--on-acc: #111315;
	--blue: #5b95ff;
	--red: #ff5a5f;
	--red-bg: #c8282e;
	--grid: rgba(255, 255, 255, 0.028);
	--shadow: 0 18px 48px -18px rgba(0, 0, 0, 0.65);
	--cat-s: 85%;
	--cat-l: 64%;

	--wrap: 1240px;
	--gut: clamp(16px, 4vw, 32px);
	--r: 3px;
	--hdr: 68px;
	--ease: cubic-bezier(.2, .7, .2, 1);
	--sg-scale: 1;
	color-scheme: dark;
}
[data-mode="light"] {
	--bg: #f3f0e8;
	--bg-2: #fbf9f4;
	--bg-3: #e8e3d6;
	--line: #d9d2c2;
	--line-2: #c3b9a4;
	--ink: #121518;
	--ink-2: #46505a;
	--ink-3: #66707a;
	--acc: #f5b700;
	--acc-ink: #8a5b00;
	--on-acc: #111315;
	--blue: #1f5bd6;
	--red: #c4252b;
	--red-bg: #b81f25;
	--grid: rgba(20, 20, 10, 0.045);
	--shadow: 0 18px 40px -20px rgba(40, 30, 0, 0.35);
	--cat-s: 70%;
	--cat-l: 33%;
	color-scheme: light;
}
@media (prefers-color-scheme: light) {
	:root:not([data-mode]) {
		--bg: #f3f0e8; --bg-2: #fbf9f4; --bg-3: #e8e3d6; --line: #d9d2c2; --line-2: #c3b9a4;
		--ink: #121518; --ink-2: #46505a; --ink-3: #66707a; --acc-ink: #8a5b00; --blue: #1f5bd6;
		--red: #c4252b; --grid: rgba(20, 20, 10, 0.045); --cat-s: 70%; --cat-l: 33%; color-scheme: light;
	}
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr) + 20px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
	margin: 0;
	background-color: var(--bg);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 48px 48px;
	color: var(--ink);
	font: 400 17px/1.55 var(--f-body);
	font-kerning: normal;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--acc-ink); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { font-family: var(--f-head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.012em; text-wrap: balance; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--acc); color: var(--on-acc); }
[hidden] { display: none !important; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; word-wrap: normal !important;
}
.sg-skip {
	position: absolute; left: 12px; top: -60px; z-index: 1000;
	background: var(--acc); color: var(--on-acc); padding: 10px 16px;
	font: 700 14px var(--f-mono); text-decoration: none; transition: top .2s;
}
.sg-skip:focus { top: 12px; color: var(--on-acc); }

.sg-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.sg-main { display: block; min-height: 60vh; outline: none; }

/* Small mono label with an amber tick */
.sg-label {
	display: inline-flex; align-items: center; gap: .55em;
	font: 600 12px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
	color: var(--ink-2); margin: 0 0 14px;
}
.sg-label::before { content: ""; width: 8px; height: 8px; background: var(--acc); flex: none; }
.sg-label .sg-ico { width: 16px; height: 16px; color: var(--acc-ink); }
.sg-label:has(.sg-ico)::before { display: none; }

.sg-ico { display: inline-block; vertical-align: middle; flex: none; }

/* Buttons */
.sg-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .6em;
	min-height: 46px; padding: 12px 22px; border: 1px solid var(--acc); border-radius: var(--r);
	background: var(--acc); color: var(--on-acc);
	font: 700 13px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
	cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, background .2s;
}
.sg-btn:hover { color: var(--on-acc); transform: translateY(-1px); box-shadow: 0 8px 22px -10px var(--acc); }
.sg-btn .sg-ico { width: 18px; height: 18px; }
.sg-btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.sg-btn--ghost:hover { color: var(--ink); border-color: var(--acc); box-shadow: none; }
.sg-btn--sm { min-height: 36px; padding: 8px 14px; font-size: 11px; }
.sg-iconbtn {
	display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0;
	border: 1px solid transparent; border-radius: var(--r); background: transparent; cursor: pointer;
	color: var(--ink); transition: background .2s, border-color .2s;
}
.sg-iconbtn:hover { background: var(--bg-3); border-color: var(--line); color: var(--acc-ink); }

/* ---------- Top bar ---------- */
.sg-topbar { border-bottom: 1px solid var(--line); background: var(--bg); font: 500 12px/1 var(--f-mono); color: var(--ink-3); letter-spacing: .04em; }
.sg-topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; }
.sg-topbar__date { margin: 0; }
.sg-clocks { display: flex; gap: 18px; }
.sg-clocks b { color: var(--acc-ink); font-weight: 700; margin-right: 4px; }
.sg-social { display: flex; align-items: center; gap: 2px; }
.sg-social a { display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--ink-3); border-radius: var(--r); }
.sg-social a:hover { color: var(--acc-ink); background: var(--bg-3); }
.sg-social .sg-ico { width: 16px; height: 16px; }

/* ---------- Header ---------- */
.sg-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	-webkit-backdrop-filter: saturate(140%) blur(12px); backdrop-filter: saturate(140%) blur(12px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .sg-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .sg-header { top: 0; } }
.sg-header__in { display: flex; align-items: center; gap: 24px; min-height: var(--hdr); }
.sg-brand { display: flex; align-items: center; gap: 18px; flex: none; }
.sg-logo { display: block; color: var(--ink); line-height: 0; }
.sg-logo__svg { height: 42px; width: auto; }
.custom-logo { max-height: 46px; width: auto; }
.lg-acc { stroke: var(--acc); }
.lg-acc-f { fill: var(--acc); }
.lg-blue { stroke: var(--blue); }
.lg-ink { fill: var(--ink); }
.lg-mute { fill: var(--ink-3); }
.lg-sub { fill: var(--acc-ink); }
[data-mode="light"] .lg-acc { stroke: #e0a400; }
[data-mode="light"] .lg-acc-f { fill: #e0a400; }
.sg-brand__tag {
	margin: 0; padding-left: 18px; border-left: 1px solid var(--line-2); max-width: 170px;
	font: 500 11px/1.35 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}

.sg-nav { flex: 1; min-width: 0; }
.sg-menu { list-style: none; padding: 0; margin: 0; display: flex; gap: 2px; justify-content: center; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.sg-menu::-webkit-scrollbar { display: none; }
.sg-menu > li { position: relative; flex: none; }
.sg-menu a {
	position: relative; display: block; padding: 10px 12px;
	font: 650 15px/1.2 var(--f-body); letter-spacing: .01em; text-decoration: none; color: var(--ink-2); white-space: nowrap;
}
.sg-menu a::after {
	content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
	background: var(--acc); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.sg-menu a:hover, .sg-menu .current-menu-item > a, .sg-menu .current-menu-ancestor > a, .sg-menu .current-post-ancestor > a { color: var(--ink); }
.sg-menu a:hover::after, .sg-menu .current-menu-item > a::after, .sg-menu .current-post-ancestor > a::after, .sg-menu .current-menu-ancestor > a::after { transform: scaleX(1); }
.sg-menu .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 220px; list-style: none; margin: 0; padding: 8px;
	background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s var(--ease);
}
.sg-menu li:hover > .sub-menu, .sg-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.sg-menu .sub-menu a::after { display: none; }

.sg-actions { display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }
.sg-mode .sg-ico--sun { display: none; }
[data-mode="dark"] .sg-mode .sg-ico--sun { display: inline-block; }
[data-mode="dark"] .sg-mode .sg-ico--moon { display: none; }
.sg-burger { display: none; }
.sg-burger .sg-ico--close { display: none; }
.sg-burger[aria-expanded="true"] .sg-ico--menu { display: none; }
.sg-burger[aria-expanded="true"] .sg-ico--close { display: inline-block; }

.sg-searchbar { border-top: 1px solid var(--line); background: var(--bg-2); padding: 18px 0; animation: sg-drop .25s var(--ease); }
@keyframes sg-drop { from { opacity: 0; transform: translateY(-6px); } }
.sg-sform { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); background: var(--bg); padding: 4px 4px 4px 14px; border-radius: var(--r); }
.sg-sform:focus-within { border-color: var(--acc); }
.sg-sform > .sg-ico { color: var(--ink-3); }
.sg-sform__input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 500 18px var(--f-body); padding: 10px 0; outline: none; }
.sg-sform__input::placeholder { color: var(--ink-3); }

/* Reading progress (articles) */
.sg-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; display: none; }
.sg-is-article .sg-progress { display: block; }
.sg-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc) 80%, var(--blue)); transform-origin: left; transform: scaleX(0); }

/* ---------- Ticker ---------- */
.sg-ticker { border-bottom: 1px solid var(--line); background: var(--bg-2); overflow: hidden; }
.sg-ticker__in { display: flex; align-items: center; gap: 18px; min-height: 44px; }
.sg-ticker__label {
	display: inline-flex; align-items: center; gap: 8px; margin: 0; flex: none;
	font: 700 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
	color: #fff; background: var(--red-bg); padding: 7px 10px; border-radius: 2px;
}
.sg-pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; position: relative; display: inline-block; flex: none; }
.sg-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: sg-pulse 1.8s ease-out infinite; }
@keyframes sg-pulse { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.sg-ticker__viewport { position: relative; flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 92%, transparent); }
.sg-ticker__track { display: flex; width: max-content; list-style: none; margin: 0; padding: 0; }
.sg-ticker__track li { display: flex; align-items: baseline; gap: 10px; padding-right: 42px; white-space: nowrap; font-size: 15px; }
.sg-ticker__track li::after { content: "◆"; font-size: 8px; color: var(--acc-ink); margin-left: 32px; align-self: center; }
.sg-ticker__track time { font: 600 12px var(--f-mono); color: var(--ink-3); }
.sg-ticker__track a { text-decoration: none; font-weight: 600; }
.sg-ticker.is-moving .sg-ticker__track { animation: sg-marquee var(--dur, 60s) linear infinite; }
.sg-ticker:hover .sg-ticker__track, .sg-ticker:focus-within .sg-ticker__track { animation-play-state: paused; }
@keyframes sg-marquee { to { transform: translateX(-50%); } }

/* ---------- Section heads ---------- */
.sg-sechead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; border-top: 2px solid var(--ink); padding-top: 14px; margin-bottom: 26px; }
.sg-sechead__t { display: flex; align-items: baseline; gap: 14px; margin: 0; font-size: clamp(24px, 2.4vw, 32px); font-weight: 800; }
.sg-sechead__t a { text-decoration: none; }
.sg-sechead__idx { font: 600 13px var(--f-mono); color: var(--acc-ink); letter-spacing: .08em; transform: translateY(-4px); }
.sg-sechead__count { font: 500 12px var(--f-mono); color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.sg-sechead__more { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); }
.sg-sechead__more .sg-ico { width: 16px; height: 16px; transition: transform .2s; }
.sg-sechead__more:hover .sg-ico { transform: translateX(3px); }

/* ---------- Cards (shared) ---------- */
.sg-card { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sg-card__media { position: relative; margin: 0; overflow: hidden; background: var(--bg-3); aspect-ratio: 16 / 10; border-radius: var(--r); }
.sg-card__media .sg-img, .sg-card__media .sg-ph { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .3s; }
.sg-card:hover .sg-card__media .sg-img { transform: scale(1.035); }
/* viewfinder brackets */
.sg-card__media::before, .sg-card__media::after {
	content: ""; position: absolute; width: 22px; height: 22px; z-index: 2; pointer-events: none;
	border: 2px solid var(--acc); opacity: 0; transition: opacity .25s, transform .35s var(--ease);
}
.sg-card__media::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; transform: translate(6px, 6px); }
.sg-card__media::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; transform: translate(-6px, -6px); }
.sg-card:hover .sg-card__media::before, .sg-card:hover .sg-card__media::after,
.sg-card:focus-within .sg-card__media::before, .sg-card:focus-within .sg-card__media::after { opacity: 1; transform: none; }

.sg-card__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sg-card__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 18px; }
.sg-card__title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.22; }
.sg-card__title a { text-decoration: none; background-image: linear-gradient(var(--acc), var(--acc)); background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .35s var(--ease), color .2s; }
.sg-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.sg-card:hover .sg-card__title a { background-size: 100% 2px; color: var(--ink); }
.sg-card__excerpt { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.sg-kicker {
	position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
	font: 700 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
	color: hsl(var(--h, 42) var(--cat-s) var(--cat-l));
}
.sg-kicker::before { content: ""; width: 6px; height: 6px; background: currentColor; transform: rotate(45deg); }
a.sg-kicker:hover { color: var(--ink); }

.sg-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; font: 500 12px/1.3 var(--f-mono); color: var(--ink-3); letter-spacing: .02em; }
.sg-meta__rt::before { content: "◷ "; }

/* NEW / READ flags (set by JS) */
.sg-flag:empty { display: none; }
.sg-flag { display: inline-flex; align-items: center; gap: 4px; font: 700 10px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; padding: 4px 6px; border-radius: 2px; }
.sg-flag.is-new { background: var(--red-bg); color: #fff; }
.sg-flag.is-read { background: var(--bg-3); color: var(--ink-3); }
.sg-card.is-read .sg-card__title a { color: var(--ink-2); }
.sg-card.is-read .sg-img { filter: saturate(.55); }

/* placeholder when no featured image */
.sg-ph {
	position: relative; display: grid; place-items: center; width: 100%; height: 100%;
	background:
		linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 22px 22px,
		linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 22px 22px,
		radial-gradient(120% 90% at 80% 10%, hsl(var(--h) 60% 40% / .45), transparent 60%),
		var(--bg-3);
}
.sg-ph .sg-logo__svg { width: 30%; max-width: 72px; height: auto; opacity: .85; }
.sg-ph span { position: absolute; left: 12px; bottom: 10px; font: 600 11px var(--f-mono); color: var(--ink-3); letter-spacing: .1em; }

/* Variants */
.sg-card--lead .sg-card__media { aspect-ratio: 16 / 9; }
.sg-card--lead .sg-card__title { font-size: clamp(30px, 3.5vw, 50px); font-weight: 800; line-height: 1.06; letter-spacing: -.02em; }
.sg-card--lead .sg-card__excerpt { font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-2); max-width: 62ch; }
.sg-card__dispatch {
	position: absolute; left: 12px; top: 12px; z-index: 2;
	font: 700 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
	background: rgba(8, 10, 12, .78); color: var(--acc); padding: 7px 9px; border-left: 3px solid var(--acc);
}

.sg-card--row { flex-direction: row; gap: 14px; align-items: flex-start; }
.sg-card--row .sg-card__media { flex: 0 0 128px; aspect-ratio: 16 / 11; }
.sg-card--row .sg-card__title { font-size: 17px; }
.sg-card--row .sg-card__media::before, .sg-card--row .sg-card__media::after { width: 12px; height: 12px; top: 6px; left: 6px; }
.sg-card--row .sg-card__media::after { top: auto; left: auto; bottom: 6px; right: 6px; }

.sg-card--brief { display: grid; grid-template-columns: 44px 1fr; gap: 0 12px; padding: 16px 0; border-top: 1px dashed var(--line-2); }
.sg-card--brief:first-of-type { border-top: 0; }
.sg-card__num { font: 700 22px/1 var(--f-mono); color: var(--acc-ink); padding-top: 2px; }
.sg-card--brief .sg-card__title { font-size: 18px; }
.sg-card--brief .sg-card__body { gap: 6px; }

.sg-card--rank { display: grid; grid-template-columns: 48px 1fr; gap: 0 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.sg-card--rank:first-of-type { border-top: 0; padding-top: 0; }
.sg-card--rank .sg-card__num { font: 800 38px/0.9 var(--f-head); color: transparent; -webkit-text-stroke: 1px var(--line-2); }
.sg-card--rank:first-of-type .sg-card__num { color: var(--acc); -webkit-text-stroke: 0; }
.sg-card--rank:hover .sg-card__num { -webkit-text-stroke-color: var(--acc); }
.sg-card--rank .sg-card__title { font-size: 16px; font-weight: 650; }

.sg-card--mini .sg-card__title { font-size: 16px; }

/* ---------- Home: lead + board ---------- */
.sg-lead { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 40px; padding-block: 36px 56px; }
.sg-board {
	position: relative; align-self: start; background: var(--bg-2); border: 1px solid var(--line);
	padding: 18px 20px 6px; border-radius: var(--r);
}
.sg-board::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; background: linear-gradient(90deg, var(--acc) 0 70%, var(--blue) 70%); }
.sg-board__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 4px; }
.sg-board__head .sg-label { margin: 0; }
.sg-board__stamp { font: 600 12px var(--f-mono); color: var(--ink-3); }
.sg-digest { margin: 6px -20px 0; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--bg-3); }
.sg-digest__line { margin: 0; font-size: 14px; color: var(--ink-2); }
.sg-digest__line strong { font: 800 20px var(--f-head); color: var(--acc-ink); margin-right: 4px; }
.sg-digest__line--muted { font: 500 12px var(--f-mono); color: var(--ink-3); margin-top: 6px; }

/* ---------- Home: chronology + rail ---------- */
.sg-split { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 48px; padding-bottom: 72px; }
.sg-timeline { position: relative; padding-left: 0; }
.sg-timeline::before { content: ""; position: absolute; left: 66px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--line-2), var(--line-2) 85%, transparent); }
.sg-timeline__day {
	position: relative; margin: 8px 0 14px 88px;
	font: 700 12px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--acc-ink);
}
.sg-timeline__day::before { content: ""; position: absolute; left: -27px; top: 50%; width: 11px; height: 11px; transform: translate(0, -50%) rotate(45deg); background: var(--acc); box-shadow: 0 0 0 4px var(--bg); }
.sg-card--timeline { display: grid; grid-template-columns: 56px minmax(0, 1fr) 150px; gap: 0 32px; padding: 16px 0 22px; flex-direction: initial; }
.sg-card--timeline + .sg-card--timeline { border-top: 1px solid var(--line); }
.sg-card--timeline .sg-card__when { text-align: right; font-family: var(--f-mono); position: relative; padding-top: 2px; }
.sg-card--timeline .sg-card__when::after { content: ""; position: absolute; right: -15px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); transition: border-color .2s, background .2s; }
.sg-card--timeline:hover .sg-card__when::after { border-color: var(--acc); background: var(--acc); }
.sg-card__hm { display: block; font-weight: 700; font-size: 15px; color: var(--ink); }
.sg-card__dm { display: block; font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.sg-card--timeline .sg-card__media { grid-column: 3; grid-row: 1; aspect-ratio: 4 / 3; }
.sg-card--timeline .sg-card__body { grid-column: 2; grid-row: 1; }
.sg-card--timeline .sg-card__title { font-size: 21px; }
.sg-card--timeline .sg-card__media::before, .sg-card--timeline .sg-card__media::after { width: 12px; height: 12px; }
.sg-chrono__more { margin: 18px 0 0 88px; }

.sg-rail { display: flex; flex-direction: column; gap: 28px; }
.sg-box { background: var(--bg-2); border: 1px solid var(--line); padding: 20px; border-radius: var(--r); }
.sg-box--note { background: transparent; border-style: dashed; }
.sg-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sg-chips a { display: inline-block; padding: 7px 11px; border: 1px solid var(--line-2); border-radius: 999px; font: 600 13px/1 var(--f-mono); text-decoration: none; color: var(--ink-2); transition: .2s; }
.sg-chips a:hover { border-color: var(--acc); color: var(--ink); background: var(--bg-3); }
.sg-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; color: var(--ink-2); }
.sg-legend__nr { font: 700 11px var(--f-mono); color: var(--acc-ink); letter-spacing: .08em; }

/* ---------- Home: category rails ---------- */
.sg-catrail { padding-bottom: 64px; }
.sg-catrail .sg-sechead { border-top-color: hsl(var(--h) var(--cat-s) var(--cat-l)); }
.sg-catrail .sg-sechead__idx { color: hsl(var(--h) var(--cat-s) var(--cat-l)); }
.sg-catrail__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: start; }
.sg-catrail__list .sg-card--row .sg-card__media { flex-basis: 184px; aspect-ratio: 16 / 10; }
.sg-catrail__list .sg-card--row .sg-card__title { font-size: 19px; }
.sg-catrail__list { display: flex; flex-direction: column; gap: 22px; }
.sg-catrail__list .sg-card + .sg-card { border-top: 1px solid var(--line); padding-top: 22px; }
.sg-catrail__main .sg-card__title { font-size: clamp(22px, 2vw, 28px); font-weight: 800; }

.sg-grid { display: grid; gap: 40px 28px; }
.sg-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sg-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sg-archive-pick { padding-bottom: 56px; }
.sg-endcta { display: flex; justify-content: center; padding-bottom: 80px; }

/* ---------- Listing / archives ---------- */
.sg-listing { padding-block: 22px 80px; }
.sg-archhead { position: relative; padding: 26px 0 28px 26px; margin: 10px 0 40px; border-bottom: 1px solid var(--line); }
.sg-archhead::before { content: ""; position: absolute; left: 0; top: 28px; bottom: 30px; width: 5px; background: hsl(var(--h, 42) var(--cat-s) var(--cat-l)); }
.sg-archhead__label { color: hsl(var(--h, 42) var(--cat-s) var(--cat-l)); }
.sg-archhead__title { font-size: clamp(36px, 5.2vw, 68px); font-weight: 800; letter-spacing: -.025em; margin: 0 0 12px; }
.sg-archhead__page { color: var(--ink-3); font-weight: 500; font-size: .5em; }
.sg-archhead__desc { max-width: 70ch; color: var(--ink-2); font-size: 18px; }
.sg-archhead__desc p:last-child { margin: 0; }
.sg-archhead__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; font: 600 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.sg-archhead__meta a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); }
.sg-archhead__meta .sg-ico { width: 15px; height: 15px; color: var(--acc-ink); }
.sg-archhead__search { margin-top: 22px; max-width: 640px; }

.sg-grid--list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 30px; }
.sg-grid--list .sg-card--lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 36px; align-items: center; padding-bottom: 44px; border-bottom: 1px solid var(--line); }
.sg-grid--list .sg-card--lead .sg-card__title { font-size: clamp(28px, 3vw, 42px); }
.sg-grid--list .sg-card.is-appended { animation: sg-in .5s var(--ease) both; }
@keyframes sg-in { from { opacity: 0; transform: translateY(12px); } }

.sg-more { display: flex; flex-direction: column; align-items: center; gap: 22px; margin-top: 56px; }
.sg-btn--more[aria-busy="true"] { opacity: .7; pointer-events: none; }
.sg-pages ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sg-pages ul.page-numbers { display: flex; min-width: 0; height: auto; padding: 0; border: 0; }
.sg-pages li > .page-numbers, .sg-pages--post > .post-page-numbers { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); font: 600 14px var(--f-mono); text-decoration: none; color: var(--ink-2); }
.sg-pages .page-numbers.current, .sg-pages .post-page-numbers.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sg-pages a.page-numbers:hover { border-color: var(--acc); color: var(--ink); }
.sg-pages .page-numbers.dots { border-color: transparent; }
.sg-pages .page-numbers .sg-ico { width: 18px; height: 18px; }
.js .sg-more .sg-pages { opacity: .75; }

.sg-empty { text-align: center; padding: 40px 0 56px; }
.sg-empty__code { font: 700 14px var(--f-mono); color: var(--acc-ink); letter-spacing: .2em; }

/* Breadcrumbs */
.sg-crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; font: 500 12px/1.4 var(--f-mono); letter-spacing: .04em; color: var(--ink-3); }
.sg-crumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.sg-crumbs li + li::before { content: "/"; color: var(--line-2); }
.sg-crumbs a { text-decoration: none; color: var(--ink-2); }
.sg-crumbs a:hover { color: var(--acc-ink); }
.sg-crumbs [aria-current] { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }

/* ---------- Article ---------- */
.sg-wrap--article { max-width: 1180px; padding-top: 22px; }
.sg-ahead { max-width: 900px; padding: 30px 0 28px; }
.sg-ahead__top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 18px; }
.sg-dispatch { font: 600 11px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding-left: 18px; border-left: 1px solid var(--line-2); }
.sg-ahead__title { font-size: clamp(32px, 4.6vw, 58px); font-weight: 800; line-height: 1.06; letter-spacing: -.024em; margin-bottom: 18px; }
.sg-ahead__dek { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.45; color: var(--ink-2); max-width: 60ch; margin-bottom: 24px; }
.sg-ahead__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sg-ahead__meta > div { padding: 12px 16px 12px 0; }
.sg-ahead__meta > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.sg-ahead__meta dt { font: 600 10px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.sg-ahead__meta dd { margin: 0; font-weight: 600; font-size: 15px; }
.sg-ahead__meta .sg-time { font: inherit; }
.sg-ahero { position: relative; margin: 0 0 8px; }
.sg-ahero .sg-img, .sg-ahero .sg-ph { width: 100%; max-height: 640px; object-fit: cover; border-radius: var(--r); aspect-ratio: 16 / 9; }
.sg-ahero figcaption { padding: 10px 0 0; font: 500 12px/1.5 var(--f-mono); color: var(--ink-3); }
.sg-ahero::before, .sg-ahero::after { content: ""; position: absolute; width: 34px; height: 34px; border: 2px solid var(--acc); z-index: 2; pointer-events: none; }
.sg-ahero::before { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.sg-ahero::after { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }

.sg-abody { max-width: 1180px; display: grid; grid-template-columns: 56px minmax(0, 720px) minmax(260px, 320px); gap: 48px; justify-content: space-between; padding-top: 36px; padding-bottom: 64px; }
.sg-tools__in { position: sticky; top: calc(var(--hdr) + 28px); display: flex; flex-direction: column; align-items: center; gap: 20px; }
.sg-tools__font { display: flex; flex-direction: column; gap: 4px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.sg-share--rail .sg-label { writing-mode: vertical-rl; transform: rotate(180deg); margin: 0 auto 8px; }
.sg-share--rail .sg-label::before { display: none; }
.sg-share__row { display: flex; gap: 6px; flex-wrap: wrap; }
.sg-share--rail .sg-share__row { flex-direction: column; }
.sg-share__btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--bg-2); color: var(--ink-2); cursor: pointer; transition: .2s; text-decoration: none; padding: 0; }
.sg-share__btn:hover { color: var(--on-acc); background: var(--acc); border-color: var(--acc); }
.sg-share__btn .sg-ico { width: 18px; height: 18px; }
.sg-share--wide { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 28px 0; }
.sg-share--wide .sg-label { margin: 0; }

.sg-abody__side .sg-sticky { position: sticky; top: calc(var(--hdr) + 28px); display: flex; flex-direction: column; gap: 24px; }

/* TOC */
.sg-toc { margin: 0 0 34px; border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--r); }
.sg-toc summary { list-style: none; cursor: pointer; padding: 16px 18px; margin: 0; display: flex; }
.sg-toc summary::-webkit-details-marker { display: none; }
.sg-toc summary::after { content: "+"; margin-left: auto; font-size: 16px; color: var(--ink-3); }
.sg-toc details[open] summary::after { content: "–"; }
.sg-toc ol { counter-reset: toc; list-style: none; margin: 0; padding: 0 18px 16px; display: grid; gap: 2px; }
.sg-toc li { counter-increment: toc; }
.sg-toc a { display: grid; grid-template-columns: 32px 1fr; gap: 6px; padding: 7px 8px; margin-left: -8px; text-decoration: none; color: var(--ink-2); border-left: 2px solid transparent; font-size: 16px; line-height: 1.35; border-radius: 0 var(--r) var(--r) 0; }
.sg-toc a::before { content: counter(toc, decimal-leading-zero); font: 600 12px/1.6 var(--f-mono); color: var(--ink-3); }
.sg-toc__l3 a { padding-left: 26px; font-size: 15px; }
.sg-toc a:hover { color: var(--ink); background: var(--bg-3); }
.sg-toc a.is-active { color: var(--ink); border-left-color: var(--acc); background: var(--bg-3); }
.sg-toc a.is-active::before { color: var(--acc-ink); }

/* Article typography */
.sg-content { --fs: calc(19px * var(--sg-scale)); font-size: var(--fs); line-height: 1.72; counter-reset: sec; overflow-wrap: break-word; }
.sg-content > * { margin-block: 0 1.15em; }
.sg-content > p:first-child, .sg-content > .wp-block-paragraph:first-child { font-size: 1.12em; line-height: 1.6; color: var(--ink); }
.sg-content > p:first-child::first-letter { float: left; font: 800 3.4em/0.85 var(--f-head); margin: .08em .1em 0 0; color: var(--acc-ink); }
.sg-content h2 { counter-increment: sec; font-size: 1.45em; font-weight: 800; margin: 1.9em 0 .7em; padding-top: .9em; border-top: 1px solid var(--line); }
.sg-content h2::before { content: "§ " counter(sec, decimal-leading-zero); display: block; margin-bottom: .55em; font: 700 12px var(--f-mono); letter-spacing: .14em; color: var(--acc-ink); }
.sg-content h3 { font-size: 1.2em; font-weight: 700; margin: 1.6em 0 .5em; }
.sg-content h4 { font-size: 1.05em; font-weight: 700; margin: 1.4em 0 .4em; }
.sg-content a { color: var(--ink); text-decoration-color: var(--acc); text-decoration-thickness: 2px; }
.sg-content a:hover { color: var(--acc-ink); }
.sg-content strong { font-weight: 700; color: var(--ink); }
.sg-content ul, .sg-content ol { padding-left: 1.4em; }
.sg-content li { margin-bottom: .45em; }
.sg-content ul li::marker { content: "■  "; color: var(--acc-ink); font-size: .7em; }
.sg-content ol li::marker { font: 700 .85em var(--f-mono); color: var(--acc-ink); }
.sg-content blockquote, .sg-content .wp-block-quote { margin: 1.8em 0; padding: 4px 0 4px 26px; border-left: 4px solid var(--acc); font-family: var(--f-head); font-size: 1.18em; font-weight: 600; line-height: 1.45; color: var(--ink); }
.sg-content blockquote cite, .sg-content .wp-block-quote cite { display: block; margin-top: .7em; font: 500 13px var(--f-mono); color: var(--ink-3); font-style: normal; }
.sg-content .wp-block-pullquote { border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); padding: 1.4em 0; text-align: left; }
.sg-content figure { margin: 2em 0; }
.sg-content figure img { border-radius: var(--r); }
.sg-content figcaption, .sg-content .wp-caption-text, .sg-content .wp-element-caption { font: 500 13px/1.5 var(--f-mono); color: var(--ink-3); margin-top: 10px; text-align: left; }
.sg-content hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.sg-content code { font: .85em var(--f-mono); background: var(--bg-3); padding: .15em .4em; border-radius: 2px; }
.sg-content pre { font: 14px/1.6 var(--f-mono); background: var(--bg-2); border: 1px solid var(--line); padding: 18px; overflow-x: auto; border-radius: var(--r); }
.sg-content iframe, .sg-content video { width: 100%; border: 0; border-radius: var(--r); }
.sg-table { overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--line); border-radius: var(--r); }
.sg-content table { width: 100%; border-collapse: collapse; font-size: .85em; }
.sg-content th, .sg-content td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sg-content th { font: 700 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; background: var(--bg-2); color: var(--ink-2); }
.sg-content .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; }
.sg-content .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; }
.sg-content .aligncenter { margin-inline: auto; }
.sg-content .alignwide { margin-inline: min(-60px, calc((720px - 100vw) / 2 + 20px)); max-width: none; }
.sg-content::after { content: ""; display: table; clear: both; }

.sg-readalso { margin: 2em 0; padding: 16px 20px; border: 1px solid var(--line); border-left: 4px solid var(--blue); background: var(--bg-2); border-radius: 0 var(--r) var(--r) 0; font-size: 17px; }
.sg-readalso .sg-label { display: flex; margin-bottom: 8px; }
.sg-readalso .sg-label::before { background: var(--blue); }
.sg-readalso a { font: 700 19px/1.3 var(--f-head); text-decoration: none; color: var(--ink); }
.sg-readalso a:hover { color: var(--acc-ink); }

.sg-endmark { margin: 34px 0 22px; font: 600 11px var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 10px; }
.sg-endmark span { color: var(--acc-ink); }
.sg-endmark::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sg-chips--article a { font-size: 14px; }

.sg-cite { border: 1px dashed var(--line-2); padding: 20px 22px; border-radius: var(--r); margin: 0 0 32px; }
.sg-cite__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 16px; }
.sg-cite__grid dt { font: 600 10px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.sg-cite__grid dd { margin: 4px 0 0; font: 600 13px var(--f-mono); white-space: nowrap; }
.sg-cite__ref { display: flex; align-items: center; gap: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.sg-cite__ref p { margin: 0; font-size: 14px; color: var(--ink-2); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sg-cite__ref .sg-label { margin: 0 8px 0 0; }

.sg-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sg-pn__link { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; background: var(--bg-2); transition: border-color .2s, transform .2s var(--ease); }
.sg-pn__link:hover { border-color: var(--acc); transform: translateY(-2px); color: var(--ink); }
.sg-pn__link .sg-label { margin: 0; }
.sg-pn__link .sg-label::before { display: none; }
.sg-pn__link .sg-ico { width: 16px; height: 16px; color: var(--acc-ink); }
.sg-pn__link strong { font: 700 17px/1.3 var(--f-head); }
.sg-pn__link--next { text-align: right; grid-column: 2; }
.sg-pn__link--next .sg-label { justify-content: flex-end; }

.sg-related { padding-bottom: 72px; }

/* Up next slide-in */
.sg-upnext {
	position: fixed; left: 20px; bottom: 20px; z-index: 40; width: min(360px, calc(100vw - 110px));
	background: var(--bg-2); border: 1px solid var(--line-2); border-top: 3px solid var(--acc); padding: 14px 16px 16px; border-radius: var(--r);
	box-shadow: var(--shadow); transform: translateY(140%); transition: transform .45s var(--ease);
}
.sg-upnext.is-on { transform: none; }
.sg-upnext .sg-label { margin-bottom: 10px; }
.sg-upnext__link { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; text-decoration: none; }
.sg-upnext__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 2px; background: var(--bg-3); }
.sg-upnext__media .sg-img, .sg-upnext__media .sg-ph { width: 100%; height: 100%; object-fit: cover; }
.sg-upnext__media .sg-ph span { display: none; }
.sg-upnext__link strong { font: 700 15px/1.3 var(--f-head); }
.sg-upnext__close { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 0; }
.sg-upnext__close:hover { color: var(--ink); }

/* ---------- Pages / 404 ---------- */
.sg-page-body { max-width: 760px; padding: 10px 0 80px; }
.sg-404 { padding-bottom: 80px; }
.sg-404__hero { text-align: center; padding: 64px 0 72px; max-width: 760px; margin: 0 auto; }
.sg-404__hero h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 800; }
.sg-404__hero > p:not(.sg-label) { color: var(--ink-2); font-size: 19px; }
.sg-404__radar { position: relative; width: 150px; height: 150px; margin: 0 auto 26px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); }
.sg-404__radar::before, .sg-404__radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--acc); opacity: 0; animation: sg-radar 2.6s ease-out infinite; }
.sg-404__radar::after { animation-delay: 1.3s; }
@keyframes sg-radar { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.sg-404__radar .sg-logo__svg { width: 64px; height: 64px; }
.sg-404__actions { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 26px; }
.sg-404__search { width: min(560px, 100%); }

/* ---------- Footer ---------- */
.sg-footer { margin-top: 24px; background: var(--bg-2); border-top: 1px solid var(--line); padding-top: 56px; }
.sg-footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 44px; }
.sg-footer__brand p { color: var(--ink-2); font-size: 15px; max-width: 40ch; margin: 18px 0; }
.sg-footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.sg-footer__col a { text-decoration: none; color: var(--ink-2); font-size: 15px; }
.sg-footer__col a:hover { color: var(--acc-ink); }
.sg-footer__col li span, .sg-footer__col li { color: var(--ink-3); font: 500 12px var(--f-mono); }
.sg-footer__col li a { font-family: var(--f-body); }
.sg-footer__social { margin-left: -6px; }
.sg-footer__widgets { padding-bottom: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
.sg-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 20px 0 28px; border-top: 1px solid var(--line); font: 500 12px/1.5 var(--f-mono); color: var(--ink-3); }
.sg-footer__bottom p { margin: 0; }
.sg-footer__sig { display: inline-flex; align-items: center; gap: 8px; }
.sg-footer__sig .sg-pulse { color: #3ccf7b; width: 7px; height: 7px; }

/* Back to top */
.sg-totop {
	position: fixed; right: 20px; bottom: 20px; z-index: 45; width: 54px; height: 54px; padding: 0;
	display: grid; place-items: center; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--bg-2); color: var(--ink); box-shadow: var(--shadow);
	opacity: 0; visibility: hidden; transform: translateY(16px) scale(.9); transition: opacity .3s, transform .3s var(--ease), visibility .3s;
}
.sg-totop.is-on { opacity: 1; visibility: visible; transform: none; }
.sg-totop:hover { color: var(--on-acc); background: var(--acc); }
.sg-totop > .sg-ico { width: 22px; height: 22px; position: relative; z-index: 1; }
.sg-totop__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.sg-totop__ring circle { fill: none; stroke: var(--line-2); stroke-width: 2.5; }
.sg-totop__ring .sg-totop__bar { stroke: var(--acc); stroke-dasharray: 131.95; stroke-dashoffset: 131.95; stroke-linecap: round; }
.sg-totop__txt {
	position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap;
	font: 700 11px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; background: var(--ink); color: var(--bg);
	padding: 6px 8px; border-radius: 2px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sg-totop:hover .sg-totop__txt, .sg-totop:focus-visible .sg-totop__txt { opacity: 1; }

.sg-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); font: 600 13px var(--f-mono); padding: 10px 16px; border-radius: var(--r); box-shadow: var(--shadow); }

/* Widgets */
.sg-widget ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sg-widget a { text-decoration: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
	.sg-brand__tag { display: none; }
	.sg-abody { grid-template-columns: 48px minmax(0, 1fr) 280px; gap: 32px; }
}
@media (max-width: 1024px) {
	.sg-lead, .sg-split { grid-template-columns: 1fr; }
	.sg-board { max-width: none; }
	.sg-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sg-grid--list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sg-footer__grid { grid-template-columns: 1fr 1fr; }
	.sg-abody { grid-template-columns: minmax(0, 1fr); max-width: 780px; }
	.sg-tools { order: -1; }
	.sg-tools__in { position: static; flex-direction: row; justify-content: space-between; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
	.sg-tools__font { flex-direction: row; padding: 0; border: 0; }
	.sg-share--rail { display: none; }
	.sg-abody__side .sg-sticky { position: static; }
	.sg-rail { display: grid; grid-template-columns: 1fr 1fr; }
	.sg-rail .sg-box--note { display: none; }
}
@media (max-width: 980px) {
	:root { --hdr: 60px; }
	.sg-burger { display: inline-grid; }
	.sg-nav {
		position: fixed; inset: var(--sg-navtop, var(--hdr)) 0 0 0; z-index: 49;
		background: var(--bg); padding: 18px var(--gut) 40px; overflow-y: auto;
		transform: translateX(100%); visibility: hidden; transition: transform .35s var(--ease), visibility .35s;
	}
	.sg-nav.is-open { transform: none; visibility: visible; }
	.sg-menu { flex-direction: column; justify-content: flex-start; overflow: visible; gap: 0; }
	.sg-menu > li { border-bottom: 1px solid var(--line); }
	.sg-menu a { font: 700 22px/1.2 var(--f-head); padding: 16px 0; color: var(--ink); }
	.sg-menu a::after { display: none; }
	.sg-menu .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 10px 14px; }
	.sg-menu .sub-menu a { font: 600 17px var(--f-body); padding: 8px 0; color: var(--ink-2); }
	.sg-clocks > span:not(:first-child) { display: none; }
	.sg-topbar__social { display: none; }
	html.sg-lock { overflow: hidden; }
	/* backdrop-filter would make the header the containing block of the fixed drawer */
	html.sg-lock .sg-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
}
@media (max-width: 760px) {
	body { font-size: 16px; }
	.sg-logo__svg { height: 36px; }
	.sg-lead { padding-top: 22px; gap: 28px; }
	.sg-grid--3, .sg-grid--list { grid-template-columns: 1fr; }
	.sg-grid--list .sg-card--lead { grid-template-columns: 1fr; gap: 16px; }
	.sg-catrail__grid { grid-template-columns: 1fr; }
	.sg-rail { grid-template-columns: 1fr; }
	.sg-timeline::before { left: 50px; }
	.sg-timeline__day { margin-left: 70px; }
	.sg-timeline__day::before { left: -25px; }
	.sg-card--timeline { grid-template-columns: 40px minmax(0, 1fr); gap: 0 26px; }
	.sg-card--timeline .sg-card__when::after { right: -14px; }
	.sg-card--timeline .sg-card__media { grid-column: 2; grid-row: 2; margin-top: 12px; aspect-ratio: 16 / 9; display: none; }
	.sg-card--timeline .sg-card__hm { font-size: 13px; }
	.sg-card--timeline .sg-card__title { font-size: 19px; }
	.sg-chrono__more { margin-left: 70px; }
	.sg-card--row .sg-card__media, .sg-catrail__list .sg-card--row .sg-card__media { flex-basis: 112px; }
	.sg-catrail__list .sg-card--row .sg-card__title { font-size: 17px; }
	.sg-footer__grid { grid-template-columns: 1fr; gap: 30px; }
	.sg-cite__grid { grid-template-columns: 1fr 1fr; }
	.sg-cite__ref { flex-direction: column; align-items: flex-start; }
	.sg-pn { grid-template-columns: 1fr; }
	.sg-pn__link--next { grid-column: auto; }
	.sg-ahead__meta { grid-template-columns: 1fr 1fr; }
	.sg-ahead__meta > div:nth-child(3) { padding-left: 0; border-left: 0; }
	.sg-ahead__meta > div:nth-child(n+3) { border-top: 1px solid var(--line); }
	.sg-ahero::before, .sg-ahero::after { width: 22px; height: 22px; top: 10px; }
	.sg-ahero::before { left: 10px; } .sg-ahero::after { right: 10px; }
	.sg-content { --fs: calc(18px * var(--sg-scale)); }
	.sg-content .alignleft, .sg-content .alignright { float: none; margin: 1em 0; max-width: 100%; }
	.sg-content .alignwide { margin-inline: 0; }
	.sg-upnext { left: 12px; right: 78px; width: auto; bottom: 14px; }
	.sg-totop { right: 14px; bottom: 14px; width: 50px; height: 50px; }
	.sg-ticker__track li { font-size: 14px; }
	.sg-sechead__more { margin-left: 0; }
	.sg-archhead { padding-left: 18px; }
}
@media (max-width: 520px) {
	.sg-topbar { font-size: 11px; letter-spacing: 0; }
	.sg-topbar__in { gap: 8px; }
	.sg-topbar__date, .sg-clocks { white-space: nowrap; }
	.sg-topbar__date { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
	.sg-clocks { flex: none; }
}
@media (max-width: 420px) {
	.sg-ticker__label { padding: 6px 8px; font-size: 10px; }
}

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
	.sg-ticker__viewport { overflow-x: auto; }
	.sg-ticker.is-moving .sg-ticker__track { animation: none; }
}
@media print {
	.sg-topbar, .sg-header, .sg-ticker, .sg-tools, .sg-abody__side, .sg-share, .sg-related, .sg-upnext, .sg-totop, .sg-footer, .sg-pn, .sg-toc { display: none !important; }
	body { background: #fff; color: #000; }
	.sg-abody { display: block; }
	.sg-content a::after { content: " (" attr(href) ")"; font-size: .8em; }
}
