/*
Theme Name: Hearthside
Theme URI: https://mindrift.online/
Description: Fast, ad-ready storytelling theme with large readable type and paged stories (Next Page button).
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: hearthside
*/

:root {
	--bg: #fbf8f3;
	--surface: #ffffff;
	--text: #1d1b18;
	--muted: #5c564d;
	--line: #e6dfd3;
	--accent: #a3261c;
	--accent-ink: #ffffff;
	--accent-soft: #f6e7e4;
	--radius: 14px;
	--measure: 700px;
	--fs-body: 20px;
	--serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html.hs-large { --fs-body: 23px; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 18px;
	line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.screen-reader-text, .skip-link:not(:focus) {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: #fff; padding: 8px 14px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: var(--measure); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 26px; color: var(--text); text-decoration: none; letter-spacing: -0.3px; }
.brand span { color: var(--accent); }
.text-size {
	border: 2px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px;
	font: 700 16px var(--sans); padding: 6px 14px; cursor: pointer; min-height: 40px;
}
.cat-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.cat-nav ul { list-style: none; margin: 0; padding: 0 16px; display: flex; gap: 6px; overflow-x: auto; max-width: 1120px; margin: 0 auto; scrollbar-width: none; }
.cat-nav a { display: block; white-space: nowrap; padding: 12px 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 16px; }
.cat-nav a:hover, .cat-nav .current-cat a { color: var(--accent); }

/* Ads */
.ad { margin: 32px auto; text-align: center; min-height: 0; overflow: hidden; }
.ad-label { display: block; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad-placeholder { border: 2px dashed var(--line); color: var(--muted); padding: 22px; font-size: 14px; border-radius: 10px; }

/* Cards / grid */
.section-title { font-family: var(--serif); font-size: 28px; margin: 36px 0 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card a { text-decoration: none; color: inherit; }
.card-img { aspect-ratio: 16 / 9; background: var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 20px; }
.card-cat { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--accent); }
.card-title { font-family: var(--serif); font-size: 22px; line-height: 1.3; margin: 6px 0 8px; }
.card-excerpt { color: var(--muted); font-size: 17px; margin: 0; }
.hero { margin-top: 28px; }
.hero > a { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; }
.hero .card-title { font-size: 32px; }
.hero .card-body { padding: 28px; }
@media (max-width: 760px) {
	.hero > a { grid-template-columns: 1fr; }
	.hero .card-title { font-size: 26px; }
	.hero .card-body { padding: 18px; }
}

/* Story */
.story-head { padding-top: 28px; }
.crumb { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.crumb a { text-decoration: none; }
.story-title { font-family: var(--serif); font-size: clamp(30px, 6vw, 44px); line-height: 1.18; margin: 10px 0 12px; letter-spacing: -0.4px; }
.story-meta { color: var(--muted); font-size: 16px; margin-bottom: 20px; }
.story-figure { margin: 0 0 8px; }
.story-figure img { width: 100%; border-radius: var(--radius); }
.part-badge { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px; padding: 6px 14px; border-radius: 999px; margin: 18px 0 4px; }
.story-body { font-family: var(--serif); font-size: var(--fs-body); line-height: 1.75; }
.story-body p { margin: 0 0 1.15em; }
.story-body h2, .story-body h3 { font-family: var(--serif); line-height: 1.3; margin: 1.6em 0 .6em; }
.story-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--accent); color: var(--muted); font-style: italic; }
.story-body figure { margin: 1.6em 0; }
.story-body figure img { border-radius: var(--radius); }
.story-body .lead { font-size: 1.08em; font-style: italic; color: var(--muted); }

/* Pager */
.pager { margin: 36px 0 12px; text-align: center; }
.pager-count { color: var(--muted); font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.next-teaser { font-family: var(--serif); font-style: italic; font-size: 20px; margin: 0 0 14px; }
.next-btn {
	display: flex; align-items: center; justify-content: center; gap: 10px;
	width: 100%; min-height: 68px; padding: 16px 24px; border-radius: var(--radius);
	background: var(--accent); color: var(--accent-ink); text-decoration: none;
	font: 800 24px/1.2 var(--sans); letter-spacing: .5px; text-transform: uppercase;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
}
.next-btn:hover { filter: brightness(1.08); }
.next-btn .arrow { font-size: 28px; }
.prev-link { display: inline-block; margin-top: 18px; font-size: 17px; font-weight: 600; color: var(--muted); }
.page-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.page-dots a, .page-dots span { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 700; color: var(--text); }
.page-dots span { background: var(--text); color: var(--bg); border-color: var(--text); }
.the-end { font-family: var(--serif); font-size: 26px; text-align: center; margin: 36px 0 8px; letter-spacing: 2px; }
.fiction-note { font-size: 15px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 28px; font-style: italic; }

/* Pages & misc */
.page-body { font-size: 19px; line-height: 1.7; padding-bottom: 40px; }
.page-body h1 { font-family: var(--serif); font-size: 38px; line-height: 1.2; }
.pagination { display: flex; gap: 8px; justify-content: center; margin: 40px 0; flex-wrap: wrap; }
.pagination .page-numbers { min-width: 46px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none; font-weight: 700; color: var(--text); }
.pagination .current { background: var(--text); color: var(--bg); }
.hs-form label { display: block; font-weight: 700; margin: 16px 0 6px; }
.hs-form input, .hs-form textarea { width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); }
.hs-form button { margin-top: 18px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 14px 28px; font: 700 18px var(--sans); cursor: pointer; }
.hs-hp { position: absolute; left: -9999px; }
.notice { padding: 14px 16px; border-radius: 10px; background: var(--accent-soft); margin: 16px 0; }

/* Footer */
.site-footer { margin-top: 56px; background: #1d1b18; color: #e9e3d8; padding: 36px 0 28px; font-size: 16px; }
.site-footer a { color: #fff; }
.footer-links { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-note { color: #b9b1a4; font-size: 14px; margin: 8px 0 0; }
