/* base: nest.css */
/* nest.css — the base theme: tokens, the elements, and the classes modules share (card, stack,
   row, field, notice, badge, tile...). Each module keeps its own look in its own stylesheet
   (its manifest's styles), built on these tokens; an application restyles both. */
:root {
  --bg: #f8f7f4; --surface: #ffffff; --text: #1d1c1a; --muted: #5f5b53;
  --border: #dedad0; --accent: #8a2b1f; --accent-text: #ffffff; --focus: #1f4f8a;
  --ok: #2d6a3e; --danger: #a32121;
  --radius: 8px; --gap: 1rem; --max: 72rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151413; --surface: #1e1d1b; --text: #ecebe6; --muted: #a6a196;
    --border: #34312c; --accent: #e0806f; --accent-text: #151413; --focus: #8db6ea;
    --ok: #7cc48e; --danger: #f08a8a;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 var(--font);
  display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; padding-block: 1.5rem 3rem; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 1rem; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem; min-height: 3.5rem; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; }
nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1rem; list-style: none; margin: 0; padding: 0; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; padding-block: 1rem; }

h1, h2, h3 { line-height: 1.25; margin: 1.5rem 0 .75rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-top: .5rem; }
p { margin: .5rem 0 1rem; }
code, pre { font-family: var(--mono); font-size: .9em; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem 1rem; overflow-x: auto; }
img, video { max-width: 100%; height: auto; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin-block: var(--gap); }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.muted { color: var(--muted); }
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

button, .button { font: inherit; cursor: pointer; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-text); border-radius: var(--radius); padding: .5rem 1rem; min-height: 2.5rem;
  text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: .55; cursor: not-allowed; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input, select, textarea { font: inherit; color: inherit; background: var(--surface); width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; min-height: 2.5rem; }
textarea { min-height: 6rem; resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

.notice { border-left: 4px solid var(--accent); background: var(--surface); padding: .75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0; }
.notice.ok { border-color: var(--ok); } .notice.danger { border-color: var(--danger); }

/* htmx: indicators without the inline styles htmx would inject. */
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.narrow { max-width: 28rem; margin-inline: auto; }
button.link { background: none; border: none; color: var(--muted); padding: .25rem .4rem; min-height: auto; }
button.link:hover, button.link.current { color: var(--text); text-decoration: underline; }
.language { gap: 0; }
.field { margin-bottom: 1rem; }
.field .hint, .field .error { display: block; margin-top: .25rem; font-size: .875rem; }
.field .hint { color: var(--muted); }
.field .error { color: var(--danger); }
.field .req { color: var(--danger); }
.field.check { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.field.check input { width: auto; min-height: auto; }
.field.check label { margin: 0; font-weight: 400; }
[aria-invalid="true"] { border-color: var(--danger); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.between { justify-content: space-between; }
form.search { display: flex; gap: .5rem; margin-block: 1rem; }
form.search input { flex: 1; }
.tile { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--accent); }
.letters { display: flex; flex-wrap: wrap; gap: .25rem; margin-block: 1rem; }
.letters a { min-width: 2.25rem; text-align: center; padding: .35rem .5rem; border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; background: var(--surface); }
.letters a[aria-current="page"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
ol.results { padding-left: 1.25rem; } ol.results li { margin-bottom: 1rem; } ol.results p { margin: .25rem 0; }
mark { background: color-mix(in srgb, var(--accent) 25%, transparent); color: inherit; border-radius: 2px; }
.pager { margin-top: 1.5rem; }
.danger-zone { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1rem; } label.check { font-weight: 400; display: inline-flex; gap: .35rem; align-items: center; }
label.check input { width: auto; min-height: auto; }
.badge { display: inline-block; font-size: .75rem; padding: .05rem .45rem; border-radius: 999px; background: var(--border); color: var(--text); vertical-align: middle; }
form.inline { display: inline; }
/* numbers in tables, and a change for the better or the worse (the game's benchmark) */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.better { color: var(--ok); } .worse { color: var(--danger); }
progress { width: 100%; max-width: 32rem; }
/* the language switch: its choices apart, in any theme */
.language { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .6rem; }

/* the line every site carries: built with Nest */
.nest-credit { margin: .35rem 0 0; font-size: .78rem; opacity: .75; }
.nest-credit a { color: inherit; }

/* morlaca-valley: morlaca.css */
/* morlaca.css — the valley theme (morlaca-valley), on the base theme; heritage and
   chronicle are built on it. A theme's stylesheet comes before the modules' own, so a
   rule for a class a module styles too (.entry, .map...) is written under main, to win. The palette is the valley's: meadow and forest greens, a slate sky, the
   terracotta of the roofs; a band of cross-stitch, as on the sleeve of an ie, under the
   header. Fonts are the system's (no web font to download): a book serif for headings. */

:root {
  --bg: #f4efe4; --surface: #fffcf5; --text: #23251f; --muted: #66645a;
  --border: #e2d9c5; --accent: #9e3a1d; --accent-text: #fffcf5; --focus: #2f5d8a;
  --forest: #24382a; --meadow: #4f6b3c; --slate: #5c6670; --cream: #f3ead8; --stitch: #b4452a;
  --radius: 10px; --max: 74rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141814; --surface: #1c211c; --text: #ece8dc; --muted: #a7a395;
    --border: #2f362e; --accent: #e08a68; --accent-text: #141814; --focus: #8db6ea;
    --forest: #101611; --meadow: #9bb787; --slate: #9aa4ad; --cream: #2a2620; --stitch: #c8603f;
  }
}

h1, h2, h3, .brand-name, .footer-name { font-family: var(--serif); font-weight: 600; letter-spacing: .005em; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.65rem); }
a { text-underline-offset: .15em; }

/* --- the header: forest green, the village's name, the stitched band ------------------ */
.site-header { background: var(--forest); border: 0; color: #f3ead8; }
.site-header .bar { min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: #f8f1e1; }
.brand-mark { width: 1.6rem; height: 1.6rem; flex: none; background: var(--stitch);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); box-shadow: inset 0 0 0 .38rem var(--stitch); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: .48rem; background: #f3ead8;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1.45rem; }
.brand-sub { font-size: .78rem; color: #c9cdb8; letter-spacing: .02em; }
.site-nav ul.menu > li > a { color: #e6e2d2; font-weight: 500; padding: .3rem 0; display: inline-block; }
.site-nav ul.menu > li > a:hover, .site-nav ul.menu a[aria-current="page"] { color: #fff; text-decoration: underline;
  text-decoration-color: var(--stitch); text-decoration-thickness: 2px; text-underline-offset: .45em; }
.site-nav ul.menu ul { background: var(--surface); }
.site-nav ul.menu ul a { color: var(--text); }
.site-header .status, .site-header .status a { color: #e6e2d2; }

.band { height: 10px; background-color: var(--cream);
  background-image:
    linear-gradient(135deg, var(--stitch) 25%, transparent 25%),
    linear-gradient(225deg, var(--stitch) 25%, transparent 25%),
    linear-gradient(315deg, var(--stitch) 25%, transparent 25%),
    linear-gradient(45deg, var(--stitch) 25%, transparent 25%);
  background-size: 10px 10px; background-position: -5px 0, -5px 0, 0 0, 0 0; }

/* --- the hero: the valley, full width, the name over it --------------------------------- */
.hero { position: relative; isolation: isolate; min-height: clamp(20rem, 58vh, 34rem); display: flex; align-items: flex-end;
  color: #fff; background: var(--forest); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(20, 28, 22, .05) 30%, rgba(20, 28, 22, .78) 100%); }
.hero-plain { min-height: 14rem; }
.hero-text { padding-block: 2.5rem 2rem; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); margin: 0; line-height: 1; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.hero-tagline { font-family: var(--serif); font-size: clamp(1.1rem, 2.6vw, 1.45rem); margin: .5rem 0 1rem; color: #f3ead8; }
.hero-facts { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.hero-facts li { background: rgba(255, 252, 245, .14); backdrop-filter: blur(4px); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px; padding: .25rem .8rem; font-size: .92rem; }
.home main { padding-top: 2rem; }

/* --- the village's text and its facts ---------------------------------------------------- */
.intro { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
main .intro-text .body { font-size: 1.06rem; }
main .intro-text .body > p:first-child { font-family: var(--serif); font-size: 1.25rem; }
.factbox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem;
  border-top: 4px solid var(--meadow); }
.factbox h2 { margin-top: 0; font-size: 1.25rem; }
.factbox h3 { font-size: 1rem; margin: 1.1rem 0 .4rem; color: var(--muted); font-family: var(--font); text-transform: uppercase; letter-spacing: .06em; }
.factbox dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; }
.factbox dt { color: var(--muted); }
.factbox dd { margin: 0; font-weight: 600; }
.distances, .access { list-style: none; padding: 0; margin: 0; }
.distances li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--border); padding: .25rem 0; }
.access li { padding: .2rem 0; }
.edit-link { float: right; margin: 0; }

/* --- sections and cards ------------------------------------------------------------------ */
.section { margin-top: 3rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.section-head h2 { margin: 0 0 .5rem; }
.section-head a { font-size: .95rem; }
.section.two { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { border-bottom: 1px solid var(--border); }
.link-list a { display: block; padding: .55rem 0; color: var(--text); text-decoration: none; }
.link-list a:hover { color: var(--accent); }
.link-list a::before { content: "◆"; color: var(--stitch); font-size: .7em; margin-right: .6rem; vertical-align: .15em; }

.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(36, 56, 42, .12); }
.post-card-link { color: var(--text); text-decoration: none; }
.post-card img, .post-card-blank { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--cream); }
.post-card-blank { background: linear-gradient(135deg, var(--meadow), var(--forest)); opacity: .85; }
.post-card h3, .post-card .post-card-title { font-size: 1.12rem; margin: .8rem 1rem .25rem; }
.post-card p { margin: 0 1rem 1rem; color: var(--muted); font-size: .93rem; }
.listing-head { margin-bottom: 1.5rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 46rem; }

/* --- an article ---------------------------------------------------------------------------- */
main .entry { max-width: 46rem; }
main .intro .entry { max-width: none; }
main .entry header h1 { font-size: clamp(1.8rem, 4.4vw, 2.6rem); }
main .entry .body { font-size: 1.05rem; }
main .entry .body h2, main .entry .body h3 { margin-top: 2rem; }
main .entry .body blockquote { margin: 1.25rem 0; padding: .25rem 1.25rem; border-left: 4px solid var(--meadow);
  font-family: var(--serif); font-size: 1.08rem; color: var(--muted); }
main .featured { margin: 0 0 1.5rem; }
main .featured img { width: auto; max-width: 100%; max-height: 30rem; object-fit: contain; border-radius: var(--radius); }

/* the gallery, the map and the comments, in the village's colours */
main .gallery-tile { border-radius: var(--radius); }
main .map { border-radius: var(--radius); }

/* --- the footer ------------------------------------------------------------------------- */
.site-footer { background: var(--forest); color: #d8d6c8; border: 0; padding-block: 2.5rem 1rem; margin-top: 3rem; }
.site-footer a { color: #f3ead8; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.footer-name { font-size: 1.5rem; color: #fff; margin: 0 0 .5rem; }
.footer-head { font-weight: 600; color: #fff; margin: 0 0 .5rem; }
.site-footer ul { display: block; list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: .15rem 0; }
.footer-end { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; color: #a9ad9c; }

@media (max-width: 52rem) {
  .intro { grid-template-columns: 1fr; }
  .site-header .bar { padding-block: .6rem; }
}
@media (max-width: 40rem) {
  .brand-sub { display: none; }
  .hero h1 { font-size: 2.6rem; }
  .site-nav { width: 100%; }
  .site-nav ul.menu { flex-wrap: wrap; gap: .1rem 1rem; }
}

/* the language switch, in the header */
.site-header .language button { color: #c9cdb8; background: none; border: 0; padding: .2rem .35rem; min-height: 0; font-size: .85rem; letter-spacing: .04em; }
.site-header .language button.current { color: #fff; font-weight: 700; text-decoration: underline; text-decoration-color: var(--stitch); text-underline-offset: .35em; }
.site-header .language button:hover { color: #fff; }
.site-header .language { margin-left: auto; }
.site-header .language a { color: #c9cdb8; text-decoration: none; padding: .45rem .5rem; font-size: .85rem; letter-spacing: .04em; min-width: 2.75rem; min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; }
.site-header .language a.current { color: #fff; font-weight: 700; text-decoration: underline; text-decoration-color: var(--stitch); text-underline-offset: .35em; }
.site-header .language a:hover { color: #fff; }
/* the footer's links: big enough for a finger */
.site-footer li a { display: inline-block; padding: .5rem 0; min-height: 2.75rem; }
.site-footer li { padding: 0; }

/* --- the search box, in the header ------------------------------------------------------- */
.site-search { display: flex; align-items: center; margin-left: auto; background: rgba(255, 252, 245, .1);
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding-left: .8rem; }
.site-search input { background: none; border: 0; color: #f8f1e1; width: 9rem; min-height: 2.5rem; padding: 0; font: inherit; font-size: .92rem; }
.site-search input::placeholder { color: #b9bea8; }
.site-search input:focus { outline: none; width: 12rem; }
.site-search:focus-within { border-color: #f3ead8; box-shadow: 0 0 0 2px var(--focus); }
.site-search button { background: none; border: 0; color: #e6e2d2; min-height: 2.5rem; min-width: 2.75rem; padding: 0 .7rem; cursor: pointer; }
.site-search button:hover { color: #fff; }
.site-search input, .site-search input:focus { transition: width .2s ease; }
.site-header .site-search + .language { margin-left: .25rem; }
@media (prefers-reduced-motion: reduce) { .site-search input { transition: none; } }

/* --- the panorama over an inner page ---------------------------------------------------------- */
.banner { height: clamp(6rem, 16vw, 11rem); overflow: hidden; background: var(--forest); position: relative; }
.banner img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; display: block; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 28, 22, .35), rgba(20, 28, 22, 0) 45%); }
main#main { padding-top: 1.5rem; }

/* --- the way back, and what to read next -------------------------------------------------------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; list-style: none; padding: 0; margin: 0 0 1rem; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: .5rem; color: var(--stitch); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--text); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-meta a { color: var(--meadow); }
main .entry .children { margin-top: 2rem; }
.related { max-width: none; }

@media (max-width: 52rem) {
  .site-search { order: 3; width: 100%; margin: .25rem 0 .5rem; }
  .site-search input, .site-search input:focus { width: 100%; }
}

/* --- a page that is not there ------------------------------------------------------------ */
.lost { max-width: 36rem; margin: 2rem auto 3rem; text-align: center; }
.lost-code { font-family: var(--serif); font-size: 4.5rem; line-height: 1; margin: 0; color: var(--stitch); }
.lost h1 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
.lost .site-search { margin: 1rem auto 1.5rem; max-width: 22rem; background: var(--surface); border-color: var(--border); }
.lost .site-search input { color: var(--text); width: 100%; }
.lost .site-search input::placeholder { color: var(--muted); }
.lost .site-search button { color: var(--muted); }

/* the line every site carries: built with Nest */
.nest-credit { margin: .35rem 0 0; font-size: .78rem; opacity: .75; }
.nest-credit a { color: inherit; }

/* morlaca-heritage: heritage.css */
/* heritage.css — morlaca.ro as its visitors have known it, on the valley theme: the
   village's name over the panorama, the menu bar under it, the page beside a sidebar,
   white pages on a soft grey, a calm teal for links (the old theme's own colour). */

:root {
  --bg: #eef0ec; --surface: #ffffff; --text: #262b28; --muted: #66706a; --border: #dde2dc;
  --accent: #00796b; --accent-text: #ffffff; --focus: #2f5d8a;
  --forest: #1f3a33; --meadow: #2e7d6e; --cream: #eef0ec; --stitch: #00796b;
  --radius: 4px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615; --surface: #1a201e; --text: #e6ebe7; --muted: #9aa6a0; --border: #2b3431;
    --accent: #4fb3a3; --accent-text: #121615; --forest: #0f1a17; --meadow: #6cc0b0; --cream: #1a201e; --stitch: #4fb3a3;
  }
}

/* --- the name over the panorama, the menu under it -------------------------------------- */
.heritage-head { background: var(--forest); }
.heritage-banner { position: relative; isolation: isolate; height: clamp(9rem, 25vw, 20rem); overflow: hidden; display: flex; align-items: center; }
.heritage-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; z-index: -2; }
.heritage-banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10, 22, 18, .62), rgba(10, 22, 18, .12) 70%); }
.heritage-title { width: 100%; }
.heritage-name { display: inline-block; color: #fff; text-decoration: none; font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1; text-shadow: 0 2px 14px rgba(0, 0, 0, .4); }
.heritage-name:hover { color: #fff; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
.heritage-tagline { color: #eef3ee; margin: .4rem 0 0; font-size: clamp(1rem, 2.2vw, 1.25rem); text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.heritage-language { position: absolute; top: .5rem; right: .75rem; }
.heritage-language .language a { color: #eef3ee; text-decoration: none; padding: .45rem .5rem; min-width: 2.75rem; min-height: 2.75rem;
  display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; letter-spacing: .04em; }
.heritage-language .language a.current { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: .35em; }
.heritage-nav { background: var(--forest); border-top: 3px solid var(--accent); }
.heritage-nav ul.menu { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 0; padding: 0; }
.heritage-nav ul.menu > li > a { display: inline-flex; align-items: center; min-height: 3rem; padding: 0 1rem; color: #e3ebe6; text-decoration: none; font-weight: 500; }
.heritage-nav ul.menu > li > a:hover, .heritage-nav ul.menu a[aria-current="page"] { background: rgba(255, 255, 255, .08); color: #fff; }
.heritage-nav ul.menu ul { background: var(--surface); }
.heritage-nav ul.menu ul a { color: var(--text); }

/* --- the page beside its sidebar -------------------------------------------------------- */
main#main { padding-top: 1.75rem; }
.with-aside { display: grid; gap: 1.75rem; grid-template-columns: minmax(0, 1fr) 18rem; align-items: start; }
.primary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1rem, 3vw, 2rem); min-width: 0; }
main .primary .entry { max-width: none; }
.aside { display: grid; gap: 1.25rem; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.widget h2 { font-family: var(--font); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  margin: 0 0 .6rem; padding-bottom: .5rem; border-bottom: 2px solid var(--accent); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: .5rem; }
.widget li:last-child { border-bottom: 0; }
.widget li a { display: block; padding: .5rem 0; color: var(--text); text-decoration: none; }
.widget li a:hover { color: var(--accent); }
.widget .count { color: var(--muted); font-size: .85rem; align-self: center; }
.widget .site-search { margin: 0; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.widget .site-search input, .widget .site-search input:focus { color: var(--text); width: 100%; }
.widget .site-search input::placeholder { color: var(--muted); }
.widget .site-search button { color: var(--muted); }
.widget .site-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--focus); }

/* the village's page: its facts under its text, the sidebar beside both */
.intro { grid-template-columns: 1fr; }
.home main#main { padding-top: 1.75rem; }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.post-card { border-radius: var(--radius); }
.post-card:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.link-list a::before { color: var(--accent); }
.crumbs li + li::before { color: var(--accent); }
.factbox { border-top-color: var(--accent); }

/* --- the footer --------------------------------------------------------------------------- */
.site-footer { background: var(--forest); color: #cbd6cf; padding-block: 1.5rem; margin-top: 2.5rem; }
.heritage-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.heritage-foot p { margin: 0; }
.heritage-foot strong { color: #fff; }

@media (max-width: 56rem) {
  .with-aside { grid-template-columns: 1fr; }
  .heritage-nav ul.menu > li > a { padding: 0 .7rem; }
}
.heritage-plain { height: auto; padding-block: 2.5rem 2rem; }

/* admin: preview.css */
/* preview.css — the bar an administrator previewing a theme sees, in any theme (site pages). */
.theme-preview-bar { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; max-width: calc(100% - 2rem);
  padding: .6rem 1rem; border-radius: 10px; font: .9rem/1.4 system-ui, sans-serif;
  background: #1d1c1a; color: #f4f2ec; box-shadow: 0 8px 28px rgb(0 0 0 / .3); }
.theme-preview-bar a { color: #ffd38a; }

/* comments: comments.css */
/* comments.css — the base look of comments: the thread, its replies and the spam trap.
   Built only on the theme's tokens (--surface, --border, --accent, --radius...), so an
   application restyles it by its own tokens, or by its own stylesheet loaded after this. */
.comments { margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
ol.comment-list, ol.comment-replies { list-style: none; padding-left: 0; }
ol.comment-replies { padding-left: 1.25rem; border-left: 2px solid var(--border); }
.comment { margin-bottom: 1rem; } .comment-meta { margin: 0 0 .25rem; } .comment-body p { margin: .25rem 0; }
.comment-reply summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* notifications: toasts.css */
/* toasts.css — the notifications module's base look, on the theme's tokens. */
.toasts { position: fixed; z-index: 200; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem;
  width: min(24rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: .75rem; padding: .7rem .8rem .7rem 1rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--muted);
  border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0, 0, 0, .16); animation: toast-in .22s ease-out; }
.toast-success { border-left-color: var(--ok); }
.toast-info { border-left-color: var(--focus); }
.toast-warning { border-left-color: #b7791f; }
.toast-error { border-left-color: var(--danger); }
.toast-text { flex: 1; line-height: 1.4; }
.toast-text::before { font-weight: 700; margin-right: .4rem; }
.toast-success .toast-text::before { content: "✓"; color: var(--ok); }
.toast-warning .toast-text::before { content: "!"; color: #b7791f; }
.toast-error .toast-text::before { content: "✕"; color: var(--danger); }
.toast-close { border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1;
  padding: 0 .2rem; min-height: 0; cursor: pointer; }
.toast-close:hover { color: var(--text); }
.toast-leaving { animation: toast-out .25s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(.5rem); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(1rem); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast-leaving { animation: none; } }
@media (max-width: 40rem) { .toasts { left: 1rem; right: 1rem; width: auto; bottom: .75rem; } }

/* content: content.css */
/* content.css — the base look of the CMS: its menus, entries, featured images and summaries.
   Built only on the theme's tokens (--surface, --border, --accent, --radius...), so an
   application restyles it by its own tokens, or by its own stylesheet loaded after this. */
ul.menu { display: flex; flex-wrap: wrap; gap: .25rem 1rem; list-style: none; margin: 0; padding: 0; }
ul.menu li { position: relative; }
ul.menu ul { display: none; position: absolute; z-index: 5; min-width: 12rem; list-style: none; margin: 0; padding: .5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
ul.menu li:hover > ul, ul.menu li:focus-within > ul { display: block; }
@media (max-width: 40rem) { ul.menu ul { position: static; display: block; border: none; padding-left: 1rem; } }
.entry .body img { border-radius: var(--radius); }
.entry .body .aligncenter { display: block; margin-inline: auto; }
.entry .body .alignleft { float: left; margin: 0 1rem .5rem 0; } .entry .body .alignright { float: right; margin: 0 0 .5rem 1rem; }
@media (max-width: 40rem) { .entry .body .alignleft, .entry .body .alignright { float: none; margin: 0 0 .5rem; } }
.featured img { width: 100%; max-height: 28rem; object-fit: cover; border-radius: var(--radius); }
.summary h2 { margin-top: 0; }
textarea.code { font-family: var(--mono); font-size: .9rem; }
/* a video: a play link until it is played, then YouTube's player in its place */
.video { position: relative; aspect-ratio: 16 / 9; margin: 1rem 0; background: #111; border-radius: var(--radius); overflow: hidden; }
.video a.video-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .6rem;
  color: #fff; text-decoration: none; font-weight: 600; background: radial-gradient(circle, #333 0, #111 70%); }
.video a.video-play::before { content: ""; width: 0; height: 0; border-style: solid; border-width: .9rem 0 .9rem 1.5rem;
  border-color: transparent transparent transparent currentColor; }
.video a.video-play:hover, .video a.video-play:focus-visible { color: var(--accent); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* the editor's versions: what changed, and how it looked */
.versions { margin-top: 2rem; }
.version-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.version-actions form { margin: 0; }
.version-actions .hint { flex-basis: 100%; margin: 0; }
.version-nav { margin: .5rem 0 1rem; }
.diff { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem 1rem; background: var(--surface); }
.diff p { margin: .4rem 0; }
.diff .diff-same { color: var(--muted); }
.diff del, .version-fields del { background: color-mix(in srgb, var(--danger) 16%, transparent); color: inherit; text-decoration: line-through; }
.diff ins, .version-fields ins { background: color-mix(in srgb, var(--ok) 18%, transparent); color: inherit; text-decoration: underline; }
.version-preview { max-width: 48rem; }
.version-copy { border-left: 4px solid var(--focus); }
.diff .diff-fold { color: var(--muted); font-style: italic; text-align: center; border-block: 1px dashed var(--border); padding: .2rem 0; }
/* the editor's content, a category at a time */
.content-browse { display: grid; grid-template-columns: 15rem 1fr; gap: 1.5rem; align-items: start; }
.term-nav { position: sticky; top: 1rem; border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; background: var(--surface); }
.term-nav-head { font-weight: 600; margin: 0 0 .4rem; }
.term-nav ul, .term-counts { list-style: none; padding: 0; margin: 0; }
.term-nav li a { display: flex; justify-content: space-between; gap: .5rem; padding: .3rem .4rem; border-radius: 6px; text-decoration: none; color: var(--text); }
.term-nav li a:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.term-nav li a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
.term-nav .count, .term-counts .count { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.depth-1 { padding-left: 1rem; } .depth-2 { padding-left: 2rem; } .depth-3 { padding-left: 3rem; } .depth-4 { padding-left: 4rem; }
.content-types { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.content-type h2 { margin: 0; font-size: 1.25rem; }
.term-counts { margin-top: .5rem; columns: 2; column-gap: 1.5rem; }
.term-counts li { padding: .15rem 0; break-inside: avoid; }
@media (max-width: 52rem) { .content-browse { grid-template-columns: 1fr; } .term-nav { position: static; } .term-counts { columns: 1; } }
.term-nav ul { display: block; }
.term-nav li { display: block; }
.term-nav li a .count { margin-left: auto; }
.term-nav > p a { color: var(--accent); }

/* gallery: gallery.css */
/* gallery.css — tiles, grids and the lightbox. Uses the theme's tokens when they exist. */
.gallery-tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); margin-block: 1rem; }
.gallery-tile { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: inherit; }
.gallery-tile img, .gallery-empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius, 8px); background: var(--border, #ddd); display: block; }
.gallery-tile:hover img { outline: 2px solid var(--accent, #8a2b1f); outline-offset: 2px; }
.gallery-tile-title { font-weight: 600; }
.gallery-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); margin-block: 1rem; }
.gallery-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius, 8px); display: block; }
dialog.lightbox { border: none; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; color: #fff; }
dialog.lightbox::backdrop { background: rgb(0 0 0 / .88); }
dialog.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
dialog.lightbox img { max-width: 96vw; max-height: 84vh; object-fit: contain; }
dialog.lightbox figcaption { max-width: 60ch; text-align: center; }
dialog.lightbox .lightbox-bar { display: flex; gap: .5rem; justify-content: center; }
dialog.lightbox button { background: rgb(255 255 255 / .15); color: #fff; border: 1px solid rgb(255 255 255 / .3); min-width: 3rem; }
dialog.lightbox .lightbox-count { align-self: center; opacity: .8; }
/* the grid of a gallery's photos (from the base theme) */
.gallery { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.gallery figure { margin: 0; } .gallery img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: var(--radius); }
/* the gallery's editor */
.gallery-photo-row { display: grid; grid-template-columns: 10rem 1fr; gap: 1rem; align-items: start; padding: .75rem 0; border-top: 1px solid var(--border); }
.gallery-photo-row img { width: 10rem; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }
.gallery-photo-row label { font-weight: 500; }
@media (max-width: 40rem) { .gallery-photo-row { grid-template-columns: 1fr; } }

