/*
Theme Name: Lectio
Theme URI: https://example.com/lectio
Author: Lukas Darling
Description: A minimalist serif blog for lectionary musings and commentary. Built-in church-year tags (Episcopal use of the Revised Common Lectionary), a readings box with a highlighted focus reading, an editable masthead, and a dark-mode toggle.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.9
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: lectio
Tags: blog, one-column, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ---------- Colors (light is default; dark via the toggle) ---------- */
:root,
[data-theme="light"] {
	--bg: #ffffff;
	--text: #1c1b19;
	--muted: #5f5b54;
	--rule: #e7e4de;
	--accent: #7a2a2a;
	--accent-hover: #5a1c1c;
	--chip: #f5f3ef;
	color-scheme: light;
}
[data-theme="dark"] {
	--bg: #151413;
	--text: #ebe7e0;
	--muted: #a8a299;
	--rule: #2f2c29;
	--accent: #e3a597;
	--accent-hover: #f0c2b7;
	--chip: #201e1c;
	color-scheme: dark;
}

:root {
	--display: "EB Garamond", Georgia, "Times New Roman", serif;
	--body: "Source Serif 4", Georgia, "Times New Roman", serif;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--body);
	font-size: 18px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	transition: background-color 0.2s, color 0.2s;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	top: 8px; left: 8px; z-index: 100;
	padding: 8px 14px;
	background: var(--text); color: var(--bg);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
	padding-top: 56px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.masthead { display: flex; flex-direction: column; gap: 4px; }
.masthead-title {
	font-family: var(--display);
	font-size: 32px;
	line-height: 1.1;
	color: var(--text);
	text-decoration: none;
}
.masthead-title:hover { color: var(--text); }
.masthead-tagline { font-style: italic; font-size: 15px; color: var(--muted); }

.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 22px; font-size: 16px; }
.site-nav .menu a { color: var(--muted); text-decoration: none; }
.site-nav .menu a:hover { color: var(--text); }
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
	color: var(--text);
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-color: var(--accent);
}

.theme-toggle {
	width: 44px; height: 44px;
	display: inline-flex; align-items: center; justify-content: center;
	padding: 0;
	background: transparent;
	border: 1px solid var(--rule);
	border-radius: 999px;
	color: var(--text);
	cursor: pointer;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Shared bits ---------- */
.meta {
	display: flex; flex-wrap: wrap; align-items: center;
	gap: 8px 16px;
	font-size: 13px;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--muted);
}
.meta .kind { color: var(--accent); }

.label {
	margin: 0;
	font-family: var(--body);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--muted);
}

.chip {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 5px 12px;
	border: 1px solid var(--rule);
	border-radius: 999px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--muted);
	text-decoration: none;
}
a.chip:hover { color: var(--text); border-color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
	display: inline-flex; align-items: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--rule);
	border-radius: 999px;
	font-size: 15px;
	color: var(--muted);
	text-decoration: none;
}
.pill:hover { color: var(--text); border-color: var(--muted); }
.pill.is-active,
.pill.is-active:hover { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- Home / feed ---------- */
.site-main { padding-bottom: 24px; }

.this-sunday {
	margin: 48px 0 0;
	padding: 14px 18px;
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
	background: var(--chip);
	border-radius: 6px;
	font-size: 15px;
	color: var(--muted);
}
.this-sunday .dot { width: 9px; height: 9px; }
.this-sunday em { color: var(--text); }

.site-main > .pills { margin-top: 40px; }
.archive-header { margin-top: 72px; }
.archive-header + .pills { margin-top: 28px; }
.archive-description { color: var(--muted); }

.feed { margin-top: 24px; }
.entry { padding: 40px 0; border-top: 1px solid var(--rule); }
.entry-title {
	margin: 12px 0 0;
	font-family: var(--display);
	font-weight: 500;
	font-size: 36px;
	line-height: 1.15;
}
.entry-title a { color: var(--text); text-decoration: none; }
.entry-title a:hover { color: var(--accent); }
.refs { margin: 10px 0 0; font-style: italic; font-size: 16px; line-height: 1.5; color: var(--muted); }
.excerpt { font-size: 19px; line-height: 1.7; margin-top: 18px; }
.excerpt p { margin: 0; }
.entry-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.entry-foot .more { margin-left: auto; font-size: 15px; }

.pagination {
	display: flex; justify-content: space-between; gap: 16px;
	padding: 32px 0;
	border-top: 1px solid var(--rule);
	font-size: 16px;
}
.empty { padding: 40px 0; border-top: 1px solid var(--rule); color: var(--muted); }

/* ---------- Single post ---------- */
.post-header .meta { margin-top: 72px; }
.post-title {
	margin: 16px 0 0;
	font-family: var(--display);
	font-weight: 500;
	font-size: 56px;
	line-height: 1.08;
}
.day-name { margin: 14px 0 0; font-family: var(--display); font-style: italic; font-size: 22px; color: var(--muted); }

.readings {
	margin-top: 40px;
	padding: 24px 28px;
	background: var(--chip);
	border-radius: 6px;
}
.readings ul {
	list-style: none;
	margin: 14px 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 16px;
	font-size: 17px;
}
.readings li {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 6px 10px;
	padding: 10px 14px;
	border: 1px solid transparent;
	border-radius: 4px;
}
.readings .slot { color: var(--muted); }
.readings li.is-focus { border-color: var(--accent); background: var(--bg); }
.readings li.is-focus .ref { font-weight: 600; }
.focus-label { font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); }

.focus-reading {
	margin-top: 32px;
	padding: 4px 0 4px 28px;
	border-left: 2px solid var(--accent);
}
.focus-reading summary {
	list-style: none;
	display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
	gap: 8px 16px;
	cursor: pointer;
}
.focus-reading summary::-webkit-details-marker { display: none; }
.focus-title { font-family: var(--display); font-size: 26px; font-weight: 500; }
.focus-title .muted { color: var(--muted); }
.toggle-text {
	display: inline-flex; align-items: center;
	min-height: 44px;
	font-size: 15px;
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 4px;
}
.focus-reading .when-closed,
.focus-reading[open] .when-open { display: inline; }
.focus-reading .when-open,
.focus-reading[open] .when-closed { display: none; }
.reading-text {
	margin-top: 14px;
	font-family: var(--display);
	font-size: 21px;
	line-height: 1.6;
}
.reading-text p { margin: 0 0 14px; white-space: pre-wrap; }
.reading-text .verse {
	font-family: var(--body);
	font-size: 12px;
	color: var(--muted);
	margin-right: 2px;
}
.translation { margin: 6px 0 0; font-size: 14px; font-style: italic; color: var(--muted); }

.post-image { margin: 40px 0 0; }

.post-content { margin-top: 44px; font-size: 20px; line-height: 1.75; }
.post-content > * { margin: 0 0 26px; }
.post-content h2,
.post-content h3 { font-family: var(--display); font-weight: 500; line-height: 1.2; margin-top: 44px; }
.post-content h2 { font-size: 32px; }
.post-content h3 { font-size: 26px; }
.post-content blockquote,
.post-content .wp-block-quote,
.post-content .wp-block-pullquote {
	margin: 36px 0;
	padding: 0;
	border: 0;
	font-family: var(--display);
	font-style: italic;
	font-size: 28px;
	line-height: 1.35;
	text-align: left;
}
.post-content blockquote p { margin: 0; }
.post-content blockquote cite,
.post-content .wp-block-quote cite {
	display: block;
	margin-top: 8px;
	font-family: var(--body);
	font-style: normal;
	font-size: 15px;
	color: var(--muted);
}
.post-content hr { border: 0; border-top: 1px solid var(--rule); margin: 44px 0; }
.post-content figcaption { font-size: 15px; color: var(--muted); }

.post-tags {
	margin-top: 40px;
	padding-top: 28px;
	border-top: 1px solid var(--rule);
	display: flex; flex-wrap: wrap; gap: 8px;
}

.post-nav {
	margin-top: 48px;
	padding: 32px 0;
	border-top: 1px solid var(--rule);
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}
.post-nav a { display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; }
.post-nav .next { text-align: right; }
.post-nav .label { font-size: 13px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.post-nav .title { font-family: var(--display); font-size: 22px; }
.post-nav a:hover .title { color: var(--accent); }

/* ---------- Pages ---------- */
.page-title {
	margin: 72px 0 0;
	font-family: var(--display);
	font-weight: 500;
	font-size: 52px;
	line-height: 1.1;
}
.page-body.has-portrait { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 36px; margin-top: 40px; }
.page-body.has-portrait .post-content { flex: 1 1 320px; min-width: 0; margin-top: 0; }
.portrait { flex: 0 0 180px; margin: 0; }
.portrait img { width: 180px; height: 220px; object-fit: cover; border-radius: 4px; display: block; }

/* ---------- Church Year archive ---------- */
.church-year .intro { font-size: 19px; color: var(--muted); margin-top: 12px; }
.church-year .intro p { margin: 0; }
.cy-section { margin-top: 48px; }
.cy-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.season { padding: 24px 0; border-top: 1px solid var(--rule); }
.season h3 {
	margin: 0;
	display: flex; align-items: center; gap: 10px;
	font-family: var(--display);
	font-weight: 500;
	font-size: 26px;
}
.season h3 .dot { width: 10px; height: 10px; }
.days { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.days .chip { font-size: 14px; }
.chip.is-written { background: var(--chip); border-color: var(--muted); color: var(--text); }
.chip .count { font-size: 12px; color: var(--muted); }
.note { font-size: 14px; font-style: italic; color: var(--muted); }
.commentary-section { margin-top: 56px; }
.commentary-section .label { margin-bottom: 8px; }
.month {
	padding: 20px 0;
	border-top: 1px solid var(--rule);
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
}
.month-name { font-family: var(--display); font-size: 22px; }
.month ul { list-style: none; margin: 0; padding: 0; text-align: right; font-size: 17px; }

/* ---------- Comments ---------- */
.comments { margin-top: 24px; padding-top: 32px; border-top: 1px solid var(--rule); }
.comment-list { list-style: none; margin: 16px 0 32px; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--rule); font-size: 17px; }
.comment-meta { font-size: 14px; color: var(--muted); }
.comment-meta a { color: var(--muted); }
.comment-form label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 12px;
	background: var(--bg);
	color: var(--text);
	border: 1px solid var(--rule);
	border-radius: 4px;
	font: inherit;
}
.comment-form .submit {
	min-height: 44px;
	padding: 0 22px;
	background: var(--text);
	color: var(--bg);
	border: 0;
	border-radius: 999px;
	font: inherit;
	font-size: 15px;
	cursor: pointer;
}

/* ---------- Footer ---------- */
.site-footer {
	padding-top: 32px;
	padding-bottom: 64px;
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
	font-size: 14px;
	color: var(--muted);
}
.site-footer a { color: var(--muted); }

/* ---------- Core block alignment ---------- */
.alignwide,
.alignfull { margin-left: 0; margin-right: 0; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.wp-caption-text { font-size: 15px; color: var(--muted); }

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
	.site-header { padding-top: 32px; }
	.masthead-title { font-size: 28px; }
	.entry-title { font-size: 30px; }
	.post-title { font-size: 40px; }
	.page-title { font-size: 40px; margin-top: 48px; }
	.post-header .meta { margin-top: 48px; }
	.readings { padding: 20px; }
	.readings ul { grid-template-columns: minmax(0, 1fr); }
	.focus-reading { padding-left: 18px; }
	.post-content { font-size: 19px; }
	.post-nav { grid-template-columns: minmax(0, 1fr); }
	.post-nav .next { text-align: left; }
	.month ul { text-align: left; }
}
