/**
 * Insight+ — blok Polling & Grafik (artikel, editor, dan Next.js).
 * Gaya datar ala grafis redaksi: warna solid, garis tipis, tanpa blur/glow/gradasi/bayangan.
 */
.gx-poll, .gx-chart {
	--gx-bg: #14171e;
	--gx-line: #2a2f3a;
	--gx-text: #dcd8cf;
	--gx-head: #fbf8f1;
	--gx-muted: #9aa0ad;
	--gx-accent: var(--in-accent, #ff2b2b);
	--gx-sans: var(--in-sans, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	--gx-serif: var(--in-serif, "Fraunces", Georgia, serif);
	position: relative;
	box-sizing: border-box;
	margin-left: 0;
	margin-right: 0;
	padding: clamp(18px, 3vw, 24px);
	border: 1px solid var(--gx-line);
	border-top: 3px solid var(--gx-head);
	border-radius: 0;
	background: var(--gx-bg);
	color: var(--gx-text);
	font: 400 15px/1.5 var(--gx-sans);
	clear: both;
}
.gx-poll *, .gx-chart * { box-sizing: border-box; }
.gx-poll p, .gx-chart p { margin: 0; }
.gx-poll--empty, .gx-chart--empty { padding: 22px; text-align: center; color: var(--gx-muted); border-style: dashed; }
.gx-sr { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }

/* ===================================================================
 * Polling
 * =================================================================== */
.gx-poll__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.gx-poll__badge { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gx-accent); }
.gx-poll.is-closed .gx-poll__badge { color: var(--gx-muted); }
.gx-poll__status { font-size: 12px; color: var(--gx-muted); text-align: right; }
.gx-poll__q { margin: 0 0 16px !important; font: 700 clamp(19px, 2.4vw, 23px)/1.3 var(--gx-serif); color: var(--gx-head); }
.gx-poll .gx-poll__opts { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gx-poll .gx-poll__opts li { margin: 0; padding: 0; }
.gx-poll .gx-poll__opts li::before, .gx-poll .gx-poll__opts li::marker { content: none; }
.gx-poll__opt {
	--p: 0%;
	position: relative; isolation: isolate; overflow: hidden;
	display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; margin: 0; padding: 12px 14px;
	border: 1px solid var(--gx-line); border-radius: 4px; background: transparent;
	color: var(--gx-head); font: 600 15px/1.35 var(--gx-sans); text-align: left; cursor: pointer;
	transition: border-color .15s, background-color .15s;
}
.gx-poll__opt:not(:disabled):hover { border-color: var(--gx-head); }
.gx-poll__opt:focus-visible { outline: 2px solid var(--gx-accent); outline-offset: 2px; }
.gx-poll__opt:disabled { cursor: default; }
.gx-poll__fill { position: absolute; inset: 0 auto 0 0; z-index: -1; width: var(--p); background: #262b36; transition: width .6s ease-out; }
.gx-poll__opt.is-top .gx-poll__fill { background: #4a1f22; }
.gx-poll__radio { flex: none; width: 18px; height: 18px; border: 2px solid var(--gx-muted); border-radius: 50%; }
.gx-poll__opt:not(:disabled):hover .gx-poll__radio { border-color: var(--gx-head); }
.gx-poll__opt.is-mine { border-color: var(--gx-accent); }
.gx-poll__opt.is-mine .gx-poll__radio { border-color: var(--gx-accent); background: var(--gx-accent); box-shadow: inset 0 0 0 3px var(--gx-bg); }
.gx-poll__txt { flex: 1 1 auto; min-width: 0; }
.gx-poll__pct { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gx-head); }
.gx-poll.has-results .gx-poll__radio { display: none; }
.gx-poll.has-results .gx-poll__opt.is-mine .gx-poll__txt::after { content: "pilihan Anda"; display: inline-block; margin-left: 8px; padding: 1px 6px; border: 1px solid var(--gx-accent); color: var(--gx-accent); font-size: 11px; font-weight: 700; vertical-align: 2px; }
.gx-poll.is-loading .gx-poll__opts, .gx-poll.is-sending .gx-poll__opts { opacity: .7; }
.gx-poll__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 14px !important; padding-top: 12px; border-top: 1px solid var(--gx-line); font-size: 13px; color: var(--gx-muted); }
.gx-poll__note { font-style: italic; }

/* --- Polling bergambar (foto tokoh) --- */
.gx-poll--photo .gx-poll__opts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.gx-poll--photo .gx-poll__opts li { display: flex; }
.gx-poll--photo .gx-poll__opt { flex-direction: column; align-items: stretch; gap: 0; height: 100%; padding: 0; text-align: center; }
.gx-poll--photo .gx-poll__pic { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: #222733; }
.gx-poll--photo .gx-poll__img { display: block; width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover; object-position: 50% 20%; border-radius: 0 !important; }
.gx-poll__ini { display: grid; place-items: center; width: 100%; height: 100%; font: 700 44px/1 var(--gx-serif); color: var(--gx-muted); }
.gx-poll--photo .gx-poll__radio { position: absolute; top: 10px; left: 10px; background: var(--gx-bg); }
.gx-poll--photo .gx-poll__txt { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 10px 4px; font-size: 14px; }
.gx-poll--photo .gx-poll__pct { min-height: 34px; padding: 2px 10px 12px; font: 800 22px/1.2 var(--gx-serif); }
.gx-poll--photo .gx-poll__pct:empty { min-height: 14px; padding: 0; }
.gx-poll--photo .gx-poll__fill { inset: auto auto 0 0; z-index: 1; height: 4px; background: var(--gx-muted); }
.gx-poll--photo .gx-poll__opt.is-top .gx-poll__fill { background: var(--gx-accent); }
.gx-poll--photo .gx-poll__opt.is-mine { outline: 2px solid var(--gx-accent); outline-offset: -2px; }
.gx-poll--photo.has-results .gx-poll__opt.is-mine .gx-poll__txt::after { display: block; margin: 4px auto 0; width: fit-content; }
@media (max-width: 520px) { .gx-poll--photo .gx-poll__opts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* ===================================================================
 * Grafik
 * =================================================================== */
.gx-chart__head { margin-bottom: 18px; }
.gx-chart__title { font: 700 clamp(18px, 2.3vw, 22px)/1.3 var(--gx-serif); color: var(--gx-head); }
.gx-chart__sub { margin-top: 4px !important; font-size: 13px; color: var(--gx-muted); }
.gx-chart__src { margin-top: 16px !important; padding-top: 12px; border-top: 1px solid var(--gx-line); font-size: 12px; color: var(--gx-muted); }
.gx-chart__src span { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.gx-chart__src a { color: var(--gx-head) !important; text-decoration: underline; text-underline-offset: 3px; }

/* --- Batang vertikal --- */
.gx-chart__plot { --h: clamp(200px, 32vw, 280px); position: relative; padding-left: 44px; }
.gx-chart__grid { position: absolute; left: 0; right: 0; top: 28px; height: var(--h); pointer-events: none; }
.gx-chart__grid span { position: absolute; left: 44px; right: 0; bottom: var(--y); border-top: 1px solid #232833; }
.gx-chart__grid span:last-child { border-top: 1px solid #5a606c; }
.gx-chart__grid i { position: absolute; right: calc(100% + 8px); top: -.65em; font: normal 500 11px/1.2 var(--gx-sans); color: var(--gx-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gx-chart__bars { position: relative; display: flex; align-items: flex-end; gap: clamp(6px, 2vw, 18px); height: calc(var(--h) + 28px); padding-top: 28px; }
.gx-chart__col { position: relative; flex: 1 1 0; min-width: 0; height: var(--v); display: flex; flex-direction: column; justify-content: flex-end; }
.gx-chart__bar { display: block; width: 100%; max-width: 72px; height: 100%; min-height: 2px; margin: 0 auto; border-radius: 2px 2px 0 0; background: var(--c); transform-origin: bottom; transition: transform .7s ease-out calc(var(--i) * 50ms); }
.gx-chart__val { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); font: 700 13px/1 var(--gx-sans); color: var(--gx-head); white-space: nowrap; font-variant-numeric: tabular-nums; transition: opacity .3s calc(var(--i) * 50ms + .4s); }
.gx-chart__lbls { display: flex; gap: clamp(6px, 2vw, 18px); margin-top: 10px; }
.gx-chart__lbls span { flex: 1 1 0; min-width: 0; font-size: 12px; line-height: 1.3; color: var(--gx-muted); text-align: center; overflow-wrap: anywhere; }
.gx-chart__plot.is-many .gx-chart__val { font-size: 10.5px; }
.gx-chart__plot.is-many .gx-chart__lbls span { font-size: 10.5px; }
@media (max-width: 520px) {
	.gx-chart__plot { padding-left: 36px; }
	.gx-chart__grid span { left: 36px; }
	.gx-chart__plot.is-many .gx-chart__val { font-size: 9.5px; letter-spacing: -.02em; }
	.gx-chart__plot.is-many .gx-u { display: none; } /* Satuan sudah ada di keterangan grafik. */
	.gx-chart__plot.is-many .gx-chart__bars, .gx-chart__plot.is-many .gx-chart__lbls { gap: 4px; }
	.gx-chart__plot.is-many .gx-chart__lbls span { font-size: 9.5px; }
}
.gx-chart[data-gx-anim]:not(.is-in) .gx-chart__bar { transform: scaleY(0); }
.gx-chart[data-gx-anim]:not(.is-in) .gx-chart__val { opacity: 0; }

/* --- Batang horizontal --- */
.gx-chart .gx-hbar { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: 10px 12px; margin: 0; padding: 0; list-style: none; }
.gx-chart .gx-hbar li { display: contents; }
.gx-chart .gx-hbar li::before, .gx-chart .gx-hbar li::marker { content: none; }
.gx-hbar__lbl { align-self: center; font-size: 14px; line-height: 1.3; color: var(--gx-text); text-align: right; overflow-wrap: anywhere; }
.gx-hbar__track { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 26px; border-left: 1px solid #5a606c; }
.gx-hbar__bar { display: block; flex: none; width: calc(var(--v) * .84); min-width: 2px; height: 22px; background: var(--c); transform-origin: left; transition: transform .7s ease-out calc(var(--i) * 50ms); }
.gx-hbar__val { flex: none; font: 700 13px/1 var(--gx-sans); color: var(--gx-head); white-space: nowrap; font-variant-numeric: tabular-nums; transition: opacity .3s calc(var(--i) * 50ms + .4s); }
@media (max-width: 520px) {
	.gx-chart .gx-hbar { gap: 8px 10px; }
	.gx-hbar__lbl { font-size: 13px; }
	.gx-hbar__val { font-size: 12px; }
	.gx-hbar__bar { width: calc(var(--v) * .72); height: 18px; }
}
.gx-chart[data-gx-anim]:not(.is-in) .gx-hbar__bar { transform: scaleX(0); }
.gx-chart[data-gx-anim]:not(.is-in) .gx-hbar__val { opacity: 0; }

/* --- Donat: tersusun vertikal (lingkaran di atas, keterangan di bawah) --- */
.gx-donut { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.gx-donut__ring { position: relative; width: min(100%, 260px); aspect-ratio: 1; }
.gx-donut__ring svg { display: block; width: 100% !important; height: 100% !important; }
.gx-donut__track { fill: none; stroke: #232833; stroke-width: 6.2; }
.gx-donut__seg { fill: none; stroke-width: 6.2; transition: opacity .5s calc(var(--i) * 80ms); }
.gx-donut__mid { position: absolute; inset: 22%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.gx-donut__mid b { font: 800 clamp(26px, 4.6vw, 36px)/1 var(--gx-serif); color: var(--gx-head); }
.gx-donut__mid span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: 12px; line-height: 1.3; color: var(--gx-muted); }
.gx-chart .gx-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 0 28px; width: 100%; margin: 0; padding: 0; list-style: none; }
.gx-chart .gx-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--gx-line); }
.gx-chart .gx-legend li::before, .gx-chart .gx-legend li::marker { content: none; }
.gx-legend__dot { width: 12px; height: 12px; background: var(--c); }
.gx-legend__lbl { font-size: 14px; color: var(--gx-text); }
.gx-legend b { font: 700 15px/1 var(--gx-sans); color: var(--gx-head); font-variant-numeric: tabular-nums; }
.gx-legend small { grid-column: 2 / 4; font-size: 12px; color: var(--gx-muted); }
.gx-chart[data-gx-anim]:not(.is-in) .gx-donut__seg { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
	.gx-chart__bar, .gx-chart__val, .gx-hbar__bar, .gx-hbar__val, .gx-donut__seg, .gx-poll__fill { transition: none !important; }
}
