/* A House Divided: 1991 explorer. Builds on /assets/site.css tokens.
   Hierarchy comes from type size, weight and spacing; rules separate, boxes are
   reserved for the interactive explorer surface. */

.x1991 { --x-gap: 72px; color: var(--text); }
.x1991 .x-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.x1991 a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.x1991 a:hover { text-decoration-color: var(--ahd); }
.x1991 .x-muted { color: var(--text-2); }

/* Header band: the page's one surface */
.x-head { padding: 52px 0 36px; border-bottom: 1px solid var(--line); }
.x-crumbs { font-size: 0.8rem; color: var(--text-3); margin-bottom: 18px; }
.x-crumbs a { color: var(--text-2); text-decoration: none; }
.x-crumbs a:hover { color: var(--text); }
.x-head h1 { font-family: var(--font-display); font-size: clamp(2.1rem, 4.6vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.04; margin-bottom: 14px; }
.x-head .x-dek { color: var(--text-2); font-size: 1.06rem; max-width: 64ch; margin-bottom: 30px; }
.x-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; }
.x-actions { display: flex; flex-direction: column; gap: 10px; }
.x-actions .btn { justify-content: center; }
.x-actions p { color: var(--text-3); font-size: 0.82rem; margin-top: 6px; }
@media (max-width: 860px) { .x-head-grid { grid-template-columns: 1fr; gap: 28px; } }

/* Definition lists for facts: label column + value column, hairline rows */
.x-facts { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); border-top: 1px solid var(--line); }
.x-facts dt, .x-facts dd { padding: 10px 0; border-bottom: 1px solid var(--line); }
.x-facts dt { color: var(--text-2); font-size: 0.88rem; padding-right: 16px; }
.x-facts dd { font-size: 0.95rem; }
.x-facts-tight dt, .x-facts-tight dd { padding: 7px 0; font-size: 0.86rem; }
.x-facts-tight { grid-template-columns: 130px minmax(0, 1fr); }

/* In-page contents */
.x-toc { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px 26px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.x-toc a { color: var(--text-2); text-decoration: none; }
.x-toc a:hover { color: var(--text); }

/* Sections */
.x-section { padding-top: var(--x-gap); scroll-margin-top: 64px; }
.x-section > h2 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 10px; }
.x-section > .x-lede { color: var(--text-2); font-size: 1rem; max-width: 70ch; margin-bottom: 30px; }
.x-section h3 { font-size: 1rem; font-weight: 650; line-height: 1.35; margin-bottom: 4px; }
.x-section p { line-height: 1.6; }

/* Two-column prose blocks for setup */
.x-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 56px; }
.x-split > div > p { color: var(--text-2); font-size: 0.95rem; margin-bottom: 12px; }
.x-split > div > h3 { margin-bottom: 8px; font-size: 1.08rem; }
@media (max-width: 860px) { .x-split { grid-template-columns: 1fr; } }

/* Category groups: heading column + entries */
.x-group { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0 40px; padding: 14px 0 10px; border-top: 1px solid var(--line); }
.x-group > h3 { padding-top: 10px; }
.x-group > h3 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; }
.x-entries { display: grid; gap: 0; }
.x-entry { border-bottom: 1px solid var(--line); }
.x-entry:last-child { border-bottom: 0; }
.x-entry summary { list-style: none; cursor: pointer; padding: 11px 28px 11px 0; position: relative; display: grid; gap: 2px; }
.x-entry summary::-webkit-details-marker { display: none; }
.x-entry summary::after { content: ""; position: absolute; right: 6px; top: 17px; width: 7px; height: 7px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform 0.15s; }
.x-entry[open] summary::after { transform: rotate(225deg); top: 21px; }
.x-entry summary:hover .x-entry-title { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.x-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.x-entry-title { font-weight: 650; font-size: 0.98rem; }
.x-entry-teaser { color: var(--text-2); font-size: 0.92rem; max-width: 76ch; }
.x-entry-body { padding: 0 28px 16px 0; }
.x-entry-body p { color: var(--text-2); font-size: 0.92rem; max-width: 76ch; }
.x-entry ul { margin: 8px 0 0; padding: 0; list-style: none; }
.x-entry li { color: var(--text-2); font-size: 0.88rem; padding: 2px 0 2px 16px; position: relative; max-width: 74ch; }
.x-entry li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 6px; height: 1px; background: var(--text-3); }
.x-group-tools { display: flex; justify-content: flex-end; margin: -14px 0 6px; }
.x-linkbtn { appearance: none; background: none; border: 0; color: var(--text-2); font: inherit; font-size: 0.85rem; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; padding: 0; }
.x-linkbtn:hover { color: var(--text); }
.x-meta { color: var(--text-3); font-size: 0.8rem; margin-top: 6px; }
@media (max-width: 860px) { .x-group { grid-template-columns: 1fr; gap: 12px; } }

/* Status for the 1953 comparison: a dot that encodes status, always with its label */
.x-status { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--text-2); }
.x-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--x-s, var(--text-3)); }
.x-status[data-s="launch"] { --x-s: #3fb27f; }
.x-status[data-s="dev"] { --x-s: #46b6c2; }
.x-status[data-s="progress"] { --x-s: var(--ahd); }
.x-status[data-s="planned"] { --x-s: rgba(224,235,240,0.38); }
.x-status-key { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: -12px 0 24px; }

/* Controls: segmented buttons and select */
.x-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 18px; }
.x-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.x-seg button { appearance: none; background: transparent; color: var(--text-2); border: 0; padding: 7px 13px; font: inherit; font-size: 0.86rem; cursor: pointer; }
.x-seg button + button { border-left: 1px solid var(--line-2); }
.x-seg button[aria-pressed="true"] { background: var(--plate-2); color: var(--text); }
.x-seg button:hover { color: var(--text); }
.x-select { appearance: none; background: var(--plate) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23b7c6cc' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 34px 8px 12px; font: inherit; font-size: 0.92rem; min-width: 230px; }
.x-control-label { color: var(--text-2); font-size: 0.86rem; }

/* Tables */
.x-table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.x-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.x-table caption { text-align: left; }
.x-table th, .x-table td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: baseline; }
.x-table thead th { color: var(--text-2); font-weight: 500; font-size: 0.8rem; border-bottom-color: var(--line-2); }
.x-table thead th button { appearance: none; background: none; border: 0; color: inherit; font: inherit; padding: 0; cursor: pointer; }
.x-table thead th button:hover { color: var(--text); }
.x-table thead th[aria-sort] button { color: var(--text); }
.x-table thead th[aria-sort="descending"] button::after { content: " \2193"; }
.x-table thead th[aria-sort="ascending"] button::after { content: " \2191"; }
.x-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.x-table tbody th { font-weight: 600; }
.x-table tbody tr:hover, .x-table tbody tr.x-hot { background: rgba(210,225,232,0.04); }
.x-table .x-label { color: var(--text-2); }
.x-table .x-sub { color: var(--text-3); font-weight: 400; font-size: 0.8rem; margin-left: 6px; }
.x-table td.x-na { color: var(--text-3); }
.x-notes { color: var(--text-3); font-size: 0.82rem; margin-top: 14px; max-width: 90ch; }
.x-notes p + p { margin-top: 6px; }

/* Lean explorer: the one interactive surface */
.x-explorer { border: 1px solid var(--line); border-radius: 14px; background: var(--ground-2); padding: 22px; }
.x-explorer-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 960px) { .x-explorer-grid { grid-template-columns: 1fr; } }
#x-lean-map svg { width: 100%; height: auto; display: block; max-height: 520px; }
#x-lean-map.x-loading { opacity: 0.55; transition: opacity 0.15s; }
.x-region { stroke: var(--ground-2); stroke-width: 1; stroke-linejoin: round; cursor: default; transition: filter 0.1s; }
.x-region:hover, .x-region.x-hot, .x-region:focus { filter: brightness(1.35); outline: none; stroke: var(--text); stroke-width: 1.5; }
.x-legend-bar { height: 8px; border-radius: 4px; margin-top: 14px; }
.x-legend-labels { display: flex; justify-content: space-between; color: var(--text-2); font-size: 0.78rem; margin-top: 6px; font-variant-numeric: tabular-nums; }
.x-legend-note { color: var(--text-3); font-size: 0.78rem; margin-top: 8px; line-height: 1.5; }
#x-lean-scatter svg { width: 100%; height: auto; display: block; margin-top: 18px; }
.x-grid { stroke: var(--line); stroke-width: 1; }
.x-axis0 { stroke: var(--line-2); stroke-width: 1; }
.x-tick { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.x-axis-label { fill: var(--text-2); font-size: 11.5px; }
.x-dot .x-hit { fill: transparent; }
.x-dot .x-mark { fill: #8fb3bf; stroke: var(--ground-2); stroke-width: 2; }
.x-dot:hover .x-mark, .x-dot.x-hot .x-mark, .x-dot:focus .x-mark { fill: var(--text); }
.x-dot:focus { outline: none; }
.x-national { fill: none; stroke: var(--ahd); stroke-width: 2; }
.x-key-dot, .x-key-ring { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: -1px; }
.x-key-dot { background: #8fb3bf; }
.x-key-ring { border: 2px solid var(--ahd); }
.x-lean-table-wrap { margin-top: 26px; }

/* Tooltip */
.x-tip { position: absolute; z-index: 50; display: none; pointer-events: none; background: var(--plate-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font-size: 0.8rem; box-shadow: 0 12px 30px -12px rgba(0,0,0,0.7); max-width: 280px; }
.x-tip-title { color: var(--text-2); margin-bottom: 3px; }
.x-tip-row { display: flex; gap: 10px; justify-content: space-between; }
.x-tip-row strong { color: var(--text-3); font-weight: 500; order: 2; }
.x-tip-row span { color: var(--text); font-variant-numeric: tabular-nums; order: 1; }

/* Static per-country fallback tables */
.x-static-leans details { border-top: 1px solid var(--line); padding: 10px 0; }
.x-static-leans summary { cursor: pointer; color: var(--text-2); font-size: 0.92rem; }
.x-static-leans summary:hover { color: var(--text); }

/* Background roster */
.x-roster { columns: 4 180px; column-gap: 28px; font-size: 0.88rem; color: var(--text-2); }
.x-roster li { list-style: none; padding: 2px 0; break-inside: avoid; }
.x-roster-head { color: var(--text); font-weight: 600; font-size: 0.86rem; margin: 0 0 6px; }

.x-source { margin-top: var(--x-gap); padding-top: 22px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 0.82rem; max-width: 92ch; }
.x-source p + p { margin-top: 8px; }

.x1991 .btn { text-decoration: none; }
@media (max-width: 600px) {
  .x-facts { grid-template-columns: 112px minmax(0, 1fr); }
  .x-facts-tight { grid-template-columns: 112px minmax(0, 1fr); }
  .x-explorer { padding: 16px; }
  .x-head { padding-top: 36px; }
}
