/* SpiralWorlds canonical entry and shared component layout. */

html body .sw-entry {
	box-sizing: border-box;
	width: calc(100% - 32px) !important;
	max-width: 1180px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.sw-entry *,
.sw-entry *::before,
.sw-entry *::after {
	box-sizing: inherit;
}

.sw-entry img,
.sw-entry video,
.sw-entry iframe,
.sw-entry table {
	max-width: 100%;
}

.sw-entry img {
	height: auto;
}

.sw-entry .sw-prose,
.sw-entry .sw-reading,
.sw-entry .sw-longform {
	max-width: 860px;
	margin-left: auto;
	margin-right: auto;
}

.sw-entry .sw-hero,
.sw-entry .sw-map,
.sw-entry .sw-wide,
.sw-entry .sw-stat-block,
.sw-entry .sw-tabs {
	width: 100%;
	max-width: 1180px;
	margin-left: auto;
	margin-right: auto;
}

.sw-entry .sw-hero img,
.sw-entry figure.sw-hero img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	margin-left: auto;
	margin-right: auto;
}

.sw-entry .sw-opening-with-emblem,
.sw-entry .sw-opening-with-arms,
.sw-entry .sw-opening-with-sigil {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(140px, 220px);
	gap: 1.5rem;
	align-items: start;
}

.sw-entry .sw-opening-with-emblem img,
.sw-entry .sw-opening-with-arms img,
.sw-entry .sw-opening-with-sigil img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}

/* Shared responsive table plumbing; page-level borders, spacing and colours remain local. */
.sw-entry .sw-table-wrap {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* Shared accessible text-hiding utility for tab legends and similar labels. */
.sw-entry .sw-visually-hidden,
.sw-visually-hidden {
	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;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Canonical CSS-only tab framework for the audited radio/label/panel family.
   Checked-state mapping and visual skins remain page-local. */
.sw-entry :is(
	.sw-tabs,
	.sw-rules-tabs,
	.sw-mechanics-tabs,
	.sw-editions,
	.sw-edition-tabs,
	.sw-css-tabs,
	.sw-rule-tabs,
	.sw-rules
):has(.sw-tab-labels):has(.sw-tab-panel) > input[type="radio"],
.sw-entry .sw-tab-input,
.sw-tab-input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.sw-entry :is(
	.sw-tabs,
	.sw-rules-tabs,
	.sw-mechanics-tabs,
	.sw-editions,
	.sw-edition-tabs,
	.sw-css-tabs,
	.sw-rule-tabs,
	.sw-rules
):has(.sw-tab-labels):has(.sw-tab-panel) .sw-tab-labels,
.sw-entry :is(
	.sw-tabs,
	.sw-rules-tabs,
	.sw-mechanics-tabs,
	.sw-editions,
	.sw-edition-tabs,
	.sw-css-tabs,
	.sw-rule-tabs,
	.sw-rules
):has(.sw-tab-labels):has(.sw-tab-panel) :is(.sw-tab-panels, .sw-panels),
.sw-entry :is(
	.sw-tabs,
	.sw-rules-tabs,
	.sw-mechanics-tabs,
	.sw-editions,
	.sw-edition-tabs,
	.sw-css-tabs,
	.sw-rule-tabs,
	.sw-rules
):has(.sw-tab-labels):has(.sw-tab-panel) .sw-tab-panel {
	min-width: 0;
	max-width: 100%;
}

.sw-entry :is(
	.sw-tabs,
	.sw-rules-tabs,
	.sw-mechanics-tabs,
	.sw-editions,
	.sw-edition-tabs,
	.sw-css-tabs,
	.sw-rule-tabs,
	.sw-rules
):has(.sw-tab-labels):has(.sw-tab-panel) .sw-tab-panel {
	display: none;
}

@media (max-width: 782px) {
	html body .sw-entry {
		width: calc(100% - 24px) !important;
	}

	.sw-entry .sw-opening-with-emblem,
	.sw-entry .sw-opening-with-arms,
	.sw-entry .sw-opening-with-sigil {
		grid-template-columns: 1fr;
	}

	.sw-entry .sw-opening-with-emblem img,
	.sw-entry .sw-opening-with-arms img,
	.sw-entry .sw-opening-with-sigil img {
		width: min(220px, 60vw);
		margin-left: auto;
		margin-right: auto;
	}
}
