/* ===================================================================
   5. CONTENT COMPONENTS
================================================================== */

/* Content typography */
.content h1 {
	font-size: 2rem;
	margin: 0 0 1rem;
	font-weight: 900;
	line-height: 1.2;
}

.post-blurb {
	color: #665c54;
	/* fallback */
	color: var(--muted);
	font-style: italic;
	margin: 0.5rem 0 0;
	line-height: 1.5;
	font-size: 1rem !important;
	margin-top: -0.5rem !important;
}

.content h2 {
	font-size: 1.5rem;
	margin: 0 0 1rem;
	font-weight: 900;
}

/* Archive month headings */
.archive-month {
	margin-bottom: 3rem;
}

.archive-month-heading {
	font-size: 1.8rem;
	font-weight: 900;
	margin: 2.5rem 0 1.5rem 0;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid #458588;
	/* fallback */
	border-bottom: 2px solid var(--accent-secondary);
	color: #458588;
	/* fallback */
	color: var(--accent-secondary);
}

.archive-month:first-child .archive-month-heading {
	margin-top: 0;
}

/* Archive post list styling */
.archive-month .post-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.archive-month .post-list li {
	padding: 0.75rem 0;
	border-bottom: 1px solid #ebdbb2;
	/* fallback */
	border-bottom: 1px solid var(--border);
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
}

.archive-month .post-list li:last-child {
	border-bottom: none;
}

.archive-month .post-list li .u-url {
	color: #3c3836;
	/* fallback */
	color: var(--fg);
	text-decoration: underline;
	font-weight: 900;
	font-family: Avenir, Montserrat, Corbel, 'URW Gothic', source-sans-pro, sans-serif;
	font-size: 1.1rem;
	transition: color 0.2s ease;
	flex-basis: 100%;
}

.archive-month .post-list li .u-url:hover {
	color: #cc241d;
	/* fallback */
	color: var(--accent-primary);
}

.archive-month .post-list .separator {
	color: #665c54;
	/* fallback */
	color: var(--muted);
	user-select: none;
}

.archive-month .post-list .tag {
	color: #076678;
	/* fallback */
	color: var(--accent-secondary);
}

.archive-month .post-list .comment-count {
	color: #076678;
	/* fallback */
	color: var(--accent-secondary);
	text-decoration: none;
	font-weight: 500;
	transition: all 0.2s ease;
}

.archive-month .post-list .comment-count:hover {
	color: #458588;
	/* fallback */
	color: var(--accent-secondary-alt);
	text-decoration: underline;
}

.content p {
	text-align: justify;
	text-justify: inter-word;
}

.content article {
	padding-top: 1.5rem;
	margin-top: 2rem;
}

/* Post header */
.post-header {
	border-bottom: 3px solid #cc241d;
	/* fallback */
	border-bottom: 3px solid var(--accent-primary);
	padding-bottom: 2rem;
	margin-bottom: 2.5rem;
}

/* Reply context */
.reply-context {
	margin-bottom: 1.5rem;
	padding: 1rem;
	background: rgba(204, 36, 29, 0.05);
	/* fallback */
	background: rgba(var(--accent-primary-rgb), 0.05);
	border-left: 3px solid #cc241d;
	/* fallback */
	border-left: 3px solid var(--accent-primary);
	border-radius: 0 0.5rem 0.5rem 0;
}

.reply-context-notice {
	font-size: 0.875rem;
	color: #665c54;
	/* fallback */
	color: var(--muted);
	margin: 0 0 1rem 0;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.reply-context-notice a {
	color: #cc241d;
	/* fallback */
	color: var(--accent-primary);
	text-decoration: none;
	font-weight: 600;
}

.reply-context-notice a:hover {
	text-decoration: underline;
}

.reply-quote {
	margin: 0;
	padding-left: 1rem;
	border-left: 2px solid #d5c4a1;
	/* fallback */
	border-left: 2px solid var(--border);
	font-style: italic;
	color: #504945;
	/* fallback */
	color: var(--muted);
}

.reply-quote p {
	margin: 0 0 0.5rem 0;
}

.reply-quote footer {
	font-size: 0.875rem;
	color: #665c54;
	/* fallback */
	color: var(--muted);
	font-style: normal;
}

.post-header h1 {
	font-size: 2.5rem;
	line-height: 1.2;
	margin-bottom: 1.5rem;
	font-weight: 900;
	color: #3c3836;
	/* fallback */
	color: var(--fg);
}

.post-header .p-summary {
	font-size: 1.25rem;
	line-height: 1.5;
	color: #665c54;
	/* fallback */
	color: var(--muted);
	font-style: italic;
	margin-bottom: 1.5rem;
	max-width: 65ch;
}

/* Microformat visual enhancements */
.h-entry {
	position: relative;
}

.p-category {
	transition: all 0.2s ease;
}

.p-category:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Entry content */
.e-content {
	font-size: 1.125rem;
	line-height: 1.8;
	color: #3c3836;
	/* fallback */
	color: var(--fg);
	max-width: 80ch;
}

.e-content>p {
	margin: 1.5rem 0;
	text-align: left;
}

.e-content>p:first-of-type {
	font-size: 1.2rem;
	line-height: 1.7;
}

.e-content .drop-cap-word {
	font-size: 2.5rem;
	line-height: 1;
	font-weight: 900;
	color: #cc241d;
	/* fallback */
	color: var(--accent-primary);
	font-family: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
	margin-right: 0.15rem;
	margin-top: 0.15rem;
}

.e-content h2 {
	font-size: 1.875rem;
	margin: 3rem 0 1.25rem;
	font-weight: 900;
	color: #3c3836;
	/* fallback */
	color: var(--fg);
	border-left: 4px solid #cc241d;
	/* fallback */
	border-left: 4px solid var(--accent-primary);
	padding-left: 1rem;
}

.e-content h3 {
	font-size: 1.5rem;
	margin: 2.5rem 0 1rem;
	font-weight: 900;
	color: #3c3836;
	/* fallback */
	color: var(--fg);
}

.e-content h4 {
	font-size: 1.25rem;
	margin: 2rem 0 0.75rem;
	font-weight: 900;
	color: #665c54;
	/* fallback */
	color: var(--muted);
}

.e-content ul,
.e-content ol {
	margin: 1.5rem 0;
	padding-left: 2.5rem;
}

.e-content li {
	margin: 0.75rem 0;
	line-height: 1.7;
}

.e-content li::marker {
	color: #cc241d;
	/* fallback */
	color: var(--accent-primary);
	font-weight: 700;
}

/* Task list styling */
.e-content .task-list-item {
	list-style: none;
	padding-left: 0;
}

.e-content .task-list-item-checkbox {
	margin-right: 0.5rem;
	transform: translateY(2px);
}

.e-content .task-list-item input[type="checkbox"]:checked + label {
	color: #665c54;
	/* fallback */
	color: var(--muted);
	text-decoration: line-through;
}

.e-content .task-list-item input[type="checkbox"]:checked {
	accent-color: #98971a;
	/* fallback */
	accent-color: var(--accent-tertiary);
}

.e-content .task-list-item input[type="checkbox"]:not(:checked) {
	accent-color: #7c6f64;
	/* fallback */
	accent-color: var(--border);
}

/* Definition list styling */
.e-content dl {
	margin: 1.5rem 0;
}

.e-content dt {
	font-weight: 700;
	color: #3c3836;
	/* fallback */
	color: var(--fg);
	font-size: 1.1rem;
	margin: 1.5rem 0 0.5rem 0;
}

.e-content dd {
	margin: 0 0 1rem 0;
	padding-left: 1rem;
	border-left: 3px solid #076678;
	/* fallback */
	border-left: 3px solid var(--accent-secondary);
	color: #504945;
	/* fallback */
	color: var(--muted);
	line-height: 1.6;
}

.e-content dd:last-child {
	margin-bottom: 0;
}

.e-content blockquote {
	margin: 2rem 0;
	padding: 1.5rem 1.5rem 1.5rem 2rem;
	border-left: 4px solid #076678;
	/* fallback */
	border-left: 4px solid var(--accent-secondary);
	background: #f0f0f0;
	font-style: italic;
	color: #000000;
	font-size: 1.1em;
}

.e-content blockquote p {
	margin: 0.5rem 0;
}

.e-content code {
	padding: 0.2rem 0.4rem;
	background: #f9f5d7;
	/* fallback */
	background: var(--bg-alt);
	border: 1px solid #7c6f64;
	/* fallback */
	border: 1px solid var(--border);
	border-radius: 3px;
	font-size: 0.9em;
	font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
}

.e-content pre code {
	padding: 0;
	background: none;
	border: none;
}

/* Image captions within content */
.e-content p em:has(img) {
	display: block;
	text-align: center;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--muted);
	font-style: italic;
}

/* Alternative for browsers that don't support :has() */
.e-content p > img + em {
	display: block;
	text-align: center;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--muted);
	font-style: italic;
}

.e-content p > img {
	display: block;
	margin: 0 auto 0.5rem auto;
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

/* External link icon positioning for wrapped images */
.e-content p > a:has(img) {
	display: block;
	position: relative;
	text-align: center;
}

.e-content p > a:has(img)::after {
	position: absolute;
	bottom: 0.5rem;
	right: 0.5rem;
	background: rgba(60, 56, 54, 0.8);
	/* fallback */
	background: rgba(var(--fg-rgb), 0.8);
	color: #fbf1c7;
	/* fallback */
	color: var(--bg);
	padding: 0.2rem 0.3rem;
	border-radius: 3px;
	font-size: 0.7rem;
	line-height: 1;
}

/* Figure styling */
.e-content figure {
	text-align: center;
	margin: 2rem 0;
}

.e-content figure img {
	display: block;
	margin: 0 auto;
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

/* Dark mode image inversion for style page hero doodle */
:root.dark-mode img[src*="hero-doodle.png"],
.dark-mode img[src*="hero-doodle.png"] {
	filter: invert(1) hue-rotate(180deg);
}

/* Alternative for browsers that don't support :has() */
@media (prefers-color-scheme: dark) {
	:root:not(.light-mode) img[src*="hero-doodle.png"] {
		filter: invert(1) hue-rotate(180deg);
	}
}

/* Notes styling */
.note-content {
	font-size: 1.125rem;
	line-height: 1.8;
	color: #3c3836;
	/* fallback */
	color: var(--fg);
	max-width: 65ch;
}

.note-content .wikilink {
	color: #076678;
	/* fallback */
	color: var(--accent-secondary);
	text-decoration: none;
	border-bottom: 1px dotted #076678;
	/* fallback */
	border-bottom: 1px dotted var(--accent-secondary);
	transition: all 0.2s ease;
}

.note-content .wikilink:hover {
	color: #458588;
	/* fallback */
	color: var(--accent-secondary-alt);
	border-bottom-style: solid;
}

/* Poetry styling */
.poem-content {
	font-size: 1.25rem;
	line-height: 1.6;
	color: #3c3836;
	/* fallback */
	color: var(--fg);
	max-width: 50ch;
	margin: 0.5rem auto 1rem auto;
	font-family: 'Crimson Text', 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
}

.poem-content p {
	margin: 1rem 0;
	text-align: left;
	white-space: pre-wrap;
}

.poem-content p:first-child {
	margin-top: 0;
	text-indent: 0;
}

.poem-content p:last-child {
	margin-bottom: 0;
}

.poem {
	border-left: 3px solid #d79921;
	/* fallback */
	border-left: 3px solid var(--accent-tertiary);
	padding-left: 2rem;
}

/* Image Alt-Text Tooltips */
.image-tooltip {
	position: fixed;
	background: #3c3836;
	color: #fbf1c7;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.4;
	max-width: 300px;
	word-wrap: break-word;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	z-index: 1000;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	pointer-events: none;
}

.image-tooltip.visible {
	opacity: 0.95;
	visibility: visible;
}

/* Dark mode adjustments */
.dark-mode .image-tooltip {
	background: #ebdbb2;
	color: #282828;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Webring icon theme switching using CSS filter */
.webring-icon {
	filter: brightness(0) invert(1);
	transition: filter 0.3s ease;
}

:root:not(.dark-mode) .webring-icon {
	filter: brightness(0) invert(0);
}

@media (prefers-color-scheme: dark) {
	:root:not(.light-mode) .webring-icon {
		filter: brightness(0) invert(1);
	}
}

.content img {
	margin: 1.5rem 0;
}

.content img:only-child {
	margin: 1.5rem auto;
	display: block;
}

.about-author-figure {
	margin: 0 0 1.5rem 0;
	text-align: center;
}

.about-author-figure .about-author-image {
	display: block;
	max-width: min(720px, 100%);
	margin: 0 auto;
	border-radius: 0;
}

.about-author-figure .about-author-caption {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--muted);
}

.book-cover-figure {
	display: block;
	margin: 0.75rem auto 1.25rem;
	text-align: center;
	max-width: min(320px, 100%);
}

.book-cover-image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 auto;
	border-radius: 0;
}

.book-cover-caption {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--muted);
}

.post-graph {
	margin: 0 auto;
	max-width: 950px;
}

.post-hero-image {
	width: 100%;
	max-width: 100%;
	margin: 0 0 2rem 0;
	border-radius: 0;
	display: block;
}

.post-hero-caption {
	font-size: 0.875rem;
	color: var(--muted);
	font-style: italic;
	text-align: center;
	margin-top: 0.5rem;
}

figure {
	margin: 2rem 0;
}

.featured-image {
	margin: 0 0 2rem 0;
}

.featured-image img {
	display: block;
	width: 100%;
	max-height: 512px;
	object-fit: cover;
	border-radius: 0;
}

.featured-image figcaption {
	font-size: 0.9375rem;
	color: var(--muted);
	font-style: italic;
	text-align: center;
	margin-top: -0.75rem;
	padding: 0 1rem;
}

.featured-image figcaption p {
	margin: 0;
	text-align: center;
}

/* Only apply to content areas */
.e-content figcaption,
.content figcaption {
	font-size: 0.95rem;
	color: #504945;
	/* fallback */
	color: var(--text-secondary);
	font-style: italic;
	text-align: center;
	margin-top: 1rem;
	padding: 0 1rem;
}

/* Comment count styling */
.comment-count {
	color: #076678;
	/* fallback */
	color: var(--accent-secondary);
	text-decoration: none;
	font-weight: 500;
	transition: all 0.2s ease;
}

.comment-count:hover {
	color: #458588;
	/* fallback */
	color: var(--accent-secondary-alt);
	text-decoration: underline;
}
