/*
Theme Name: Mad Men Revisited
Author: Robert Ziegler
Description: A plain reading theme for an episode-by-episode Mad Men rewatch. Black header band, Mad Men red for links, Source Serif 4 for text and Jost for the site name.
Version: 1.0
Requires at least: 6.6
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: mad-men-revisited
*/

/* Colors, fonts and sizes live in theme.json and can be changed under
   Appearance > Editor > Styles. This file holds the layout details. */

/* Dark mode: when a reader's device is set to dark, swap the neutrals.
   The red stays the same. */
@media (prefers-color-scheme: dark) {
	html body {
		--wp--preset--color--paper: #17181B;
		--wp--preset--color--ink: #E6E4DF;
		--wp--preset--color--muted: #A3A5AA;
		--wp--preset--color--rule: #303238;
		--wp--preset--color--band: #0C0C0E;
		--wp--preset--color--band-ink: #F0EEE9;
		color-scheme: dark;
	}
}

body { -webkit-text-size-adjust: 100%; }

a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--wp--preset--color--red); outline-offset: 2px; }

/* Section labels: Jost capitals */
.is-style-label,
.pp-kicker,
.wp-block-comments-title,
.post-navigation-link__label,
.pp-jump strong {
	font-family: var(--wp--preset--font-family--jost);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--label);
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Header band ------------------------------------------------------ */

.wp-site-blocks { padding-top: 0; padding-bottom: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }

.pp-band {
	background: var(--wp--preset--color--band);
	border-bottom: 4px solid var(--wp--preset--color--red);
	padding-top: 1.75rem;
	padding-bottom: 1.5rem;
}
.pp-band-row { gap: 0.5rem 1.5rem; }
.pp-band .wp-block-site-title { margin: 0; }
.pp-band .wp-block-site-title a { color: var(--wp--preset--color--band-ink); text-decoration: none; }
.pp-band .wp-block-site-tagline { margin: 0.5rem 0 0; color: var(--wp--preset--color--band-ink); opacity: 0.72; }
.pp-band .wp-block-navigation { gap: 1.5rem; font-size: var(--wp--preset--font-size--medium); color: var(--wp--preset--color--band-ink); }
.pp-band .wp-block-navigation a { color: var(--wp--preset--color--band-ink); text-decoration: none; padding-bottom: 0.15rem; }
.pp-band .wp-block-navigation a:hover,
.pp-band .wp-block-navigation .current-menu-item > a { border-bottom: 2px solid var(--wp--preset--color--band-ink); }

/* Main column ------------------------------------------------------ */

.pp-main { padding-top: 2.5rem; padding-bottom: 3.5rem; }
.pp-main h1 { margin-top: 0; text-wrap: balance; }

/* Front page: episode list */
.pp-jump { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; }
.pp-jump strong { color: var(--wp--preset--color--muted); margin-right: 0.25rem; }
.pp-jump a {
	font-family: var(--wp--preset--font-family--jost);
	font-weight: 700;
	font-size: 1rem;
	text-decoration: none;
}
.pp-jump a:hover { text-decoration: underline; }

.pp-season {
	margin-top: 2.75rem !important;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid var(--wp--preset--color--ink);
}
.wp-block-heading.pp-season + .wp-block-table { margin-top: 0.5rem; }

.wp-block-table.is-style-episodes { margin: 0; }
.wp-block-table.is-style-episodes table { border-collapse: collapse; width: 100%; }
.wp-block-table.is-style-episodes td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--rule);
	padding: 0.3rem 0;
	color: var(--wp--preset--color--muted);
	vertical-align: top;
}
.wp-block-table.is-style-episodes td:first-child {
	width: 5rem;
	font-variant-numeric: tabular-nums;
}
.wp-block-table.is-style-episodes a { text-decoration: none; }
.wp-block-table.is-style-episodes a:hover { text-decoration: underline; }
/* An episode whose title is linked has an essay: its number turns red */
.wp-block-table.is-style-episodes tr:has(a) td:first-child { color: var(--wp--preset--color--red); }

/* Essays ----------------------------------------------------------- */

.pp-kicker { margin-bottom: 0.75rem; }
.pp-kicker a { color: var(--wp--preset--color--red); text-decoration: none; }
.pp-kicker + .wp-block-post-title { margin-top: 0; }

.is-style-credits { color: var(--wp--preset--color--muted); font-size: 1rem; }
.is-style-credits + * { margin-top: 1rem; }

.is-style-dek {
	font-size: var(--wp--preset--font-size--large);
	font-style: italic;
	line-height: 1.45;
	padding-bottom: 1.75rem;
	border-bottom: 2px solid var(--wp--preset--color--ink);
	margin-bottom: 2.25rem;
}

/* Scene headings: mark the timestamp as "Inline code" in the editor */
.wp-block-post-content h2 { margin-top: 2.5rem; }
.wp-block-heading code {
	font: inherit;
	font-weight: 400;
	color: var(--wp--preset--color--muted);
	background: none;
	padding: 0;
	margin-right: 0.6em;
	font-variant-numeric: tabular-nums;
}

/* Indent with padding: WordPress centers every block in the column with !important margins */
.is-style-dialogue { padding-left: 2rem; }

.wp-block-quote {
	padding-left: 2rem;
	border-left: 0;
	font-size: 1.0625rem;
}

sup { line-height: 0; }
sup a, .wp-block-footnotes a { text-decoration: none; }

.wp-block-heading.is-style-label { margin-top: 2.5rem; }
.wp-block-heading.is-style-label.pp-endmatter {
	padding-top: 1.25rem;
	border-top: 2px solid var(--wp--preset--color--ink);
	margin-top: 3rem;
}
.wp-block-footnotes, .pp-setups { font-size: 1rem; padding-left: 1.75rem; }
.wp-block-footnotes li, .pp-setups li { margin-bottom: 0.5rem; }

/* Previous / next */
.pp-post-nav {
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--wp--preset--color--rule);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem 2rem;
}
.pp-post-nav .wp-block-post-navigation-link { margin: 0; }
.post-navigation-link__label { display: block; color: var(--wp--preset--color--muted); }
.post-navigation-link-next { text-align: right; margin-left: auto !important; }

/* Comments --------------------------------------------------------- */

.pp-comments { margin-top: 3rem; padding-top: 1.25rem; border-top: 2px solid var(--wp--preset--color--ink); }
.wp-block-comments-title { margin: 0 0 1.25rem; }
.wp-block-comment-template { list-style: none; margin: 0; padding: 0; }
.wp-block-comment-template li { margin: 0; }
.wp-block-comment-template ol { list-style: none; padding-left: 1.5rem; border-left: 1px solid var(--wp--preset--color--rule); }
.pp-comment { padding: 1rem 0; border-bottom: 1px solid var(--wp--preset--color--rule); }
.pp-comment-meta { gap: 0.75rem; align-items: baseline; }
.pp-comment .wp-block-comment-author-name { font-weight: 700; font-size: 1rem; }
.pp-comment .wp-block-comment-author-name a { color: inherit; text-decoration: none; }
.pp-comment .wp-block-comment-date { font-size: 0.9375rem; }
.pp-comment .wp-block-comment-date a { color: var(--wp--preset--color--muted); text-decoration: none; }
.pp-comment .wp-block-comment-content { margin-top: 0.5rem; }
.pp-comment .wp-block-comment-content p { margin: 0 0 0.75em; }
.pp-comment .wp-block-comment-reply-link,
.pp-comment .wp-block-comment-edit-link { font-size: 0.9375rem; display: inline-block; margin-right: 1rem; }

.wp-block-post-comments-form { margin-top: 2rem; }
.wp-block-post-comments-form .comment-reply-title {
	font-family: var(--wp--preset--font-family--jost);
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.wp-block-post-comments-form input:not([type="submit"]):not([type="checkbox"]),
.wp-block-post-comments-form textarea {
	width: 100%;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: 0;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font: inherit;
	font-size: 1rem;
}
.wp-block-post-comments-form input[type="submit"] {
	padding: 0.6rem 1.25rem;
	border: 0;
	border-radius: 0;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
	font-family: var(--wp--preset--font-family--jost);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}
.wp-block-post-comments-form input[type="submit"]:hover { background: var(--wp--preset--color--red); }

/* Archive lists (a season's essays, search results) */
.pp-archive .wp-block-post-title { font-size: var(--wp--preset--font-size--large); font-weight: 500; margin-bottom: 0.25rem; }
.pp-archive .wp-block-post-title a { text-decoration: none; }
.pp-archive .wp-block-post-template > li { padding-bottom: 1rem; border-bottom: 1px solid var(--wp--preset--color--rule); }

/* Footer ----------------------------------------------------------- */

.pp-foot { border-top: 1px solid var(--wp--preset--color--rule); padding-top: 1.25rem; padding-bottom: 2.5rem; }
.pp-foot p { margin: 0; color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }
