/*
Theme Name: Pestwit
Theme URI: https://pestwit.com
Author: John P.
Description: Plain, fast block theme for pestwit.com. One reading column, self-hosted fonts, no JavaScript of its own.
Version: 0.3.6
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pestwit
*/

/* Everything that theme.json cannot express lives here. */

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

a { text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { text-wrap: balance; }

/* Site header */
.pestwit-site-header { padding-block: 1.1rem; }
.pestwit-site-header__in { gap: 0.5rem 2rem; }
.pestwit-brand { margin: 0; font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.2; }
.pestwit-brand a { color: #fff; text-decoration: none; }
.pestwit-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-family: var(--wp--preset--font-family--display); font-size: 0.95rem; }
.pestwit-nav a { color: rgba(255, 255, 255, 0.82); text-decoration: none; }
.pestwit-nav a:hover, .pestwit-nav .current-cat > a { color: #fff; text-decoration: underline; }
.pestwit-site-header a:focus-visible, .pestwit-site-footer a:focus-visible { outline-color: var(--wp--preset--color--mint); }

/* Site footer */
.pestwit-site-footer { padding-block: 2rem; font-family: var(--wp--preset--font-family--display); font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); text-align: center; }
.wp-site-blocks > footer { margin-block-start: 0; }
.pestwit-site-footer p { margin: 0; }
.pestwit-footer-links { justify-content: center; gap: 0.25rem 1.5rem; margin-bottom: 0.75rem; }
.pestwit-site-footer a { color: rgba(255, 255, 255, 0.88); text-decoration: none; }
.pestwit-site-footer a:hover { color: #fff; text-decoration: underline; }

/* Kicker: the category label above a title */
.pestwit-kicker { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin-block: 0 0.75rem; }
.pestwit-kicker a { text-decoration: none; }
.pestwit-kicker a:hover { text-decoration: underline; }

/* Byline */
.pestwit-byline { gap: 0.25rem 0.75rem; font-family: var(--wp--preset--font-family--display); font-size: 0.95rem; color: var(--wp--preset--color--muted); margin-block: 0 2rem; }
.pestwit-byline p, .pestwit-byline > div { margin: 0; }
.pestwit-byline .wp-block-post-author-name { color: var(--wp--preset--color--ink); font-weight: 700; }
.pestwit-byline > * + *::before { content: "\00b7"; margin-right: 0.75rem; }
.pestwit-byline .pestwit-updated time::before { content: "Updated "; }
.pestwit-avatar { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--wp--preset--color--accent); color: var(--wp--preset--color--surface); display: grid; place-items: center; margin: 0; font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 0.9rem; line-height: 1; }
.pestwit-byline .pestwit-avatar + *::before { content: none; }

/* Featured image */
.pestwit-featured { margin-block: 0 2.5rem; }
.pestwit-featured img { border-radius: 6px; }

/* Post body */
.wp-block-post-content > p:first-child { font-size: 1.3rem; line-height: 1.55; }
.wp-block-post-content :is(ul, ol) { padding-left: 1.4rem; }
.wp-block-post-content li + li { margin-top: 0.6rem; }
.wp-block-post-content li::marker { color: var(--wp--preset--color--accent); font-family: var(--wp--preset--font-family--display); font-weight: 700; }
.wp-block-post-content strong { font-weight: 600; }
.wp-block-post-content figcaption { font-family: var(--wp--preset--font-family--display); font-size: 0.85rem; color: var(--wp--preset--color--muted); }

/* Sources: small numbers in the text jump to the list at the end of the post */
.wp-block-post-content sup { font-size: 0.7em; line-height: 0; }
.wp-block-post-content sup a[href^="#source-"] { padding: 0.5em 0.2em; margin-inline: 0.05em -0.1em; font-family: var(--wp--preset--font-family--display); font-weight: 700; text-decoration: none; }
.wp-block-post-content sup a[href^="#source-"]:hover { text-decoration: underline; }
.pestwit-sources-title { font-size: 1.25rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--wp--preset--color--rule); }
.pestwit-sources { font-size: 1rem; line-height: 1.55; color: var(--wp--preset--color--muted); }
.pestwit-sources li { scroll-margin-top: 1.5rem; overflow-wrap: anywhere; }
.pestwit-sources li + li { margin-top: 0.4rem; }
.pestwit-sources li:target { color: var(--wp--preset--color--ink); background: var(--wp--preset--color--accent-soft); box-shadow: 0 0 0 0.35rem var(--wp--preset--color--accent-soft); border-radius: 2px; }

/* Disclaimer and author box */
.pestwit-disclaimer { margin-top: 3rem; padding: 1.25rem 1.5rem; border-left: 3px solid var(--wp--preset--color--accent); background: var(--wp--preset--color--surface); font-size: 1rem; line-height: 1.6; color: var(--wp--preset--color--muted); font-style: italic; }
.pestwit-disclaimer p { margin: 0; }
.pestwit-author { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--wp--preset--color--rule); gap: 1rem; align-items: flex-start; }
.pestwit-author .pestwit-avatar { width: 3.25rem; height: 3.25rem; font-size: 1.1rem; margin: 0; }
.pestwit-author h2 { font-size: 1.1rem; margin: 0 0 0.25rem; letter-spacing: 0; }
.pestwit-author p:not(.pestwit-avatar) { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--wp--preset--color--muted); }

/* Post lists: home, archives, related */
.pestwit-post-list .wp-block-post-template { gap: 2.5rem 2rem; }
.pestwit-related .wp-block-post-template { gap: 2rem 1.5rem; }
.pestwit-related .wp-block-post-title { font-size: 1.05rem; }
.pestwit-card .wp-block-post-featured-image { margin: 0 0 1rem; }
.pestwit-card .wp-block-post-featured-image img { border-radius: 6px; }
.pestwit-card .wp-block-post-title { margin: 0 0 0.5rem; }
.pestwit-card .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.pestwit-card .wp-block-post-title a:hover { color: var(--wp--preset--color--accent); text-decoration: underline; }
.pestwit-card .wp-block-post-excerpt { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--wp--preset--color--muted); }
.pestwit-card .wp-block-post-excerpt__excerpt { margin: 0; }
.pestwit-related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--wp--preset--color--rule); }
.pestwit-related > h2 { font-size: 1.25rem; margin: 0 0 1.5rem; }
.wp-block-query-pagination { margin-top: 3rem; font-family: var(--wp--preset--font-family--display); font-size: 0.95rem; }

/* Archive intro */
.pestwit-intro { margin-bottom: 2.5rem; }
.pestwit-intro h1 { margin: 0 0 0.75rem; }
.pestwit-intro p, .pestwit-intro .wp-block-term-description { margin: 0; color: var(--wp--preset--color--muted); }

/* Keep the footer at the bottom of the window on short pages */
.wp-site-blocks { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.wp-site-blocks > main { flex: 1 0 auto; }

/* Home, first page: the newest post leads, full width, image beside the text */
.home:not(.paged) .pestwit-post-list .wp-block-post-template > li:first-child { grid-column: 1 / -1; }
.home:not(.paged) .pestwit-post-list .wp-block-post-template > li:first-child .wp-block-post-title { font-size: clamp(1.5rem, 3.2vw, 2.1rem) !important; line-height: 1.12; margin-bottom: 0.75rem; }
.home:not(.paged) .pestwit-post-list .wp-block-post-template > li:first-child .wp-block-post-excerpt { font-size: 1.125rem; }
@media (min-width: 48rem) {
	.home:not(.paged) .pestwit-post-list .wp-block-post-template > li:first-child .pestwit-card:has(.wp-block-post-featured-image) {
		display: grid;
		grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
		grid-template-rows: 1fr auto auto auto 1fr;
		column-gap: 2.5rem;
		padding-bottom: 2.5rem;
		border-bottom: 1px solid var(--wp--preset--color--rule);
	}
	.home:not(.paged) .pestwit-post-list .wp-block-post-template > li:first-child .pestwit-card:has(.wp-block-post-featured-image) > * { grid-column: 2; }
	.home:not(.paged) .pestwit-post-list .wp-block-post-template > li:first-child .pestwit-card > .wp-block-post-featured-image { grid-column: 1; grid-row: 1 / -1; margin: 0; }
	.home:not(.paged) .pestwit-post-list .wp-block-post-template > li:first-child .pestwit-card > .wp-block-post-terms { grid-row: 2; }
	.home:not(.paged) .pestwit-post-list .wp-block-post-template > li:first-child .pestwit-card > .wp-block-post-title { grid-row: 3; }
	.home:not(.paged) .pestwit-post-list .wp-block-post-template > li:first-child .pestwit-card > .wp-block-post-excerpt { grid-row: 4; }
	.home:not(.paged) .pestwit-post-list .wp-block-post-template > li:only-child .pestwit-card:has(.wp-block-post-featured-image) { border-bottom: 0; padding-bottom: 0; }
}
