/* Living Document: filter column (25 %) and list (75 %) */

.ld-layout {
  --ld-purple: #663568;
  --ld-green: #009D51;
  --ld-green-dark: #0B9053;
  --ld-line: #c9d8cf;
  --ld-soft: #f3f7f4;
  --ld-muted: #707070;
  --ld-text-soft: #4C4E62;
  display: grid;
  grid-template-columns: minmax(240px, 25%) 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 1.5rem;
}
/* Smaller text for the controls only; entries keep the site's general sizes */
.ld-sidebar,
.ld-toolbar,
.ld-status,
.ld-empty {
  font-size: 0.7em;
}
.ld-filter-toggle {
  display: none;
}

/* Filter column */
.ld-sidebar {
  position: sticky;
  top: calc(73px + 1rem); /* below the sticky header */
  max-height: calc(100vh - 73px - 2rem);
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
}
.ld-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--ld-green);
  padding-bottom: 0.4rem;
}
.ld-sidebar-head h2 {
  margin: 0;
  font-size: 1.3em;
}
.ld-reset {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ld-purple);
  font: inherit;
  font-size: 0.85em;
  text-decoration: underline;
}
.ld-group {
  border-bottom: 1px solid var(--ld-line);
}
.ld-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.8rem 0;
  font-weight: 600;
  cursor: pointer;
}
.ld-group summary::-webkit-details-marker {
  display: none;
}
.ld-group summary::after {
  content: "";
  margin-left: auto;
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-25%);
  transition: transform 0.2s ease;
}
.ld-group[open] summary::after {
  transform: rotate(-135deg);
}
.ld-group-count,
.ld-active-count {
  background: var(--ld-green);
  color: #fff;
  border-radius: 1em;
  padding: 0 0.5em;
  font-size: 0.75em;
  line-height: 1.6;
}
.ld-filter {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
  min-width: 0;
}
.ld-filter[hidden] {
  display: none;
}
.ld-filter legend {
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ld-text-soft);
  margin-bottom: 0.3rem;
  padding: 0;
}
.ld-filter[data-depends-on] {
  padding-left: 0.8rem;
  border-left: 2px solid var(--ld-line);
}
.ld-options {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ld-option label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5em;
  align-items: baseline;
  padding: 0.15rem 0;
  cursor: pointer;
  line-height: 1.3;
}
.ld-option input {
  accent-color: var(--ld-green);
  transform: translateY(0.1em);
}
.ld-option--indented {
  padding-left: 0.6rem;
}
.ld-option-group {
  font-size: 0.85em;
  color: var(--ld-muted);
  margin-top: 0.4rem;
}
.ld-option-count {
  color: var(--ld-muted);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
}
.ld-option.is-empty label {
  opacity: 0.4;
}
.ld-option--more {
  display: none;
}
.ld-filter.show-more .ld-option--more {
  display: block;
}
.ld-more {
  background: none;
  border: 0;
  padding: 0.2rem 0;
  cursor: pointer;
  color: var(--ld-green-dark);
  font: inherit;
  font-size: 0.9em;
  font-weight: 600;
}
.ld-range {
  display: flex;
  align-items: end;
  gap: 0.5rem;
}
.ld-range label {
  display: flex;
  flex-direction: column;
  font-size: 0.85em;
  flex: 1;
  min-width: 0;
}
.ld-range input,
.ld-sort select,
.ld-search {
  font: inherit;
  color: inherit;
  border: 1px solid var(--ld-line);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}
.ld-range input:focus-visible,
.ld-sort select:focus-visible,
.ld-search:focus-visible {
  outline: 2px solid var(--ld-green);
  outline-offset: 1px;
}
.ld-switch {
  display: flex;
  align-items: center;
  gap: 0.6em;
  cursor: pointer;
  line-height: 1.3;
  position: relative;
}
.ld-switch input {
  position: absolute;
  opacity: 0;
}
.ld-switch-track {
  flex: none;
  position: relative;
  width: 2.2em;
  height: 1.2em;
  border-radius: 1em;
  background: #ccc;
  transition: background 0.2s ease;
}
.ld-switch-track::after {
  content: "";
  position: absolute;
  top: 0.15em;
  left: 0.15em;
  width: 0.9em;
  height: 0.9em;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.ld-switch input:checked + .ld-switch-track {
  background: var(--ld-green);
}
.ld-switch input:checked + .ld-switch-track::after {
  transform: translateX(1em);
}
.ld-switch input:focus-visible + .ld-switch-track {
  outline: 2px solid var(--ld-purple);
  outline-offset: 2px;
}

/* List */
.ld-toolbar {
  display: flex;
  gap: 1rem;
  align-items: stretch; /* the sort select takes the height of the search field */
}
.ld-toolbar .ld-search {
  flex: 1;
  padding: 0.5rem 0.75rem;
}
.ld-sort {
  display: flex;
}
.ld-sort select {
  width: auto;
  height: 100%;
  padding: 0.5rem 0.75rem;
}
.ld-status {
  min-height: 2.5rem;
  margin: 0.8rem 0;
}
.ld-result-count {
  margin: 0 0 0.4rem;
  font-size: 0.9em;
  color: var(--ld-text-soft);
}
.ld-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}
.ld-chips button {
  font: inherit;
  font-size: 0.8em;
  cursor: pointer;
  border: 1px solid var(--ld-green);
  background: var(--ld-soft);
  color: var(--ld-purple);
  border-radius: 1em;
  padding: 0.1rem 0.7rem;
}
.ld-chips button::after {
  content: " ×";
}
.ld-chips button:hover {
  background: #e2efe6;
}
.ld-empty {
  text-align: center;
  padding: 2rem 0;
  border-top: 2px solid var(--ld-green);
}

/* Entries */
.living-document .livdoc-entry {
  padding: 1rem 0 1.2rem;
  border-top: 1px solid var(--ld-line);
}
.living-document .livdoc-entry:first-child {
  border-top: 2px solid var(--ld-green);
}
.living-document .livdoc-entry:last-child {
  border-bottom: 2px solid var(--ld-green);
}
.living-document .livdoc-entry[hidden] {
  display: none;
}
.ld-summary {
  margin: 0.3rem 0 0;
  font-size: 0.85em;
  color: var(--ld-muted);
}
.ld-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8em;
}
.ld-badge {
  border: 1px solid var(--ld-purple);
  border-radius: 4px;
  padding: 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.85em;
  font-weight: 600;
}
.ld-badge--cs {
  border-color: var(--ld-green);
  color: var(--ld-green-dark);
}
.ld-year {
  font-weight: 600;
}

/* Details, opened with "Weiterlesen" (site.js) */
.living-document .livdoc-entry .inner {
  overflow: hidden;
}
.living-document .collapsible {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease-in;
}
.living-document .livdoc-entry.show-all .collapsible {
  grid-template-rows: 1fr;
}
.living-document .info-box {
  display: grid;
  grid-template-columns: 25% 1fr;
  column-gap: 1em;
  row-gap: 0.4rem;
  margin-top: 1em;
  font-size: 0.9em;
}
.living-document .info-box h4 {
  margin: 0;
  font-size: 0.9em;
}
.living-document .info-box .abstract > *:first-child {
  margin-top: 0;
}
.living-document .event-buttons {
  margin: 0.6rem 0 0;
}
.living-document .livdoc-entry .link-button {
  position: relative;
  display: flex;
  gap: 0.3em;
  border: 2px solid green;
  border-radius: 15px;
  padding: 0.2em 1em;
  height: 2em;
  background: transparent;
  color: var(--ld-purple, #663568);
  font-weight: 600;
  margin: 0;
}
.living-document .livdoc-entry.show-all .link-button .more {
  display: none;
}
.living-document .livdoc-entry .link-button .less {
  display: none;
}
.living-document .livdoc-entry.show-all .link-button .less {
  display: block;
}

/* Read-more is a <button>: take over the page font like the former <a> did */
.living-document .livdoc-entry button.link-button {
  font: inherit;
  font-weight: 600;
  align-items: center;
  cursor: pointer;
}
.living-document .livdoc-entry .link-button:focus-visible,
.ld-reset:focus-visible,
.ld-more:focus-visible,
.ld-chips button:focus-visible,
.ld-filter-toggle:focus-visible,
.ld-group summary:focus-visible,
.ld-option input:focus-visible {
  outline: 2px solid var(--ld-purple, #663568);
  outline-offset: 2px;
}

.ld-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .living-document .collapsible,
  .ld-group summary::after,
  .ld-switch-track,
  .ld-switch-track::after {
    transition: none;
  }
}

@media (max-width: 900px) {
  .ld-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .ld-filter-toggle,
  .ld-sidebar,
  .ld-toolbar,
  .ld-status,
  .ld-empty {
    font-size: 0.8em;
  }
  .ld-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5em;
    justify-self: start;
    font: inherit;
    font-weight: 600;
    color: var(--ld-purple);
    cursor: pointer;
    border: 2px solid var(--ld-green);
    border-radius: 15px;
    background: #fff;
    padding: 0.3rem 1rem;
  }
  .ld-sidebar {
    display: none;
    position: static;
    max-height: none;
  }
  .ld-layout.filters-open .ld-sidebar {
    display: block;
  }
  .ld-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .living-document .info-box {
    grid-template-columns: 1fr;
  }
}
