/* byronpeters.com
   The look follows the earlier Indexhibit site: 13px Helvetica, black on
   white, a fixed index on the left, pink and yellow as the only colours.
   To change the two colours everywhere, edit the two lines below. */

:root {
	--pink: #fed1ff;
	--yellow: #fff200;
	--index: 215px;
}

html, body { margin: 0; padding: 0; }
body {
	font-size: 13px;
	font-family: 'Helvetica Neue', Arial, Helvetica, Verdana, sans-serif;
	line-height: 1.3em;
	background: #fff;
	color: #000;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

a:link, a:visited { text-decoration: none; color: #000; }
a:hover { text-decoration: underline; background-color: var(--yellow); }
a:focus-visible { outline: 1px solid #000; outline-offset: 1px; }
a img { border: 0; }
p { margin: 0 0 1em 0; }
em, i { font-style: italic; }
strong, b { font-weight: bold; }
u { text-decoration: underline; }
small { font-size: 9px; }
ul, ol { margin: 0 0 1em 0; padding: 0 0 0 1.4em; }
blockquote { margin: 0 0 1em 0; padding-left: 9px; }

.container { padding: 27px 9px 25px 27px; }

/* ---------- the index ---------- */

#index {
	position: fixed;
	top: 0; bottom: 0; left: 0;
	width: var(--index);
	overflow: auto;
	background: #fff;
	z-index: 30;
}
#index ul { list-style: none; margin: 0 0 1.5em 0; padding: 0; }
#index ul ul { margin: 0; }
#index .section_title, #index .section_title a { text-decoration: underline; }
#index li.active > a, #index li.hot > a { background-color: var(--yellow); }
/* a display this browser could not run (engine/core.js marks it for the rest of the visit) */
#index li.off > a { color: #999; text-decoration: line-through; }
#index .site_title { margin-bottom: 1.5em; }
#menubar { display: none; }

/* ---------- an exhibit, as a page (Basic) ---------- */

#exhibit { margin-left: var(--index); min-height: 100vh; }
#exhibit .inner { display: flex; align-items: flex-start; }
#exhibit .text { flex: 0 0 auto; width: 350px; margin-right: 30px; }
#exhibit .text.fits { position: sticky; top: 27px; }
#exhibit .text p { max-width: 350px; }
#exhibit .media { flex: 1 1 auto; min-width: 0; }
#exhibit figure { margin: 0 0 1.5em 0; }
#exhibit figure img { display: block; max-width: 100%; height: auto; }
#exhibit figure a { display: block; }
#exhibit figure a:hover { background: none; }
#exhibit figcaption { margin-top: 3px; max-width: 350px; }
#exhibit .player { position: relative; width: 100%; max-width: 1000px; }
#exhibit .player::before { content: ''; display: block; padding-top: 56.25%; }
#exhibit .player iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; }
#exhibit .close { display: none; }
#exhibit .thumbs a { display: inline-block; vertical-align: middle; margin: 0 25px 25px 0; }
#exhibit .thumbs a:hover { background: none; }
#exhibit .thumbs img { display: block; height: 200px; width: auto; max-width: 100%; }

/* ---------- the space (Immersive, Objects) ----------
   The front page of these two displays is a space of pictures. An exhibit
   opened from it is the plain page above, with a way back. */

#stage { display: none; }
.spatial #stage {
	display: block;
	position: fixed;
	left: var(--index); top: 0; right: 0; bottom: 0;
	overflow: hidden;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	cursor: default;
}
.spatial.open #stage { visibility: hidden; }
/* What stands on the stage sets its own visibility from one moment to the next, which would outweigh the line
   above. An exhibit that covers the stage must never show the space through its text, so everything on the
   stage is hidden by name as well. (Beside a panel the space stays in sight; see ".panel" below.) */
.spatial.open:not(.panel) #stage *, .spatial.open:not(.panel) #tag { visibility: hidden !important; }
.spatial:not(.open) { overflow: hidden; overscroll-behavior: none; }
.spatial:not(.open) body { overflow: hidden; height: 100%; overscroll-behavior: none; background-color: #fff !important; }
.spatial:not(.open) #exhibit { display: none; }
#stage canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
#stage .tile {
	position: absolute; left: 0; top: 0;
	transform-origin: 0 0;
	will-change: transform, opacity;
	cursor: pointer;
	background: #fff;
	-webkit-user-drag: none;
}
#stage img.tile { display: block; }
#stage .tile.words {
	box-sizing: border-box;
	border: 1px solid #000;
	padding: 9px 10px;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.3em;
}
#stage .tile.words u { display: block; margin-bottom: 1em; }
#stage.pointing, #stage.pointing .tile { cursor: pointer; }
/* the world: floating among everything on the site (Immersive on a computer).
   Each tile is a white sheet the browser moves as one layer; what is on it thins out with the mist. */
#stage.world { z-index: 1; }
#stage.world .tile { cursor: default; overflow: hidden; will-change: transform, opacity;
	/* The edge a visitor sees lies inside the layer. A browser cuts the edge of a layer hard, and lets it step
	   from pixel to pixel as the tile drifts, which made the edges of the pictures glitter; so every layer
	   carries a clear rim (this border), and the picture's own edge, lying within the drawing, is smoothed like
	   the rest of it. EDGE in engine/view-immersive.js is the width of the rim and must follow any change here.
	   The white of the sheet is switched on only while the tile stands in the mist (the class "misted"); a tile
	   seen clear is drawn as its picture alone, so nothing white can glint along its edge. */
	box-sizing: content-box; border: 2px solid transparent; background-color: transparent; background-clip: padding-box; }
#stage.world .tile.misted { background-color: #fff; }
#stage.world.pointing .tile { cursor: pointer; }
#stage.world.carrying, #stage.world.carrying .tile { cursor: grabbing; }
#stage.world .tile > * { pointer-events: none; }
#stage.world .tile.picture img { display: block; width: 100%; height: 100%; will-change: opacity; }
#stage.world .tile.text .face { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; will-change: opacity; }
#stage .tile.text { font-size: 13px; line-height: 1.3em; }
#stage .tile.text .cols {
	box-sizing: border-box; padding: 0 7px;
	column-width: 228px; column-gap: 14px; column-fill: auto;
	transform-origin: 0 0; background: #fff;
}
#stage .tile.text p { margin: 0 0 1em 0; }
/* the picture behind the space: softened in engine/view-immersive.js, faded here, and fitted to the stage */
#mist { display: none; position: fixed; left: var(--index); top: 0; width: calc(100% - var(--index)); height: 100%; object-fit: cover; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 2.4s; }
.in-world:not(.open) #mist, .in-world.panel #mist { display: block; }
.in-world:not(.open) #mist.ready, .in-world.panel #mist.ready { opacity: .52; }
/* the index stays a white column, and the space comes out of it softly */
.in-world:not(.open) #index::after { content: ''; position: fixed; left: var(--index); top: 0; bottom: 0; width: 110px; background: linear-gradient(to right, #fff, rgba(255,255,255,0)); pointer-events: none; }

/* the name of the work under the pointer, set like a hovered link */
#tag {
	position: fixed;
	z-index: 25;
	left: 0; top: 0;
	padding: 0 2px;
	background: var(--yellow);
	text-decoration: underline;
	white-space: nowrap;
	pointer-events: none;
	visibility: hidden;
}

/* the way back from an exhibit to the space, and from the space to the plain site: a small box with a cross, as
   on a window. The first belongs to the exhibit; the second (#leave) is put in by engine/core.js (startView). */
.spatial #exhibit .close, #leave {
	display: block; box-sizing: border-box; width: 17px; height: 17px;
	border: 1px solid #000;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9'%3E%3Cpath d='M.5.5l8 8m0-8l-8 8' stroke='%23000' fill='none'/%3E%3C/svg%3E") no-repeat center / 9px 9px;
}
.spatial #exhibit .close:hover, #leave:hover { background-color: var(--yellow); }
.spatial #exhibit .close { position: fixed; z-index: 28; top: 14px; right: 14px; }
#leave { position: fixed; z-index: 29; top: 14px; right: 14px; }
/* while an exhibit covers the whole stage, its own box stands in that corner */
.open:not(.panel) #leave { display: none; }

/* ---------- an exhibit beside the space (Immersive and Objects on a computer) ----------
   The exhibit opens as a panel just to the right of the menu, a column that scrolls by itself, and the space
   stays in sight beyond it. The box at the panel's top right closes it. The class "panel" is set by
   engine/core.js (setPanel) and by the script in the head of every page. */
:root { --panel: clamp(400px, 40vw, 620px); }
.panel.open { overflow: hidden; overscroll-behavior: none; }
.panel.open body { overflow: hidden; height: 100%; overscroll-behavior: none; background-color: #fff !important; }
.panel.open #stage { visibility: visible; }
.panel.open #exhibit {
	position: fixed; z-index: 20; left: var(--index); top: 0; bottom: 0; width: var(--panel);
	margin-left: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
	background-color: var(--tone, #fff);
	animation: panel-in .22s ease-out;
}
@keyframes panel-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.panel.open #exhibit .container { padding: 27px; }
.panel.open #exhibit .inner { display: block; }
.panel.open #exhibit .text, .panel.open #exhibit .text.fits { width: auto; margin: 0 0 1.5em 0; position: static; }
.panel.open #exhibit .text p, .panel.open #exhibit figcaption { max-width: 440px; }
.panel.open #exhibit .thumbs img { height: 150px; }
.panel.open #exhibit .close { position: sticky; float: right; top: 14px; right: auto; margin: -13px -13px 10px 14px; }
@media (prefers-reduced-motion: reduce) { .panel.open #exhibit { animation: none; } }

/* ---------- small screens ---------- */

@media only screen and (max-width: 780px) {
	#menubar {
		display: block;
		position: fixed;
		top: 0; left: 0;
		z-index: 40;
		padding: 12px 18px;
	}
	#menubar a { background: #fff; padding: 2px 4px 2px 0; text-decoration: underline; }
	#index {
		display: none;
		width: auto; right: 0;
		padding-top: 28px;
		z-index: 35;
	}
	.menu-open #index { display: block; }
	.container { padding: 18px 18px 25px 18px; }
	#exhibit { margin-left: 0; padding-top: 28px; }
	#exhibit .inner { display: block; }
	#exhibit .text, #exhibit .text.fits { width: auto; margin: 0 0 1.5em 0; position: static; }
	#exhibit .text p, #exhibit figcaption { max-width: 100%; }
	#exhibit .thumbs img { height: 150px; }
	.spatial #stage { left: 0; }
	.in-world #index::after { display: none; }
	#mist { left: 0; width: 100%; }
	.spatial #exhibit .close { position: static; float: right; margin: 0 0 10px 18px; width: 23px; height: 23px; background-size: 11px 11px; }
	/* without JavaScript the word Menu cannot open anything, so the menu simply stands above the exhibit */
	.no-js #menubar { display: none; }
	.no-js #index { display: block; position: static; padding-top: 0; }
	.no-js #exhibit { padding-top: 0; }
}

@media print {
	#index, #stage, #menubar, #tag { display: none !important; }
	#exhibit { margin: 0 !important; display: block !important; }
}
