/* `EXCLUSIONS by window size 

Window size breakpoints: <500, 500-800, 800-1200, >1200

I use three classes to control which elements display in different window sizes.  The most common usage pattern is to declare that a larger element will small windows "never" ("swnj"), but then also define another element to replace it on small windows only ("swoj").  

													dev only
sizes			swoj	swnj	xlwoj xlwnj	mwoj	lwoj
-500			✓		×		×		 ✓			×			×
500-800		×		✓		×		 ✓			✓			×
800-1200	×		✓		×		 ✓			×			✓
1200+		×		✓		✓		 ×			×			×

swoj = small window only (formerly win_s_only)
swnj = small window never (formerly no_small_window)

xlwoj = extra large windows only (formerly big_window_only and win_xl_only)
swnj = small window never (formerly no_small_window)

Some dev-only ones…
mwoj = medium window only, dev only, never used in practice
lowj = large window only, dev only, never used in practice
 	(the j is a convention I use sometimes to distinguish short strings from other word fragments)

CHANGELOG

2021-03-05 — uc3, css3, ecom2, pagespeed1, major stylesheet de-crufting, published in several stages Mar 1–5 2020
	* Simplified responsive CSS, "one size fits all (but fits mobile best)".
	* Way fewer @media declaration. One body width (86vw) to rule them all, limited by a max-width (800). That necessitated careful checking of margin-busters, most of which had to be reeled in: sidebar, sidebar-box, and pull quotes. Also made those all one-size-fits-all while I was at it.
	* First uses of clamp() for bracketing, but minimally. I don’t trust it yet.
	* One font-size/line-height: 21/1.5.  I’d really like to use clamp() here, but not yet.
	* Greatly simplified footnote list: sacrificed the lovely custom list counters, made it responsive in just one way, a switch from list-style-position from inside to outside at 700px. Finally, minor savings of characters: replaced "media screen and" with just "media".
	* Link styles polish, especially simpler new styling of all anchor links (now using a[href^='#'] to select toc, and backrefs); simpler backrefs.
	* Killed or moved many classes:
		* char_bullet_compact, char_checkmark, char_bullet_fat
		* .inline-list (moved to custom css for the 2 articles using the class)
		* .audio_downloads and bookmarking styles (.sec_bookmark_icon etc, moved to custom css for logged in users)
		* deleted quite a bit of unnecessary .zoomer stuff
		* show more/less sections now only in books.php
		* eliminate 'pupb nostyle' (the only use of nostyle, to negate one property of pupb when pupb isn't even needed there in the first place)
	* A bunch more minor stuff:
		* Simplification of asides.
		* Greatly simplified styling of abstracts, removed ALL related classes.
		* Eliminated lighter text colour of li, blockquote.
		* Fix for minor IE 11 hack for 'main' element.
		* Moderately simplified badge classes.
		* Fine-tuned heading sizes, dropped tweaks for desktop.
		* Removed unnecessary nostyle class from ccs-badge and stylesheet
		* Shortened a bunch of widely used classnames: popup_c>pupw, pupb_c>pupb, yt_embed_width_limiter>ytebox, yt_embed>ytemb, link_info_button>linksbutn, curncySelecBox>csbox.
		* Eliminated some minor duplicated styles
2021-02-26 — Aggressive simplification of masthead and nav.  Site now has only a logo that links to the home page on most pages.  The home page has a tagline and menu.


*/

html {scroll-behavior: smooth}

@media (max-width: 500px) { /* in windows up to 500px wide... */
	.swnj {display:none} /* small-window-never will not display */
	}

@media (max-width: 1200px) { /* in windows up to 1200px wide... */
	.xlwoj {display:none} /* XL-windows-only will not display */
	}

@media (min-width: 1200px) { /* in windows up to 1200px wide... */
	.xlwnj {display:none} /* XL-windows-only will not display */
	}

@media (min-width: 500px) { /* in windows at least 500px wide... */
	.swoj {display:none} /* small-window-only gets display turned off */
	}



/* ======= ↓ MAIN STYLESHEET ↓ ======= */

/* This is the main CSS stylesheet for PainScience.com.  css-critical.css is inlined in <head>, while the main styles are linked with preload and applied onload (see my inclood function for more detail on this method).

Misc notes and reference material:

Key terms are prefixed with a ` (tick) symbol to make them easy to find. Although most important elements are mentioned in several places, there is usually a main location in the stylesheet where most of the declarations about it are made, and you can find that quickly by searching for, say, ` + navlinks or popup.

The 'cs' prefix for class and ID names is basically saying that it’s a stylesheet thing.  This facilitates global find-change, and discriminates the label from identical terms that may appear frequently in other contexts. For instance, searching for “notes” across the whole site gets 385 hits; search for “csfns” gets only the 131 that I need. If I ever need to change class name, it is a WAY easier to do so if it has a distinctive prefix.  (The main reason it isn’t used more widely is just that’s a shitload of work to change all the legacy labels.)

main fonts and most likely fallback:
	font_body			Palatino, Constantia (currently doing #sans_vs_serif experiment; if sans wins, I’ll thinking harder about that stack)
	font_accent		Gill Sans
	font_heads		AvenirNextCondensed-Bold
	font_narrow		AvenirNextCondensed, HelveticaNeue

standard colours…
	main blue			369		
	bright blue		69C		
	gray blue			79B		
	neon blue			27D		
	link blue			47A
	alt blue				1F6494 just a blue I like, a bit greyer than the main blue

	soft red				C66
	bright red			C01

	light sage			81AD81
	dark sage			4B7B49
	rich green			1F6494

	dark gray			666
	light gray			999
	faint gray			CCC	
	*/


body, .font_body, .pupw /* popup gets declared here because otherwise popups inherit whatever font their parent has, which is often wrong */
/* {font-family: "Avenir Next", Helvetica, Candara, Trebuchet, sans !important} /* #sans_vs_serif */
{font-family: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Constantia, Georgia, serif !important}

/* `ACCENT — A few select page elements are set in Gill Sans (first choice), a "pretty" and fairly websafe font, a decent replacement for Prenton, which I used via for many years via Typekit. Gill Sans is on all iThings and ~97% of desktop systems. */
.font_accent, .capt, .sidebar, .preamble, .short
{font-family: GillSans, "Gill Sans", "Gill Sans MT", Calibri, HelveticaNeue, sans-serif-condensed, Arial, sans-serif !important;
font-style: italic}

/* stronger accent font */
.font_accent strong, .pq {font-family: GillSans-SemiBoldItalic, "Gill Sans", "Gill Sans MT", Calibri, HelveticaNeue, Arial, sans-serif !important;
font-weight: 600} /* rather than actually emboldening the text, which defaults to Gill Sans BOLD, which is a bit excessive when contrasted Light Italic , just use the lighter weight font GillSans-Italic; */

h1, #subtitle, h2, .font_heads, h3, h4, .sidebar .runin, button {
	font-family: AvenirNextCondensed-Bold, "Arial Narrow", "DejaVu Sans Condensed", "Helvetica Narrow", HelveticaNeue-Thin, sans-serif-condensed, /* this appears to be the only way to specify the thin version of Roboto on Android */ Calibri, "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif;
	font-weight: bold; /* AvenirNextCondensed-Bold will mostly be unaffected by the “bold” declaration, except that child <em> will inherit it bold too; if “normal” is declared here, that’s fine in general, but for <em> you get a true normal font-weight because reasons. So declaring bold is an otherwise harmless fix for that Avenir edge case. Arial Narrow behaves more predictably: normal is always normal, bold is always bold. */
	font-stretch: condensed;
	}

.font_metadata {font-family: GillSans, "Gill Sans", "Gill Sans MT", Calibri, HelveticaNeue, sans-serif-condensed, Arial, sans-serif;}

.font_narrow, .nav, #toc ul, label, table, .sidebar-box, .img_byline {
font-family: AvenirNextCondensed-Medium, HelveticaNeue, sans-serif-condensed, Tahoma, Arial, sans-serif;
font-weight: normal;
font-stretch: condensed}

.pupb, a[id^="frj"], .badge { /* An edge case of a font-stack for popup buttons, footnote references, and badges. I wish I could use the narrow font stack for all of these, but the top font in that stack, Avenir, has some vertical positioning weirdness that doesn't play nicely with text-borders */
font-family: Tahoma, Verdana, "DejaVu Sans", sans; 
}

/* elements with smaller/smallest font-sizes and corresponding tighter line-height; “important” because they are often used to over-ride other styles */
.smaller, .preamble, .capt, aside, .abstract {
font-size:.9em !important;
line-height:1.3 !important;}

.smallest, .attr, #csfns>li, #csfns>div>li {
font-size:.8em !important;
line-height:1.2 !important;}


/* <##>== ↓ DOC `STRUCTURE, MAJOR PAGE ELEMENTS  ↓ == */

body {
margin: 0 auto;
width: 86vw;
max-width: 800px;
font-size:20px;
line-height:1.3
}

@media (min-width: 500px) {
body {font-size: 21px; line-height:1.4}
}

main {
display: block; /* declaring block is for fucking IE 11, still ~300/week in early 2021 */ 
margin: 8vh 0 12vh 0;
}

#endmark {margin: 10vh 0 20vh 0}

footer {
border-top: 4px #CCC solid;
padding-top:2em;
text-align: center;
color: #666;
font-size: .9em;
}




/* <##>== ↓ `NAVIGATION and `LINKS ↓ == */

/*	a:link — a normal, unvisited link
	a:visited — a link the user has visited
	a:hover — a link when the user mouses over it
	a:active — a link the moment it is clicked */

/* link defaults: */
a:link {text-decoration: none} /* nuke underlining in general + navlinks  */
nav a, .backref {text-decoration: none !important} /* nuke underlining for some links (importantly, to pre-empt the restoration of underling for hover and focus comin up soon) */
a {color: #47A} /* primary link color, persistent in visited navlinks and some other special links */
a:visited {color: #55A} /* visited color, purple */
a:hover, a:focus {color: #27D; text-decoration: underline} /* restore underlining back on for hover/focus (hover for mousers, focus for keyboarders) */
a:active {color: #69C} /* bright blue */
#metadata a {color: #999} /* understated links in gray text */
a.disabled {pointer-events: none; color:#999 !important}


/* nav link exceptions, special underlining: */
.nav a {text-decoration: none}
.nav a:visited, #footer a:visited {color: #47A} /* primary link color is persistent in visited navlinks and some other special links */
.nav a:hover {border-bottom: 2px solid #79B} /* nicer underlining of navlinks */
.nav a:visited {color: #47A} /* primary link color, persistent in visited navlinks and some other special links */
.nav .key {pointer-events: none; cursor: default; color: #8895A2 !important} /* color is important because it must override more specific declarations */

/* nav link layout: */
.nav {list-style-type: none; padding: 0}
.nav li {display: inline; padding: 0}
.nav li+li  {margin-left:2vw} /* This is an elegant solution to an annoying puzzle, by declaring a left margin on all li items that follow li items in the list… which doesn't apply to the first item. So centred nav lists don't get shoved around by a margin on either the first or last item, and even in non-centred nav lists, there's no extraneous right-margin dangling off the end of the list (usually not a problem, but sometimes). */

/* Links to document anchors are shades of green: */
a[href^='#'] {color:#81AD81} /* sage green */
a[href^='#']:hover {color:#009051 !important} /* richer green */
a[href^='#']:active {color:#00F900} /* neon green */
a[href^='#']:visited {color:#9EB89A} /* muted grey green */
.backref {float:right; margin: 0 -4vw .5em .5em}  /* backref anchors are inserted into footnotes by footnotes.js */

.camo:link, .camo:visited {color: inherit; text-decoration: underline} /* camoflaged link, same colour as parent text, highlighted with underline instead */

.authanc:link, .authanc:visited {color: #036} /* "authority anchor," a link that's there just for the association with an authoritative source, not really a link I actually want visitors to click; so, understated links in body text, still clearly visible, but less bright than the default link colour */


/* <##>== ↓ `FRONTMATTER, `TITLES, `HEADINGS, `SECTIONS ↓ == */

h1, #subtitle, h2, h3, h4, .part-subhead {color: #336699; line-height: 1.2}

#title, #subtitle {margin: .3em 0}

h1#title {font-size: 1.5em; font-weight: 700;}

#subtitle {font-size: 1.1em; color: #79B} /* AvenirNextCondensed-Bold will mostly be unaffected by the “bold” declaration, except that child <em> will inherit it bold too; if “normal” is declared here, that’s fine in general, but for <em> you get a true normal font-weight because reasons. So declaring bold is an otherwise harmless fix for that Avenir edge case. Arial Narrow behaves more predictably: normal is always normal, bold is always bold. */

#metadata {color: #888}

.first {margin-top:5vh} /* the first element of content, manually set for each page as needed */

.chapter {margin-top: 10vh}

h2, .chapter h3 { /* H2s and H3s are identical in un/structured pages */
margin: 7vh auto 3vh auto;
font-size: 1.2em;
color: #369; /* color must be stated explicitly here, or it will be over-ridden by the regular H3 colour set below) */} 

section { /* any part or chapter in a structured doc */
clear:both;
padding-top: .1em; /* this padding forces the div to encompass the margin on the heading, which it contains, so part link to the section anchor leave some space above the heading; it only needs to be a sliver */}

/* H3s and H4s are identical in unstructured pages (both subheads), but different in structured pages (chapter head and subhead); the more specific declaration of .chapter h3 will override these styles in a structured doc; */
												
h3, h4 {	color: #79B; font-size: 1.1em; margin: 5vh auto 1em auto}

.part {margin-top: 15vh}

.part header {text-align: center}

.part header h2 { /* some things about H2 are different in the context of the part-head */
margin: 8vh auto 1em auto;
letter-spacing: -.5px;
text-transform: uppercase}

.part header h2~p { /* part subheadings <p> preceded by h2 contained in a .part */
margin: 1em auto 4vh auto;
font-size: 1.1em;
color: #79B}

h3.q {font-size: 1.1em; margin-bottom: -0.4em} /* headings that are "questions" in Q&A, critical above the fold only a couple places */


.secnav {
text-align:right;
color:#999;
font-size:11px;
}




/* <##> Some adjustments for larger-than-common-mobile windows: */

@media (min-width: 500px) {
	div.sidecap img {float: left; margin: 0 1.5em 1em 0}
	.imgbox.sidecap {text-align: left}
	h1#title {font-size: 1.8em}
	#subtitle {font-size: 1.3em} 
	h2, .chapter h3 {font-size: 1.4em}
	h3, h4 {	font-size: 1.3em} 
	}

/* I could bump all the heading sizes up again for even bigger windows, but I'd really rather use clam() for everything, but the browser support still not there, and in the spirit of one-size-fits-all-but-fits-mobile-best... it's "fine" without bumping everything up for h1#title
@media (min-width: 800px) { 
 {font-size: 1.8em}
	#subtitle {font-size: 1.5em} 
	h2, .chapter h3 {font-size: 1.4em}
	h3, h4 {	font-size: 1.3em} 
	} */


/* <##>== `CONTENT: `BLOCKQUOTES, `QUOTATIONS, `LISTS (there's a bunch of other block level content, of course, just not above the fold) */

blockquote.short {margin: 2em 10% 2em 8%; font-size: 1.4em; color:#059}

.short .attr {margin: -.8em 10% 0 30%}

.attr {
margin: -.8em 10% 0 30%;
text-indent: -0.2em;
color: #999;
}

.attr::before {content: '~ ';color: #79b}



@media (max-width: 500px) { /* rare use of max-width here: these styles are declared only for windows under 500 so that default styles will still apply in larger windows */
ul, ol {margin: 1em 1em 1em 0; padding: 0 0 0 .5em}
}

li {margin: 0.4em 0; padding-left: 0; font-size:.95em; line-height: 1.3}






/* `PULL QUOTES, `PQs */

/* pq = pull quote */
.pq { display: none } /* no pull quotes by default, because there's no way to do pull quotes right on the smallest screens; minimum window is the bigger smartphones... */

@media (min-width: 390px) {
	.pq { /* pq = pull quote */
	display:block; /* necesssary because many pull quotes are still spans */
	float:right;
	font-style:italic;
	line-height: 1.4;
	color: #609C60;
	width: 50%;
	font-size: clamp(1.2em, 3vw, 1.8em);
	margin: 1.4em -4vw 1em 1.2em; /* slight margin-busting */
	}
	.pq strong, .pq em {color: #4B7B49}
}



/* <##>== ↓ `IMAGES `IMGS ↓ ==  Markup for images and captions generated by php function img(), from the file img.php. It's old and janky but still churns out viable markup after a decade. The styles here assume a generous window size, and then some adjutsing declarations are made for images/layouts that are too large for their window (mostly removing floats and sidecaps where there's no room for them, or scaling images down if they are too big for their window. */

.imgbox {text-align: center; margin: 1.4em auto; position:relative; clear: both} 

.imgbox.right.w100 {float: right; margin: 0 -2vw 2vh 4%} /* the teensiest imgbox can float to the right by default, in any window; larger images will be floated in windows big enough for them; the rules are more restrictive for titleimages (which have less room to work with) */

@media (min-width: 398px) {.right.w160 {float: right; margin: 0 -3vw 2vh 4%}}
@media (min-width: 500px) {.right.w200 {float: right; margin: 0 -4vw 2vh 4%}}
@media (min-width: 700px) {.right.w300 {float: right; margin: 0 -4vw 2vh 4%}}
@media (min-width: 900px) {.right.w400 {float: right; margin: 0 -4vw 2vh 4%}}
/* doc width max 800, so 400 wide images are the largest floatable imgbox */

.pupw .right, .meta .right {margin-right:0} /* don't bust out of bordered boxes like popup windows and meta */

.imgbox.center {margin: 3em auto}

img {border: 0; vertical-align: 0; max-width: 100%; height: auto;}

.capt {color:#666; margin: .5em auto}

.caphead {padding: 0; /* ←? */ color:#79B}

.img_byline {line-height:1.2; opacity: .6; margin-top:0; font-size: 12px} /* a unique typesetting challenge here, must be as small as possible but still legible; not a modification of .capt */

/* Styles for captions under large centered images, a little more room underneath, slightly larger for roomier caption format */
.imgbox.center .capt.below {margin: 1em 10% 0 10%; width:auto}

/* see below for special cases in windows at least 500px wide. */

/* 2021-03-05 The zoomer stuff was in a state of half-implemented mess.  I had removed buttons from most pages last fall, but not the styles, because they were still needed for cart pages.  This time I removed the "fancy" zoomer styles, and went back to the ancient plus-sign-in-a-popup-button styles. The fancier zoomer styles still exist in one place: the store page. */

.zoomer {position: absolute; left:-15px;} 
.zoomer:link {color:grey; text-decoration:none; cursor: zoom-in}

@media (max-width: 500px) { /* Some hacky limits for zoomed images in small windows; the right way to do this would be to modify the script so that it calculates size/position correctly for small windows, which it clearly wasn't built for.  But that's hard. So this. */
#ZoomBox {
	max-width:96% !important;
	left:2% !important;
	}
img#ZoomImage {
	max-width: 85% !important;
	height: auto !important;
	padding: 6% !important
	}
}






/* <##>== ↓ `NOTES (footnote list, not popups) ↓ == */

#csfns {padding:0; list-style-position:inside} /* Footnote list is info dense and does not need visual separation from body content, and so I want it to use the whole width of the body. */

#csfns>li, #csfns>div>li { /* this selects all footnote li elements that are direct children of the footnote list (#csfns); '#csfns li' would style lists inside of footnotes as well */
margin: 2em 0 /* much more top/bottom margin than default list items */
}

#csfns>li::marker, #csfns>div>li::marker {color:#369} /* colour the marker in supported browsers */

#csfns ul, #csfns ol {list-style-position:outside} /* Nested lists should still have 'outside' markers. */

@media (min-width: 700px) { /* at 700 wide, move list markers out into the margin */
ol#csfns {list-style-position:outside}}

#csfns>li blockquote, #csfns>div>li blockquote {margin: 1em}

.sidebar ul, .sidebar ol {padding-left:1em}




/* <##>== ↓ `POPUPS ↓ == */

/* Popup buttons (.pupb) and footnote references (.frj) are very similar properties, so I define them together here, starting with a few cosmetic refinements that weren't made in css-critical. */ 

.pupb, a[id^="frj"], .zoomer {
/* uses the Tahoma etc font-stack */
z-index: 10;
margin: 0 0 0 2px;
padding: 0 2px;
border: 1px solid #AAA;
vertical-align:.1em;
font-size: .85em;
line-height:1;
font-style:normal;
cursor: help;
color: #47A;
background-color: white;
border-radius: 3px;
white-space: break-spaces;
}

a[id^="frj"] {font-weight: bold}
/* a.noteworthy {font-weight: bold;} 2021-02-26 experiment, now making ALL footnotes bold, only distinction between noteworthy and boring is colour */
a.boring {color: #999}

/* Some declarations about foonote references in different states are !important because they have to override default declarations made explicitly for first five note reference IDs in css-critical. */

.pupb:hover, .frj:hover {
border-color: #69C !important;
color: #69C !important;
text-decoration:none;
}

.pupb:active, .frj:active {
color: #336699 !important;
border-color: #336699 !important;
background-color: #FFFF66 !important;
}

.img-box .pupb {z-index: 1; /* this fixes a rare edge case: when a popup overlaps a zoom button, the zoom button is on the same level as the popups close button, because they are styled the same way; the only fix I can think of is to push zoom buttons right down to the bottom of the stack to live below popups */}

.pupx { /* “pupx” = popup close button */
display: inline-block;
cursor:pointer;
position: absolute;
z-index: 30;
/* button size is a function of the size of the center × symbol, which is defined by the height and width, plus the border thickness: 14px + 8px = 22px diameter; that is then subtly increased on hover */
height: 14px; width: 14px; /* determines the size of the center × */
top: -24px; /* determines the vertical offset, which should be 2x button size -4px */
left: 0; right: 0; /* required for centering an absolutely positioned block */
margin: 0 auto; padding: 0;
border: 8px solid #79b; /* border radius functions like "padding" around the × */
border-radius: 100%; /* makes the button completely round */
background: linear-gradient(-45deg, transparent 0%, transparent 43%, white 43%,  white 57%, transparent 57%, transparent 100%), linear-gradient(45deg, transparent 0%, transparent 43%, white 43%,  white 57%,transparent 57%, transparent 100%);
background-color: #69c;
transition: width .3s, height .3s, margin-left .3s, top .3s, bottom .3s;
box-shadow: 0 0 0 3px rgba(256,256,256,1);
}

.pupx:hover {
height: 18px; width: 18px; /* a subtle increase in the size of the × */
top: -26px; /* change the offset by half the size increase: (18px -14p = a 4px size increase, so divide that in half to 2px, and then change the top value by 2px so that the vertical offset "follows" in the increase in size, allowing it to "grow from the centre" */
border-color: #27d;
background-color: #27d;
}

.pupx:active {border-color: #008000}

.pupw { /* `popup defaults for medium (non .large, non .small). This is one of the trickiest elements in the stylesheet. Many of these declarations seem redundant, but they have to be restated for the popup, or the popup will inherit values from whatever context the popup is in.  I will declare dimensions AFTER these*/
position: absolute;
display:none;
z-index: 120;
left:0; right: 0; /* required for centering an absolutely positioned div */
/* width, padding, font size and line height declared below for readability of variations for pupw size */
margin: 1.5em auto;
padding: 1em;
background-color: #FFFFFF;
border-radius: 2vw; /* scale roundness of corners with screen width */
text-align: left;
font-weight: normal;
font-size: 19px; /* manually set somewhat lower than body font size */
line-height:1.3;
font-style: normal;
color: #666;
box-shadow: 0 0 60px 65px rgba(200, 200, 200, 0.95);
text-indent: 0; /* resets indentation when popups inherit it from sidebars */
white-space: normal;
}

.sidebar .pupw em:not(.runin) {text-decoration: none}

/*
Calculating max-widths for the popups:
small		max-width = 800−((1-.60)×800)−(.10×800) 
med		max-width = 800−((1-.72)×800)−(.08×800)
large 	med-width = 800−(.06×800)

/* using % for the padding here is clevar, because it effectively ties it to the max-width of the div, because it's a % of the div width */
*/

.pupw.small {
width: 60vw; max-width:400px; padding: 2em 5%; font-size: 1em} 

.pupw {
width: 72vw; max-width:512px; padding: 2em 4%}

.pupw.large {
width: 88vw; max-width:752px; padding: 2em 3%; font-size: .85em}

/* For popups that contain other block elements (p, ul, blockquote, etc), eliminate their standard top and bottom margins when they are the first or "last" (technically 2nd to last, because the pupx button is always the last child, but we also do :last-child to capture the final items in nested blocks like the last item in a list or the last para in a blockquote). 
disabled 2021-05-21 because I found an example of breakage that I could not work around, see §massage#j2 (attribution of quote overlapping quote)
*/
/* .pupw p:first-child {margin-top: 0; color:green} 
.pupw p:last-child {margin-bottom: 0; color:red}
.pupw p:nth-last-child(2) {margin-bottom: 0; color:orange} */

.pupw h3 {margin-top:1.5em; font-size:1.1em}
.pupw h3:first-of-type {margin-top:.5em}



/* <##>== ↓ `TOCs, TABLES OF CONTENTS ↓ == */

#toc {padding:2vw}

#toc ul {margin:0; padding-left:0}

#toc ul > li > ul {padding-left:1.5vw; margin-top: 1em}

/* l1 headings */
#toc ul > li {font-weight:bold; font-size: 1.1em; list-style:none; margin-top:2em; /*color:blue */} 

/* l2 headings (must over-ride l1 styles) */
#toc ul > li > ul > li {font-weight: normal; font-size: .95em; margin-top: 0; margin-bottom:.7em; line-height:1.1;
color:#666;
}






.badge {
/* uses the Tahoma etc font-stack */
color: white;
background-color: #bbb;
padding: .15em .4em;
border-radius: 3px
}

.badge.light {
background-color: #d4d4d4;
font-size: .9em;
font-weight: normal;
padding: 1px 3px
}

.badge.blue, h2 .badge, h3 .badge  {background-color: #79B}

blockquote blockquote {margin: 1em 2em; font-size: .9em}

blockquote.featured {margin: 2.2em 1.6em; line-height: 1.6; font-size: 1.2em; color:#059} /* used only in blog for years, a useful class I simply neglected, a compromise between a plain blockquote and the much more decorative “short” class */

.runin {font-style: normal; font-weight: bold; color: #333}

div.runinheadings .runin {font-size: 1.1em; color: #369}





/* <##>== ↓ THE `ASIDES: `META, `SIDEBARs, `SIDEBAR-BOX `WIDEBARs  ↓ == */

/* The .meta and .widebar classes have different purposes, but look very similar (both full-column-width divs):

	• .meta: information about the document or website, rather than the topic, very bold

	• .widebar: intended for relevant digressions, visually similar to meta but much less prominent (widebar.intersection gives a generous top margin so it is set aside between sections more prominently)  */

aside { /* all meta and widebar and sidebar blocks are modified <aside> elements and are similar enough to have some basics in common, differing mainly in their borders and large-window adjustments;  */
clear: both;
z-index: 10;
margin: 6vh 0;
padding: 1em;
border: 3px solid #79B;
}

/* meta is a roundrect */
.meta {border-radius: 10px}

/* widebars have italicized contents to set them apart, and only top/bottom borders */
.widebar, .sidebar {border-width: 2px 0; color: #444}

.widebar {background: linear-gradient(white, #E6F5FF)}

.intersection {margin: 12vh auto} /* a minor modifier for meta and widebar and short quotes, giving more generous margins to disassociate them from content in the sections before and after */

.sidebar-box {
display: inline-block;
float: right;
width: initial; max-width: 35%; /* we want unspecified width, so under the max-width the box sidebar will shrink to fit a short statement */
margin: 1em -4vw 1em 1em; padding: 1.5vw;
font-size:.8em !important;
text-align: center;
border: 1px solid #ccc;
border-radius: 1.5vw;
}
	
.sidebar .runin { /* sidebar headings are styled to look pretty much just like h3s */
color: #369;
}

.widebar .sidebar {padding: .5em 0 .8em .5em} /* the white background of the sidebar becomes visible against the unusual blue background of the widebar, making the text appear to be far too close to the edge; this fixes by adding just a little padding  */

@media (min-width: 500px) {
	.sidebar { /* in medium windows and larger, sidebar layout diverges from widebar, floating to the right in a flexible width container up to 40%, and losing the bottom border  */
	background-color: white; /* ditch the background color for floated sidebars */
	float: right;
	width: initial; max-width: 40%; /* we want unspecified width, so under the max-width the box sidebar will shrink to fit a short statement */
	margin: 1em -5vw 2vh 4vw; /* very different margins! */
	padding: 0.5em 0 0 .2em; 
	border-width: 3px 0 0 0; /* get rid of the bottom border set for default wide/sidebars */
	}
	}


/* Eliminate top/bottom margin from first/last block elements in meta and widebars (and nested up to 3 levels deep)  */

aside > :first-child {margin: 0}

aside :last-child, aside :last-child :last-child, aside :last-child :last-child :last-child {margin-bottom: 0}

aside h2, aside h3, aside h4 {margin: 0 0 1em 0; font-size: 1.1em} /* H2/3/4 in an aside will have bad margins, unsuitable for this context */



/* <##>== ↓ `FORMS n `BUTTONS ↓ == Some forms are used prominently above the fold, e.g. the home page subscribe CTA, the blog subscribe CTA, login. Buttons are also part of .font_heads. */

/* all inputs and buttons inherit document defaults; this can ONLY be declared in the critical styles, before the font-family declaration for buttons in the main stylesheet, NOT AFTER 
input, button {font-family: inherit; font-size: 100%} */

.form-box { /* a gray box that contains some forms, e.g. the login form and most subscribe/join CTAs; mostly aesthetic but may also contain Alpine stuff */
margin: 2% auto;
padding: 3%;
border-radius: 8px;
text-align:center;
background: #f2f2f2;
}

#login {position:fixed !important; top:15%;} /* this keeps the login window in the viewport, which is mostly useful for preventing a disorienting UX if it’s off the screen when login is successful */

input[type=email], input[type=text] { /* defaults for email/text inputs, used in .subscribe and .login forms */
width:100%;
color:#27D;
margin-bottom:1%;
padding: .4em .8em .3em .8em;
border: 1px solid #ced3d9;
border-radius: 6px;
box-sizing: border-box;
text-align:center;
}

button { /* default <button>: bright blue #27D round rects, with a bold white label that turns yellow on hover; the width is undefined */
border:0;
outline:0;
border-radius: 8px;
padding: .5em .8em .3em .8em;
color:white;
background-color: #27D;
cursor:pointer;
margin:2px;
}

button:hover {color:yellow}

button:active {color:white; background-color: #69C}

.subscribe button {background-color: #69C} /* a greyer blue for subscribe buttons */

.subscribe button, .form-box button { width:100%; } /* subscribe buttons are full-width on mobile … */

@media (min-width: 500px)  {.form-box {width:70%}} /* but constrain the form-box in larger windows */

.subscribe.teensy {display:inline-block; font-size:.8em;}
.subscribe.teensy input[type=email] {width:160px;  padding:.2em; border-radius:4px; border-color: #79B}
.subscribe.teensy button {width:90px; margin: 0 0 0 .2em;  padding: .2em; border-radius:4px; background-color: #79B}

.subscribe.compact input[type=email] {width:65%; max-width:360px; font-size:.9em; border-color: #69c}
.subscribe.compact button {width:32%; max-width:120px; margin: 0 0 0 .2em; border-radius:6px; font-size:.9em}
.subscribe.compact p {margin:0.2em 0 0 0.2em; color:#999}






/* <##>== ↓ `TABLES ↓ == */

table, table.small, table.medium, table.large {
width: 100%;
margin: 2em auto; padding: 0;
color: #666;
border-spacing: .5vw 1vw;
}

table.small {font-size: .8em; line-height: 1.3}
table.medium {font-size: 12px; line-height: 1.2}
table.large {font-size: 11px; line-height: 1.2}

th {white-space: nowrap}

th, td {text-align: left; vertical-align: top;}

.right-justified-headings th {text-align:right;padding-right:.5em}
.small-headings th {font-weight:normal; color:#BBB; }

@media (min-width: 500px) {
table.small {		width: 80%; font-size: .9em}
table.medium { width: 90%; font-size: .8em}
table.large {		width: 100%; font-size: .8em}}

@media (min-width: 800px) {
table.small {		width: 70%; font-size: .9em}
table.medium { width: 85%; font-size: .8em}
table.large {		width: 100%; font-size: .8em}}

table caption {
font-style: italic;
text-align: left;
border-bottom: 2px solid #CCC;
}


/* <##>== ↓ `MISC ↓ == */

.inlineabc {color:#777}

.color_gray_blue {color:#79B}
.color_soft_red {color:#C66}
.expression {color: #5C7890}
.warning {color: #C01 !important}


abbr {border-bottom: none; color: #666}

/* generic class for any modest size block/img that is floated to the right with a bit of margin to the left and below */
.floater {float:right;margin: 0 0 2vw 2vw}

/* YouTube embeds */
.ytebox {margin: 3em auto; text-align:center} /* trick for responsive YT video embedding; https://webdesignerwall.com/tutorials/css-elastic-videos  */

div.ytemb {
position: relative;
padding-bottom: 56.25%; /* a mystery; something to do with the proportions of videos? */
padding-top: 30px; height: 0
}

.ytemb iframe, .ytemb object, .ytemb embed {
position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

@media (min-width: 800px) {.ytebox {width: 600px; max-width: 100%;}}

.highlight, .hl {padding: 3px; background-color: #FFFFE2}

em.highlight, em.hl {font-style: normal}

.testimonial em.highlight, .testimonial em.hl {font-style: inherit} /* this is a bit hacky, to override unwanted font-style normalization in testimonials */

.separator {
text-align: center;
color: #79B;
margin: 2.5em auto
}

.separator.bullet:after {content: "•"} /* A bullet is added by the stylesheet only when the bullet class is specified.  This makes it possible to have a standard bullet separator, or to apply the separator styles to some other character(s) in special cases. */

sup {vertical-align: .2em}
sub {vertical-align: -.1em; font-size:.7em}

.fine_print {color: #AAA; font-size:.9em}

label {color: gray}

.qa li {line-height: 1.4;margin: .8em auto}
.qa em.runin { color: #369 }

.isolated { /* for blocks that are “isolated” by generous top and bottom margins */
margin-top: 5em;
margin-bottom: 4em;
}

.upd_item {
font-size: .9em;
color: #333;
margin-left: 1em;
text-indent: -1em}

.css_caption { /* a generic caption for a biggish centred image (so far used only with youtube embeds)  */
/* set in prenton */
margin: 1em auto;
font-style: italic;
font-size: .9em;
color: #666
}

hr {width: 60%}

.clear {clear: both}

.pupw iframe{display: none} /* hide youtube embeds inside of popups */

.featured_link {font-size:1.2em;}

.inline-meta {color: #79B; font-size: .8em; vertical-align: 0.1em}

/* linking info button and popup */

#linksbutn {
display:inline;
position:absolute;
right:1vw;
border:0;
padding:0;
margin-top:.2em;
opacity:.3;
}

.link_info_urls {
font-size:.85em;
color:#4B7B49;
margin-left:0;
}

#link_info_popup {position: absolute}

@media (min-width: 800px) {
#linksbutn {
margin-top:.3em;
opacity:.5;
}
#linksbutn img {width:16px}
.link_info_url {font-size:1.2em;margin-left:2em}
}



#ui_msg { /* a generic UI window for short messages to the user in response to actions (such as "Copied!" after click-to-copy text); element is created onclick by Javascript copy() function */
opacity: 0;
transition: opacity .5s;
position: fixed;
top: 30%;
left: 50%; /* puts left edge of object at center*/
transform: translate(-50%, 0); /*  horizontal centering (slides object half it’s width to the left) */
color:white;
background-color:#4d83b9;
border-radius:.6em;
box-shadow: 0 0 0 20px rgba(255,255,255,1); /* much like declaring border 20px solid white, but preserves rounded corners */
font-size: 2em;
font-family: -apple-system, Helvetica, Arial, sans-serif;
font-weight: bold;
z-index:130; /* must be quite high to be float over a popup */
padding: 1em
}


/* the copythis* and ui_msg styles are duped to css-tools, so that they can be used in my dev tools even when the main stylesheet isn't present */

.copythis { /* #copy feature — The .copythis class is a span containing text that can be copied with a tap/click by invoking my copy() function, followed by telluser(Copied!) which uses showbriefly() to temporarily show a confirmation message. */
cursor: copy;
color: #4B7B49;
border-bottom: 1px dotted #81AD81
}

.copythis:after, .copythis2:after { /* copythis2 can be used alone to append the ✄ without the green and underlining of .copythis */
content: "✄";
margin-left: 8px;
opacity:.4
}

/* with an SVG
.copythis:after{
content: "";
background: url(/imgs/icon-copy.svg) no-repeat;
background-size: 18px;
height: 18px;
width: 18px;
position: absolute;
margin-left: 5px;
margin-top: .3em;
opacity:.6;
} */

.copythis:active {background-color:yellow}️

.copythis:hover { /* as always, hover is really only for those increasingly rare desktop users */
cursor:copy;
color:#81AD81;
background-color:white
}

.subtopics {margin-top:2em;margin-left:10vw;text-indent:-5vw;font-size:.9em;line-height:2.2}






/* #ECOM2018 > #CART > stylesheet */

/* Some bare minimum buy blurb styling is done inline in case of CSS preload failure, which is particularly a known issue with some versions of Firefox, even using preloadCSS.  The inline styles ensure that rendering isn't so bad it's unusable, and indeed it's almost adequate.  The stylesheet adds some flair and responsiveness, but this basic version is actually pretty serviceable compared to the original buy blurb design without a stylesheet. */


/* 2020-06-03 MANUALLY ADDED TYPEKIT'S ANCIENT CSS TO THIS STYLESHEET SO I CAN ADD 'font-display: swap' */

/*
 * The Typekit service used to deliver this font or fonts for use on websites
 * is provided by Adobe and is subject to these Terms of Use
 * http://www.adobe.com/products/eulas/tou_typekit. For font license
 * information, see the list below.
 *
 * ingra-condensed:
 *   - http://typekit.com/eulas/00000000000000003b9acd76
 *
 * © 2009-2020 Adobe Systems Incorporated. All Rights Reserved.
 */
/*{"last_published":"2017-12-11 18:36:20 UTC"}*/

@import url("https://p.typekit.net/p.css?s=1&k=ram1lku&ht=tk&f=26504&a=139500&app=typekit&e=css");

@font-face {
font-family:"ingra-condensed";
src:url("https://use.typekit.net/af/55bfdc/00000000000000003b9acd76/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n8&v=3") format("woff2"),url("https://use.typekit.net/af/55bfdc/00000000000000003b9acd76/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n8&v=3") format("woff"),url("https://use.typekit.net/af/55bfdc/00000000000000003b9acd76/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n8&v=3") format("opentype");
font-display: swap; /* THIS DECLARATION MANUALLY CHANGED FROM AUTO TO SWAP */
font-style:normal;
font-weight:800;
}

.tk-ingra-condensed { font-family: "ingra-condensed",sans-serif; }



    
div.buybutn { /* Some defaults for the legacy green buy buttons of all types (see below for button animations and behaviours). There are new buttons that have the buybutn class, but are not <div> but <button>. The buybutton class is used as a hook for checkout-cart.js. */
/* inlined defaults for div.buybutn.bb_big: font-family: sans-serif; border: 6px solid #369; border-radius: .5em; font-weight:bold; color: white; background-color: #369 */
display:inline-block;
font-family: "ingra-condensed", sans-serif !important; /* Ingra Condense is a Typekit font */
color: white;
background: linear-gradient(-5deg, #157031, #57AA4E) !important; /* green buy button; 1st color is the darker base, 2nd is brighter top;
although I don’t expect to use it again, for the historical record, the old blue button was #369, #4D83B9 */
border: 0 !important;
}

.bb_big {
width: 80vw; height: 25vw; /* most of the width of the view; can't be wider than <main>; ratio is ~ 1:3 */
max-width: 330px;
max-height: 90px;
margin: 0 auto;
border-radius: 8px !important;
font-size: 42px; /* This design is extremely sensitive to font-size, so this will have to be adjusted */
line-height: .7; /* for this big font size, the line-height has to be brought down below the height of the font */
font-weight: 900;
font-stretch: ultra-condensed;
letter-spacing: -1px;
}

@media (min-width: 345px) { .bb_big {font-size: 45px;}}
@media (min-width: 370px) { .bb_big {font-size: 48px;}}
@media (min-width: 410px) { .bb_big {font-size: 52px;}}

.bb_tiny {
width:110px;
border-radius: 4px !important;
padding: 5px 2px 3px 8px; /* right padding compensates for centering illusion: the tiny cents text makes it look left-er */
text-align: center;
font-size:22px; line-height: 1;
}

.bb_big .bb_buy {
position: absolute; top: 15px; left: 15px; /* the price is pinned to the upper right corner of the button */
}

.bb_big .bb_prc {
position: absolute; top: 15px; right: 15px; /* the price is pinned to the upper right corner of the button */
}

.bb_big .bb_code { /* only the big buttons have currency codes */
display: block;
position: absolute;
font-size: .32em;
top: 38px; right: 13px;
opacity: 0.5;
}

.bb_sym {
font-size:.6em;
line-height: 0; /* hack for FF */
vertical-align:.45em;
}

.bb_tiny .bb_sym {
font-size:.8em;
vertical-align:.2em;
}

.bb_cents {
font-size:.5em !important;
line-height: 0; /* hack for FF */
vertical-align:.7em;
opacity:.8;
}

.bb_tiny .bb_cents {
font-size:.7em !important;
vertical-align:.28em;
}

div.buybutn img { /* the hard-to-label img buy-button-ln2-(blue|green).png */
display: inline-block !important; position: absolute;
max-width: 90%; left: 5%; /* fill most of the width and center by pushing away from the left edge by half of the unused width */
bottom: 10px; /* pull it down to the bottom edge of the button */}

/* #bbln2 requires these styles for rendering .ln2 before rasterizing it, see evernote:///view/523333/s4/24143a90-82dc-4282-ab11-f09a7687256a/24143a90-82dc-4282-ab11-f09a7687256a/ .ln2 { font-size: 15px; display: inline-block; margin: 1px auto; width: 100%; text-align: center; font-stretch: ultra-condensed;} .ln2 .svg-inline--fa {margin: 0 5px 0 3px; color:white; opacity:0.5;} */

.ccs-badge {margin-top:.4em !important} /* badge needs a bit of top margin regardless of layout */

@media (min-width: 700px) { /* when there's enough horizontal room, switch to the landscape format for the buyb-box, with the book cover floated to the left of the buybutn */
	.buyb-box {width: 556px; /* max-width of cover (206) + max-width of button (330) + left margin on non-imgbox (20) */}
	.buyb-box .imgbox {float:left}
	.non-imgbox {display:inline-block; /* bundles everything other than the cover; this is now the element that wraps around the floated cover, not its contents, protecting against the bullet points wrapping under the cover */
		margin-left: 20px;}
}

@media (min-width: 1200px) { /* when there's enough horizontal room, switch to the landscape format for the buyb-box, with the book cover floated to the left of the buybutn */
	.buyb-box {width: 580px; /* minor hack: at the 1200 breakpoint, font-size goes up to 22px, which makes the text just a little too wide for the book cover to float beside it. */}
	}

.csbox label {font-size:.8em; color:#408002; }
@media (min-width: 500px) {.curncySelec {vertical-align:.3em !important;}}

.csbox .pupb {
font-size:.8em;
color:#408002;
padding: 0 2px;
}


/* button animations and behaviours */

div.buybutn { /* https://css-tricks.com/almanac/properties/a/animation/ */  
	animation-name: buttonsparkle;
	animation-duration: 5s; 
	animation-timing-function: ease-in-out;
	animation-delay: 0;
	animation-direction: alternate;
	animation-iteration-count: infinite;
	}

@keyframes buttonsparkle {
	0% {		-webkit-filter: brightness(1) saturate(1) contrast(1); }
	80% {		-webkit-filter: brightness(1.01) saturate(1.1) contrast(1.05);}
	100% {	-webkit-filter: brightness(1.04) saturate(1.4) contrast(1.2);}
}

div.buybutn:hover, div.buybutn:focus, div.buybutn:hover, div.buybutn:focus { /* apply a slight shadow on hover */
color: #FFFFB0;
animation-name: none;
-webkit-filter: brightness(1.04) saturate(1.4) contrast(1.2); 
box-shadow: 2px 2px 4px #888;
-webkit-transform: translateX(-2px);
transform: translateX(-2px);
}

div.buybutn:active, div.buybutn:active {
color:yellow;
-webkit-filter: brightness(1.04) saturate(1.4) contrast(1.2); 
box-shadow: 1px 1px 2px #666;
transform: translateX(-1px);
-webkit-transform: translateX(-1px);
}

.buyb-bullets {margin-top:.5em}

div.vendor-id-container {
padding: 0;
float: right;
background: #FFF;
font-size: .8em;
line-height: 1;
margin: 0 0 20px 20px;
color: #888;
border: 1px #bbb solid;
border-radius: 3px;
}

table.vendor-id {
margin: 3px
}

table.vendor-id th {
font-weight: normal;
color: #bbb;
text-align: right;
text-transform: lowercase;
margin-right: 2px
}


/* `PRICES */

.dollarsign, .cents {
font-weight: normal;
vertical-align: .1em;
margin-right: -1px
}

.dollars {
font-weight: bold
}

.cents, .currency {
color: inherit;
font-size: .8em
}

.cents {
vertical-align: .2em;
position: relative;
letter-spacing: -1px;
margin-right: .1em;
color: #555;
}

.large-price .dollarsign {
font-size: .8em;
vertical-align: .2em;
margin-right: -3px
}

.large-price .dollars.withcents {
letter-spacing: -3px;
margin-right: 5px
}

.large-price .cents {
font-size: .8em;
color: #888;
vertical-align: 0.2em;
text-decoration: underline
}

.currency {
font-weight: normal;
font-size: .9em;
color: #555;
margin-right: .2em
}

.pricedash {
color: #555;
margin-left: 4px;
margin-right: 2px
}


ul.checklist {list-style-type: none}
ul.checklist li {margin: 1em 0}
ul.checklist li input {
float: left;
margin-left: -2em;
margin-top: 6pt
}




/* <##>== ↓ `PAYWALL  ↓ == See also forms & buttons. */

.paywall_marker {
	background-color:#81AD81;
	color:white;
	font-size:1em;
	text-align:center;
	letter-spacing:1px;
	margin:5em -2% .2em -2%;
	border-radius: 10px;
	text-shadow:none;
}

.paywall_marker.top {
	padding: 12px 0 4px 0;
	border-radius: 10px 10px 2px 2px;
}


.paywall_marker.bottom {
	padding: 8px 0 10px 0;
	border-radius: 2px 2px 10px 10px;
	margin: 2em -2% 10em -2%;
	}

.paywall_status_message, .unlocked_post_message {
margin: .5em 5% 2em 5%;
text-align:center;
color:gray;
font-family:Helvetica;
font-size:.7em;
}

.unlocked_post_message { /* a minor variation of the above */
margin: 10% 0;
font-size:.9em;
color:#27D;
}

p.emoji_big_divider {text-align:center; font-size: 80pt; margin: 5% 0 2%}


