/**
 * Vestbirk Dokumenter — frontend
 * Custom dropdown (tema kan ikke style native <select> pålideligt).
 */

.vd-docs {
  --vd-text: #2c2a26;
  --vd-muted: #6b6560;
  --vd-line: #e5ddd4;
  --vd-bg: #faf8f5;
  --vd-card: #ffffff;
  --vd-accent: #3d5a45;
  --vd-accent-soft: #e8efe9;
  --vd-radius: 12px;
  --vd-space: 1.25rem;
  --vd-ui-font: inherit;
  color: var(--vd-text);
  max-width: 42rem;
  margin: 0 auto;
  font-family: var(--vd-ui-font);
  font-size: 1rem;
  line-height: 1.5;
  box-sizing: border-box;
}

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

.vd-docs__header {
  margin-bottom: 2rem;
}

.vd-docs__title {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  color: var(--vd-text);
  line-height: 1.25;
}

.vd-docs__label {
  display: block;
  font-family: var(--vd-ui-font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--vd-muted);
  margin-bottom: 0.5rem;
}

.vd-docs__select-wrap {
  position: relative;
  max-width: 100%;
  z-index: 5;
}

.vd-docs__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.25rem;
  margin: 0;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius);
  background: var(--vd-card);
  color: var(--vd-text);
  font-family: var(--vd-ui-font);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(44, 42, 38, 0.04);
  appearance: none;
  -webkit-appearance: none;
}

.vd-docs__trigger:hover {
  border-color: #d0c6ba;
}

.vd-docs__trigger:focus {
  outline: 2px solid var(--vd-accent);
  outline-offset: 2px;
}

.vd-docs__trigger[aria-expanded="true"] {
  border-color: var(--vd-accent);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.vd-docs__trigger-text {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
}

.vd-docs__trigger-icon {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--vd-muted);
  transition: transform 0.15s ease;
}

.vd-docs__trigger[aria-expanded="true"] .vd-docs__trigger-icon {
  transform: rotate(180deg);
}

.vd-docs__listbox {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--vd-card);
  border: 1px solid var(--vd-accent);
  border-top: none;
  border-radius: 0 0 var(--vd-radius) var(--vd-radius);
  box-shadow: 0 10px 24px rgba(44, 42, 38, 0.12);
  max-height: 18rem;
  overflow-y: auto;
}

.vd-docs__listbox[hidden] {
  display: none !important;
}

.vd-docs__option {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.1rem;
  margin: 0;
  font-family: var(--vd-ui-font);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--vd-text);
  cursor: pointer;
}

.vd-docs__option:hover,
.vd-docs__option:focus,
.vd-docs__option.is-active {
  background: var(--vd-accent-soft);
  outline: none;
}

.vd-docs__option.is-selected {
  font-weight: 650;
  color: var(--vd-accent);
}

.vd-docs__hint,
.vd-docs__empty,
.vd-docs__error,
.vd-docs__loading {
  font-family: var(--vd-ui-font);
  color: var(--vd-muted);
  margin: 0.5rem 0 0;
  padding: 1.25rem 0;
}

.vd-docs__class-name {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1.75rem;
  line-height: 1.3;
}

.vd-docs__section {
  margin-bottom: 2.25rem;
}

.vd-docs__section-title {
  font-family: var(--vd-ui-font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vd-muted);
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--vd-line);
}

.vd-docs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.vd-docs__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 1rem 1.15rem;
  background: var(--vd-bg);
  border-radius: var(--vd-radius);
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vd-docs__item:hover {
  border-color: var(--vd-line);
  background: var(--vd-card);
}

.vd-docs__item-main {
  flex: 1 1 12rem;
  min-width: 0;
}

.vd-docs__item-title {
  display: block;
  font-family: var(--vd-ui-font);
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--vd-text);
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

.vd-docs__item-meta {
  display: block;
  font-family: var(--vd-ui-font);
  font-size: 0.85rem;
  color: var(--vd-muted);
  line-height: 1.35;
}

.vd-docs__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  font-family: var(--vd-ui-font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--vd-accent);
  text-decoration: none;
  padding: 0.65rem 1rem;
  background: var(--vd-accent-soft);
  border-radius: 999px;
  min-height: 44px;
  line-height: 1.2;
}

.vd-docs__link:hover,
.vd-docs__link:focus {
  text-decoration: none;
  filter: brightness(0.97);
  outline: 2px solid var(--vd-accent);
  outline-offset: 2px;
}

.vd-docs__link-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .vd-docs__item {
    flex-direction: column;
    align-items: stretch;
  }

  .vd-docs__link {
    justify-content: center;
  }
}
