@import url("fonts.css");

/* Vier Klosterpigmente kodieren die vier Inhaltsarten. */
:root {
  --voronet: #1e4d8f;      /* Städte */
  --voronet-tief: #163a6d;
  --sucevita: #2c5b4b;     /* Natur */
  --sucevita-tief: #1f4337;
  --humor: #8c3323;        /* Sehenswertes */
  --humor-tief: #6b2519;
  --moldovita: #c08f34;    /* Unterwegs */
  --moldovita-tief: #9a7027;

  --kalk: #ecebe4;         /* Kalkputz: Lesegrund */
  --kalk-2: #e0ded4;
  --kalk-3: #d2cfc2;
  --nacht: #10213d;        /* Tinte */
  --nacht-2: #3a4862;
  --auf-pigment: #eeede6;
  --auf-pigment-2: #c9d2e0;

  --ground: var(--kalk);
  --ground-2: var(--kalk-2);
  --rule: var(--kalk-3);
  --ink: var(--nacht);
  --ink-2: var(--nacht-2);

  --f-display: "Marcellus", "Alegreya", Georgia, serif;
  --f-text: "Alegreya", Georgia, serif;
  --f-data: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;

  --wrap: 78rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --band: clamp(3.5rem, 8vw, 7rem);
  --ease: cubic-bezier(.16, 1, .3, 1);

  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111a2a;
    --ground-2: #172238;
    --rule: #26324a;
    --ink: #e6e5dd;
    --ink-2: #aab3c3;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink-2) var(--ground); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.1875rem/1.62 var(--f-text);
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--moldovita); color: var(--nacht); }
:focus-visible { outline: 3px solid var(--moldovita); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; line-height: 1.08; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--moldovita); color: var(--nacht); padding: .5rem 1rem; font-family: var(--f-data); }
.skip:focus { top: 1rem; }

/* ---------- Pigmentflächen ---------- */
.p-blau  { --pig: var(--voronet);   --pig-tief: var(--voronet-tief); }
.p-gruen { --pig: var(--sucevita);  --pig-tief: var(--sucevita-tief); }
.p-rot   { --pig: var(--humor);     --pig-tief: var(--humor-tief); }
.p-ocker { --pig: var(--moldovita); --pig-tief: var(--moldovita-tief); }
.p-nacht { --pig: var(--nacht);     --pig-tief: #0a1629; }

.field { background: var(--pig); color: var(--auf-pigment); }
.field.p-ocker { color: var(--nacht); }
.field a { color: inherit; }

/* ---------- Kopfzeile ---------- */
.top { position: relative; z-index: 2; }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 1.1rem; }
.mark { font-family: var(--f-display); font-size: 1.35rem; text-decoration: none; letter-spacing: .02em; display: inline-flex; align-items: center; gap: .6rem; }
.mark svg { width: 1.1rem; height: 1.4rem; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; margin: 0; padding: 0; list-style: none; font: 500 .95rem/1.2 var(--f-data); letter-spacing: .02em; }
.nav a { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; padding-block: .35rem; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: currentColor; }
.chip { width: .7rem; height: .9rem; border-radius: 50% 50% 0 0 / 39% 39% 0 0; background: var(--c); box-shadow: 0 0 0 1px rgb(255 255 255 / .35); flex: none; }
.c-blau { --c: var(--voronet); } .c-gruen { --c: var(--sucevita); } .c-rot { --c: var(--humor); } .c-ocker { --c: var(--moldovita); } .c-nacht { --c: var(--nacht); }

/* ---------- Nische (Rundbogen) ---------- */
.niche { display: grid; gap: .6rem; text-decoration: none; color: inherit; min-width: 0; }
.niche__arch {
  position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 50% 50% 0 0 / 40% 40% 0 0;
  background: var(--pig-tief, var(--nacht));
  border-bottom: 5px solid var(--edge, var(--pig, var(--moldovita)));
}
.niche__arch img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease), filter 1.4s var(--ease); }
.niche__arch::after {
  content: ""; position: absolute; inset: 7px 7px 0; pointer-events: none;
  border: 1px solid rgb(238 237 230 / .55); border-bottom: 0;
  border-radius: 50% 50% 0 0 / 40% 40% 0 0;
}
.niche:hover .niche__arch img { transform: scale(1.045); }
.niche__name { font-family: var(--f-display); font-size: 1.3rem; line-height: 1.15; }
.niche__sub { display: block; font: 400 .9rem/1.3 var(--f-data); opacity: .82; margin-top: .15rem; }
.e-blau { --edge: var(--voronet); } .e-gruen { --edge: #4f8a73; } .e-rot { --edge: #b5513b; } .e-ocker { --edge: var(--moldovita); }
.field .e-blau { --edge: #5f8fd1; }

/* ---------- Register: unveränderliche Achse ---------- */
.register { padding-block: var(--band); }
.register__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1rem 3rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.register__head h2 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
.register__lead { grid-column: 1; max-width: 46ch; margin: .9rem 0 0; opacity: .9; }
.register__all { grid-column: 2; grid-row: 1 / span 2; align-self: end; font: 500 1rem/1.2 var(--f-data); letter-spacing: .02em; white-space: nowrap; display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: .3rem; }
.register__all svg { width: 1.1rem; height: .7rem; transition: transform .5s var(--ease); }
.register__all:hover svg { transform: translateX(4px); }
.row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 42vw), 1fr)); gap: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.75rem); }
.row--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1000px) {
  .row--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .register__head { grid-template-columns: 1fr; }
  .register__all { grid-column: 1; grid-row: auto; justify-self: start; }
  .row--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Startseite: die blaue Wand ---------- */
.wall { padding-bottom: clamp(3rem, 6vw, 5rem); overflow: hidden; }
.wall__title { padding-top: clamp(2.5rem, 7vw, 6rem); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.5rem 4rem; align-items: end; }
.wall h1 { font-size: clamp(3.6rem, 12vw, 6rem); line-height: .95; letter-spacing: -.015em; }
.wall__lead { font-size: clamp(1.15rem, 1.7vw, 1.35rem); max-width: 34ch; margin: 0; color: var(--auf-pigment); }
.legend { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: .45rem; font: 400 1rem/1.35 var(--f-data); color: var(--auf-pigment-2); }
.legend li { display: flex; gap: .65rem; align-items: center; }
.legend a { color: var(--auf-pigment); text-decoration: none; border-bottom: 1px solid rgb(238 237 230 / .4); }
.legend a:hover { border-bottom-color: currentColor; }
.legend .chip { width: .85rem; height: 1.1rem; }
.wall__niches { margin-top: clamp(2.5rem, 5vw, 4rem); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(.75rem, 1.6vw, 1.5rem); }
.wall__niches .niche__name { font-size: clamp(1rem, 1.35vw, 1.2rem); }
.wall__niches .niche:nth-child(even) { margin-top: clamp(1.5rem, 4vw, 3.5rem); }
@media (max-width: 900px) {
  .wall__title { grid-template-columns: 1fr; }
  .wall__niches { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(9.5rem, 40vw); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: thin; }
  .wall__niches .niche { scroll-snap-align: start; }
}

/* Das eine Bewegungsmoment: die Bögen öffnen sich wie ein Fresko, das freigelegt wird. */
@media (prefers-reduced-motion: no-preference) {
  .reveal .niche__arch img { animation: unveil 1.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 110ms + 150ms); }
  @keyframes unveil {
    from { clip-path: inset(100% 0 0 0); transform: scale(1.12); filter: saturate(.3); }
    to   { clip-path: inset(0 0 0 0);   transform: scale(1);    filter: none; }
  }
}

/* ---------- Karte ---------- */
.map { position: relative; }
.map svg { width: 100%; height: auto; display: block; }
.map__land { fill: var(--ground-2); stroke: var(--ink-2); stroke-width: 1.2; stroke-linejoin: round; }
.map__dot { stroke: var(--ground); stroke-width: 2; transition: r .3s var(--ease); cursor: pointer; }
.map__dot.k-city { fill: var(--voronet); }
.map__dot.k-nature { fill: var(--sucevita); }
.map__dot.k-sight { fill: var(--humor); }
.map a:focus-visible .map__dot, .map a:hover .map__dot { r: 11; }
.map__lbl { font: 500 15px/1 var(--f-data); fill: var(--ink); paint-order: stroke; stroke: var(--ground); stroke-width: 4px; pointer-events: none; }
.map__lbl--minor { font-size: 13px; fill: var(--ink-2); }
.map__tip { position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 14px)); background: var(--nacht); color: var(--auf-pigment); font: 500 .95rem/1.2 var(--f-data); padding: .45rem .7rem; border-radius: 3px; white-space: nowrap; opacity: 0; transition: opacity .2s; box-shadow: 0 6px 18px rgb(0 0 0 / .22); }
.map__tip.on { opacity: 1; }
.map-filter { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font: 500 .95rem/1.2 var(--f-data); margin-bottom: 1.25rem; }
.map-filter label { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; }
.map-filter input { accent-color: var(--nacht); width: 1rem; height: 1rem; }

/* ---------- Kopf einer Ortstafel ---------- */
.plate-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem); }
.crumbs { font: 500 .95rem/1.3 var(--f-data); letter-spacing: .02em; display: flex; flex-wrap: wrap; gap: .35rem .6rem; margin-bottom: 1.4rem; color: var(--auf-pigment-2); }
.field.p-ocker .crumbs { color: var(--nacht); }
.crumbs a { text-decoration: none; border-bottom: 1px solid currentColor; }
.plate-head h1 { font-size: clamp(2.75rem, 7vw, 5.5rem); }
.plate-head__alt { font: 400 1.1rem/1.4 var(--f-data); margin-top: .7rem; opacity: .85; }
.plate-head__tag { font-size: clamp(1.2rem, 1.8vw, 1.45rem); line-height: 1.45; max-width: 44ch; margin: 1.3rem 0 0; }

/* Faktenleiste: dicht gesetzt gegen das ruhige Bild */
.facts { background: var(--pig-tief); color: var(--auf-pigment); }
.facts.p-ocker { color: var(--nacht); }
.facts dl { margin: 0; display: flex; flex-wrap: wrap; gap: .9rem 2.25rem; padding-block: 1.1rem; font-family: var(--f-data); font-variant-numeric: lining-nums tabular-nums; }
.facts div { min-width: 0; }
.facts dt { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; opacity: .78; }
.facts dd { margin: .1rem 0 0; font-size: 1.02rem; font-weight: 500; }

.plate-img { margin: 0; }
.plate-img__frame { position: relative; overflow: hidden; border-radius: 50% 50% 0 0 / clamp(8rem, 22vw, 18rem) clamp(8rem, 22vw, 18rem) 0 0; background: var(--pig-tief); max-height: 78vh; }
.plate-img__frame img { width: 100%; height: 100%; max-height: 78vh; object-fit: cover; }
.plate-img figcaption, .credit { font: 400 .85rem/1.4 var(--f-data); color: var(--ink-2); margin-top: .6rem; }
.credit a { color: inherit; }
.stage { padding-top: clamp(2rem, 4vw, 3rem); }

/* ---------- Lesetext ---------- */
.read { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: clamp(2rem, 6vw, 6rem); padding-block: clamp(2.5rem, 5vw, 4.5rem) var(--band); }
.read__main { max-width: 68ch; }
.read__main > p:first-child { font-size: 1.3rem; line-height: 1.55; }
.read__main h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); margin: 2.6em 0 .7em; }
.read__main h2:first-child { margin-top: 0; }
.highlights { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.highlights li { padding: 1rem 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); gap: .3rem 1.5rem; }
.highlights b { font-family: var(--f-display); font-weight: 400; font-size: 1.15rem; line-height: 1.3; }
.highlights span { color: var(--ink-2); font-size: 1.05rem; }
@media (max-width: 620px) { .highlights li { grid-template-columns: 1fr; } }
.tip { margin: 2.5rem 0 0; padding: 1.4rem 1.6rem; background: var(--moldovita); color: var(--nacht); border-radius: 2px; }
.tip h3 { font-size: 1.35rem; margin-bottom: .45rem; }
.tip p { margin: 0; }

.aside { display: grid; gap: 2.5rem; align-content: start; }
.aside h2 { font-size: 1.45rem; margin-bottom: .9rem; }
.near { list-style: none; margin: 0; padding: 0; font-family: var(--f-data); }
.near li { border-top: 1px solid var(--rule); }
.near a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .7rem 0; text-decoration: none; }
.near a:hover .near__n { text-decoration: underline; text-underline-offset: .2em; }
.near__n { font-weight: 500; font-size: 1.05rem; }
.near__d { font-variant-numeric: lining-nums tabular-nums; color: var(--ink-2); font-size: .95rem; }
.minimap .map__dot { cursor: default; }
.minimap .map__dot.is-here { r: 26; stroke: var(--moldovita); stroke-width: 3; }
.minimap .map__dot:not(.is-here) { r: 9; opacity: .45; }

@media (max-width: 900px) {
  .read { grid-template-columns: 1fr; }
}

/* ---------- Übersichtsseiten ---------- */
.index-head { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2.5rem, 5vw, 4rem); }
.index-head h1 { font-size: clamp(3rem, 8vw, 6rem); }
.index-head p { max-width: 52ch; font-size: clamp(1.15rem, 1.6vw, 1.3rem); margin: 1.2rem 0 0; }
.index-head .count { font: 500 1rem/1.2 var(--f-data); letter-spacing: .02em; color: var(--auf-pigment-2); margin-top: 1.4rem; }
.field.p-ocker .count { color: var(--nacht); }
.group { padding-block: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--rule); display: grid; grid-template-columns: minmax(10rem, 15rem) minmax(0, 1fr); gap: 1.5rem clamp(2rem, 4vw, 4rem); }
.group:first-child { border-top: 0; }
.group__label h2 { font-size: clamp(1.6rem, 2.5vw, 2rem); position: sticky; top: 1.5rem; }
.group__label a { text-decoration: none; }
.group__label p { font: 400 .95rem/1.4 var(--f-data); color: var(--ink-2); margin-top: .6rem; }
.group .niche__sub { color: var(--ink-2); opacity: 1; }
@media (max-width: 760px) { .group { grid-template-columns: 1fr; } .group__label h2 { position: static; } }

/* Regionen und Themen als Textregister */
.textlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 0 clamp(2rem, 4vw, 4rem); }
.textlist li { border-top: 1px solid var(--line, var(--rule)); }
.textlist a { display: block; padding: 1.2rem 0 1.4rem; text-decoration: none; }
.textlist b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 1.6rem; line-height: 1.15; }
.textlist em { font-style: normal; font: 400 .95rem/1.3 var(--f-data); opacity: .8; }
.textlist span { display: block; margin-top: .45rem; font-size: 1.05rem; opacity: .9; }
.textlist a:hover b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.field .textlist { --line: rgb(238 237 230 / .28); }
.field.p-ocker .textlist { --line: rgb(16 33 61 / .25); }

.list-block { margin-top: 2.5rem; }

/* ---------- Fuß ---------- */
.foot { padding-block: clamp(3rem, 6vw, 4.5rem) 2.5rem; font: 400 1rem/1.5 var(--f-data); }
.foot__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 2rem; }
.foot h2 { font-family: var(--f-display); font-size: 1.6rem; margin-bottom: .6rem; }
.foot h3 { font: 700 .8rem/1 var(--f-data); letter-spacing: .12em; text-transform: uppercase; margin-bottom: .9rem; color: var(--auf-pigment-2); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.foot a { text-decoration: none; } .foot a:hover { text-decoration: underline; }
.foot p { color: var(--auf-pigment-2); max-width: 36ch; }
.foot__base { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid rgb(238 237 230 / .2); color: var(--auf-pigment-2); font-size: .9rem; display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }
@media (max-width: 760px) { .foot__grid { grid-template-columns: 1fr 1fr; } .foot__grid > :first-child { grid-column: 1 / -1; } }

/* Bildnachweis */
.credits { list-style: none; padding: 0; margin: 0; font: 400 .95rem/1.45 var(--f-data); columns: 2 22rem; column-gap: 3rem; }
.credits li { break-inside: avoid; padding: .7rem 0; border-top: 1px solid var(--rule); }
.credits b { font-weight: 500; }
.credits span { color: var(--ink-2); }

/* Nachträge */
.field.p-blau .c-blau, .p-blau .chip.c-blau { box-shadow: 0 0 0 1.5px var(--auf-pigment); }
@media (max-width: 620px) {
  .facts dl { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.25rem; }
  .facts dd { font-size: .95rem; overflow-wrap: anywhere; }
}
.wall__niches { scroll-padding-inline: var(--gutter); }
.aside .map:not(.minimap) .map__dot { r: 16; stroke-width: 4; }
.aside .map:not(.minimap) a:hover .map__dot, .aside .map:not(.minimap) a:focus-visible .map__dot { r: 22; }
.aside .map__land { stroke-width: 2.5; }

/* Kartenbeschriftung: auf schmalen Schirmen nur noch über das Namensschild */
@media (max-width: 600px) { .map__lbl { display: none; } }

/* Fries an den Registernähten: eine Reihe kleiner Blendarkaden, wie unter dem Traufgesims der Moldauklöster */
.wall, .register.field { position: relative; }
.wall::after, .register.field::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
  background-color: var(--pig-tief);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='14'%3E%3Cpath d='M3 14V8a8 8 0 0 1 16 0v6z'/%3E%3C/svg%3E") repeat-x left bottom / 22px 14px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='14'%3E%3Cpath d='M3 14V8a8 8 0 0 1 16 0v6z'/%3E%3C/svg%3E") repeat-x left bottom / 22px 14px;
}
.register.field.p-nacht::after { background-color: #26324a; }

/* Seitenspalte läuft beim Lesen mit */
@media (min-width: 901px) { .aside { position: sticky; top: 1.5rem; align-self: start; } }
