/* The infobox (net_cyc/articles/_infobox), drawn as Wikipedia draws its infobox templates: a box floated right in a
   smaller size, the title band (nc-infobox__above) and the header rows in the colours of its kind's group (the
   --nc-band-* pairs of 01-settings/_palette.css), the subheader's lines and the images centred, a label in bold left of
   its value, a group label alone on its row, sub-rows with "• " indented under it, a multi-column row's cells side by
   side with dotted rules between them, full-width text rows centred. The rows are set close, as Wikipedia's are (a
   line of 1.5em and almost no padding). A country's, a settlement's and a place's top-level rows are ruled apart by
   rules that run from edge to edge (the cells' borders collapsed), in lines of 1.2em, as in Infobox country and
   Infobox settlement; a country's subheader (the native names) is in larger italics, its sub-rows' labels are not
   bold, and a war's subheader ("Part of …") sits on a grey band, as in Infobox military conflict. On a narrow screen
   the box spans the width. */

.nc-infobox { --band: transparent; --band-header: var(--nc-hover); float: right; clear: right; width: var(--nc-infobox-width); margin: 0.5em 0 0.5em 1em; padding: 0.2em; border: 1px solid var(--nc-box-border); border-spacing: 3px; background: var(--nc-box); color: var(--nc-text); font-size: 88%; line-height: 1.5em; }
.nc-infobox :where(th, td) { padding: 0.1em 0.25em; text-align: left; vertical-align: top; }
.nc-infobox__above { padding: 0.2em 0.4em; line-height: 1.35; background: var(--band); font-size: 125%; font-weight: 700; text-align: center; }
.nc-infobox__subheader { text-align: center; }
.nc-infobox__header { padding-block: 0.1em; background: var(--band-header); font-weight: 700; text-align: center; }
.nc-infobox__label { width: 38%; font-weight: 700; }
.nc-infobox__data { overflow-wrap: anywhere; }
.nc-infobox__full { text-align: center; }
.nc-infobox__row--group .nc-infobox__label { width: auto; }
.nc-infobox .nc-infobox__row--sub > .nc-infobox__label { padding-left: 0.6em; }

.nc-infobox__images { padding: 0.25em 0; text-align: center; }
.nc-infobox__image-row { display: flex; align-items: flex-end; justify-content: space-around; gap: 0.5em; }
.nc-infobox__figure { flex: 0 1 auto; min-width: 0; }
.nc-infobox__image { display: block; max-width: 100%; max-height: 18em; margin: 0 auto; object-fit: contain; }
.nc-infobox__image-row:has(> :nth-child(2)) .nc-infobox__image { max-height: 8em; }
.nc-infobox__caption { margin-top: 0.125em; line-height: 1.5em; }

.nc-infobox__columns-cell { padding: 0; }
.nc-infobox__columns { display: grid; }
.nc-infobox__columns--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nc-infobox__columns--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nc-infobox__columns--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nc-infobox__column { padding: 0.1em 0.25em; }
.nc-infobox__column + .nc-infobox__column { border-left: 1px dotted var(--nc-border); }

.nc-infobox:is(.nc-infobox--country, .nc-infobox--settlement, .nc-infobox--place) { padding: 0; border-collapse: collapse; line-height: 1.2em; }
.nc-infobox:is(.nc-infobox--country, .nc-infobox--settlement, .nc-infobox--place) :where(th, td) { padding: 0.15em 0.6em; }
.nc-infobox:is(.nc-infobox--country, .nc-infobox--settlement, .nc-infobox--place) :is(.nc-infobox__row--parent, .nc-infobox__row--group, .nc-infobox__row:not(.nc-infobox__row--sub)) > * { padding-top: 0.4em; border-top: 1px solid var(--nc-box-border); }
.nc-infobox:is(.nc-infobox--country, .nc-infobox--settlement, .nc-infobox--place) .nc-infobox__row--last-sub > *, .nc-infobox:is(.nc-infobox--country, .nc-infobox--settlement, .nc-infobox--place) .nc-infobox__row:not(.nc-infobox__row--sub, .nc-infobox__row--parent, .nc-infobox__row--group) > * { padding-bottom: 0.4em; }
.nc-infobox:is(.nc-infobox--country, .nc-infobox--settlement, .nc-infobox--place) .nc-infobox__above { padding-block: 0.3em; }
.nc-infobox--country .nc-infobox__subheader { padding-bottom: 0.3em; font-size: 115%; font-style: italic; }
.nc-infobox--country .nc-infobox__row--sub > .nc-infobox__label { font-weight: 400; }
.nc-infobox:is(.nc-infobox--country, .nc-infobox--settlement, .nc-infobox--place) .nc-infobox__row--sub > .nc-infobox__label { padding-left: 0.9em; }
.nc-infobox--military-conflict .nc-infobox__subheader { background: var(--nc-hover); }

.nc-infobox:is(.nc-infobox--military-conflict, .nc-infobox--military-unit) { --band: var(--nc-band-conflict); --band-header: var(--nc-band-conflict); }
.nc-infobox:is(.nc-infobox--country, .nc-infobox--settlement, .nc-infobox--place) { --band: var(--nc-band-place); --band-header: var(--nc-band-place-header); }
.nc-infobox:is(.nc-infobox--person, .nc-infobox--officeholder, .nc-infobox--royalty, .nc-infobox--scientist) { --band: var(--nc-band-person); --band-header: var(--nc-band-person-header); }
.nc-infobox:is(.nc-infobox--company, .nc-infobox--political-party, .nc-infobox--legislature, .nc-infobox--organization, .nc-infobox--university, .nc-infobox--newspaper, .nc-infobox--website) { --band: var(--nc-band-organization); --band-header: var(--nc-band-organization-header); }
.nc-infobox:is(.nc-infobox--treaty, .nc-infobox--legislation, .nc-infobox--work, .nc-infobox--periodical) { --band: var(--nc-band-document); --band-header: var(--nc-band-document-header); }
.nc-infobox:is(.nc-infobox--ship, .nc-infobox--aircraft, .nc-infobox--spacecraft, .nc-infobox--space-station, .nc-infobox--device, .nc-infobox--physical-quantity, .nc-infobox--physical-law) { --band: var(--nc-band-technology); --band-header: var(--nc-band-technology-header); }
.nc-infobox--event { --band: var(--nc-band-event); --band-header: var(--nc-band-event-header); }

@media (max-width: 40rem) {
  .nc-infobox { float: none; width: 100%; margin: 0 0 1em; }
  .nc-infobox__label { width: 40%; }
}
