/**
 * Theme-independent styles for legacy Soylent Red & Phry semantic markup.
 */

/* Soylent Red <dl class="dialogue"> speaker formatting */
.entry-content dl.dialogue {
	margin: 1.25em 1.5em;
}

.entry-content dl.dialogue dt {
	float: left;
	font-weight: 700;
	margin-right: 0.4em;
}

.entry-content dl.dialogue dt::after {
	content: ": ";
}

.entry-content dl.dialogue dd {
	margin: 0 0 0.6em 0;
}

.entry-content dl.dialogue dd::after {
	clear: both;
	content: "";
	display: table;
}

/* Soylent Red <p class="update"> callout box */
.entry-content p.update {
	background-color: rgba(128, 128, 128, 0.12);
	border: 1px solid rgba(128, 128, 128, 0.45);
	padding: 0.6em 0.9em;
}

.entry-content p.update ins {
	background: transparent;
	text-decoration: none;
}

/* Soylent Red <span class="url"> inline URL display */
.entry-content span.url {
	font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
	font-size: 0.9375em;
}

/* Soylent Red <code> annotations (<span class="comment"> and <ins>) */
.entry-content code .comment {
	color: #2f6f31;
}

@media (prefers-color-scheme: dark) {
	.entry-content code .comment {
		color: #7ec699;
	}
}

.entry-content code ins {
	background: transparent;
	font-weight: 700;
	text-decoration: none;
}

/* Soylent Red <pre class="poem"> proportional verse formatting */
.entry-content pre.poem {
	background: transparent;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	margin: 0;
	padding: 0;
}

/* Phry / early Soylent Red footnotes (<a class="footnote">, <p class="footnote">) */
.entry-content a.footnote {
	cursor: pointer;
	font-size: 0.8em;
	font-weight: 700;
	line-height: 0;
	padding: 0 0.1em;
	scroll-margin-top: 6em;
	vertical-align: super;
}

.entry-content a.footnote.is-active {
	color: #000;
}

@media (prefers-color-scheme: dark) {
	.entry-content a.footnote.is-active {
		color: #fff;
	}
}

.entry-content p.footnote {
	font-size: 0.85em;
	scroll-margin-top: 6em;
}

/* Anchored footnote popover (progressive enhancement) */
.roryparle-footnote-popover {
	--fn-arrow-x: 50%;
	--fn-bg: #fff;
	--fn-border: #c8c8c8;
	--fn-text: #222;
	background-color: var(--fn-bg);
	border: 1px solid var(--fn-border);
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	box-sizing: border-box;
	color: var(--fn-text);
	font-size: 0.875rem;
	line-height: 1.55;
	max-width: min(24rem, calc(100vw - 24px));
	padding: 0.75em 0.95em;
	position: absolute;
	z-index: 1100;
}

.roryparle-footnote-popover[hidden] {
	display: none;
}

@media (prefers-color-scheme: dark) {
	.roryparle-footnote-popover {
		--fn-bg: #2d2d2d;
		--fn-border: #5a5a5a;
		--fn-text: #eee;
		box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
	}
}

.roryparle-footnote-popover a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.roryparle-footnote-popover__arrow {
	background-color: var(--fn-bg);
	border-left: 1px solid var(--fn-border);
	border-top: 1px solid var(--fn-border);
	height: 10px;
	left: calc(var(--fn-arrow-x) - 5px);
	position: absolute;
	top: -6px;
	transform: rotate(45deg);
	width: 10px;
}

.roryparle-footnote-popover.is-above .roryparle-footnote-popover__arrow {
	border-bottom: 1px solid var(--fn-border);
	border-left: 0;
	border-right: 1px solid var(--fn-border);
	border-top: 0;
	bottom: -6px;
	top: auto;
}

/* Automatic notice for posts older than 3 years */
.roryparle-old-post-notice {
	background-color: rgba(128, 128, 128, 0.1);
	border-left: 3px solid rgba(160, 160, 160, 0.55);
	box-sizing: border-box;
	color: inherit;
	font-size: 0.9rem;
	font-style: italic;
	line-height: 1.5;
	margin: 0 0 2em 0;
	opacity: 0.88;
	padding: 0.65em 1em;
}

/* Proportional mobile scaling for embedded YouTube & Vimeo iframes */
.entry-content iframe[src*="youtube.com/embed/"],
.entry-content iframe[src*="player.vimeo.com/video/"] {
	aspect-ratio: 16 / 9;
	height: auto;
	max-width: 100%;
}

.entry-content iframe[width="425"],
.entry-content iframe[width="420"],
.entry-content iframe[width="400"][height="300"] {
	aspect-ratio: 4 / 3;
}

.entry-content iframe[width="400"][height="267"] {
	aspect-ratio: 3 / 2;
}

/* /archives/ directory shortcode ([roryparle_archives]) */
.roryparle-archives {
	--rp-chip-bg: rgba(0, 0, 0, 0.045);
	--rp-chip-bg-hover: rgba(0, 0, 0, 0.1);
	--rp-chip-border: rgba(0, 0, 0, 0.14);
	--rp-chip-border-hover: rgba(0, 0, 0, 0.35);
	--rp-divider: rgba(0, 0, 0, 0.1);
	--rp-muted: rgba(0, 0, 0, 0.52);
}

@media (prefers-color-scheme: dark) {
	.roryparle-archives {
		--rp-chip-bg: rgba(255, 255, 255, 0.07);
		--rp-chip-bg-hover: rgba(255, 255, 255, 0.15);
		--rp-chip-border: rgba(255, 255, 255, 0.16);
		--rp-chip-border-hover: rgba(255, 255, 255, 0.42);
		--rp-divider: rgba(255, 255, 255, 0.12);
		--rp-muted: rgba(255, 255, 255, 0.56);
	}
}

.roryparle-archives__section {
	margin: 0 0 2.5rem 0;
}

.roryparle-archives__section:last-child {
	margin-bottom: 0;
}

.roryparle-archives__section > h2 {
	font-size: 1.15rem;
	letter-spacing: 0.02em;
	margin: 0 0 0.85rem 0;
	padding: 0;
}

/* Search bar */
.roryparle-search-form {
	display: flex;
	gap: 0.5rem;
	margin: 0;
}

.roryparle-search-form .roryparle-search-form__input {
	flex: 1 1 auto;
	margin: 0;
	min-width: 0;
}

.roryparle-search-form .roryparle-search-form__submit {
	flex: 0 0 auto;
	margin: 0;
	padding-left: 1.25em;
	padding-right: 1.25em;
}

/* Category & Tag pill lists */
.entry-content .roryparle-pill-list,
.roryparle-pill-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.roryparle-pill-list--compact {
	gap: 0.35rem;
}

.roryparle-pill-list > li {
	margin: 0;
	padding: 0;
}

.entry-content .roryparle-archives a.roryparle-pill,
.roryparle-archives a.roryparle-pill {
	align-items: baseline;
	background-color: var(--rp-chip-bg);
	border: 1px solid var(--rp-chip-border);
	border-radius: 999px;
	box-shadow: none;
	color: inherit;
	display: inline-flex;
	font-size: 0.875rem;
	gap: 0.38em;
	line-height: 1.35;
	padding: 0.32em 0.75em;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.entry-content .roryparle-archives a.roryparle-pill:hover,
.entry-content .roryparle-archives a.roryparle-pill:focus,
.roryparle-archives a.roryparle-pill:hover,
.roryparle-archives a.roryparle-pill:focus {
	background-color: var(--rp-chip-bg-hover);
	border-color: var(--rp-chip-border-hover);
	box-shadow: none;
	color: inherit;
}

.roryparle-pill--tag {
	font-size: 0.825rem;
}

.roryparle-pill--tag::before {
	color: var(--rp-muted);
	content: "#";
	margin-right: -0.25em;
}

.roryparle-pill > small {
	color: var(--rp-muted);
	font-size: 0.78em;
	font-variant-numeric: tabular-nums;
}

/* Expandable full A-Z tag index */
.roryparle-all-tags {
	border-top: 1px solid var(--rp-divider);
	margin-top: 1rem;
	padding-top: 0.75rem;
}

.roryparle-all-tags > summary {
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.25rem 0;
	user-select: none;
}

.roryparle-all-tags__body {
	margin-top: 0.85rem;
}

.roryparle-tag-group {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin: 0 0 1rem 0;
}

@media screen and (min-width: 34em) {
	.roryparle-tag-group {
		align-items: flex-start;
		flex-direction: row;
		gap: 0.75rem;
	}
}

.roryparle-tag-group__letter {
	color: var(--rp-muted);
	flex: 0 0 2.25rem;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.9;
	margin: 0;
	padding: 0;
}

/* By Year & Month timeline matrix */
.roryparle-year-grid {
	border-top: 1px solid var(--rp-divider);
}

.roryparle-year-row {
	align-items: baseline;
	border-bottom: 1px solid var(--rp-divider);
	display: flex;
	gap: 0.75rem;
	padding: 0.55rem 0;
}

.roryparle-year-row__year {
	align-items: baseline;
	display: flex;
	flex: 0 0 4.75rem;
	font-variant-numeric: tabular-nums;
	gap: 0.35rem;
}

.entry-content .roryparle-year-row__year a,
.roryparle-year-row__year a {
	box-shadow: none;
	color: inherit;
	font-weight: 700;
	text-decoration: none;
}

.entry-content .roryparle-year-row__year a:hover,
.entry-content .roryparle-year-row__year a:focus,
.roryparle-year-row__year a:hover,
.roryparle-year-row__year a:focus {
	box-shadow: inset 0 -1px 0 currentColor;
	color: inherit;
}

.roryparle-year-row__count {
	color: var(--rp-muted);
	font-size: 0.78rem;
}

.roryparle-year-row__months {
	display: grid;
	flex: 1 1 auto;
	gap: 0.25rem;
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media screen and (min-width: 38em) {
	.roryparle-year-row__months {
		gap: 0.2rem;
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}
}

.entry-content .roryparle-archives .roryparle-month,
.roryparle-archives .roryparle-month {
	border-radius: 4px;
	box-shadow: none;
	display: block;
	font-size: 0.78rem;
	line-height: 1.5;
	padding: 0.18rem 0.1rem;
	text-align: center;
	text-decoration: none;
}

.entry-content .roryparle-archives a.roryparle-month.is-active,
.roryparle-archives a.roryparle-month.is-active {
	background-color: var(--rp-chip-bg);
	border: 1px solid var(--rp-chip-border);
	color: inherit;
	font-weight: 600;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.entry-content .roryparle-archives a.roryparle-month.is-active:hover,
.entry-content .roryparle-archives a.roryparle-month.is-active:focus,
.roryparle-archives a.roryparle-month.is-active:hover,
.roryparle-archives a.roryparle-month.is-active:focus {
	background-color: var(--rp-chip-bg-hover);
	border-color: var(--rp-chip-border-hover);
	box-shadow: none;
	color: inherit;
}

.roryparle-archives .roryparle-month.is-empty {
	border: 1px solid transparent;
	color: var(--rp-muted);
	opacity: 0.35;
}

/* Smart listing "Continue reading ->" link */
.entry-content p.roryparle-read-more {
	margin: 1.15em 0 0 0;
}

.entry-content a.roryparle-more-link {
	box-shadow: none;
	font-size: 0.925rem;
	font-weight: 600;
	text-decoration: none;
}

.entry-content a.roryparle-more-link:hover,
.entry-content a.roryparle-more-link:focus {
	box-shadow: inset 0 -1px 0 currentColor;
}

/* Single-post "Related posts" footer block */
.roryparle-related-posts {
	border-top: 1px solid rgba(128, 128, 128, 0.25);
	margin: 2.75rem 0 0.5rem 0;
	padding-top: 1.5rem;
}

.entry-content .roryparle-related-posts__heading,
.roryparle-related-posts__heading {
	color: inherit;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	margin: 0 0 0.75rem 0;
	opacity: 0.75;
	padding: 0;
	text-transform: uppercase;
}

.entry-content .roryparle-related-posts__list,
.roryparle-related-posts__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.roryparle-related-posts__list > li {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.6rem;
	justify-content: space-between;
	margin: 0 0 0.5rem 0;
	padding: 0;
}

.roryparle-related-posts__list > li:last-child {
	margin-bottom: 0;
}

.roryparle-related-posts__list time {
	font-size: 0.825rem;
	font-variant-numeric: tabular-nums;
	opacity: 0.62;
	white-space: nowrap;
}

/* <pre> code block card & non-destructive Copy button (preserves <span class="comment">, <ins>, <strong>) */
.entry-content .roryparle-code-wrap {
	margin: 0 0 1.5em 0;
	position: relative;
}

.entry-content .roryparle-code-wrap > pre {
	margin: 0;
}

.entry-content pre:not(.poem) {
	background-color: #f6f7f9;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 6px;
	box-sizing: border-box;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace;
	font-size: 0.875rem;
	line-height: 1.55;
	overflow-x: auto;
	padding: 1rem 1.15rem;
	tab-size: 4;
}

.entry-content .roryparle-code-wrap > pre:not(.poem) {
	padding-right: 4.5rem;
}

@media (prefers-color-scheme: dark) {
	.entry-content pre:not(.poem) {
		background-color: #1b1d21;
		border-color: rgba(255, 255, 255, 0.14);
	}
}

.entry-content pre:not(.poem) code {
	background: transparent;
	font-family: inherit;
	font-size: inherit;
	padding: 0;
}

.entry-content pre code ins {
	background-color: rgba(46, 160, 67, 0.15);
	border-radius: 3px;
	padding: 0.05em 0.2em;
}

@media (prefers-color-scheme: dark) {
	.entry-content pre code ins {
		background-color: rgba(63, 185, 80, 0.22);
	}
}

.entry-content .roryparle-copy-code {
	background-color: rgba(128, 128, 128, 0.14);
	border: 1px solid rgba(128, 128, 128, 0.3);
	border-radius: 4px;
	color: inherit;
	cursor: pointer;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.2;
	opacity: 0.78;
	padding: 0.32rem 0.6rem;
	position: absolute;
	right: 0.55rem;
	top: 0.55rem;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.entry-content .roryparle-copy-code:hover,
.entry-content .roryparle-copy-code:focus,
.entry-content .roryparle-copy-code.is-copied {
	background-color: rgba(128, 128, 128, 0.26);
	color: inherit;
	opacity: 1;
}

/* Click-to-zoom photo lightbox */
.entry-content img.roryparle-zoomable {
	cursor: zoom-in;
}

html.roryparle-lightbox-open {
	overflow: hidden;
}

.roryparle-lightbox {
	align-items: center;
	background-color: rgba(14, 16, 20, 0.92);
	box-sizing: border-box;
	cursor: zoom-out;
	display: flex;
	flex-direction: column;
	inset: 0;
	justify-content: center;
	padding: 2.5rem 1.25rem 1.5rem;
	position: fixed;
	z-index: 9999;
}

.roryparle-lightbox[hidden] {
	display: none;
}

.roryparle-lightbox__img {
	border-radius: 4px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
	max-height: 85vh;
	max-width: min(94vw, 1400px);
	object-fit: contain;
}

.roryparle-lightbox__caption {
	color: #d8dce3;
	font-size: 0.875rem;
	line-height: 1.45;
	margin-top: 0.75rem;
	max-width: 46rem;
	text-align: center;
}

.roryparle-lightbox__close {
	align-items: center;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	display: flex;
	font-size: 1.5rem;
	height: 2.4rem;
	justify-content: center;
	line-height: 1;
	padding: 0;
	position: absolute;
	right: 1rem;
	top: 1rem;
	width: 2.4rem;
}

.roryparle-lightbox__close:hover,
.roryparle-lightbox__close:focus {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
}
