/* Pythagoras Foundation. Huisstijl uit het logo: diepgroen + goud.
   Systeemlettertypen: geen externe afhankelijkheden, blijft jaren werken. */
:root {
  --green: #243d2e;
  --green-2: #345440;
  --green-tint: #eef2ee;
  --gold: #b78a42;
  --gold-tint: #f6efe2;
  --ink: #1d2520;
  --muted: #5f6a63;
  --paper: #fbfaf7;
  --card: #ffffff;
  --line: #e6e2d8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --wide: 74rem;
  --text: 42rem;
  --header-h: 5rem;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(36 61 46 / .05), 0 6px 20px rgb(36 61 46 / .06);

  --pagefind-ui-scale: .9;
  --pagefind-ui-primary: var(--green);
  --pagefind-ui-text: var(--ink);
  --pagefind-ui-background: var(--card);
  --pagefind-ui-border: var(--line);
  --pagefind-ui-tag: var(--green-tint);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: var(--radius);
  --pagefind-ui-font: var(--sans);
}

/* ---------- basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 1.5rem); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.7 var(--serif);
  display: flex; flex-direction: column; min-height: 100vh; text-rendering: optimizeLegibility; }
img, svg { max-width: 100%; }
a { color: var(--green); text-decoration: underline; text-decoration-color: rgb(183 138 66 / .55);
  text-decoration-thickness: 1px; text-underline-offset: .2em; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--green-2); text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { color: var(--green); font-weight: 600; line-height: 1.2; letter-spacing: -.005em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); margin: .5rem 0 1rem; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin: 2.25rem 0 .75rem; }
h3 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
.icon { flex: 0 0 auto; vertical-align: middle; }
.tetractys { color: var(--gold); display: block; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: .5rem; z-index: 30; background: var(--green); color: #fff;
  padding: .5rem 1rem; border-radius: var(--radius); text-decoration: none; }
.skip:focus { left: .5rem; }

/* ---------- vaste header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgb(251 250 247 / .92);
  backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line); }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent); opacity: .45;
  z-index: 0; pointer-events: none; }
.bar { position: relative; z-index: 1; max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; min-height: var(--header-h);
  display: flex; align-items: center; gap: 2rem; }
.brand { display: block; flex: 0 0 auto; color: var(--green); text-decoration: none; font-size: 1.3rem; font-weight: 600; }
.brand img { display: block; height: 3.2rem; width: auto; }

.menu { margin-left: auto; }
.menu ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4rem; }
.menu a { position: relative; display: block; padding: .5rem 0; white-space: nowrap; font-family: var(--sans); font-size: .76rem;
  font-weight: 500; letter-spacing: .15em; text-transform: uppercase; color: var(--green); text-decoration: none; }
.menu a::after { content: ""; position: absolute; left: 0; right: 0; bottom: .15rem; height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.menu a:hover::after, .menu a[aria-current="page"]::after { transform: scaleX(1); }

.tools { display: flex; align-items: center; gap: .5rem; }
.icon-button { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 999px;
  border: 1px solid transparent; background: none; color: var(--green); cursor: pointer; padding: 0; }
.icon-button:hover { background: var(--green-tint); color: var(--green); }
.menu-toggle { display: none; border-color: var(--line); }
.menu-toggle [data-icon="close"] { display: none; }
.site-header.open .menu-toggle [data-icon="menu"] { display: none; }
.site-header.open .menu-toggle [data-icon="close"] { display: block; }

.lang-select { position: relative; font-family: var(--sans); font-size: .8rem; }
.lang-select summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .35rem;
  height: 2.4rem; padding: 0 .7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--green);
  font-weight: 500; letter-spacing: .06em; background: var(--card); }
.lang-select summary::-webkit-details-marker { display: none; }
.lang-select summary:hover { border-color: var(--gold); }
.lang-select summary .icon:last-child { color: var(--gold); transition: transform .2s; }
.lang-select[open] summary .icon:last-child { transform: rotate(180deg); }
.lang-select ul { position: absolute; z-index: 5; right: 0; top: calc(100% + .5rem); margin: 0; padding: .4rem; list-style: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 12rem; }
.lang-select li a { display: flex; gap: .75rem; align-items: baseline; padding: .5rem .75rem; border-radius: 5px;
  text-decoration: none; color: var(--ink); font-size: .9rem; }
.lang-select li a:hover { background: var(--green-tint); }
.lang-select .lang-code { font-size: .72rem; letter-spacing: .08em; color: var(--muted); width: 1.6rem; }
.lang-select li a[aria-current] { color: var(--green); font-weight: 600; }
.lang-select li a[aria-current] .lang-code { color: var(--gold); }

@media (max-width: 1120px) {
  :root { --header-h: 4.25rem; }
  .bar { flex-wrap: wrap; gap: .5rem 1rem; padding: .5rem 1.25rem; }
  .brand img { height: 2.5rem; }
  .tools { margin-left: auto; }
  .menu-toggle { display: inline-grid; }
  .menu { order: 3; flex-basis: 100%; margin: 0; }
  .menu ul { flex-direction: column; gap: 0; padding: .25rem 0 1rem; }
  .menu li + li { border-top: 1px solid var(--line); }
  .menu a { padding: .85rem 0; font-size: .82rem; }
  .menu a::after { display: none; }
  .menu a[aria-current="page"] { color: var(--gold); }
  .js .site-header:not(.open) .menu { display: none; }
}
@media (max-width: 420px) {
  .bar { gap: .5rem .75rem; padding: .5rem 1rem; }
  .brand img { height: 1.85rem; }
  .tools { gap: .25rem; }
  .icon-button { width: 2.3rem; height: 2.3rem; }
  main { padding: 1.5rem 1rem 4rem; }
  .lang-select summary { padding: 0 .55rem; }
  .lang-select summary .icon:first-child { display: none; }
}

/* ---------- algemene inhoud ---------- */
main { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 2rem 1.5rem 5rem; flex: 1; }
.page-head { display: flex; align-items: center; gap: .9rem; margin-bottom: .5rem; }
.page-head h1 { margin: 0; }
.prose { max-width: var(--text); }
.prose p:first-child { font-size: 1.15rem; color: var(--green); }
.intro { color: var(--muted); max-width: var(--text); margin: .25rem 0 1.75rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-family: var(--sans); font-size: .82rem;
  color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--green); }
.sep { display: inline-flex; color: var(--gold); }
.code { display: inline-block; font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .08em;
  color: var(--gold); background: var(--gold-tint); border-radius: 4px; padding: .05rem .4rem; margin-right: .5rem; vertical-align: .15em; }
.count { font-family: var(--sans); font-size: .82rem; color: var(--muted); }
.note { font-family: var(--sans); font-size: .9rem; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow); }
.button { display: inline-flex; align-items: center; gap: .55rem; margin: .5rem 0 2rem; padding: .7rem 1.25rem;
  background: var(--green); color: #fff; text-decoration: none; border-radius: 999px; font-family: var(--sans);
  font-size: .9rem; font-weight: 500; transition: background .15s, transform .15s; }
.button:hover { background: var(--green-2); color: #fff; transform: translateY(-1px); }
.more { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--sans); font-size: .9rem; font-weight: 500; text-decoration: none; }
.more:hover .icon { transform: translateX(3px); }
.more .icon { transition: transform .15s; color: var(--gold); }

/* ---------- home ---------- */
.home { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 4rem; align-items: start; padding-top: 1.5rem; }
.home-side { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: calc(var(--header-h) + 1.5rem); }
.search-card label { display: flex; align-items: center; gap: .5rem; font-family: var(--sans); font-weight: 600; color: var(--green); margin-bottom: .85rem; }
.search-card label .icon { color: var(--gold); }
.search-row { display: flex; gap: .5rem; }
.search-row input { flex: 1; min-width: 0; font-family: var(--sans); font-size: .95rem; padding: .65rem .9rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); }
.search-row input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.search-row button { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--sans); font-size: .9rem;
  font-weight: 500; padding: .6rem 1.1rem; border: 0; border-radius: 999px; background: var(--green); color: #fff; cursor: pointer; }
.search-row button:hover { background: var(--green-2); }
.search-card .count { margin: .9rem 0 0; }
.letter-card { display: flex; flex-direction: column; gap: .3rem; text-decoration: none; color: var(--ink);
  border-left: 3px solid var(--gold); transition: transform .15s, box-shadow .15s; }
.letter-card:hover { transform: translateY(-2px); color: var(--ink); }
.letter-card strong { color: var(--green); font-size: 1.35rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--sans); font-size: .7rem;
  font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; gap: 2rem; padding-top: .5rem; }
  .home-side { position: static; }
  .search-row button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------- bibliotheek ---------- */
#search { margin: 0 0 3rem; }
.pagefind-ui__search-input { border-radius: 999px !important; }
.pagefind-ui__result-link { color: var(--green) !important; }
.pagefind-ui__result-title { font-family: var(--serif) !important; }
.overview h2 { display: flex; align-items: center; gap: .6rem; }
.overview h3 a { color: var(--green); text-decoration: none; }
.cats { list-style: none; padding: 0; margin: 0 0 1rem; border-top: 1px solid var(--line); }
.cats a { display: flex; align-items: center; gap: .25rem; padding: .85rem .5rem; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; transition: background .15s; }
.cats a:hover { background: var(--green-tint); }
.cats .name { flex: 1; font-size: 1.05rem; min-width: 0; }
.cats .desc { display: block; font-size: .8rem; color: var(--muted); line-height: 1.4; margin-top: .15rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cats .count { margin-right: .5rem; }
.cats .icon { color: var(--gold); }
.table-wrap { overflow-x: auto; margin: 1.5rem 0 3rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.docs { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .9rem; }
table.docs th, table.docs td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.docs tr:last-child td { border-bottom: 0; }
table.docs th { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--paper); }
table.docs tbody tr:hover { background: var(--green-tint); }
table.docs td a { font-family: var(--serif); font-size: 1rem; text-decoration: none; }
table.docs td a:hover { text-decoration: underline; }

/* ---------- publicatie en nieuwsbrief ---------- */
.meta { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.5rem; margin: 1.25rem 0;
  padding: 1.25rem 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--sans); font-size: .9rem; max-width: var(--text); }
.meta dt { color: var(--muted); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; padding-top: .1rem; }
.meta dd { margin: 0; }
.theme { font-style: italic; color: var(--green); font-size: 1.15rem; margin: .25rem 0; }
.contents { padding-left: 1.2rem; margin: .5rem 0; max-width: var(--text); }
.contents li { margin: .2rem 0; }
.contents li::marker { color: var(--gold); }
.page { border-top: 1px solid var(--line); padding: 1.5rem 0; max-width: var(--text); }
.page h2 { display: inline-block; font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold); margin: 0 1rem .75rem 0; }
.pagelink { display: inline-flex; align-items: center; gap: .3rem; font-family: var(--sans); font-size: .8rem; color: var(--muted); text-decoration: none; }
.pagelink:hover { color: var(--green); }
.text { white-space: pre-wrap; font-size: 1rem; color: #2c3530; }

/* vaste afbeelding bovenaan een contentpagina */
.page-hero { margin: 0 0 2rem; border-radius: var(--radius); overflow: hidden; background: var(--green); box-shadow: var(--shadow); }
.page-hero img { display: block; width: 100%; max-height: 32rem; object-fit: cover; }
.page-hero figcaption { padding: .7rem 1.2rem; font-family: var(--sans); font-size: .82rem; color: #dfe7e1; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }

/* teksten in contentpagina's */
.prose h2 { font-size: 1.4rem; margin: 2.5rem 0 .6rem; }
.prose h2:first-of-type { margin-top: 1rem; }

/* gedichten/verzen met regelnummers in de kantlijn, zoals in een tekstuitgave */
.verses { margin: 2rem 0 2.5rem; padding: 1.6rem 1.75rem 1.4rem 3.75rem; background: var(--card);
  border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); }
.verses figcaption { margin: 0 0 1rem -2rem; font-family: var(--sans); font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.verse-lines { list-style: none; counter-reset: line; margin: 0; padding: 0; }
.verse-lines li { position: relative; counter-increment: line; padding-left: 1.5rem; text-indent: -1.5rem; line-height: 1.75; }
.verse-lines li:nth-child(5n)::before { content: counter(line); position: absolute; left: -2.5rem; top: .35em; width: 1.75rem;
  text-align: right; text-indent: 0; font-family: var(--sans); font-size: .72rem; color: var(--gold); }
.verse-credit { margin: 1.25rem 0 0 -2rem; font-family: var(--sans); font-size: .82rem; color: var(--muted); }
@media (max-width: 600px) {
  .verses { padding: 1.25rem 1rem 1.1rem 2.6rem; }
  .verses figcaption, .verse-credit { margin-left: -1.6rem; }
  .verse-lines li { font-size: .95rem; padding-left: 1rem; text-indent: -1rem; }
  .verse-lines li:nth-child(5n)::before { left: -2.3rem; }
}

/* volledige tekst, standaard dichtgeklapt */
.fulltext { margin: 1rem 0 2rem; max-width: var(--text); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.fulltext > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem;
  padding: .9rem 1.2rem; font-family: var(--sans); font-size: .9rem; font-weight: 500; color: var(--green); }
.fulltext > summary::-webkit-details-marker { display: none; }
.fulltext > summary:hover { background: var(--green-tint); }
.fulltext > summary .icon { color: var(--gold); transition: transform .2s; transform: rotate(-90deg); }
.fulltext[open] > summary .icon { transform: none; }
.fulltext > summary .count { margin-left: auto; }
.fulltext[open] > summary { border-bottom: 1px solid var(--line); }
.fulltext .page { padding: 1.25rem 1.2rem; border-top: 0; }
.fulltext .page + .page { border-top: 1px solid var(--line); }

/* ---------- slider ---------- */
.slider + .home { padding-top: 0; }
.slider { position: relative; margin: 0 0 2rem; border-radius: var(--radius); overflow: hidden; background: var(--green); box-shadow: var(--shadow); }
.slides { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; margin: 0; scroll-snap-align: start; aspect-ratio: 12 / 5; }
.slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 3rem 1.5rem 1.1rem; color: #fff; font-style: italic;
  background: linear-gradient(transparent, rgb(20 35 26 / .78)); font-size: 1rem; }
.slide-btn { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border: 0; border-radius: 999px; background: rgb(251 250 247 / .85); color: var(--green); cursor: pointer; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; }
.slider:hover .slide-btn, .slide-btn:focus-visible { opacity: 1; }
.slide-btn.prev { left: 1rem; } .slide-btn.next { right: 1rem; }
.dots { position: absolute; right: 1.25rem; bottom: 1.1rem; display: flex; gap: .4rem; }
.dots button { width: .55rem; height: .55rem; padding: 0; border: 0; border-radius: 999px; background: rgb(255 255 255 / .5); cursor: pointer; transition: width .2s, background .2s; }
.dots button[aria-current] { width: 1.4rem; background: var(--gold); }
@media (max-width: 700px) {
  .slide { aspect-ratio: 4 / 3; }
  .slide-btn { opacity: 1; width: 2.3rem; height: 2.3rem; }
  .dots { left: 0; right: 0; justify-content: center; bottom: .6rem; }
  .slide figcaption { padding-bottom: 2rem; font-size: .9rem; }
}

/* ---------- nieuwsbrieven ---------- */
.letters { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1.25rem; }
.letters > li { display: flex; }
.letter { position: relative; display: flex; flex-direction: column; gap: .35rem; width: 100%; text-decoration: none; color: var(--ink);
  transition: transform .15s, border-color .15s; }
.letter:hover { transform: translateY(-2px); border-color: var(--gold); color: var(--ink); }
.letter-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.letter .num { font-size: 2.6rem; line-height: 1; color: var(--gold); font-weight: 600; }
.letter .when { font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.letter strong { color: var(--green); font-size: 1.15rem; margin-top: .4rem; }
.letter .theme { font-size: 1rem; }
.letter .contents { font-family: var(--sans); font-size: .82rem; color: var(--muted); margin-bottom: 1.5rem; }
.letter .go { position: absolute; right: 1.25rem; bottom: 1rem; display: flex; gap: .5rem; color: var(--gold); }

/* foutpagina's */
.error-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; max-width: var(--text); margin: 2rem 0; }
.error-actions .search-card { flex: 1 1 22rem; }
.error-actions .button { margin: 0; }
.error-langs { justify-content: flex-start; margin-top: 2rem; }

/* ---------- footer en startpagina ---------- */
.site-footer { background: var(--green); color: #dfe7e1; font-family: var(--sans); font-size: .85rem; }
.site-footer .inner { max-width: var(--wide); margin: 0 auto; padding: 2.25rem 1.5rem; display: flex;
  justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: .8rem; font-family: var(--serif); font-size: 1.1rem; color: #fff; }
.site-footer nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.site-footer a { color: #dfe7e1; text-decoration: none; letter-spacing: .04em; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--gold); }
.splash { display: flex; flex-direction: column; align-items: center; gap: 2rem; padding: 18vh 1.5rem 4rem; }
.splash img { width: min(30rem, 90vw); height: auto; }
.langlist { list-style: none; padding: 0; margin: 0; display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; font-family: var(--sans); }
.langlist a { display: block; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--card); }
.langlist a:hover { border-color: var(--gold); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .site-header, .site-footer, .button, .pagelink { display: none !important; }
  body { background: #fff; }
}
