/*
Theme Name:   ColorMag Child (EIStories)
Template:     colormag
Description:  Editorial design (Option A) for The Engineering of Conscious Experience. CSS only.
Version:      1.0.2
Text Domain:  colormag-child
*/

/* ==========================================================================
   OPTION A: "EDITORIAL JOURNAL"
   A calm science-and-culture magazine look: serif headlines, thin rules
   instead of boxes, one ink-red accent, generous reading column.

   HOW TO TWEAK (no programming needed):
   - Colours, fonts, sizes and spacing all live in section 1 (":root").
     Change a value there and it changes everywhere.
   - Size note: ColorMag sets 1rem = 10px. So 1.6rem = 16px, 2.4rem = 24px.
   - ColorMag prints its own Customizer CSS AFTER this file. Some rules
     below start with "body" or repeat a class on purpose, so they still win.

   CONTENTS
    1. Settings (colours, fonts, sizes, spacing)
    2. Fonts (loaded from the parent theme's own files, no Google Fonts)
    3. Page basics (background, text, links, focus, selection)
    4. Header: site title + tagline
    5. Header: main menu (desktop) and menu button (phone)
    6. Page width and layout
    7. Post lists (home, categories, tags, search)
    8. Archive title (category / tag pages)
    9. Single post: title, meta line, featured image
   10. Single post: reading column (text, headings, lists, links)
   11. Video embeds (responsive 16:9 YouTube / Vimeo)
   12. Previous / next links
   13. Comments and comment form
   14. Footer and back-to-top button
   15. Phone and tablet adjustments
   ========================================================================== */


/* ==========================================================================
   1. SETTINGS
   ========================================================================== */
:root {
	/* Colours ------------------------------------------------------------ */
	--ed-paper:       #fbfaf7;  /* page background (warm off-white)        */
	--ed-surface:     #ffffff;  /* menus, form fields                       */
	--ed-ink:         #1b1a18;  /* headlines and main text (16.7:1)          */
	--ed-text:        #2e2c29;  /* long-form body text (13:1)               */
	--ed-muted:       #5f5b54;  /* dates, authors, excerpts (6.4:1)         */
	--ed-rule:        #dedad2;  /* thin dividing lines                      */
	--ed-rule-strong: #1b1a18;  /* the heavier rule under the masthead      */
	--ed-accent:      #a3311f;  /* the one accent: ink red (6.7:1)          */
	--ed-accent-dark: #7e2416;  /* accent on hover                          */
	--ed-tint:        #f3efe7;  /* soft panel / image placeholder          */
	--ed-field:       #858075;  /* form field borders (3.8:1)               */

	/* Fonts -------------------------------------------------------------- */
	--ed-serif: "Ed Plex Serif", "IBM Plex Serif", Georgia, "Times New Roman", serif;
	--ed-sans:  "Ed Open Sans", "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	/* Type sizes (px, so they ignore ColorMag's 10px rem) ---------------- */
	--ed-size-meta:     13px;   /* dates, authors, categories               */
	--ed-size-small:    15px;   /* excerpts, comments                       */
	--ed-size-body:     18px;   /* article text                             */
	--ed-size-card:     20px;   /* headline on a list card                  */
	--ed-size-lead:     clamp(26px, 2.6vw, 36px); /* first story on home    */
	--ed-size-title:    clamp(30px, 4.2vw, 46px); /* single post headline   */
	--ed-size-masthead: clamp(24px, 3.6vw, 44px); /* site title             */

	/* Layout -------------------------------------------------------------- */
	--ed-page:    1200px;       /* max width of the whole page              */
	--ed-measure: 700px;        /* reading column (about 70 characters)     */
	--ed-wide:    960px;        /* videos / featured image on single posts  */
	--ed-gutter:  clamp(16px, 4vw, 40px); /* side padding                   */

	/* Spacing scale (4px base) ------------------------------------------- */
	--ed-s1: 4px;
	--ed-s2: 8px;
	--ed-s3: 12px;
	--ed-s4: 16px;
	--ed-s5: 24px;
	--ed-s6: 32px;
	--ed-s7: 48px;
	--ed-s8: 64px;
}


/* ==========================================================================
   2. FONTS
   Files ship with ColorMag in colormag/assets/fonts/. The path "../colormag/"
   works because the child theme folder sits next to the parent folder.
   Note: there is no Plex Serif italic file, so italics are slanted by the
   browser (fine for short phrases).
   ========================================================================== */
@font-face {
	font-family: "Ed Plex Serif";
	src: url("../colormag/assets/fonts/IBMPlexSerif-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Ed Plex Serif";
	src: url("../colormag/assets/fonts/IBMPlexSerif-SemiBold.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Ed Plex Serif";
	src: url("../colormag/assets/fonts/IBMPlexSerif-Bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Ed Open Sans";
	src: url("../colormag/assets/fonts/OpenSans-Regular.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Ed Open Sans";
	src: url("../colormag/assets/fonts/OpenSans-SemiBold.woff") format("woff");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Ed Open Sans";
	src: url("../colormag/assets/fonts/OpenSans-Bold.woff") format("woff");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Ed Open Sans";
	src: url("../colormag/assets/fonts/OpenSans-Italic.woff") format("woff");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}


/* ==========================================================================
   3. PAGE BASICS
   ========================================================================== */
body {
	background: var(--ed-paper);
	color: var(--ed-text);
	font-family: var(--ed-sans);
	padding: 0;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
body #page,
body .cm-content {
	background: transparent;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--ed-serif);
	color: var(--ed-ink);
	text-wrap: balance;
}

a {
	color: var(--ed-accent);
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}
a:hover {
	color: var(--ed-accent-dark);
}

/* Keyboard focus: a clear ink-red ring on everything you can tab to. */
:focus-visible {
	outline: 2px solid var(--ed-accent);
	outline-offset: 3px;
	border-radius: 2px;
}

::selection {
	background: #f1d3cc;
	color: var(--ed-ink);
}

/* "Skip to content" link: visible when it gets keyboard focus. */
.skip-link:focus {
	background: var(--ed-ink);
	color: #fff;
	padding: var(--ed-s3) var(--ed-s4);
	z-index: 100000;
}


/* ==========================================================================
   4. HEADER: SITE TITLE + TAGLINE (the "masthead")
   ========================================================================== */
body #cm-masthead,
body .cm-header-builder .cm-main-header {
	background: var(--ed-paper);
}
body .cm-header-builder .cm-header-main-row {
	padding-top: var(--ed-s6);
	padding-bottom: var(--ed-s4);
	background: transparent;
}
body .cm-header-builder .cm-main-row {
	justify-content: center;
}
body .cm-header-builder .cm-header-left-col,
body .cm-header-builder .cm-header-center-col {
	justify-content: center;
}
body .cm-header-builder .cm-site-info {
	text-align: center;
}
body .cm-header-builder .cm-site-title {
	font-family: var(--ed-serif);
	font-size: var(--ed-size-masthead);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
	margin: 0;
}
body .cm-header-builder .cm-site-title a {
	color: var(--ed-ink);
	text-decoration: none;
}
body .cm-header-builder .cm-site-title a:hover {
	color: var(--ed-accent);
}
body .cm-header-builder .cm-site-description {
	margin-top: var(--ed-s2);
	font-family: var(--ed-sans);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ed-muted);
}


/* ==========================================================================
   5. HEADER: MAIN MENU
   Light bar between two rules: a heavy ink line on top, a hairline below.
   ========================================================================== */
body .cm-header-builder.cm-full-width .cm-header-bottom-row,
body .cm-header-builder .cm-mobile-row .cm-header-bottom-row {
	background: var(--ed-paper);
	border-top: 2px solid var(--ed-rule-strong);
	border-bottom: 1px solid var(--ed-rule);
	box-shadow: none;
}
body .cm-header-builder .cm-header-bottom-row .cm-container {
	max-width: var(--ed-page);
}
body .cm-header-builder .cm-bottom-row {
	justify-content: center;
}
body .cm-header-builder .cm-header-bottom-row .cm-header-left-col {
	flex: 1;
	justify-content: center;
}
body #cm-primary-nav {
	background: transparent;
	border: 0;
	box-shadow: none;
}
body .cm-primary-nav ul {
	justify-content: center;
	flex-wrap: wrap;
}
body .cm-primary-nav li,
body .cm-primary-nav ul li.current-menu-item,
body .cm-primary-nav ul li.current_page_item,
body .cm-primary-nav ul li.current-menu-ancestor,
body .cm-primary-nav ul li:hover,
body .cm-primary-nav ul li.focus {
	background: transparent;
	padding: 0;
}
body .cm-primary-nav a {
	font-family: var(--ed-sans);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: none;
	color: var(--ed-ink);
	line-height: 1;
	padding: 16px 14px 14px;
	border-bottom: 2px solid transparent;
	text-decoration: none;
}
body .cm-primary-nav a:hover,
body .cm-primary-nav li.focus > a {
	color: var(--ed-accent);
}
/* The page you are on: ink-red underline. */
body .cm-primary-nav li.current-menu-item > a,
body .cm-primary-nav li.current_page_item > a {
	color: var(--ed-accent);
	border-bottom-color: var(--ed-accent);
}
/* Drop-down sub-menus (none today, styled in case one is added). */
body .cm-primary-nav .sub-menu {
	background: var(--ed-surface);
	border: 1px solid var(--ed-rule);
}

/* Phone menu button: ink icon on paper instead of white on dark. */
body .cm-header .cm-menu-toggle svg,
body .cm-header-builder .cm-mobile-row .cm-menu-toggle svg {
	fill: var(--ed-ink);
}
body .cm-header-builder .cm-mobile-row .cm-menu-toggle {
	width: 48px;
	height: 48px;
}
/* Phone menu panel (opens under the button). */
body .cm-header-builder .cm-mobile-row .cm-mobile-nav {
	background: var(--ed-surface);
	border-top: 1px solid var(--ed-rule);
	border-bottom: 1px solid var(--ed-rule);
}
body .cm-mobile-nav li {
	border-bottom: 1px solid var(--ed-rule);
	background: transparent;
}
body .cm-mobile-nav a {
	display: block;
	padding: 14px var(--ed-gutter);
	font-family: var(--ed-sans);
	font-size: 16px;
	font-weight: 600;
	text-transform: none;
	color: var(--ed-ink);
}
body .cm-mobile-nav li.current-menu-item > a {
	color: var(--ed-accent);
}


/* ==========================================================================
   6. PAGE WIDTH AND LAYOUT
   ========================================================================== */
body .cm-container {
	max-width: var(--ed-page);
	padding-left: var(--ed-gutter);
	padding-right: var(--ed-gutter);
}
body #cm-content.cm-content {
	padding-top: var(--ed-s7);
	padding-bottom: var(--ed-s8);
}
/* No sidebar on this site: let the main column use the full width
   (ColorMag's Customizer CSS would otherwise squeeze it to 70%). */
body.cm-no-sidebar .cm-content .cm-primary,
body .cm-content .cm-primary {
	width: 100%;
	padding-right: 0;
	float: none;
}


/* ==========================================================================
   7. POST LISTS (home, categories, tags, search)
   Each story sits under a thin rule instead of inside a shadowed box.
   Desktop: 3 columns, the newest story is a large "lead" over 2 columns.
   ========================================================================== */
body .cm-posts.cm-layout-2 {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: var(--ed-s6);
	row-gap: var(--ed-s7);
}
body .cm-posts.cm-layout-2 .post,
body .cm-posts.cm-layout-2 .page {
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	border-top: 1px solid var(--ed-rule);
	padding-top: var(--ed-s4);
	overflow: visible;
}

/* Inside each story: picture, headline, short summary, categories,
   then date and author. */
body .cm-posts.cm-layout-2 .cm-post-content {
	padding: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"img"
		"title"
		"text"
		"cats"
		"meta";
	align-content: start;
}
body .cm-posts.cm-layout-2 .cm-featured-image   { grid-area: img; }
body .cm-posts.cm-layout-2 .cm-entry-header     { grid-area: title; }
body .cm-posts.cm-layout-2 .cm-entry-summary    { grid-area: text; }
body .cm-posts.cm-layout-2 .cm-entry-header-meta { grid-area: cats; }
body .cm-posts.cm-layout-2 .cm-below-entry-meta { grid-area: meta; }

/* Pictures: always 16:9 and cropped to fill, so tall or 4:3 YouTube
   thumbnails (480x360 with black bars) line up neatly. */
body .cm-posts.cm-layout-2 .cm-featured-image {
	margin: 0 0 var(--ed-s4);
	text-align: left;
}
body .cm-posts.cm-layout-2 .cm-featured-image a {
	display: block;
	overflow: hidden;
	background: var(--ed-tint);
}
body .cm-posts.cm-layout-2 .cm-featured-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
body .cm-posts.cm-layout-2 .post:hover .cm-featured-image img {
	transform: scale(1.02);
}

/* Headlines */
body .cm-posts.cm-layout-2 .cm-entry-title {
	font-family: var(--ed-serif);
	font-size: var(--ed-size-card);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
	margin: 0 0 var(--ed-s2);
	overflow-wrap: anywhere;   /* long #hashtags must not overflow */
}
body .cm-posts.cm-layout-2 .cm-entry-title a {
	color: var(--ed-ink);
	text-decoration: none;
}
body .cm-posts.cm-layout-2 .cm-entry-title a:hover {
	color: var(--ed-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
}

/* Short summary: two lines max (imported YouTube descriptions run long). */
body .cm-posts.cm-layout-2 .cm-entry-summary p {
	font-family: var(--ed-sans);
	font-size: var(--ed-size-small);
	line-height: 1.55;
	color: var(--ed-muted);
	margin: 0 0 var(--ed-s3);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	overflow-wrap: anywhere;
}
/* The "Read More" button repeats the headline link; the whole headline
   is already the link, so the button is hidden from list pages. */
body .cm-posts.cm-layout-2 .cm-entry-button {
	display: none;
}

/* Byline row: categories as small ink-red words, then date and author. */
body .cm-posts .cm-entry-header-meta,
body .single .cm-entry-header-meta {
	margin: 0;
}
body .cm-post-categories {
	gap: 0;
}
body .cm-post-categories a,
body .cm-posts .cm-post-categories a {
	background: none;
	padding: 0;
	border-radius: 0;
	color: var(--ed-accent);
	font-family: var(--ed-sans);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.6;
	padding-block: 3px;   /* slightly taller tap area */
}
body .cm-post-categories a + a::before {
	content: "/";
	color: var(--ed-rule);
	padding: 0 6px;
	font-weight: 400;
}
body .cm-below-entry-meta {
	margin: 0;
	gap: 0 var(--ed-s3);
	font-family: var(--ed-sans);
	font-size: var(--ed-size-meta);
	color: var(--ed-muted);
	line-height: 1.6;
}
body .cm-below-entry-meta a,
body .cm-below-entry-meta span,
body .cm-below-entry-meta .cm-author a {
	color: var(--ed-muted);
	font-size: var(--ed-size-meta);
	text-decoration: none;
}
body .cm-below-entry-meta a:hover {
	color: var(--ed-accent);
	text-decoration: underline;
}
/* Small calendar / person icons removed; the author gets a "By" instead. */
body .cm-below-entry-meta svg {
	display: none;
}
body .cm-below-entry-meta .cm-author::before {
	content: "By";
	color: var(--ed-muted);
}

/* LEAD STORY: newest post on each list page spans 2 of the 3 columns and
   2 rows; the next two stories stack beside it (headline only). */
body .cm-posts.cm-layout-2-style-1 .post:first-child {
	grid-column: span 2;
	grid-row: span 2;
	border-top: 2px solid var(--ed-ink);
}
body .cm-posts.cm-layout-2-style-1 .post:nth-child(2) .cm-entry-summary,
body .cm-posts.cm-layout-2-style-1 .post:nth-child(3) .cm-entry-summary {
	display: none;
}
body .cm-posts.cm-layout-2-style-1 .post:first-child .cm-entry-title {
	font-size: var(--ed-size-lead);
	line-height: 1.15;
	letter-spacing: -0.02em;
	font-weight: 600;
}
body .cm-posts.cm-layout-2-style-1 .post:first-child .cm-entry-summary p {
	font-family: var(--ed-serif);
	font-size: 17px;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	max-width: 62ch;
}
/* Second story sits beside the lead with a matching heavy top rule. */
body .cm-posts.cm-layout-2-style-1 .post:nth-child(2) {
	border-top: 2px solid var(--ed-ink);
}

/* Stories without a picture: give the headline a little more presence. */
body .cm-posts.cm-layout-2 .post:not(.has-post-thumbnail) .cm-entry-title {
	font-size: calc(var(--ed-size-card) + 4px);
}


/* ==========================================================================
   8. ARCHIVE TITLE (category, tag, search pages)
   ========================================================================== */
body .cm-page-header {
	margin-bottom: var(--ed-s6);
}
body .cm-page-header .cm-page-title {
	border: 0;
	margin: 0;
	padding: 0;
	font-family: var(--ed-serif);
	font-size: clamp(32px, 4vw, 48px);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.1;
	color: var(--ed-ink);
}
body .cm-page-header .cm-page-title span {
	background: none;
	color: inherit;
	padding: 0;
	display: inline;
}
body .cm-page-header .taxonomy-description,
body .cm-page-header .archive-description {
	margin-top: var(--ed-s3);
	max-width: 62ch;
	color: var(--ed-muted);
	font-size: 16px;
}


/* ==========================================================================
   9. SINGLE POST: HEADLINE, META LINE, FEATURED IMAGE
   Order on the page: categories, headline, date/author, picture, text.
   ========================================================================== */
body.single .cm-posts .post,
body.page .cm-posts .page {
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	overflow: visible;
}
body.single .cm-post-content,
body.page .cm-post-content {
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
}
body.single .cm-post-content > *,
body.page .cm-post-content > * {
	width: 100%;
	max-width: var(--ed-measure);
}
body.single .cm-post-content > .cm-entry-header-meta { order: 1; margin-bottom: var(--ed-s3); }
body.single .cm-post-content > .cm-entry-header      { order: 2; }
body.single .cm-post-content > .cm-below-entry-meta  { order: 3; }
body.single .cm-post-content > .cm-featured-image    { order: 4; }
body.single .cm-post-content > .cm-entry-summary,
body.single .cm-post-content > .cm-entry-content     { order: 5; }
body.single .cm-post-content > *:not(.cm-entry-header-meta):not(.cm-entry-header):not(.cm-below-entry-meta):not(.cm-featured-image):not(.cm-entry-summary) { order: 6; }

body.single .cm-entry-header .cm-entry-title,
body.page .cm-entry-header .cm-entry-title {
	font-family: var(--ed-serif);
	font-size: var(--ed-size-title);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--ed-ink);
	margin: 0 0 var(--ed-s4);
	overflow-wrap: anywhere;
}
body.single .cm-post-content > .cm-below-entry-meta {
	padding-bottom: var(--ed-s5);
	margin-bottom: var(--ed-s6);
	border-bottom: 1px solid var(--ed-rule);
	font-size: 14px;
}
body.single .cm-post-content > .cm-below-entry-meta a,
body.single .cm-post-content > .cm-below-entry-meta span {
	font-size: 14px;
}
body.single .cm-post-content > .cm-below-entry-meta .cm-author a {
	color: var(--ed-ink);
	font-weight: 600;
}

/* Featured picture: wider than the text, like a magazine opener. */
body.single .cm-post-content > .cm-featured-image {
	max-width: var(--ed-wide);
	margin: 0 0 var(--ed-s7);
}
body.single .cm-post-content > .cm-featured-image img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 600px;
	object-fit: cover;
}
/* Video posts: the picture is just the video's own thumbnail, shown again
   right above the player. Hide the duplicate so the video leads. */
body.single .cm-post-content:has(.cm-entry-summary iframe[src*="youtube"]) > .cm-featured-image,
body.single .cm-post-content:has(.cm-entry-summary iframe[src*="vimeo"]) > .cm-featured-image {
	display: none;
}


/* ==========================================================================
   10. SINGLE POST: READING COLUMN
   ========================================================================== */
body.single .cm-entry-summary,
body.page .cm-entry-summary {
	font-family: var(--ed-serif);
	font-size: var(--ed-size-body);
	line-height: 1.7;
	color: var(--ed-text);
	overflow-wrap: break-word;
}
body.single .cm-entry-summary p,
body.page .cm-entry-summary p,
body.single .cm-entry-summary li,
body.page .cm-entry-summary li {
	font-size: var(--ed-size-body);
	line-height: 1.7;
	text-wrap: pretty;
}
body.single .cm-entry-summary p,
body.page .cm-entry-summary p {
	margin: 0 0 1.1em;
}
body.single .cm-entry-summary h2,
body.page .cm-entry-summary h2 {
	font-size: 28px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.015em;
	margin: 2em 0 0.6em;
	padding-top: var(--ed-s4);
	border-top: 1px solid var(--ed-rule);
}
body.single .cm-entry-summary h3,
body.page .cm-entry-summary h3 {
	font-size: 22px;
	font-weight: 600;
	line-height: 1.3;
	margin: 1.8em 0 0.5em;
}
body.single .cm-entry-summary h4,
body.page .cm-entry-summary h4 {
	font-size: 19px;
	font-weight: 600;
	margin: 1.6em 0 0.4em;
}
body.single .cm-entry-summary ul,
body.single .cm-entry-summary ol {
	padding-left: 1.3em;
	margin: 0 0 1.4em;
}
body.single .cm-entry-summary li {
	margin-bottom: 0.4em;
}
body.single .cm-entry-summary li::marker {
	color: var(--ed-accent);
}
body.single .cm-entry-summary strong {
	font-weight: 600;
	color: var(--ed-ink);
}
body.single .cm-entry-summary a,
body.page .cm-entry-summary a {
	color: var(--ed-accent);
	text-decoration: underline;
	text-decoration-color: rgba(163, 49, 31, 0.4);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	overflow-wrap: anywhere;   /* long pasted URLs wrap instead of overflowing */
}
body.single .cm-entry-summary a:hover,
body.page .cm-entry-summary a:hover {
	color: var(--ed-accent-dark);
	text-decoration-color: currentColor;
}
body.single .cm-entry-summary blockquote {
	margin: 1.6em 0;
	padding: var(--ed-s5) var(--ed-s6);
	background: var(--ed-tint);
	font-size: 20px;
	font-style: italic;
	border: 0;
}
body.single .cm-entry-summary img {
	max-width: 100%;
	height: auto;
}
body.single .cm-entry-summary figure,
body.single .cm-entry-summary .wp-caption {
	max-width: 100%;
	margin: 1.6em 0;
}
body.single .cm-entry-summary figcaption,
body.single .cm-entry-summary .wp-caption-text {
	font-family: var(--ed-sans);
	font-size: var(--ed-size-meta);
	color: var(--ed-muted);
	margin-top: var(--ed-s2);
}
body.single .cm-entry-summary table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--ed-sans);
	font-size: 15px;
	margin: 1.6em 0;
}
body.single .cm-entry-summary th,
body.single .cm-entry-summary td {
	border-bottom: 1px solid var(--ed-rule);
	padding: var(--ed-s2) var(--ed-s3);
	text-align: left;
}
body.single .cm-entry-summary hr {
	border: 0;
	border-top: 1px solid var(--ed-rule);
	margin: 2em 0;
}
/* Affiliate disclosure line on book guides: small and quiet. */
body.single .cm-entry-summary .affiliate-disclosure {
	font-family: var(--ed-sans);
	font-size: 14px;
	color: var(--ed-muted);
}
body.single .cm-entry-summary .affiliate-disclosure em {
	font-style: normal;
}
/* Tags list under the post (if shown). */
body.single .cm-posts .tags a {
	border: 1px solid var(--ed-rule);
	border-radius: 2px;
	color: var(--ed-muted);
	font-family: var(--ed-sans);
	font-size: 13px;
	padding: 2px 8px;
}


/* ==========================================================================
   11. VIDEO EMBEDS
   ~19,000 posts paste a fixed-size YouTube <iframe width="560" height="340">.
   These rules make every YouTube / Vimeo player 16:9 and as wide as the
   video column on every screen (no JavaScript needed). On single posts the
   player is a little wider than the text column, like a magazine figure.
   Other iframes (maps, forms, ads) are only stopped from overflowing; their
   height is left alone.
   ========================================================================== */
.cm-entry-summary iframe,
.cm-entry-content iframe {
	max-width: 100%;
}
/* Leave Google ad iframes exactly as AdSense sizes them. */
.cm-entry-summary iframe[id^="aswift"],
.cm-entry-summary iframe[id^="google_ads"],
.cm-entry-summary ins iframe {
	max-width: none;
}

.cm-entry-summary iframe[src*="youtube.com"],
.cm-entry-summary iframe[src*="youtube-nocookie.com"],
.cm-entry-summary iframe[src*="youtu.be"],
.cm-entry-summary iframe[src*="player.vimeo.com"],
.cm-entry-summary .wp-block-embed iframe {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
	background: #000;
	margin: 0 0 var(--ed-s5);
}
/* Single posts: break out of the 700px text column to the wider 960px,
   but never wider than the screen. */
body.single .cm-entry-summary iframe[src*="youtube.com"],
body.single .cm-entry-summary iframe[src*="youtube-nocookie.com"],
body.single .cm-entry-summary iframe[src*="youtu.be"],
body.single .cm-entry-summary iframe[src*="player.vimeo.com"] {
	--ed-video-w: max(100%, min(var(--ed-wide), 100vw - 2 * var(--ed-gutter) - 16px));
	width: var(--ed-video-w);
	max-width: none;
	margin-left: calc((100% - var(--ed-video-w)) / 2);
	margin-bottom: var(--ed-s6);
}
/* The <br> tags pasted after each video add big gaps: drop the first ones. */
.cm-entry-summary iframe + br,
.cm-entry-summary iframe + br + br {
	display: none;
}
/* Gutenberg embed blocks (a few posts) */
.cm-entry-summary .wp-block-embed__wrapper::before {
	display: none;
}


/* ==========================================================================
   12. PREVIOUS / NEXT LINKS
   On lists: "← Previous" = older posts. On single posts: neighbour posts.
   ========================================================================== */
body ul.default-wp-page {
	display: flex;
	gap: var(--ed-s5);
	margin: var(--ed-s7) 0 0;
	padding: var(--ed-s5) 0 0;
	border-top: 1px solid var(--ed-rule);
}
body.single ul.default-wp-page {
	max-width: var(--ed-measure);
	margin-left: auto;
	margin-right: auto;
}
body ul.default-wp-page li {
	flex: 1;
	margin: 0;
}
body ul.default-wp-page li:empty {
	display: none;
}
body ul.default-wp-page a {
	display: inline-flex;
	align-items: center;
	gap: var(--ed-s2);
	min-height: 44px;
	font-family: var(--ed-serif);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--ed-ink);
	text-decoration: none;
}
body ul.default-wp-page a:hover {
	color: var(--ed-accent);
	text-decoration: underline;
}
body ul.default-wp-page .meta-nav svg {
	width: 16px;
	height: 16px;
	fill: var(--ed-accent);
	flex: none;
}
/* List pages: older-posts link as a quiet outlined button. */
body:not(.single) ul.default-wp-page a {
	font-family: var(--ed-sans);
	font-size: 15px;
	padding: 10px 20px;
	border: 1px solid var(--ed-ink);
	border-radius: 2px;
}
body:not(.single) ul.default-wp-page a:hover {
	background: var(--ed-ink);
	color: var(--ed-paper);
	text-decoration: none;
}
body.single ul.default-wp-page .previous::before,
body.single ul.default-wp-page .next::before {
	display: block;
	font-family: var(--ed-sans);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ed-muted);
	margin-bottom: var(--ed-s1);
}
body.single ul.default-wp-page .previous:not(:empty)::before { content: "Previous"; }
body.single ul.default-wp-page .next:not(:empty)::before { content: "Next"; }
body.single ul.default-wp-page .next {
	text-align: right;
}


/* ==========================================================================
   13. COMMENTS AND COMMENT FORM
   ========================================================================== */
body .comments-area {
	max-width: var(--ed-measure);
	margin: var(--ed-s7) auto 0;
	padding: 0;
	background: transparent;
	box-shadow: none;
}
body .comments-area .comments-title,
body .comments-area .comment-reply-title {
	font-family: var(--ed-serif);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--ed-ink);
	padding-top: var(--ed-s5);
	border-top: 2px solid var(--ed-ink);
	margin-bottom: var(--ed-s5);
}
body .comments-area .comment-list,
body .comments-area .comment-list .children {
	list-style: none;
	margin: 0;
	padding: 0;
}
body .comments-area .comment-list .children {
	padding-left: var(--ed-s5);
}
body .comments-area article.comment {
	padding: var(--ed-s4) 0;
	border-bottom: 1px solid var(--ed-rule);
	background: transparent;
	margin: 0;
}
body .comments-area .comment-meta {
	margin-bottom: var(--ed-s1);
}
/* ColorMag indents comments 60px to make room for avatars, which this
   site does not show: line everything up on the left instead. */
body .comments-area .comment-author {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 var(--ed-s3);
}
body .comments-area .comment-metadata,
body .comments-area .comment-content {
	margin-left: 0;
	margin-top: 0;
}
body .comments-area .comment-content > :last-child {
	margin-bottom: 0;
}
body .comments-area .comment-author .fn,
body .comments-area .comment-author .fn a {
	font-family: var(--ed-sans);
	font-size: 15px;
	font-weight: 700;
	color: var(--ed-ink);
	text-decoration: none;
}
body .comments-area .comment-metadata,
body .comments-area .comment-metadata a,
body .comments-area .comment-date-time {
	font-family: var(--ed-sans);
	font-size: var(--ed-size-meta);
	color: var(--ed-muted);
	display: inline-flex;
	gap: var(--ed-s3);
	align-items: center;
}
body .comments-area .comment-metadata svg {
	display: none;
}
body .comments-area .comment-content p {
	font-family: var(--ed-sans);
	font-size: 16px;
	line-height: 1.6;
	color: var(--ed-text);
	margin-bottom: 0.8em;
	overflow-wrap: anywhere;
}
body .comments-area .comment-list li {
	margin: 0;
	padding: 0;
}
body .comments-area .comment-content {
	margin-bottom: 0;
}
body .comments-area .comment-content p:last-of-type {
	margin-bottom: 0;
}
body .comments-area .comment-reply-link {
	font-family: var(--ed-sans);
	font-size: var(--ed-size-meta);
	font-weight: 700;
	color: var(--ed-accent);
	text-decoration: none;
	display: inline-block;
	margin-top: var(--ed-s2);
	padding: 6px 0;
}
/* Form fields */
body .comment-form label {
	display: block;
	font-family: var(--ed-sans);
	font-size: 14px;
	font-weight: 600;
	color: var(--ed-ink);
	margin-bottom: var(--ed-s1);
}
body .comment-form .comment-notes {
	font-size: 14px;
	color: var(--ed-muted);
}
body .comment-form input[type="text"],
body .comment-form input[type="email"],
body .comment-form input[type="url"],
body .comment-form textarea {
	width: 100%;
	box-sizing: border-box;
	background: var(--ed-surface);
	border: 1px solid var(--ed-field);
	border-radius: 2px;
	padding: 10px 12px;
	font-family: var(--ed-sans);
	font-size: 16px;
	color: var(--ed-ink);
}
body .comment-form input:focus,
body .comment-form textarea:focus {
	border-color: var(--ed-accent);
	outline: 2px solid var(--ed-accent);
	outline-offset: 0;
}
body .comment-form input[type="submit"] {
	background: var(--ed-ink);
	color: var(--ed-paper);
	border: 0;
	border-radius: 2px;
	padding: 12px 24px;
	min-height: 44px;
	font-family: var(--ed-sans);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}
body .comment-form input[type="submit"]:hover {
	background: var(--ed-accent);
}


/* ==========================================================================
   14. FOOTER AND BACK-TO-TOP BUTTON
   ========================================================================== */
body .cm-footer-builder .cm-footer-bottom-row {
	background: var(--ed-paper);
	color: var(--ed-muted);
	border-top: 2px solid var(--ed-ink);
	padding-top: var(--ed-s5);
	padding-bottom: var(--ed-s6);
}
body .cm-footer-builder .cm-footer-bottom-row .cm-copyright {
	font-family: var(--ed-sans);
	font-size: 13px;
	color: var(--ed-muted);
}
body .cm-footer-builder .cm-footer-bottom-row a {
	color: var(--ed-ink);
	text-decoration: underline;
	text-decoration-color: var(--ed-rule);
}
body .cm-footer-builder .cm-footer-bottom-row a:hover {
	color: var(--ed-accent);
}
body a#scroll-up i {
	background: var(--ed-ink);
	border-radius: 2px;
}


/* ==========================================================================
   15. PHONE AND TABLET ADJUSTMENTS
   ========================================================================== */

/* Tablet: 2 columns, lead story full width. */
@media (max-width: 1099px) {
	body .cm-posts.cm-layout-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	body .cm-posts.cm-layout-2-style-1 .post:first-child {
		grid-column: 1 / -1;
		grid-row: auto;
	}
	body .cm-posts.cm-layout-2-style-1 .post:nth-child(2) {
		border-top: 1px solid var(--ed-rule);
	}
	body .cm-posts.cm-layout-2-style-1 .post:nth-child(2) .cm-entry-summary,
	body .cm-posts.cm-layout-2-style-1 .post:nth-child(3) .cm-entry-summary {
		display: block;
	}
}

/* Header rows: ColorMag swaps to its phone header at 768px. */
@media (max-width: 768px) {
	body .cm-header-builder .cm-header-main-row {
		padding-top: var(--ed-s5);
		padding-bottom: var(--ed-s3);
	}
	body .cm-header-builder .cm-site-title {
		max-width: 16em;
		margin: 0 auto;
	}
	/* Empty side columns pushed the title off-centre on phones. */
	body .cm-header-builder .cm-mobile-row .cm-header-left-col:empty,
	body .cm-header-builder .cm-mobile-row .cm-header-right-col:empty,
	body .cm-header-builder .cm-mobile-row .cm-header-center-col:empty {
		display: none;
	}
	body .cm-header-builder .cm-mobile-row .cm-header-center-col {
		flex: 1;
	}
	body .cm-header-builder .cm-mobile-row .cm-header-bottom-row .cm-bottom-row {
		justify-content: center;
	}
	body .cm-header-builder .cm-mobile-row .cm-header-bottom-row .cm-header-left-col {
		align-items: center;
	}
	body #cm-content.cm-content {
		padding-top: var(--ed-s5);
	}
}

/* Phone: one column. Lead story keeps its big picture; the rest become a
   compact list (headline left, small picture right) for fast skimming. */
@media (max-width: 699px) {
	body .cm-posts.cm-layout-2 {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 0;
	}
	body .cm-posts.cm-layout-2 .post {
		padding: var(--ed-s4) 0;
	}
	body .cm-posts.cm-layout-2 .post:not(:first-child) .cm-post-content {
		grid-template-columns: minmax(0, 1fr) 112px;
		grid-template-areas:
			"title img"
			"cats  img"
			"meta  img";
		column-gap: var(--ed-s4);
	}
	body .cm-posts.cm-layout-2 .post:not(:first-child) .cm-featured-image {
		margin: 4px 0 0;
	}
	body .cm-posts.cm-layout-2 .post:not(:first-child) .cm-entry-summary {
		display: none;
	}
	body .cm-posts.cm-layout-2 .post:not(:first-child) .cm-entry-title {
		font-size: 17px;
		line-height: 1.3;
	}
	body .cm-posts.cm-layout-2-style-1 .post:first-child {
		padding-top: 0;
		border-top: 0;
	}
	body .cm-posts.cm-layout-2-style-1 .post:first-child .cm-featured-image {
		margin-left: calc(-1 * var(--ed-gutter));
		margin-right: calc(-1 * var(--ed-gutter));
	}
	body .cm-posts.cm-layout-2 .post:not(.has-post-thumbnail) .cm-entry-title {
		font-size: 19px;
	}

	body.single .cm-entry-summary,
	body.single .cm-entry-summary p,
	body.single .cm-entry-summary li {
		font-size: 17px;
	}
	body.single .cm-entry-summary h2 { font-size: 24px; }
	body.single .cm-entry-summary h3 { font-size: 20px; }

	/* Single posts on phone: video and picture run edge to edge. */
	body.single .cm-entry-summary iframe[src*="youtube.com"],
	body.single .cm-entry-summary iframe[src*="youtube-nocookie.com"],
	body.single .cm-entry-summary iframe[src*="youtu.be"],
	body.single .cm-entry-summary iframe[src*="player.vimeo.com"] {
		--ed-video-w: calc(100% + 2 * var(--ed-gutter));
	}
	body.single .cm-post-content > .cm-featured-image {
		margin-bottom: var(--ed-s6);
		width: calc(100% + 2 * var(--ed-gutter));
		max-width: none;
		margin-left: calc(-1 * var(--ed-gutter));
		margin-right: calc(-1 * var(--ed-gutter));
	}

	body ul.default-wp-page {
		flex-direction: column;
	}
	body.single ul.default-wp-page .next {
		text-align: left;
	}
}

/* Respect "reduce motion" settings. */
@media (prefers-reduced-motion: reduce) {
	body .cm-posts.cm-layout-2 .cm-featured-image img {
		transition: none;
	}
	body .cm-posts.cm-layout-2 .post:hover .cm-featured-image img {
		transform: none;
	}
}

/* ==========================================================================
   99. GUARD AGAINST COLORMAG'S CUSTOMIZER COLOURS
   ColorMag prints its own colour CSS (primary blue #257BC1, dark menu bar
   #27272A) after this file, with long selectors that can beat the rules
   above. It always does so in the Customizer preview, and may on the live
   site once any ColorMag colour setting is saved. The ids below (#cm-masthead,
   #cm-content) are doubled on purpose so these rules always win.
   ========================================================================== */
#cm-masthead#cm-masthead .cm-header-bottom-row {
	background: var(--ed-paper);
}
#cm-masthead#cm-masthead .cm-header-bottom-row .cm-container,
#cm-masthead#cm-masthead .cm-header-bottom-row .cm-bottom-row,
#cm-masthead#cm-masthead #cm-primary-nav,
#cm-masthead#cm-masthead .cm-primary-nav ul li,
#cm-masthead#cm-masthead .cm-primary-nav ul li:hover,
#cm-masthead#cm-masthead .cm-primary-nav ul li.focus,
#cm-masthead#cm-masthead .cm-primary-nav ul li.current-menu-item,
#cm-masthead#cm-masthead .cm-primary-nav ul li.current_page_item,
#cm-masthead#cm-masthead .cm-primary-nav ul li.current-menu-ancestor,
#cm-masthead#cm-masthead .cm-primary-nav ul li.current_page_ancestor,
#cm-masthead#cm-masthead .cm-home-icon.front_page_on {
	background: transparent;
}
#cm-masthead#cm-masthead .cm-primary-nav ul li ul li,
#cm-masthead#cm-masthead .cm-primary-nav ul li ul li:hover {
	background: var(--ed-surface);
}
#cm-masthead#cm-masthead .cm-primary-nav a {
	color: var(--ed-ink);
}
#cm-masthead#cm-masthead .cm-primary-nav li.current-menu-item > a,
#cm-masthead#cm-masthead .cm-primary-nav li.current_page_item > a,
#cm-masthead#cm-masthead .cm-primary-nav li > a:hover {
	color: var(--ed-accent);
}
#cm-masthead#cm-masthead .cm-site-title a {
	color: var(--ed-ink);
}
#cm-content#cm-content .cm-post-categories a,
#cm-content#cm-content .cm-post-categories a:hover {
	background: none;
	color: var(--ed-accent);
}
#cm-content#cm-content .cm-post-categories a:hover {
	color: var(--ed-accent-dark);
}
#cm-masthead#cm-masthead .cm-header-bottom-row {
	border-top-color: var(--ed-rule-strong);
}
#cm-footer#cm-footer .cm-footer-bottom-row a {
	color: var(--ed-ink);
}
#cm-footer#cm-footer .cm-footer-bottom-row a:hover {
	color: var(--ed-accent);
}
html body a.skip-link.screen-reader-text {
	color: var(--ed-ink);
}
/* Same guard for ColorMag's default fonts (menu in capitals, thin title). */
#cm-masthead#cm-masthead .cm-site-title,
#cm-masthead#cm-masthead .cm-site-title a {
	font-family: var(--ed-serif);
	font-size: var(--ed-size-masthead);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-transform: none;
}
#cm-masthead#cm-masthead .cm-primary-nav a {
	font-family: var(--ed-sans);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: none;
}
/* Same guard for the phone menu panel (ColorMag default: dark #27272A panel,
   blue current row, near-black text = unreadable). Found live 2026-12-04. */
#cm-masthead#cm-masthead .cm-mobile-nav,
#cm-masthead#cm-masthead .cm-mobile-nav .cm-mobile-header-row,
#cm-masthead#cm-masthead .cm-mobile-nav ul {
	background: var(--ed-surface);
}
#cm-masthead#cm-masthead .cm-mobile-nav li,
#cm-masthead#cm-masthead .cm-mobile-nav li:hover,
#cm-masthead#cm-masthead .cm-mobile-nav li.current-menu-item,
#cm-masthead#cm-masthead .cm-mobile-nav li.current_page_item,
#cm-masthead#cm-masthead .cm-mobile-nav li.current-menu-ancestor,
#cm-masthead#cm-masthead .cm-mobile-nav li.current-page-ancestor {
	background: transparent;
	border-color: var(--ed-rule);
}
#cm-masthead#cm-masthead .cm-mobile-nav li a {
	color: var(--ed-ink);
}
#cm-masthead#cm-masthead .cm-mobile-nav li.current-menu-item > a,
#cm-masthead#cm-masthead .cm-mobile-nav li.current_page_item > a,
#cm-masthead#cm-masthead .cm-mobile-nav li > a:hover {
	color: var(--ed-accent);
}
