/* KGV Goldene Höhe -- one stylesheet, no framework.
   Colours taken over from the old site (theme "Planet Green"). */

:root {
  --green: #6ab43e;
  --green-dark: #4e8a2c;
  --text: #434343;
  --muted: #64686d;
  --line: #dbdbdb;
  --soft: #f4f7f1;
  --bg: #ffffff;
  --radius: 6px;
  --wrap: 1200px;
  --prose: 760px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font: 400 16px/1.7 Poppins, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; }
a { color: var(--green-dark); text-underline-offset: 2px; }
a:hover { color: var(--green); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

h1, h2, h3 { font-family: Albertus, Georgia, serif; line-height: 1.25; color: #2f3a28; font-weight: 400; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 .5rem; }
h2 { font-size: 1.5rem; margin: 2.2rem 0 .8rem; }
h3 { font-size: 1.2rem; margin: 1.8rem 0 .6rem; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ---- Header & navigation ------------------------------------------- */

.site-header { position: relative; border-bottom: 4px solid var(--green); background: var(--bg); }
/* Header stays at the top while scrolling (above the map's controls). */
.site-header { position: sticky; top: 0; z-index: 1100; }
html { scroll-padding-top: 6rem; }
.brand { margin-right: auto; }
.header-search { display: flex; padding: .45rem; border-radius: var(--radius); color: var(--green); }
.header-search:hover { color: var(--green-dark); background: var(--soft); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .75rem; }

.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: inherit; flex-shrink: 0; }
.brand-title { display: block; font: 1.8rem/1 Albertus, Georgia, serif; color: var(--green); }
.brand-tagline { display: block; font-size: .8rem; color: var(--muted); }

.site-header nav ul { list-style: none; margin: 0; padding: 0; }
.site-header nav a {
  display: block; padding: .35rem .45rem; border-radius: var(--radius);
  text-decoration: none; color: var(--text); font-weight: 600; font-size: .85rem; white-space: nowrap;
}
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--green-dark); background: var(--soft); }

.nav-desktop ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0; }

/* Mobile: the menu is a <details> element -- opens without JavaScript. */
.nav-toggle { display: none; }
.nav-toggle summary {
  list-style: none; cursor: pointer; padding: .45rem .9rem; white-space: nowrap;
  border: 2px solid var(--green); border-radius: var(--radius); font-weight: 600; color: var(--green-dark);
}
.nav-toggle summary::-webkit-details-marker { display: none; }
.nav-toggle summary::before { content: "☰ "; }
.nav-toggle[open] summary::before { content: "✕ "; }
.nav-toggle[open] nav {
  position: absolute; left: 0; right: 0; z-index: 10; margin-top: .75rem;
  background: var(--bg); border-bottom: 4px solid var(--green); padding: .5rem 16px 1rem;
  box-shadow: 0 8px 16px rgb(0 0 0 / .08);
}

@media (max-width: 1060px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: block; }
  .brand-title { font-size: 1.6rem; }
  .brand img { width: 58px; height: auto; }
}
@media (max-width: 480px) {
  .brand { gap: .5rem; flex-shrink: 1; min-width: 0; }
  /* Slim sticky header on phones: name on one line, no tagline. */
  .brand-title { white-space: nowrap; }
  .brand-tagline { display: none; }
  .brand-title { font-size: 1.3rem; }
  .brand-tagline { font-size: .7rem; }
  .brand img { width: 44px; }
}

/* ---- Homepage hero --------------------------------------------------- */

.hero {
  --hero-img: url(hero-900.jpg);
  background: linear-gradient(90deg, rgb(20 20 15 / .6), rgb(20 20 15 / .25)), var(--hero-img) center 35% / cover;
  color: #fff; min-height: min(85vh, 860px); display: flex; align-items: center; padding: 4rem 0;
}
@media (min-width: 700px) { .hero { --hero-img: url(hero-1600.jpg); } }
@media (min-width: 1700px) { .hero { --hero-img: url(hero-2400.jpg); } }
.hero .wrap { width: 100%; }
.hero p { margin: 0; font-size: clamp(1rem, 2.2vw, 1.3rem); text-shadow: 0 1px 3px rgb(0 0 0 / .6); }
.hero .hero-title {
  font: clamp(2.4rem, 8vw, 6rem)/1.05 Albertus, Georgia, serif; margin: 0 0 1rem; max-width: 12ch;
  text-shadow: 0 2px 12px rgb(0 0 0 / .45);
}

/* ---- Articles ---------------------------------------------------------- */

/* Content left, sidebar right; on narrow screens the sidebar moves below. */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; padding-block: 2.5rem 3rem; }
@media (min-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.layout > main { min-width: 0; }
.entry, .entry-header { max-width: var(--prose); }
.entry-header { margin-bottom: 1.5rem; }
.entry-meta { color: var(--muted); font-size: .9rem; margin: 0 0 .3rem; }
.entry-image img { display: block; width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--radius); margin-bottom: 1.5rem; }

.prose img { border-radius: var(--radius); display: block; margin: 1rem 0; }
.prose video { display: block; width: 100%; max-height: 80vh; margin: 1rem 0; border-radius: var(--radius); background: #000; }
.prose blockquote { margin: 1.5rem 0; padding: .5rem 1.2rem; border-left: 4px solid var(--green); background: var(--soft); }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1.5rem 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: .4rem .7rem; text-align: left; vertical-align: top; }
.prose th { background: var(--soft); }
/* The homepage widens to the full wrap so post cards get room. */
.prose .cards { margin-block: 1rem 1.5rem; }

.tags { color: var(--muted); font-size: .85rem; margin-top: 2rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9rem; }
.pager a { max-width: 48%; }
.breadcrumb { color: var(--muted); font-size: .9rem; margin: 0 0 .3rem; }
.breadcrumb a { color: inherit; }
.page-group h2 { margin-bottom: .4rem; }
.page-list { margin-top: 0; }

/* ---- Post cards ------------------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); transition: box-shadow .2s; }
/* Long lists: the browser skips laying out cards far off screen. */
.card { content-visibility: auto; contain-intrinsic-size: auto 340px; }
.card:hover { box-shadow: 0 6px 18px rgb(0 0 0 / .08); }
.card-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.card img, .card-noimage { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin: 0; border-radius: 0; }
.card-noimage { background: var(--soft) url(logo.png) center / 40% no-repeat; }
.card-body { padding: .8rem 1rem 1rem; }
.card-body time { font-size: .8rem; color: var(--muted); }
.card-body h3 { font-size: 1rem; margin: .2rem 0 .4rem; }
.card-body p { font-size: .88rem; margin: 0; color: var(--muted); }
main > .cards { max-width: var(--wrap); }

/* ---- Gallery & carousel (CSS only) --------------------------------------- */

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin: 1.5rem 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; margin: 0; transition: opacity .2s; }
.gallery a:hover img { opacity: .85; }

/* Swipe on phones, scroll on desktop; scroll-snap makes it stop on each image. */
.carousel {
  display: flex; gap: .75rem; overflow-x: auto; margin: 1.5rem 0; padding-bottom: .5rem;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
  scrollbar-color: var(--green) var(--soft);
}
.carousel a { flex: 0 0 85%; scroll-snap-align: center; }
.carousel img { width: 100%; height: clamp(220px, 50vw, 440px); object-fit: cover; margin: 0; }

/* ---- Accordion: native <details>, no JavaScript --------------------------- */

details:not(.nav-toggle) { border: 1px solid var(--line); border-radius: var(--radius); margin: .6rem 0; background: var(--bg); }
details:not(.nav-toggle) > summary {
  cursor: pointer; list-style: none; padding: .8rem 2.8rem .8rem 1rem; position: relative; font-weight: 600;
}
details:not(.nav-toggle) > summary::-webkit-details-marker { display: none; }
details:not(.nav-toggle) > summary::after {
  content: "+"; position: absolute; right: 1rem; top: 50%; translate: 0 -50%;
  font-size: 1.4rem; color: var(--green); transition: rotate .2s;
}
details:not(.nav-toggle)[open] > summary::after { rotate: 45deg; }
details:not(.nav-toggle)[open] > summary { border-bottom: 1px solid var(--line); background: var(--soft); }
details:not(.nav-toggle) > :not(summary) { margin-inline: 1rem; }

/* ---- Parcella placeholders --------------------------------------------- */

.placeholder { border: 2px dashed var(--green); border-radius: var(--radius); background: var(--soft); padding: 1rem 1.2rem; margin: 1.5rem 0; color: var(--muted); }

/* ---- Forms (posted to Parcella) ------------------------------------------
   Parcella sends the visitor back with the outcome as #fragment; only the
   matching message is shown (:target), no JavaScript involved. */

.form { display: grid; gap: .35rem; margin: 1.5rem 0; }
.form label { font-weight: 600; margin-top: .6rem; }
.form input:not([type=checkbox]), .form select, .form textarea {
  font: inherit; color: inherit; width: 100%; padding: .55rem .7rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { border-color: var(--green); }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem 1rem .8rem; margin: 0; }
.form legend { font-weight: 600; padding: 0 .3rem; }
.form .form-check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; cursor: pointer; }
.form .form-check input { margin-top: .35rem; accent-color: var(--green-dark); width: 1.1rem; height: 1.1rem; flex: none; }
.form-hint { color: var(--muted); font-size: .85rem; margin: 0; font-weight: 400; }
.form button, .map-load, .more-button {
  justify-self: start; margin-top: 1rem; font: inherit; font-weight: 600; cursor: pointer;
  padding: .7rem 1.4rem; border: 0; border-radius: var(--radius); background: var(--green-dark); color: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / .12); transition: background .2s;
}
.form button:hover, .map-load:hover, .more-button:hover { background: #3b6a20; }
/* Honeypot: off-screen for people, still filled in by naive bots. */
.form-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-result { display: none; padding: .9rem 1.1rem; border-radius: var(--radius); border-left: 4px solid; margin: 1.5rem 0; scroll-margin-top: 1.5rem; }
.form-result:target { display: block; }
.form-result.is-ok { border-color: var(--green); background: var(--soft); }
.form-result.is-warn { border-color: #d29a1d; background: #fdf6e3; }
.form-result.is-error { border-color: #c0392b; background: #fbecea; }
.form-unavailable { padding: 1rem 1.2rem; background: var(--soft); border-radius: var(--radius); }

/* ---- Lightbox (native <dialog>, opened by lightbox.js) ------------------- */

.lightbox-dialog { border: 0; padding: 0; background: transparent; max-width: 95vw; max-height: 95vh; overflow: visible; }
.lightbox-dialog::backdrop { background: rgb(0 0 0 / .85); }
.lightbox-dialog img { display: block; max-width: 95vw; max-height: 88vh; margin: 0 auto; border-radius: var(--radius); }
.lightbox-dialog p { color: #fff; text-align: center; margin: .5rem 0 0; font-size: .9rem; }
.lightbox-dialog button {
  position: fixed; top: 50%; translate: 0 -50%; border: 0; border-radius: 50%; width: 3rem; height: 3rem;
  background: rgb(255 255 255 / .15); color: #fff; font-size: 1.6rem; cursor: pointer;
}
.lightbox-dialog button:hover { background: rgb(255 255 255 / .3); }
.lightbox-dialog .lb-prev { left: 1rem; }
.lightbox-dialog .lb-next { right: 1rem; }
.lightbox-dialog .lb-close { top: 1.5rem; right: 1rem; translate: none; }

/* ---- Footer ------------------------------------------------------------ */

.site-footer { background: #2f3a28; color: #d9e4d2; padding: 2rem 0; font-size: .9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--green); text-decoration: underline; }
.site-footer p { margin: 0; }

/* ---- Call-to-action buttons (::: button) ------------------------------ */

.buttons { margin: 1.5rem 0; }
.buttons p { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }
.buttons a {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .7rem 1.4rem; border-radius: var(--radius);
  background: var(--green-dark); color: #fff; font-weight: 600; text-decoration: none;
  box-shadow: 0 2px 6px rgb(0 0 0 / .12);
  transition: background .2s, transform .2s, box-shadow .2s;
}
.buttons a::after { content: "→"; transition: transform .2s; }
.buttons a:hover, .buttons a:focus-visible {
  background: #3b6a20; color: #fff;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgb(0 0 0 / .18);
}
.buttons a:hover::after { transform: translateX(3px); }
.buttons a:focus-visible { outline: 3px solid var(--green-dark); outline-offset: 2px; }

/* ---- Two-column tiles (::: columns) ------------------------------------ */

.columns {
  display: grid; gap: 2rem 2.5rem; margin-block: 2rem;
}
@media (min-width: 640px) { .columns { grid-template-columns: 1fr 1fr; } }
.layout .entry:has(.columns) { max-width: none; }
.column h2 { margin-top: 0; }
.column img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin: 0 0 1rem; }

/* ---- Sidebar ----------------------------------------------------------- */

.muted { color: var(--muted); }
.widget { background: var(--soft); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1.5rem; }
.widget h2 { font-size: 1.25rem; margin: 0 0 .8rem; }
.widget p { margin: .8rem 0 0; font-size: .9rem; }

.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: .55rem 0; border-bottom: 1px solid var(--line); line-height: 1.4; }
.events li:last-child { border-bottom: 0; }
.events time { display: block; font-size: .8rem; font-weight: 600; color: var(--green-dark); }
.events strong { display: block; font-weight: 600; }
.events span { display: block; font-size: .85rem; color: var(--muted); }
.prose .events { max-width: 520px; }

/* ---- Search ------------------------------------------------------------ */

.search-form { display: flex; gap: .4rem; }
.search-form input {
  flex: 1; min-width: 0; font: inherit; padding: .45rem .7rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.search-form button {
  font: inherit; font-weight: 600; padding: .45rem .9rem; cursor: pointer;
  border: 0; border-radius: var(--radius); background: var(--green); color: #fff;
}
.search-form button:hover { background: var(--green-dark); }
.search-results { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.search-results li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.search-results h2 { font-size: 1.2rem; margin: 0 0 .2rem; }
.search-results time { font-size: .8rem; color: var(--muted); }
.search-results p { margin: .3rem 0 0; font-size: .92rem; }
.search-results mark { background: #d7ecc6; color: inherit; border-radius: 2px; }

/* ---- Timeline (::: timeline) ------------------------------------------
   A line down the middle, a dot per entry, cards alternating left/right with
   the date on the opposite side. Narrow screens: line on the left. */

.timeline { list-style: none; margin: 2.5rem 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px;
  background: linear-gradient(var(--green), #c9e3b5); border-radius: 2px;
}
.timeline li {
  display: grid; grid-template-columns: minmax(0, 1fr) 3.5rem minmax(0, 1fr); align-items: start; position: relative; margin-bottom: 2rem;
}
.timeline li::before {
  content: ""; grid-column: 2; grid-row: 1; justify-self: center; margin-top: 1.05rem;
  width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--bg);
  border: 3px solid var(--green); box-shadow: 0 0 0 4px var(--bg); z-index: 1;
}
.tl-date {
  grid-row: 1; margin: .85rem 0 0; font: 1.35rem/1.2 Albertus, Georgia, serif; color: var(--green-dark);
}
.tl-card {
  grid-row: 1; position: relative; background: var(--soft); border-radius: var(--radius);
  padding: 1rem 1.2rem; box-shadow: 0 2px 8px rgb(0 0 0 / .05);
}
.tl-card::before {  /* little pointer towards the line */
  content: ""; position: absolute; top: 1.2rem; border: .6rem solid transparent;
}
.tl-card h3 { margin: 0 0 .4rem; font-size: 1.2rem; }
.tl-card p { margin: .4rem 0 0; font-size: .95rem; }
.tl-card img { width: 100%; max-height: 220px; object-fit: cover; margin: .6rem 0; }

.timeline li:nth-child(odd) .tl-card { grid-column: 1; }
.timeline li:nth-child(odd) .tl-card::before { left: 100%; border-left-color: var(--soft); }
.timeline li:nth-child(odd) .tl-date { grid-column: 3; }
.timeline li:nth-child(even) .tl-card { grid-column: 3; }
.timeline li:nth-child(even) .tl-card::before { right: 100%; border-right-color: var(--soft); }
.timeline li:nth-child(even) .tl-date { grid-column: 1; text-align: right; }

@media (max-width: 700px) {
  /* :nth-child(n) matches every entry and outranks the odd/even rules above. */
  .timeline::before { left: 1rem; }
  .timeline li:nth-child(n) { grid-template-columns: 2rem minmax(0, 1fr); column-gap: .8rem; }
  .timeline li:nth-child(n)::before { grid-column: 1; grid-row: 1 / 3; margin-top: .2rem; }
  .timeline li:nth-child(n) .tl-date { grid-column: 2; grid-row: 1; text-align: left; margin: 0 0 .4rem; font-size: 1.1rem; }
  .timeline li:nth-child(n) .tl-card { grid-column: 2; grid-row: 2; }
  .timeline li:nth-child(n) .tl-card::before { display: none; }
}
.layout .entry:has(.timeline) { max-width: none; }

/* ---- Map (::: map) ------------------------------------------------------ */

.map { height: 450px; border-radius: var(--radius); margin: 1.5rem 0; background: var(--soft); z-index: 0; }
@media (max-width: 700px) { .map { height: 340px; } }
.map-consent { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 1.5rem; text-align: center; color: var(--muted); }
.map-consent p { max-width: 32rem; margin: 0; }
.map-pin { background: none; border: 0; }
.map-pin span {
  position: relative; isolation: isolate; display: grid; place-items: center; width: 34px; height: 30px;
  color: #fff; font: 700 .8rem/1 Poppins, sans-serif;
}
.map-pin span::before {  /* the pin: a rotated drop shape behind the label */
  content: ""; position: absolute; z-index: -1; left: 2px; top: 0; width: 30px; height: 30px;
  border-radius: 50% 50% 50% 0; rotate: -45deg; background: var(--green); border: 2px solid #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / .35);
}
.leaflet-popup-content { font: .9rem/1.5 Poppins, sans-serif; }
.leaflet-popup-content p { margin: .4rem 0 0; }

/* Long menu on small screens: scroll inside it, the page stays put. */
.nav-toggle[open] nav { max-height: calc(100vh - 6rem); overflow-y: auto; }
@media (max-width: 700px) {
  .site-header .header-row { padding-block: .4rem; }
}

/* ::: posts ... carousel=3 -- cards in a row to swipe through */
.cards-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .6rem; }
.cards-carousel .card { flex: 0 0 min(280px, 80%); scroll-snap-align: start; }

/* ::: posts ... more=9 -- button under the list (assets/more.js) */
.more-button { display: block; margin: 1.5rem auto 0; }

/* Search suggestions under a search box (assets/search-suggest.js) */
.search-form { position: relative; }
.search-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 50; margin: .25rem 0 0; padding: .3rem 0;
  list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgb(0 0 0 / .12); }
.search-suggest a { display: block; padding: .4rem .8rem; color: inherit; text-decoration: none; line-height: 1.3; }
.search-suggest a:hover, .search-suggest a:focus { background: var(--soft); }
.search-suggest a:focus-visible { outline: 2px solid var(--green-dark); outline-offset: -2px; }
.search-suggest small { display: block; color: var(--muted); }
.search-suggest .all { color: var(--green-dark); font-weight: 600; }

/* ALTCHA spam protection in the forms (assets/altcha/) */
altcha-widget { display: block; margin-top: 1rem; --altcha-max-width: 100%; --altcha-border-radius: var(--radius);
  --altcha-color-border: var(--line); --altcha-color-base: var(--bg); }
