/*
Theme Name: Shaping Sense
Theme URI: https://senseshaper.com
Author: Zachary Fisher
Author URI: https://senseshaper.com
Description: A scholarly theme after the early printed book: vellum page, woodcut border with printer's devices, marginal glosses on both sides, manicules, citable paragraph numbers, a triangular colophon and a site-wide Works Cited. Pair with the Senseshaper Marginalia plugin.
Version: 1.2.0
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shaping-sense
Tags: blog, one-column, two-columns, right-sidebar, custom-menu, threaded-comments, translation-ready
*/

/* ------------------------------------------------------------------
   Ink, rubric, vellum
   ------------------------------------------------------------------ */
:root {
	--ink: #1C1A17;
	--ink-soft: #3A352D;
	--gloss: #3F3A32;
	--grey: #4D473E;
	--rule: #D8D0C0;
	--rubric: #8B1A10;
	--rubric-dark: #640F08;
	--paper: #F5F0E2;
	--margin: 214px;      /* text column inset; glosses live in it */
	--gloss-w: 190px;
}

html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper) var(--ss-vellum) repeat;
	color: var(--ink);
	font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
	font-size: 19px;
	line-height: 1.6;
	font-variant-ligatures: common-ligatures;
}
a { color: var(--rubric); }
a:hover { color: var(--rubric-dark); }
img { max-width: 100%; height: auto; }
.sc { font-variant: small-caps; letter-spacing: .08em; }
.rubric { color: var(--rubric); }
.screen-reader-text, .skip-link:not(:focus) {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus { position: absolute; z-index: 10; top: 8px; left: 8px; padding: 8px 14px; background: var(--paper); border: 1px solid var(--ink); }

/* ------------------------------------------------------------------
   The page: vellum and the printer's border
   ------------------------------------------------------------------ */
.vel { padding: 1px 0; box-shadow: inset 0 0 180px rgba(110, 80, 35, .10); min-height: 100vh; }
.frame {
	position: relative;
	box-sizing: border-box;
	width: calc(100% - 48px);
	max-width: 1480px;
	margin: 36px auto;
	border: 48px solid transparent;
	border-image: var(--ss-border) 60 round;
}
.pdev {
	position: absolute;
	z-index: 2;
	width: 80px;
	height: 80px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	background: var(--paper) var(--ss-vellum) repeat;
	border: 3px solid var(--ink);
	box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--ink);
}
.pdev img { width: 58px; height: auto; display: block; }
.pdev.tl { left: -64px; top: -64px; }
.pdev.tr { right: -64px; top: -64px; }
.pdev.bl { left: -64px; bottom: -64px; }
.pdev.br { right: -64px; bottom: -64px; }

/* ------------------------------------------------------------------
   Header: the pamphlet title
   ------------------------------------------------------------------ */
.hdr { padding: 18px 40px 0; }
.hdr-in { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.hdr-top { align-self: stretch; display: flex; justify-content: space-between; font-size: 15px; color: var(--grey); }
.numb { letter-spacing: .14em; }
.mast-wrap { margin: 0; font-size: inherit; font-weight: 400; line-height: 1; }
.mast { text-decoration: none; color: var(--ink); font-family: '1456 Gutenberg', 'UnifrakturMaguntia', serif; font-size: 78px; line-height: 1; }
.mast:hover { color: var(--ink); }
.mast .rubric { color: var(--rubric); }
.rule-double { align-self: stretch; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); height: 3px; }
.tagline { margin: 0; font-style: italic; font-size: 17px; color: var(--ink-soft); }
.nav { align-self: stretch; padding: 8px 0; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 36px; font-variant: small-caps; letter-spacing: .08em; font-size: 18px; }
.nav-list a { color: var(--ink); text-decoration: none; }
.nav-list a:hover, .nav-list .current-menu-item > a { color: var(--rubric); }

/* ------------------------------------------------------------------
   Columns
   ------------------------------------------------------------------ */
.wrap { max-width: 1360px; margin: 0 auto; padding: 48px 40px 64px; display: flex; flex-wrap: wrap; gap: 56px; }
.essay, .home-main { flex: 999 1 760px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }

/* ------------------------------------------------------------------
   Essay head
   ------------------------------------------------------------------ */
.essay-head { display: flex; flex-direction: column; gap: 10px; }
.threads { font-size: 16px; color: var(--grey); }
.pt { margin: 0; font-family: 'JSL Ancient', 'IM Fell English', Georgia, serif; font-weight: 400; font-size: 44px; line-height: 1.12; }
.pt a { color: var(--ink); text-decoration: none; }
.pt a:hover { color: var(--rubric); }
.byline { font-style: italic; font-size: 17px; color: var(--ink-soft); }
.standfirst { margin: 6px 0 0; max-width: 680px; font-style: italic; font-size: 19px; line-height: 1.5; color: var(--ink-soft); }
.page-head { text-align: center; align-items: center; }

/* ------------------------------------------------------------------
   The text column, with margins for glosses
   ------------------------------------------------------------------ */
.entry { padding: 0 var(--margin); }
.entry::after { content: none; }
.entry > * { margin-top: 0; margin-bottom: 22px; }
.entry p { margin: 0 0 22px; }
.entry h1, .entry h2, .entry h3, .entry h4 { font-weight: 400; line-height: 1.25; margin: 32px 0 14px; }
.entry h1, .entry h2 { font-family: 'JSL Ancient', Georgia, serif; font-size: 28px; }
.entry h3, .entry h4 { font-variant: small-caps; letter-spacing: .06em; font-size: 21px; }
.entry blockquote { margin: 0 0 22px; padding: 0 0 0 1.2em; border-left: 2px solid var(--rule); font-size: 18px; }
.entry blockquote p:last-child { margin-bottom: 0; }
.entry ul, .entry ol { padding-left: 1.4em; }
.entry hr { border: 0; border-top: 1px solid var(--rule); margin: 32px auto; width: 40%; }
.entry table { border-collapse: collapse; font-size: 16px; }
.entry td, .entry th { border-bottom: 1px solid var(--rule); padding: 4px 8px; }
.entry iframe { max-width: 100%; }
/* Old posts pasted from Word carry their own fonts, sizes and colours: set them in the house type. */
.entry [style*="font-family"] { font-family: inherit !important; }
.entry [style*="font-size"] { font-size: inherit !important; }
.entry span[style*="color"], .entry h1[style*="color"], .entry h2[style*="color"], .entry h3[style*="color"] { color: inherit !important; }
.entry span[style*="underline"] { text-decoration: none !important; font-style: italic; }

/* Images and captions */
.aligncenter, .wp-caption.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: 4px 22px 12px 0; }
.alignright { float: right; margin: 4px 0 12px 22px; }
.wp-caption { max-width: 100%; }
.wp-caption img { display: block; margin: 0 auto; }
.wp-caption-text, .wp-element-caption, figcaption { font-size: 15px; font-style: italic; color: var(--grey); text-align: center; margin: 6px 0 0; }
.entry .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.entry .gallery-item { margin: 0; }
.entry .gallery br { display: none; }

/* Paragraph numbers sit at the head of the left margin, level with their paragraph
   (positioned, not floated, so long notes and glosses can never push them down) */
.ssm-numbered { position: relative; }
.ssm-pn {
	position: absolute;
	top: 0;
	left: calc(-1 * var(--margin));
	width: var(--gloss-w);
	padding-top: 4px;
	text-align: right;
	font-style: normal;
	font-variant: small-caps;
	font-size: 14px;
	letter-spacing: .04em;
	line-height: 1.4;
	color: var(--rubric);
	opacity: .45;
	text-decoration: none;
	transition: opacity .15s;
}
.ssm-numbered > .ssm-gloss-left { margin-top: 1.5em; }
.ssm-pn:hover, .ssm-pn:focus { opacity: 1; text-decoration: underline; }
.ssm-pn:target, p:target > .ssm-pn { opacity: 1; }

/* Marginal glosses: they float into the margins without breaking the text */
.ssm-gloss {
	display: block;
	width: var(--gloss-w);
	margin-bottom: 14px;
	padding-top: 4px;
	font-size: 15px;
	line-height: 1.45;
	font-style: italic;
	color: var(--gloss);
	border: 0;
	opacity: 1;
}
.ssm-gloss-left { float: left; clear: left; margin-left: calc(-1 * var(--margin)); text-align: right; }
.ssm-gloss-right { float: right; clear: right; margin-right: calc(-1 * var(--margin)); text-align: left; }
.ssm-gloss-ruled { font-style: normal; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 8px 0; }
.ssm-gloss > .ssm-manicule:first-child { display: block; font-size: 34px; line-height: 1; margin: 2px 0 6px; font-style: normal; }
.ssm-gloss-left > .ssm-manicule:first-child { text-align: right; }
.ssm-manicule { color: var(--rubric); font-style: normal; }
.ssm-mani-text { font-weight: 600; }

/* Footnote markers */
.ssm-fnref, sup.fn { font-size: 12px; line-height: 0; }
.ssm-fnref a, sup.fn a { color: var(--rubric); text-decoration: none; font-weight: 600; padding: 0 1px; }

/* Footnotes as sidenotes: set in the right margin beside their reference.
   The list at the foot of the essay is kept for narrow screens and print. */
.ssm-sidenote {
	display: block;
	float: right;
	clear: right;
	width: var(--gloss-w);
	margin: 0 calc(-1 * var(--margin)) 12px 0;
	padding-top: 4px;
	font-size: 14px;
	line-height: 1.4;
	font-style: normal;
	text-align: left;
	color: var(--gloss);
}
.ssm-sn-q { display: block; margin: 4px 0 4px 10px; padding-left: 8px; border-left: 1px solid var(--rule); }
.ssm-sn-no { color: var(--rubric); font-weight: 600; font-size: 12px; margin-right: 2px; }
.ssm-sidenote.is-lit { background: rgba(139, 26, 16, .08); transition: background-color .6s; }
.ssm-gloss .ssm-sidenote { display: none; }
@media (min-width: 1101px) {
	.ssm-notes, .wp-block-footnotes { display: none; }
}

.ssm-subhead { text-align: center; margin-top: 32px !important; }

/* Excursus */
.ssm-excursus { clear: none; margin: 0 0 22px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 6px 0; }
.ssm-excursus > summary { cursor: pointer; font-variant: small-caps; letter-spacing: .05em; color: var(--rubric); min-height: 32px; }
.ssm-exc-label { margin-right: .6em; }
.ssm-exc-body { padding: 10px 0 0 1.2em; font-size: 18px; }
.ssm-video { margin: 0 0 22px; }
.ssm-dead-embed { color: var(--grey); text-align: center; }

/* Bibliography at the foot of an essay */
.ssm-bib-heading { margin-top: 36px !important; padding-top: 14px; border-top: 1px solid var(--ink); font-variant: small-caps; letter-spacing: .08em; font-size: 20px; font-weight: 400; text-align: left; }
.ssm-bib-entry, .ssm-bib-heading ~ p { font-size: 16px; line-height: 1.5; padding-left: 2em; text-indent: -2em; margin-bottom: 10px !important; }

/* Signature and end matter (glosses may run on beside these) */
.signature { text-align: right; font-size: 20px; letter-spacing: .08em; }
.endmatter { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.colo { width: 100%; max-width: 540px; margin: 8px auto 0; text-align: center; font-size: 17px; line-height: 1.5; }
.colo a { color: inherit; }
.colo .ln-br { display: inline; }
.two-faces { display: block; margin: 10px auto 6px; }
.cite { width: 100%; max-width: 560px; margin: 6px auto 0; text-align: center; font-size: 17px; line-height: 1.5; transition: background-color .6s; }
.cite.ssm-cite-updated { background-color: rgba(139, 26, 16, .08); }

/* Everything after the text clears the margins */
.essay > :not(.entry):not(.essay-head) { clear: both; }

/* Notes, history, responses */
.ssm-notes { border-top: 1px solid var(--ink); padding-top: 18px; margin-top: 20px; font-size: 16px; line-height: 1.5; }
.ssm-notes-title { margin: 0 0 10px; font-weight: 400; font-variant: small-caps; letter-spacing: .08em; font-size: 18px; }
.ssm-notes ol { margin: 0; padding-left: 1.6em; display: flex; flex-direction: column; gap: 8px; }
.ssm-back { text-decoration: none; }
.wp-block-footnotes { font-size: 16px; line-height: 1.5; border-top: 1px solid var(--ink); padding-top: 18px; }
.fold { border-top: 1px solid var(--rule); padding-top: 10px; font-size: 17px; }
.fold > summary { cursor: pointer; color: var(--rubric); min-height: 44px; display: flex; align-items: center; }
.fold-note { color: var(--grey); font-size: 15px; }
.history { margin: 0 0 10px; padding-left: 1.2em; }
.responses { padding-left: 1.2em; }
.responses .comment-body { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.comment-meta { font-size: 15px; color: var(--grey); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	font: inherit; font-size: 17px; width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--ink); background: rgba(255, 252, 243, .55);
}
.comment-form .submit, .search-submit { font: inherit; font-variant: small-caps; letter-spacing: .08em; padding: 8px 18px; min-height: 44px; border: 0; background: var(--rubric); color: #fff; cursor: pointer; }
.pn-nav { display: flex; justify-content: space-between; gap: 24px; border-top: 3px double var(--ink); padding-top: 16px; font-size: 17px; }
.pn-nav a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); max-width: 48%; }
.pn-nav a:hover { color: var(--rubric); }
.pn-nav .sc { font-size: 15px; color: var(--rubric); }
.pn-next { text-align: right; margin-left: auto; }

/* ------------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------------ */
.side { flex: 1 1 260px; max-width: 320px; display: flex; flex-direction: column; gap: 36px; border-left: 1px solid var(--rule); padding-left: 32px; font-size: 16px; line-height: 1.5; }
.side-section { display: flex; flex-direction: column; gap: 10px; }
.side-h { margin: 0; font-weight: 400; font-variant: small-caps; letter-spacing: .08em; font-size: 18px; color: var(--ink); }
.rubric-h { color: var(--rubric); font-variant: normal; letter-spacing: .1em; }
.side-p { margin: 0; color: var(--grey); }
.side-note { font-size: 14px; color: var(--grey); text-align: center; }
.search { display: flex; flex-direction: column; gap: 6px; }
.search input { font: inherit; padding: 10px 12px; border: 1px solid var(--ink); background: rgba(255, 252, 243, .55); min-height: 44px; box-sizing: border-box; width: 100%; }
.also { text-align: center; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); padding: 16px 0; gap: 14px; }
.also .side-h { letter-spacing: .1em; font-size: 17px; color: var(--grey); }
.also a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.3; letter-spacing: .03em; text-transform: uppercase; }
.also a:hover { color: var(--rubric); }
.also-no { color: var(--rubric); font-weight: 400; }
.btn-red { display: flex; justify-content: center; align-items: center; min-height: 48px; background: var(--rubric); color: #fff; text-decoration: none; font-variant: small-caps; letter-spacing: .08em; font-size: 18px; }
.btn-red:hover { background: var(--rubric-dark); color: #fff; }
.btn-red + .side-note { margin-top: -4px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.tile-frame { aspect-ratio: 4 / 5; border: 1px solid var(--ink); background: rgba(120, 95, 50, .08); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-ph { font-size: 13px; color: var(--grey); text-align: center; padding: 8px; }
.tile-t { font-size: 14px; line-height: 1.3; text-align: center; }
.zazzle { margin-top: 14px; color: var(--ink); }
.zazzle .ssm-shelf, .zazzle .ssz-shelf { color: var(--ink); }
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.side-list a { display: inline-flex; min-height: 32px; align-items: center; }
.side-status { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.widget ul { padding-left: 1.2em; }

/* ------------------------------------------------------------------
   Home and lists
   ------------------------------------------------------------------ */
.home-main { gap: 40px; }
.lead { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.lead .pt { font-size: 40px; line-height: 1.15; }
.lead-p { margin: 0; color: var(--ink-soft); }
.fleuron { text-align: center; color: var(--rubric); font-size: 22px; letter-spacing: .6em; }
.toc { display: flex; flex-direction: column; gap: 4px; }
.toc-h { margin: 0 0 12px; font-family: 'JSL Ancient', Georgia, serif; font-weight: 400; font-size: 30px; text-align: center; letter-spacing: .04em; }
.toc-row { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid #E2DACA; color: var(--ink); text-decoration: none; }
.toc-row:hover .toc-t { color: var(--rubric); }
.toc-line { display: flex; align-items: baseline; gap: 12px; }
.toc-no { flex: 0 0 3.4em; color: var(--rubric); font-variant: small-caps; letter-spacing: .04em; font-size: 17px; text-align: right; }
.toc-t { font-size: 20px; line-height: 1.35; }
.toc-dots { flex: 1 1 40px; border-bottom: 1px dotted #9C9384; transform: translateY(-5px); }
.toc-y { font-variant: small-caps; color: var(--grey); font-size: 17px; }
.toc-th { font-size: 15px; color: var(--grey); padding-left: calc(3.4em + 12px); }
.notes-list .toc-th, .notes-list .toc-line { padding-left: 0; }
.arch-head { text-align: center; }
.nav-links { display: flex; gap: 12px; justify-content: center; font-variant: small-caps; }

/* Works Cited page */
.ssm-works-cited { font-size: 18px; }
.ssm-wc-count { text-align: center; color: var(--grey); font-variant: small-caps; letter-spacing: .06em; }
.ssm-wc-letters { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-variant: small-caps; margin-bottom: 18px; }
.ssm-wc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.ssm-wc-list li { padding-left: 2em; text-indent: -2em; scroll-margin-top: 20px; }
.ssm-wc-cited { display: block; text-indent: 0; font-size: 15px; color: var(--grey); font-variant: small-caps; letter-spacing: .03em; }
.ssm-wc-cited a { font-variant: normal; letter-spacing: 0; }
.page-body .entry { padding: 0 6%; }

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.ftr { border-top: 1px solid var(--ink); }
.ftr-in { max-width: 1360px; margin: 0 auto; padding: 24px 40px 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--grey); }

/* ------------------------------------------------------------------
   Narrower screens
   ------------------------------------------------------------------ */
@media (max-width: 1299px) {
	.side { flex-basis: 100%; max-width: 600px; margin: 0 auto; border-left: 0; padding-left: 0; border-top: 3px double var(--ink); padding-top: 28px; text-align: center; }
	.side-list { align-items: center; }
	.tiles { grid-template-columns: repeat(2, minmax(0, 190px)); justify-content: center; }
	.search { align-items: stretch; }
}

/* Margins too narrow for glosses: they sit in the text, marked by a rule */
@media (max-width: 1100px) {
	.entry { padding: 0; }
	.ssm-gloss, .ssm-gloss-left, .ssm-gloss-right {
		float: none; width: auto; margin: 0 0 12px; text-align: left;
		border-left: 2px solid var(--rule); padding: 0 0 0 12px;
	}
	.ssm-gloss-ruled { border-top: 0; border-bottom: 0; }
	.ssm-gloss > .ssm-manicule:first-child { display: inline; font-size: inherit; margin: 0 .3em 0 0; }
	.ssm-pn { position: static; display: block; width: auto; margin: 0 0 4px; padding: 0; text-align: left; }
	.ssm-numbered > .ssm-gloss-left { margin-top: 0; }
	.ssm-sidenote { display: none; }
	.toc-th { padding-left: 0; }
}

@media (max-width: 700px) {
	body { font-size: 18px; }
	.frame { width: auto; margin: 12px; border-width: 22px; border-image-source: var(--ss-border-phone); }
	.pdev { width: 40px; height: 40px; border-width: 2px; box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px var(--ink); }
	.pdev img { width: 28px; }
	.pdev.tl { left: -31px; top: -31px; }
	.pdev.tr { right: -31px; top: -31px; }
	.pdev.bl { left: -31px; bottom: -31px; }
	.pdev.br { right: -31px; bottom: -31px; }
	.hdr { padding: 10px 14px 0; }
	.mast { font-size: 50px; }
	.nav-list { gap: 4px 22px; font-size: 17px; }
	.wrap { padding: 28px 16px 40px; gap: 36px; }
	.pt { font-size: 31px; }
	.lead .pt { font-size: 30px; }
	.toc-line { flex-wrap: wrap; }
	.toc-dots { display: none; }
	.toc-no { flex-basis: auto; text-align: left; }
	.alignleft, .alignright { float: none; display: block; margin: 0 auto 12px; }
	.ftr-in { padding: 20px 16px 28px; }
	.pn-nav { flex-direction: column; }
	.pn-nav a { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}

@media print {
	.vel { box-shadow: none; }
	.frame { border: 0; margin: 0; width: auto; }
	.pdev, .side, .nav, .pn-nav, .fold, .skip-link, .ssm-sidenote { display: none !important; }
	.ssm-notes, .wp-block-footnotes { display: block !important; }
	.ssm-excursus { display: block; }
}
