/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * The JSON table islands: what the page around the tables adds to the Islands demo, whose style
 * sheet it has too, and the heads of the islands. All in the colors of the theme.
 */

.table-islands__tables {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1em;
}

.table-island {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.5em;
	padding: 0.75em;
	border: 1px solid var(--antilia-theme-border, #ccc);
	border-radius: 0.5em;
	background: var(--antilia-theme-surface, #ffffff);
	color: var(--antilia-theme-text, #222);
}

.table-island__header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5em 1em;
}

.table-island__badge {
	padding: 0.1em 0.6em;
	border: 1px solid transparent;
	border-radius: 1em;
	font-size: 0.85em;
	font-weight: 600;
	color: var(--antilia-theme-on-primary, #fff);
	background: var(--antilia-theme-primary, #2f5bd3);
}

.table-island--svelte .table-island__badge {
	border: 1px solid var(--antilia-theme-primary, #2f5bd3);
	color: var(--antilia-theme-primary, #2f5bd3);
	background: transparent;
}

.table-island__summary {
	font-weight: 600;
}

.table-island__life {
	margin-inline-start: auto;
	font-size: 0.8em;
	font-variant-numeric: tabular-nums;
	color: color-mix(in srgb, var(--antilia-theme-text, #222) 65%, transparent);
}

/* the button of the form of an island, away from those that end it */
.table-island__edit-in-wicket {
	margin-block-start: 0.5em;
}

/* what the panel of the server tells of the users selected */

.table-islands__selection,
.table-islands__facts {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 0.2em 1em;
	margin: 0;
}

.table-islands__selection dt,
.table-islands__facts dt {
	font-weight: 600;
}

.table-islands__selection dd,
.table-islands__facts dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.table-islands__details {
	display: grid;
	justify-items: start;
	gap: 0.5em;
	padding: 0.6em 0.8em;
	border: 1px solid var(--antilia-theme-border, #ccc);
	border-radius: 0.4em;
	background: var(--antilia-theme-surface, #ffffff);
}

.table-islands__name {
	margin: 0;
	font-size: 1em;
}

/* on a phone the table keeps its columns readable and scrolls sideways in a box of its own */
.table-island__table {
	overflow-x: auto;
	/* the list of the column chooser is a little higher than the table */
	padding-bottom: 0.25em;
}

/* the form of a user is no wider than its dialog */
.user-edit {
	min-width: min(22em, calc(100vw - 8em));
}
