/*
 * JTC 21 Working Groups — public page.
 * Built on the jtc21-theme design tokens (navy, ice, green, Inter, pill buttons,
 * 18px card radius, 1180px container). Fallback values match the theme, so it
 * still looks right if the theme's variables are missing.
 *
 * Selectors are scoped to .jwg and kept one step more specific than the theme's
 * ".entry-content a / p / ul / li" rules, which would otherwise turn buttons into
 * green underlined links and lists into bullets.
 */
.jwg {
	--jwg-navy: var(--navy, #022747);
	--jwg-navy-deep: var(--navy-deep, #00203D);
	--jwg-ice: var(--ice, #88BFE8);
	--jwg-ice-soft: var(--ice-soft, #E7F1FB);
	--jwg-green: var(--green, #009A44);
	--jwg-green-deep: var(--green-deep, #00792F);
	--jwg-ink: var(--ink, #10202F);
	--jwg-slate: var(--slate, #4C6076);
	--jwg-line: var(--line, #DCE4EC);
	--jwg-card-bg: var(--card-bg, #F2F5F8);
	--jwg-radius: var(--radius, 10px);
	--jwg-radius-lg: var(--radius-lg, 18px);
	--jwg-container: var(--container, 1180px);
	--jwg-font: var(--font-display, 'Inter', 'Segoe UI', Arial, sans-serif);
	--jwg-w: min(calc(var(--jwg-container) - 48px), calc(100vw - 48px));
	font-family: var(--jwg-font);
	color: var(--jwg-ink);
}
.jwg *, .jwg *::before, .jwg *::after { box-sizing: border-box; }
.jwg p { max-width: none; }

/* ------------------------------------------------------------------ */
/* Blue box — full width, aligned to the theme container               */
/* ------------------------------------------------------------------ */
.jwg .jwg-hero {
	background: linear-gradient(160deg, var(--jwg-navy) 0%, var(--jwg-navy-deep) 100%);
	color: #fff;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: 40px 24px 44px;
}
/* Continue straight on from the theme's navy page-title band (.page-hero has 56px bottom padding,
   .entry-content 56px top padding: pulling up 80px leaves a 32px gap under the page title). */
.jwg .jwg-hero--merge { margin-top: -80px; padding-top: 0; background: var(--jwg-navy); }
/* The full-width box uses 100vw, which includes the scrollbar; stop that causing sideways scrolling. */
body:has(.jwg-hero) { overflow-x: clip; }
.jwg .jwg-hero-inner { max-width: calc(var(--jwg-container) - 48px); margin: 0 auto; }
.jwg .jwg-eyebrow {
	display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--jwg-ice);
	background: rgba(136, 191, 232, .12); border: 1px solid rgba(136, 191, 232, .35);
	padding: 5px 14px; border-radius: 999px; margin-bottom: 16px;
}
.jwg .jwg-hero-title {
	color: #fff; margin: 0 0 10px; font-size: clamp(22px, 2.4vw, 28px); font-weight: 800;
	line-height: 1.2; letter-spacing: -0.02em;
}
.jwg .jwg-hero-intro { color: rgba(255, 255, 255, .82); font-size: 16.5px; line-height: 1.6; max-width: 62ch; margin: 0 0 22px; }
.jwg .jwg-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ------------------------------------------------------------------ */
/* Buttons — same system as the theme's .btn                           */
/* ------------------------------------------------------------------ */
.jwg a.jwg-btn {
	display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
	font-family: var(--jwg-font); font-weight: 700; font-size: 15px; line-height: 1.2;
	padding: 12px 24px; border-radius: 999px; border: 2px solid transparent;
	text-decoration: none; cursor: pointer;
	transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.jwg a.jwg-btn:hover { transform: translateY(-1px); text-decoration: none; }
.jwg a.jwg-btn--primary { background: var(--jwg-green); color: #fff; }
.jwg a.jwg-btn--primary:hover, .jwg a.jwg-btn--primary:focus { background: var(--jwg-green-deep); color: #fff; }
.jwg a.jwg-btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.jwg a.jwg-btn--ghost:hover, .jwg a.jwg-btn--ghost:focus { background: rgba(255, 255, 255, .08); border-color: #fff; color: #fff; }
.jwg a.jwg-btn--outline { background: transparent; color: var(--jwg-navy); border-color: var(--jwg-navy); }
.jwg a.jwg-btn--outline:hover, .jwg a.jwg-btn--outline:focus { background: var(--jwg-navy); color: #fff; }
.jwg a.jwg-btn--sm { padding: 7px 16px; font-size: 13px; }
.jwg a:focus-visible, .jwg summary:focus-visible { outline: 3px solid var(--jwg-green); outline-offset: 2px; }
.jwg .jwg-hero a:focus-visible { outline-color: var(--jwg-ice); }

/* ------------------------------------------------------------------ */
/* Cards — full theme container width, compact                         */
/* ------------------------------------------------------------------ */
.jwg .jwg-main {
	width: var(--jwg-w);
	margin-left: calc((100% - var(--jwg-w)) / 2);
	padding-top: 32px;
}
.jwg .jwg-hero + .jwg-main { padding-top: 32px; }
.jwg .jwg-grid {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start;
}
.jwg .jwg-card {
	background: #fff; border: 1px solid var(--jwg-line); border-radius: var(--jwg-radius-lg);
	padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 96px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.jwg .jwg-card:hover { border-color: var(--jwg-ice); box-shadow: 0 12px 30px rgba(2, 39, 71, .08); }

.jwg .jwg-card-head { display: flex; align-items: center; gap: 14px; }
.jwg .jwg-badge {
	flex: none; width: 44px; height: 44px; border-radius: var(--jwg-radius);
	background: var(--jwg-ice-soft); color: var(--jwg-navy);
	display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.jwg .jwg-card-title { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 800; color: var(--jwg-navy); letter-spacing: -0.01em; }
.jwg .jwg-card-short { margin: 2px 0 0; font-size: 14px; line-height: 1.4; color: var(--jwg-slate); }

.jwg .jwg-roles {
	margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 14px;
	background: var(--jwg-card-bg); border-radius: var(--jwg-radius); padding: 10px 14px;
}
.jwg .jwg-roles dt { font-size: 12px; font-weight: 600; color: var(--jwg-slate); line-height: 1.4; }
.jwg .jwg-roles dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--jwg-navy); line-height: 1.35; }

.jwg .jwg-list-head {
	display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--jwg-slate);
	padding-bottom: 6px; border-bottom: 1px solid var(--jwg-line);
}
.jwg .jwg-list ul { list-style: none; margin: 0; padding: 0; max-width: none; }
.jwg .jwg-list li.jwg-item {
	display: flex; align-items: center; gap: 12px; margin: 0; padding: 9px 0;
	border-bottom: 1px solid var(--jwg-line); font-size: 14px; color: var(--jwg-ink);
}
.jwg .jwg-list li.jwg-item:last-child { border-bottom: 0; padding-bottom: 0; }
.jwg .jwg-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jwg .jwg-code { font-size: 12px; font-weight: 600; color: var(--jwg-slate); letter-spacing: .01em; }
.jwg .jwg-item-title { font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--jwg-ink); }
.jwg .jwg-stage {
	flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
	font-size: 12px; font-weight: 600; line-height: 1.2; padding: 4px 10px; border-radius: 999px;
	background: #fff; border: 1px solid var(--jwg-line); color: var(--jwg-ink);
}
.jwg .jwg-stage::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--jwg-stage, #8C8571); }

.jwg p.jwg-empty {
	margin: 0; font-size: 14px; line-height: 1.5; color: var(--jwg-slate);
	background: var(--jwg-card-bg); border-left: 3px solid var(--jwg-green); border-radius: 0 var(--jwg-radius) var(--jwg-radius) 0; padding: 10px 14px;
}

/* Footer: "Show scope" link left, Join button right */
.jwg .jwg-card-foot {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px 16px;
	padding-top: 12px; border-top: 1px solid var(--jwg-line);
}
.jwg .jwg-card-foot > a.jwg-btn { grid-column: 2; grid-row: 1; }
.jwg .jwg-scope summary {
	display: inline-flex; align-items: center; gap: 6px; min-height: 34px; cursor: pointer; list-style: none;
	font-size: 13.5px; font-weight: 700; color: var(--jwg-green-deep);
}
.jwg .jwg-scope summary::-webkit-details-marker { display: none; }
.jwg .jwg-scope summary::after {
	content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg); transition: transform .15s ease;
}
.jwg .jwg-scope[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.jwg .jwg-scope summary:hover { text-decoration: underline; }
.jwg .jwg-scope .jwg-hide, .jwg .jwg-scope[open] .jwg-show { display: none; }
.jwg .jwg-scope[open] .jwg-hide { display: inline; }
.jwg .jwg-scope-body { margin-top: 6px; font-size: 14px; line-height: 1.55; color: var(--jwg-slate); }
.jwg .jwg-scope-body p { margin: 0 0 8px; font-size: 14px; color: var(--jwg-slate); }
.jwg .jwg-scope-body ul { list-style: disc; margin: 0; padding-left: 18px; max-width: none; }
.jwg .jwg-scope-body li { font-size: 14px; color: var(--jwg-slate); margin: 0 0 2px; }

.jwg .screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px;
	overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal;
}

@media (max-width: 980px) {
	.jwg .jwg-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
	.jwg .jwg-hero { padding-left: 24px; padding-right: 24px; }
	.jwg .jwg-roles { grid-template-columns: minmax(0, 1fr); gap: 2px; }
	.jwg .jwg-roles > div { display: flex; gap: 8px; align-items: baseline; }
	.jwg .jwg-roles dt { flex: 0 0 88px; }
	.jwg .jwg-card { padding: 18px; }
	.jwg .jwg-list li.jwg-item { flex-direction: column; align-items: flex-start; gap: 6px; }
	.jwg .jwg-hero-actions a.jwg-btn { width: 100%; justify-content: center; }
}
