/*
Theme Name: Bagni di Lucca
Theme URI: https://avaloncreativeltd.com
Author: Avalon Creative Ltd
Author URI: https://avaloncreativeltd.com
Description: Visitor guide theme for Bagni di Lucca and the Val di Lima. Includes Itineraries, Attractions, Villages map, Outdoor activities, Events calendar, Accommodation and Articles pages, and sets up its pages and menu when activated. Fonts and map library are self-hosted; the only third-party requests are OpenFreeMap map tiles on the Villages page. The optional event finder calls the Perplexity API from your server.
Version: 1.6.0
Requires at least: 6.4
Tested up to: 6.8
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: bagni-di-lucca
Tags: blog, travel, custom-menu, featured-images, translation-ready, accessibility-ready
*/

/* ==========================================================================
   Fonts (self-hosted, SIL OFL 1.1 — see assets/fonts/LICENSE-*)
   ========================================================================== */
@font-face { font-family: "Gloock"; font-style: normal; font-weight: 400; font-display: swap;
	src: url("assets/fonts/gloock-latin-400-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Gloock"; font-style: normal; font-weight: 400; font-display: swap;
	src: url("assets/fonts/gloock-latin-ext-400-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap;
	src: url("assets/fonts/figtree-latin-400-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap;
	src: url("assets/fonts/figtree-latin-500-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 600; font-display: swap;
	src: url("assets/fonts/figtree-latin-600-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap;
	src: url("assets/fonts/figtree-latin-ext-400-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap;
	src: url("assets/fonts/figtree-latin-ext-500-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 600; font-display: swap;
	src: url("assets/fonts/figtree-latin-ext-600-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
	src: url("assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
	src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* ==========================================================================
   Tokens — river green and chestnut on a pale valley grey
   ========================================================================== */
:root {
	--bg: #eef1ee; --surface: #f8faf8; --ink: #1d2a26; --muted: #5b6b66; --line: #cdd6d2;
	--river: #2f5d55; --river-deep: #182c29; --river-soft: #dce8e4; --chestnut: #8a4b2a; --note: #f6ece2;
	--on-river: #f8faf8;
	--display: "Gloock", Georgia, "Times New Roman", serif;
	--body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
	--wrap: 960px; --wrap-text: 720px; --gutter: clamp(16px, 4vw, 28px); --radius: 6px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #141b19; --surface: #1b2421; --ink: #e4ebe8; --muted: #9fb0aa; --line: #2f3d39;
		--river: #7fb8ab; --river-deep: #0f1715; --river-soft: #22332f; --chestnut: #d99a72; --note: #2a211b;
		--on-river: #10201c;
		color-scheme: dark;
	}
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg, video, iframe { max-width: 100%; height: auto; }
a { color: var(--river); text-underline-offset: 0.15em; }
a:hover { color: var(--chestnut); }
:focus-visible { outline: 2px solid var(--chestnut); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.15; text-wrap: balance; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; word-wrap: normal !important; }
.screen-reader-text:focus { clip: auto; clip-path: none; height: auto; width: auto; margin: 0; background: var(--surface); color: var(--ink); padding: 12px 16px; z-index: 100000; top: 8px; left: 8px; }
.skip-link:focus { position: absolute; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--text { max-width: calc(var(--wrap-text) + 2 * var(--gutter)); }
.site-main { padding-block: 0 64px; }

/* ==========================================================================
   Site header and navigation
   ========================================================================== */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.site-brand { font-family: var(--display); font-size: 1.5rem; line-height: 1; color: var(--ink); text-decoration: none; }
.site-brand:hover { color: var(--river); }
.site-brand small { display: block; font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.custom-logo { max-height: 56px; width: auto; }

.nav-toggle { display: none; font: 600 0.9375rem var(--body); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.primary-nav a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; }
.primary-nav a:hover { background: var(--river-soft); color: var(--ink); }
.primary-nav .current-menu-item > a, .primary-nav .current_page_item > a, .primary-nav .current_page_parent > a { background: var(--river); color: var(--on-river); }
.primary-nav .sub-menu { display: none; }

@media (max-width: 760px) {
	.js .nav-toggle { display: inline-block; }
	.js .primary-nav { display: none; width: 100%; padding-bottom: 12px; }
	.js .primary-nav.is-open { display: block; }
	.site-header__inner { flex-wrap: wrap; }
	.primary-nav ul { flex-direction: column; }
}

/* ==========================================================================
   Page heading (shared by all guide pages)
   ========================================================================== */
.page-head { padding-block: 48px 24px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.eyebrow { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--river); margin: 0 0 10px; }
.page-head h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1.05; margin: 0 0 16px; }
.page-head h1 em { font-style: normal; color: var(--river); }
.lede { max-width: 62ch; color: var(--muted); font-size: 1.0625rem; margin: 0; }
.lede p:last-child { margin-bottom: 0; }
.small-print { max-width: 62ch; margin: 16px 0 0; font-size: 0.9rem; color: var(--muted); }

/* ==========================================================================
   Shared components
   ========================================================================== */
.filters, .jump { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 22px; margin: 0; list-style: none; }
.filters button, .jump a { font: 500 0.875rem/1.2 var(--body); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; text-decoration: none; }
.filters button:hover, .jump a:hover { border-color: var(--river); color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--river); border-color: var(--river); color: var(--on-river); }
.no-js .filters { display: none; }

.section { padding-block: 24px 8px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.2rem); margin: 0; }
.count { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.06em; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.stack { display: grid; gap: 20px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel > * { margin: 0; }
.panel--wide { padding: 28px clamp(18px, 4vw, 36px); gap: 0; }
.kind { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--chestnut); }
.panel h3 { font-size: 1.45rem; line-height: 1.2; }
.panel h3 a { color: inherit; text-decoration: none; }
.panel h3 a:hover { color: var(--river); }
.alt { display: block; font-family: var(--body); font-size: 0.875rem; font-weight: 500; color: var(--muted); margin-top: 3px; }
.meta { font-family: var(--mono); font-size: 0.78rem; color: var(--river); }
.note { background: var(--note); border-radius: 4px; padding: 10px 14px; font-size: 0.9rem; max-width: 65ch; }
.note strong { color: var(--chestnut); font-weight: 600; }
.grid .note { margin-top: auto; }

/* Itineraries */
.panel--wide h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin: 6px 0 2px; }
.sub { color: var(--muted); margin: 0 0 18px !important; font-weight: 500; }
.desc { max-width: 65ch; margin: 0 0 20px !important; font-size: 1.05rem; }
.route { list-style: none; margin: 0 0 22px !important; padding: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px 0; border-top: 1px dashed var(--line); }
.route li { display: flex; align-items: center; font-size: 0.875rem; font-weight: 500; }
.route li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--river); background: var(--surface); margin-right: 7px; flex: none; }
.route li.is-dest::before { background: var(--river); }
.route li:not(:last-child)::after { content: ""; width: 22px; height: 2px; background: var(--river-soft); margin: 0 8px; }
.route--loose li:not(:last-child)::after { background: none; width: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 24px; margin: 0 0 20px !important; }
.facts div { min-width: 0; }
.facts dt, .contact dt { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.facts dd, .contact dd { margin: 2px 0 0; font-size: 0.9375rem; }
.more { max-width: 65ch; color: var(--muted); font-size: 0.95rem; margin: 0 0 16px !important; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* Attractions */
.story { margin-top: 36px; padding: 32px clamp(20px, 4vw, 40px); background: var(--river); color: var(--on-river); border-radius: var(--radius); }
.story h2 { color: var(--on-river); font-size: clamp(1.7rem, 4vw, 2.2rem); }
.story p { max-width: 64ch; margin: 14px 0 0; font-size: 1.05rem; }
.visitors { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.visitors li { font-family: var(--display); font-size: 1.2rem; border: 1px solid var(--on-river); border-radius: 999px; padding: 4px 16px; }
.info { margin-top: 36px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; align-items: start; }
.info h2 { font-size: 1.7rem; }
.info p { color: var(--muted); max-width: 52ch; }
.contact { display: grid; gap: 12px; }
.contact div { min-width: 0; }
.contact dd { overflow-wrap: anywhere; }

/* Accommodation */
.addr { font-family: var(--mono); font-size: 0.8125rem; color: var(--river); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.addr a { font-family: var(--body); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.chips li { font-size: 0.78rem; font-weight: 500; background: var(--river-soft); color: var(--ink); border-radius: 999px; padding: 3px 11px; }
.links { margin-top: auto !important; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.btn { display: inline-block; font: 600 0.875rem/1.2 var(--body); text-decoration: none; border-radius: 4px; padding: 9px 14px; border: 1px solid var(--river); color: var(--river); background: transparent; }
.btn:hover { background: var(--river-soft); color: var(--ink); }
.btn--primary { background: var(--river); color: var(--on-river); }
.btn--primary:hover { background: var(--river-deep); color: #fff; }
.aside-box { margin-top: 36px; padding: 26px clamp(20px, 4vw, 36px); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--chestnut); border-radius: var(--radius); }
.aside-box h2 { font-size: 1.6rem; }
.aside-box ul { margin: 12px 0 0; padding-left: 20px; max-width: 64ch; }
.aside-box li + li { margin-top: 6px; }

/* Articles */
.featured { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
@media (max-width: 680px) { .featured { grid-template-columns: 1fr; } }
.plate { background: var(--river-deep); color: #fff8e9; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-height: 200px; border-bottom: 6px solid #bb773d; }
.plate__cap { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: #e5b882; }
.plate__big { font-family: var(--display); font-size: clamp(3.5rem, 9vw, 5.5rem); line-height: 0.9; }
.plate--image { padding: 0; border-bottom: 0; }
.plate--image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured__body { padding: 28px clamp(20px, 4vw, 36px); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.featured__body > * { margin: 0; }
.featured__body h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
.featured__body h2 a { color: inherit; text-decoration: none; }
.featured__body h2 a:hover { color: var(--river); }
.excerpt { color: var(--muted); }
.excerpt p { margin: 0; }
.read { margin-top: auto !important; font-weight: 600; font-size: 0.875rem; color: var(--river); text-decoration: none; }
.read:hover { text-decoration: underline; }
.soon { margin-top: auto !important; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.date { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.pagination { margin-top: 28px; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; color: var(--ink); }
.pagination .current { background: var(--river); color: var(--on-river); border-color: var(--river); }

/* Home */
.hero { padding-block: 64px 40px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: clamp(2.8rem, 8vw, 5rem); line-height: 1; margin: 0 0 18px; }
.hero h1 em { font-style: normal; color: var(--river); }
.hero .lede { font-size: 1.15rem; }
.tiles { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); margin-top: 32px; }
.tile { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-decoration: none; color: var(--ink); min-width: 0; }
.tile:hover { border-color: var(--river); color: var(--ink); }
.tile h2, .tile h3 { font-size: 1.5rem; margin: 0; }
.tile p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.tile .kind { color: var(--river); }

/* ==========================================================================
   Single articles and ordinary pages
   ========================================================================== */
.article-head { background: var(--river-deep); color: #fff8e9; padding-block: 64px 52px; border-bottom: 6px solid #bb773d; }
.article-head .eyebrow { color: #e5b882; }
.article-head h1 { font-size: clamp(2.4rem, 7vw, 4rem); line-height: 1.07; margin: 14px 0 20px; color: #fff8e9; }
.standfirst { font-size: 1.25rem; line-height: 1.5; color: #d5dfd8; margin: 0; }
.standfirst p { margin: 0; }
.article-meta { font-family: var(--mono); font-size: 0.78rem; color: #b9ccc2; margin-top: 22px; }
.article-head .post-thumbnail { margin-top: 28px; }
.article-head .post-thumbnail img { border-radius: var(--radius); display: block; }

.entry-content { padding-top: 40px; font-size: 1.125rem; line-height: 1.75; }
.entry-content > p:first-child { font-size: 1.3rem; line-height: 1.65; }
.page .entry-content > p:first-child { font-size: inherit; line-height: inherit; }
.entry-content h2 { font-size: 1.75rem; margin-top: 1.6em; }
.entry-content h3 { font-size: 1.35rem; margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content sup { font-family: var(--mono); font-size: 0.7rem; margin-left: 2px; }
.entry-content sup a { text-decoration: none; }
.entry-content blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--river); color: var(--muted); }
.entry-content img { border-radius: var(--radius); }
.entry-content .note-line, .entry-content .research-note { font-size: 0.875rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; }
.entry-content .sources { font-size: 0.875rem; line-height: 1.7; }
.entry-content .sources li { overflow-wrap: anywhere; margin-bottom: 10px; }
.entry-content .alignwide { max-width: none; }
.entry-content .wp-block-image figcaption, .wp-caption-text { font-size: 0.875rem; color: var(--muted); }
.post-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 40px; padding-top: 20px; }
.back-link { font-weight: 600; text-decoration: none; }

/* Home banner and photo mosaic */
.home-hero { position: relative; margin: 0; color: #fff; background: var(--river-deep); }
.home-hero__media { margin: 0; height: clamp(440px, 72vh, 760px); }
.home-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; display: block; }
.home-hero__text { position: absolute; inset: auto 0 0 0; padding-block: 120px 36px; background: linear-gradient(to top, rgba(16, 26, 23, 0.86), rgba(16, 26, 23, 0.55) 55%, rgba(16, 26, 23, 0)); }
.home-hero .eyebrow { color: #e5d2b0; }
.home-hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: 1; margin: 0 0 14px; color: #fff; text-wrap: balance; }
.home-hero h1 em { font-style: normal; color: #bfe0d6; }
.home-hero .lede { color: #e8efec; font-size: 1.125rem; max-width: 56ch; }
.home-hero__credit { margin: 14px 0 0; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; color: #c9d6d1; }
.site-main--home .tiles { margin-top: 0; }

.mosaic { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: clamp(200px, 22vw, 290px); }
.mosaic__item { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--line); }
.mosaic__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.mosaic__item:hover img { transform: scale(1.03); }
.mosaic__tall { grid-row: span 2; }
.mosaic__wide { grid-column: span 2; }
.mosaic__item figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 10px; font-size: 0.85rem; font-weight: 500; color: #fff; background: linear-gradient(to top, rgba(10, 18, 16, 0.75), rgba(10, 18, 16, 0)); }
@media (max-width: 700px) {
	.mosaic { grid-template-columns: 1fr; grid-auto-rows: auto; }
	.mosaic__item { aspect-ratio: 4 / 3; }
	.mosaic__tall { grid-row: auto; aspect-ratio: 3 / 4; }
	.mosaic__wide { grid-column: auto; }
}

/* Pages and articles built from imported HTML (class bdl-page) */
.site-main--html { padding-top: 24px; }
.site-main--html .bdl-page { padding-inline: 0; background: transparent; }
.single .bdl-article .ah { display: none; }
.single .bdl-article { background: transparent; }
.single .bdl-article .body { padding-inline: 0; }

/* Forms and comments */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea {
	font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
	padding: 10px 12px; width: 100%; max-width: 100%;
}
input[type="submit"], .search-submit { font: 600 0.9375rem var(--body); background: var(--river); color: var(--on-river); border: 0; border-radius: 4px; padding: 10px 18px; cursor: pointer; }
.search-form { display: flex; gap: 8px; max-width: 480px; }
.search-form label { flex: 1; }
.comments-area, #comments, #respond { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 24px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 20px; }
.comment-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.comment-form p { margin-bottom: 12px; }
.comment-form label { display: block; font-weight: 500; margin-bottom: 4px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-block: 32px; font-size: 0.875rem; color: var(--muted); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.site-footer strong { font-family: var(--display); font-weight: 400; font-size: 1.25rem; color: var(--ink); display: block; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--river); }
.last-checked { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 40px; padding-top: 16px; }

/* ==========================================================================
   Events page (page-events.php)
   ========================================================================== */
.ev { margin-top: 28px; }
.ev-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ev-nav[hidden] { display: none; }
.ev-nav__title { margin: 0; font-size: clamp(1.6rem, 4vw, 2.1rem); text-align: center; flex: 1; }
.ev-nav button { font: 600 1.1rem var(--body); width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.ev-nav button:hover:not(:disabled) { border-color: var(--river); color: var(--river); }
.ev-nav button:disabled { opacity: 0.35; cursor: default; }
.ev-month { padding-bottom: 36px; scroll-margin-top: 90px; }
.ev-month + .ev-month { border-top: 1px solid var(--line); padding-top: 28px; }
.ev-month__title { font-size: clamp(1.6rem, 4vw, 2.1rem); margin: 0 0 14px; }
html:not(.js) .ev-month.is-empty:not(.is-current) { display: none; }
.js .ev.is-paged .ev-month { display: none; border-top: 0; padding-top: 0; }
.js .ev.is-paged .ev-month.is-shown { display: block; }
.js .ev.is-paged .ev-month__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.ev-cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ev-cal__head, .ev-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ev-cal__head span { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 8px 8px 6px; border-bottom: 1px solid var(--line); }
.ev-day { min-height: 92px; padding: 6px 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; color: var(--ink); text-decoration: none; min-width: 0; }
.ev-day:nth-child(7n) { border-right: 0; }
.ev-day--pad { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.ev-day__n { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.ev-day.is-past .ev-day__n { opacity: 0.55; }
.ev-day.is-today .ev-day__n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: var(--river); color: var(--on-river); opacity: 1; }
.ev-day.has-events { background: var(--river-soft); }
.ev-day.has-events:hover { outline: 2px solid var(--river); outline-offset: -2px; }
.ev-day.has-events .ev-day__n { color: var(--river); font-weight: 500; }
.ev-day__items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-day__item { font-size: 0.74rem; line-height: 1.25; background: var(--surface); border-left: 3px solid var(--chestnut); border-radius: 2px; padding: 2px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-day__more { font-family: var(--mono); font-size: 0.7rem; color: var(--river); }

.ev-list { display: grid; gap: 16px; margin-top: 22px; }
.ev-card { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; scroll-margin-top: 90px; }
.ev-card:target { outline: 2px solid var(--river); outline-offset: 2px; }
.ev-poster { margin: 0; aspect-ratio: 1 / 1.414; border-radius: 4px; overflow: hidden; background: var(--bg); }
.ev-poster a { display: block; width: 100%; height: 100%; }
.ev-poster img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ev-poster--empty { border: 2px dashed var(--line); display: grid; place-items: center; text-align: center; }
.ev-poster__ph { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 12px; }
.ev-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
.ev-date { display: grid; justify-items: center; min-width: 58px; padding: 8px 6px; border-radius: 4px; background: var(--river); color: var(--on-river); line-height: 1; }
.ev-date__d { font-family: var(--display); font-size: 1.9rem; }
.ev-date__m { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; }
.ev-when { font-family: var(--mono); font-size: 0.78rem; color: var(--river); margin: 0 0 4px; }
.ev-text h3 { font-size: 1.45rem; line-height: 1.2; margin: 0 0 6px; }
.ev-meta { color: var(--muted); font-size: 0.92rem; margin: 0 0 8px; }
.ev-desc p { margin: 0 0 8px; font-size: 0.95rem; }
.ev-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 0; font-size: 0.9rem; font-weight: 600; }
.ev-links a { text-decoration: none; }
.ev-links a:hover { text-decoration: underline; }
.ev-empty { margin-top: 18px; padding: 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.ev-note { font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

@media (max-width: 760px) {
	.ev-day { min-height: 48px; padding: 4px; align-items: center; }
	.ev-day__items { display: none; }
	.ev-day.has-events::after { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--chestnut); }
	.ev-cal__head span { padding: 6px 2px; text-align: center; font-size: 0.62rem; }
	.ev-card { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 12px; }
	.ev-body { grid-template-columns: 1fr; gap: 8px; }
	.ev-date { display: none; }
	.ev-text h3 { font-size: 1.2rem; }
}
@media (max-width: 420px) {
	.ev-card { grid-template-columns: 1fr; }
	.ev-poster { max-width: 220px; }
}

@media print {
	.site-header, .site-footer, .filters, .jump, .links, .nav-toggle, .ev-nav { display: none !important; }
	.js .ev.is-paged .ev-month { display: block !important; }
	.article-head { background: none; color: #000; border-bottom: 1px solid #999; padding-block: 16px; }
	.article-head h1, .standfirst, .article-meta, .article-head .eyebrow { color: #000; }
	.panel { break-inside: avoid; }
}
