/* Shioh style for the older pages built on templates/base.html (the tables: Wikipedia, postfix, near-earth,
 * city populations, baseball; also the 15 puzzle). Cosmetic only: page background, fonts, the boxes (as pastel cells),
 * their title bars (as translucent bands) and the red .basic buttons (as navy buttons). It never touches the inputs,
 * :checked rules, sizes or positions the CSS interactions depend on, and each page's own inline <style> comes later,
 * so it still wins any tie. Imported by css/tables.css (so the pre-rendered table pages pick it up) and linked
 * directly by templates/sortable.html. The variables come from css/shioh-style.css (the base) and css/site-theme.css. */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Open+Sans:wdth,wght@75..100,400..700&display=swap");
@import url("shioh-style.css");
@import url("site-theme.css");

body {
	color: var(--ss-ink);
	font-family: var(--ss-font-body);
	background-color: var(--ss-bg);
	background-image: linear-gradient(var(--ss-overlay), var(--ss-overlay)), var(--ss-pattern);
	background-repeat: repeat;
	background-size: auto, var(--ss-pattern-size);
	background-attachment: fixed;
}

/* a little dark gap between the boxes (cosmetic: the grid's columns and rows stay as they were) */
div.container {
	column-gap: var(--ss-gap);
}

/* the boxes: pastel cells (the side panel lilac, the main area periwinkle) */
div.container > div.content-11,
div.container > div.content-13,
div.container > div.content-31,
div.container > div.content-33,
div.container > div.content-12,
div.container > div.content-21 {
	background: var(--ss-p3);
	border: 1px solid var(--ss-border);
	border-radius: var(--ss-radius);
	box-shadow: 0 2px 12px rgb(0 0 0 / 0.28);
}
div.container > div.content-22 {
	background: var(--ss-p1);
	border: 1px solid var(--ss-border);
	border-radius: var(--ss-radius);
	box-shadow: 0 2px 12px rgb(0 0 0 / 0.28);
}

/* tables go on white (the style's "surface"), not straight on the pastel cell: the Wikipedia table (#table) and
   the near-earth one left some columns and rows see-through */
div.container > div.content-22 #table,
div.container > div.content-22 table {
	background: #fff;
}

/* title bars: a translucent band in Montserrat instead of a photo with shadowed white text */
div.container div .title {
	background: var(--ss-band-pattern), var(--ss-band);
	border: 0;
	border-bottom: 1px solid var(--ss-rule);
	border-radius: var(--ss-radius) var(--ss-radius) 0 0;
	top: 0;
	left: 0;
	color: var(--ss-ink);
	text-shadow: none;
	font-family: var(--ss-font-head);
	font-weight: 700;
}
div.container div .title .titleBG {
	background: none;
}
div.container div .title a,
div.container div .title label {
	color: var(--ss-ink);
	text-shadow: none;
}
div.container div .title a:hover,
div.container div .title label:hover {
	text-shadow: none;
	text-decoration: underline;
}
h1, h2, h3 {
	font-family: var(--ss-font-head);
}
div.container a:not(.basic) {
	color: var(--ss-link);
}

/* baseball table: long names used to wrap onto a hidden second line ("V. Pasquantino" showed as "V."); keep them
   on one line and end with "…" instead */
.sortable .data-cell.sortable-col1 {
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* baseball table: the columns were sized for the browser's narrow default font; Open Sans digits are wider, so
   3-digit numbers ran into the next column or were clipped. Use Open Sans's condensed width in the cells. */
.sortable .data-cell,
.sortable-header .header-cell {
	font-stretch: 80%;
}

/* buttons */
a.basic,
button.basic {
	background: var(--ss-accent);
	border: 1px solid var(--ss-accent);
	border-radius: var(--ss-radius-sm);
	font-family: var(--ss-font-body);
	font-weight: 600;
	box-shadow: none;
}
a.basic:hover,
button.basic:hover {
	background: var(--ss-accent);
	opacity: 0.9;
}

/* Phones: one column of full-width boxes, each as tall as its content, the main area first. newbase.css's phone
   layout put the side boxes two to a row (and tables.css forced its desktop columns back on), so each box was
   half the screen wide and no shorter. The expand/collapse radios only change grid spans, so in one column they
   have nothing to do. */
@media screen and (max-width: 719px) {
	body {
		margin: var(--ss-page-pad-phone);
	}
	div.container {
		height: auto !important;   /* (some pages fix it, which squeezed the boxes and hid what's below their tables) */
		width: auto !important;
		max-width: none;
		margin: 0;
		grid-template-columns: minmax(0, 1fr) !important;
		grid-template-rows: none !important;
		grid-auto-rows: auto;
		row-gap: var(--ss-gap);
	}
	div.container > div[class^="content-"] {
		grid-column: 1 !important;
		grid-row: auto !important;
		height: auto !important;
		min-width: 0;
	}
	div.container > div.content-22 { order: -1; }
	div.container div:not(.content-22) > .content {
		height: auto;
	}
	div.container div .title .titleRight {
		display: none;   /* the expand/collapse buttons */
	}
	/* table cells on one line: the table scrolls sideways in its box instead of every row wrapping tall */
	div.container > div.content-22 td {
		white-space: nowrap;
	}
}
