/* Hudelist – editorial theme. Tokens come from theme.json (--wp--preset--*). */

:root {
	--ink: var(--wp--preset--color--ink, #1d1b19);
	--paper: var(--wp--preset--color--paper, #faf7f2);
	--muted: var(--wp--preset--color--muted, #6b645c);
	--rule: var(--wp--preset--color--rule, #e4ddd2);
	--accent: var(--wp--preset--color--accent, #8a1c1c);
	--serif: var(--wp--preset--font-family--serif, Georgia, serif);
	--sans: var(--wp--preset--font-family--sans, system-ui, sans-serif);
	--gutter: clamp(1rem, 4vw, 2rem);
	--text: 40rem;
	--wide: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--serif);
	font-size: 1.125rem;
	line-height: 1.7;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: .5rem; z-index: 100; background: var(--ink); color: var(--paper); padding: .5rem 1rem; }
.skip-link:focus { left: .5rem; }

.wrap { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--text { max-width: calc(var(--text) + 2 * var(--gutter)); }

.eyebrow, .entry-meta, .section__more, .filters, .button, .site-tagline, .book-facts, .chapter-list__meta, .card__related, .primary-nav, .gallery-card__count {
	font-family: var(--sans);
}
.eyebrow { margin: 0 0 .5rem; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--accent); }
.entry-meta { margin: 0; font-size: .8125rem; color: var(--muted); }
.entry-meta a { color: inherit; }

.button {
	display: inline-block; padding: .65rem 1.25rem; border: 1px solid var(--ink); border-radius: 2px;
	background: var(--ink); color: var(--paper); font-size: .875rem; font-weight: 600; text-decoration: none;
	transition: background .15s, color .15s;
}
.button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.button--ghost { background: transparent; color: var(--ink); }
.link-arrow { font-family: var(--sans); font-size: .875rem; font-weight: 600; text-decoration: none; }

/* Header -------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.admin-bar .site-header { top: 32px; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.5rem; }
.site-title { font-size: 1.375rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.site-tagline { margin: 0; font-size: .75rem; color: var(--muted); }
.primary-nav { display: flex; align-items: center; gap: 1.25rem; }
.primary-nav .menu { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.primary-nav .menu a { display: block; padding: .25rem 0; font-size: .875rem; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
.primary-nav .menu a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a,
.primary-nav .current_page_parent > a { border-bottom-color: var(--accent); }
.header-search input { width: 9rem; padding: .4rem .6rem; border: 1px solid var(--rule); border-radius: 2px; background: #fff; font: inherit; font-size: .8125rem; }
.nav-toggle { display: none; }

@media (max-width: 960px) {
	.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border: 0; background: none; cursor: pointer; }
	.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after { content: ""; display: block; width: 1.4rem; height: 2px; background: var(--ink); position: relative; transition: transform .2s; }
	.nav-toggle__bar::before { position: absolute; top: -7px; }
	.nav-toggle__bar::after { position: absolute; top: 7px; }
	.nav-open .nav-toggle__bar { background: transparent; }
	.nav-open .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
	.nav-open .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }
	.primary-nav { display: none; position: absolute; inset: 100% 0 auto; flex-direction: column; align-items: stretch; padding: 1rem var(--gutter) 1.5rem; background: var(--paper); border-bottom: 1px solid var(--rule); }
	.nav-open .primary-nav { display: flex; }
	.primary-nav .menu { flex-direction: column; }
	.primary-nav .menu a { padding: .6rem 0; font-size: 1rem; border-bottom: 1px solid var(--rule); }
	.header-search input { width: 100%; }
	.site-tagline { display: none; }
}

/* Sections ------------------------------------------------------------ */
.site-main { min-height: 60vh; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--rule); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section__title { margin: 0 0 1.25rem; font-size: 1.5rem; }
.section__head .section__title { margin: 0; }
.section__more { font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap; }

/* Hero */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.hero__portrait { margin: 0; }
.hero__portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.05); border-radius: 2px; }
.hero__title { margin: 0 0 1rem; font-size: clamp(2.5rem, 7vw, 4.5rem); line-height: 1; letter-spacing: -.02em; }
.hero__intro { max-width: 36rem; font-size: 1.25rem; color: #3a3632; }
.hero__intro p { margin: 0 0 1rem; }
.hero__links { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 0; }
@media (max-width: 720px) {
	.hero__inner { grid-template-columns: 1fr; }
	.hero__portrait { max-width: 12rem; }
}

/* Featured books */
.section--books { background: #f1ebe1; }
.book-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr)); gap: 2.5rem; }
.book-feature { display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; align-items: start; }
.book-feature__cover img { width: 100%; box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 12px 24px -12px rgba(0,0,0,.45); }
.book-feature__title { margin: 0; font-size: 1.375rem; }
.book-feature__title a { color: var(--ink); text-decoration: none; }
.book-feature__subtitle { margin: .25rem 0 0; font-style: italic; color: #3a3632; }
.book-feature__imprint { margin: .25rem 0 .75rem; font-family: var(--sans); font-size: .8125rem; color: var(--muted); }
.book-feature p { font-size: 1rem; }
@media (max-width: 480px) { .book-feature { grid-template-columns: 6rem 1fr; gap: 1rem; } }

/* Article cards */
.card__title { margin: .35rem 0 .5rem; font-size: 1.25rem; line-height: 1.3; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--accent); }
.card__excerpt { font-size: 1rem; color: #3a3632; }
.article-lead-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 2.5rem; }
.article-lead-grid .card { padding-top: 1rem; border-top: 1px solid var(--rule); }
.article-lead-grid .card--lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: .5rem 2.5rem; padding: 0 0 2rem; border-top: 0; border-bottom: 1px solid var(--rule); }
.card--lead .entry-meta { grid-column: 1 / -1; }
.card--lead .card__title { margin: 0; font-size: clamp(1.75rem, 3.5vw, 2.5rem); line-height: 1.15; }
.card--lead .card__excerpt { font-size: 1.125rem; }
@media (max-width: 900px) {
	.article-lead-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.article-lead-grid .card--lead { grid-template-columns: 1fr; }
}
@media (max-width: 600px) { .article-lead-grid { grid-template-columns: 1fr; } }

.article-list { max-width: 48rem; }
.article-list .card { padding-block: 1.5rem; border-bottom: 1px solid var(--rule); }
.article-list .card:first-child { padding-top: 0; }

/* Press */
.press-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 2rem; }
.card--press { padding: 1.75rem; background: #fff; border: 1px solid var(--rule); border-radius: 2px; }
.card__quote { margin: 0 0 1rem; padding-left: 1rem; border-left: 3px solid var(--accent); font-style: italic; font-size: 1rem; color: #3a3632; }
.card__related { margin: 0; font-size: .8125rem; color: var(--muted); }

/* Page heads & filters ------------------------------------------------ */
.page-head { padding-block: clamp(2rem, 5vw, 3.5rem) 1.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--rule); }
.page-head__title { margin: 0; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -.015em; }
.page-head__year { color: var(--muted); font-weight: 400; }
.page-head__lede { max-width: 40rem; color: var(--muted); }
.filters { margin-top: 1.5rem; }
.filters__row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .5rem; padding: 0; list-style: none; }
.filters a { display: inline-block; padding: .3rem .75rem; border: 1px solid var(--rule); border-radius: 999px; font-size: .8125rem; color: var(--ink); text-decoration: none; background: #fff; }
.filters a:hover { border-color: var(--ink); }
.filters a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filters .count { color: var(--muted); font-size: .75rem; }
.filters a[aria-current] .count { color: var(--rule); }
.filters__row--years a { padding: .2rem .55rem; font-size: .75rem; }
.empty { color: var(--muted); }

/* Single entries ------------------------------------------------------- */
.entry-header { padding-block: clamp(2rem, 6vw, 4rem) 1.5rem; }
.entry-title { margin: 0 0 1rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12; letter-spacing: -.015em; }
.entry-lede { margin: 0 0 1.25rem; font-size: 1.25rem; line-height: 1.55; color: #3a3632; }
.entry-byline { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.entry-image { margin-block: 0 2rem; }
.entry-portrait { margin-block: 0 1.5rem; }
.entry-portrait img { width: 12rem; filter: grayscale(1); }

.entry-content { padding-bottom: 3rem; }
.entry-content > * { margin-block: 0 1.25em; }
.entry-content h2 { margin-top: 2.25em; font-size: 1.625rem; }
.entry-content h3 { margin-top: 2em; font-size: 1.3rem; }
.entry-content blockquote { margin-inline: 0; padding-left: 1.25rem; border-left: 3px solid var(--accent); font-style: italic; }
.entry-content .alignright { float: right; max-width: 45%; margin: .35rem 0 1rem 1.5rem; }
.entry-content .alignleft { float: left; max-width: 45%; margin: .35rem 1.5rem 1rem 0; }
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content figcaption { font-family: var(--sans); font-size: .8125rem; color: var(--muted); }
.entry--chapter .entry-content > p:first-of-type::first-letter { float: left; font-size: 3.6em; line-height: .85; padding: .08em .1em 0 0; color: var(--accent); }

.entry-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; padding-block: 1.5rem; border-top: 1px solid var(--rule); }
.entry-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding-block: 2rem 4rem; border-top: 1px solid var(--rule); }
.entry-nav div:last-child { text-align: right; }
.entry-nav a { color: var(--ink); text-decoration: none; font-size: 1.0625rem; line-height: 1.35; }
.entry-nav a:hover { color: var(--accent); }
.entry-nav span { display: block; margin-bottom: .25rem; font-family: var(--sans); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Book page ------------------------------------------------------------ */
.book-head { padding-block: clamp(2rem, 6vw, 4rem); margin-bottom: 2.5rem; background: #f1ebe1; }
.book-head__inner { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.book-head__cover { margin: 0; }
.book-head__cover img { width: 100%; box-shadow: 0 2px 4px rgba(0,0,0,.15), 0 24px 48px -20px rgba(0,0,0,.5); }
.book-head__subtitle { margin: -.5rem 0 1rem; font-size: 1.25rem; font-style: italic; color: #3a3632; }
.book-facts { margin: 0 0 1.5rem; font-size: .875rem; }
.book-facts div { display: flex; gap: .75rem; }
.book-facts dt { min-width: 4.5rem; color: var(--muted); }
.book-facts dd { margin: 0; }
.book-head__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }
@media (max-width: 640px) {
	.book-head__inner { grid-template-columns: 1fr; }
	.book-head__cover { max-width: 11rem; }
}
.book-section { padding-block: 2rem 3rem; border-top: 1px solid var(--rule); }
.chapter-list { margin: 0; padding: 0; list-style: none; counter-reset: ch; }
.chapter-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--rule); counter-increment: ch; }
.chapter-list li::before { content: counter(ch, decimal-leading-zero); margin-right: 1rem; font-family: var(--sans); font-size: .8125rem; color: var(--muted); padding-top: .2rem; }
.chapter-list a { flex: 1; color: var(--ink); text-decoration: none; font-size: 1.125rem; }
.chapter-list a:hover { color: var(--accent); }
.chapter-list__meta { font-size: .75rem; color: var(--muted); white-space: nowrap; padding-top: .3rem; }

/* Bibliography --------------------------------------------------------- */
.biblio-group { margin-bottom: 3rem; }
.biblio-list { max-width: 48rem; margin: 0; padding: 0; list-style: none; }
.biblio-item { display: flex; gap: 1.25rem; padding-block: 1.25rem; border-bottom: 1px solid var(--rule); }
.biblio-item__cover { flex: 0 0 4.5rem; }
.biblio-item__cover img { width: 4.5rem; height: auto; box-shadow: 0 6px 12px -6px rgba(0,0,0,.4); }
.biblio-item__title { margin: 0; font-size: 1.1875rem; line-height: 1.3; }
.biblio-item__title a { color: var(--ink); text-decoration: none; }
.biblio-item__title a:hover { color: var(--accent); }
.biblio-item__subtitle { margin: .15rem 0 0; font-style: italic; }
.biblio-item__imprint { margin: .25rem 0 0; font-family: var(--sans); font-size: .8125rem; color: var(--muted); }
.biblio-item__desc { margin: .5rem 0 0; font-size: 1rem; color: #3a3632; }

/* Galleries ------------------------------------------------------------ */
.gallery-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 2rem; padding-bottom: 4rem; }
.gallery-card { display: block; color: var(--ink); text-decoration: none; }
.gallery-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: .75rem; filter: grayscale(.2); transition: filter .2s; }
.gallery-card:hover img { filter: none; }
.gallery-card__title { display: block; font-size: 1.25rem; }
.gallery-card__count { font-size: .8125rem; color: var(--muted); }
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption { background: linear-gradient(0deg, rgba(0,0,0,.75), transparent); font-family: var(--sans); font-size: .75rem; }

/* Lightbox (assets/js/main.js) */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 2rem; background: rgba(15,13,12,.94); }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1200px, 100%); }
.lightbox img { max-height: 82vh; width: auto; margin-inline: auto; }
.lightbox figcaption { margin-top: .75rem; color: #ddd; font-family: var(--sans); font-size: .875rem; text-align: center; }
.lightbox button { position: absolute; border: 0; background: none; color: #fff; font-size: 2rem; cursor: pointer; padding: 1rem; }
.lightbox .lb-close { top: 0; right: 0; }
.lightbox .lb-prev { left: 0; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 0; top: 50%; transform: translateY(-50%); }

/* Pagination & forms --------------------------------------------------- */
.pagination { margin-block: 2.5rem 4rem; font-family: var(--sans); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.pagination .page-numbers { padding: .4rem .75rem; border: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-size: .875rem; background: #fff; }
.pagination .page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.search-form { display: flex; gap: .5rem; max-width: 30rem; margin-top: 1rem; }
.search-form label { flex: 1; }
.search-form .search-field { width: 100%; padding: .6rem .75rem; border: 1px solid var(--rule); font: inherit; font-size: 1rem; }
.search-form .search-submit { padding: .6rem 1rem; border: 0; background: var(--ink); color: var(--paper); font-family: var(--sans); cursor: pointer; }

/* Footer --------------------------------------------------------------- */
.site-footer { margin-top: 4rem; padding-block: 3rem 1.5rem; background: var(--ink); color: #d8d2c8; font-family: var(--sans); font-size: .875rem; }
.site-footer a { color: #fff; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.site-footer__name { margin: 0; font-family: var(--serif); font-size: 1.375rem; color: #fff; }
.site-footer__tagline { margin: .25rem 0 1rem; color: #a59d92; }
.footer-menu { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.footer-menu a { text-decoration: none; }
.site-footer__legal { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #3a3632; color: #8a8278; font-size: .75rem; }
.site-footer__legal p { margin: 0; }

@media print {
	.site-header, .site-footer, .entry-nav, .entry-sources, .filters { display: none; }
	body { background: #fff; font-size: 11pt; }
}
