/* ──────────────────────────────────────────────
   Section
────────────────────────────────────────────── */
.arkiv-search {
  color: var(--black-95, #1c1b1b);
  position: relative;
}

/* ──────────────────────────────────────────────
   Mobile drawer — outside container, hidden on desktop
────────────────────────────────────────────── */
.arkiv-search__drawer {
  display: none;
}

.arkiv-search__drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
  border-bottom: 1px solid var(--gray30, #d1d1d1);
}

.arkiv-search__drawer-close {
  background: transparent;
  border: 0;
  padding: 4px;
  cursor: pointer;
  color: var(--black-95, #1c1b1b);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.arkiv-search__drawer .arkiv-search__sidebar-hr {
  display: block;
  margin: 12px 20px 0;
}

.arkiv-search__drawer .arkiv-search__form {
  padding: 16px 20px 24px;
}

/* ──────────────────────────────────────────────
   Desktop layout grid (inside .container)
────────────────────────────────────────────── */
.arkiv-search__layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  align-items: start;
}

/* ──────────────────────────────────────────────
   Desktop sidebar — sandLight, sticky
────────────────────────────────────────────── */
.arkiv-search__sidebar {
  background: var(--sandLight, #fffbf5);
  position: relative;
  align-self: stretch;
}

/* Extend sandLight background to the left viewport edge */
.arkiv-search__sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: 100vw;
  background: var(--sandLight, #fffbf5);
}

/* Inner wrapper: no padding — content sits flush in the sandLight column */
.arkiv-search__sidebar-inner {
  padding: 0;
  padding-top: 44px;
  position: sticky;
  top: var(--sidebar-top, var(--headerHeight));
  transition: top 250ms ease;
}

/* Mobile filter toggle: hidden on desktop, styled as pill on mobile */
.arkiv-search__filter-toggle {
  display: none;
}

.arkiv-search__overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 10;
  cursor: pointer;
}

.arkiv-search__sidebar-hr {
  display: none;
  border: none;
  border-top: 1px solid var(--gray30, #d1d1d1);
  margin: 12px 0 0;
}

.arkiv-search__sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.arkiv-search__sidebar-title {
  font-size: 19px;
  margin: 0;
}

.arkiv-search__reset {
  font-size: 15px;
}

.arkiv-search__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.arkiv-search__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.arkiv-search__label {
  display: block;
}

.arkiv-search__input-control {
  position: relative;
}

.arkiv-search__input-control input {
  width: 100%;
  height: 41px;
  padding: 0 44px 0 14px;
  border-radius: 8px;
  border: 1px solid var(--gray40, #b8b8b8);
  background: var(--white, #fff);
  color: inherit;
  font-size: 16px;
}

.arkiv-search__submit {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--black-95, #1c1b1b);
  display: flex;
  align-items: center;
  justify-content: center;
}

.arkiv-search__submit svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arkiv-search .dd label,
.arkiv-search__multi-toggle {
  width: 100%;
  min-height: 41px;
  border-radius: 8px;
  border: 1px solid var(--gray40, #b8b8b8);
  background: var(--white, #fff);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  color: var(--black-95, #1c1b1b);
  cursor: pointer;
}

.arkiv-search .dd ul {
  border-radius: 8px;
  border: 1px solid var(--gray40, #b8b8b8);
  padding: 8px 0;
  background: var(--white, #fff);
  margin-top: 4px;
}

.arkiv-search .dd ul li {
  border-radius: 6px;
  margin: 0 8px;
}

.arkiv-search .dd > ul li:hover {
  background: var(--sand25, #f3eddf);
  color: var(--black-95, #1c1b1b);
}

.arkiv-search__multi {
  position: relative;
}

.arkiv-search__multi-toggle svg {
  flex-shrink: 0;
  margin-left: 8px;
}

.arkiv-search__multi-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 8px 0;
  background: var(--white, #fff);
  border: 1px solid var(--gray40, #b8b8b8);
  border-radius: 8px;
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 240px;
  overflow-y: auto;
}

.arkiv-search__multi[data-open='true'] .arkiv-search__multi-list {
  display: block;
}

.arkiv-search__multi-list li {
  margin: 0 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
}

.arkiv-search__multi-list li:hover {
  background: var(--sand25, #f3eddf);
}

.arkiv-search__multi-list-item--child {
  padding-left: 28px;
}

.arkiv-search__multi-list input[type='checkbox'],
.arkiv-search__multi-list input[type='radio'] {
  accent-color: var(--black-95, #1c1b1b);
}

.arkiv-search__multi-list label {
  font-size: 16px;
  cursor: pointer;
  flex: 1;
}

.arkiv-search__range {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px 0;
}

.arkiv-search__range-values {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
  color: var(--black-95, #1c1b1b);
}

.arkiv-search__range-track {
  position: relative;
  height: 28px;
}

.arkiv-search__range-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 999px;
  background: var(--gray30, #d1d1d1);
}

.arkiv-search__range-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 999px;
  background: var(--black-95, #1c1b1b);
  pointer-events: none;
}

.arkiv-search__range-track input[type='range'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 28px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
  margin: 0;
}

.arkiv-search__range-track input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white, #fff);
  border: 2px solid var(--black-95, #1c1b1b);
  cursor: pointer;
  pointer-events: auto;
}

.arkiv-search__range-track input[type='range']::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white, #fff);
  border: 2px solid var(--black-95, #1c1b1b);
  cursor: pointer;
  pointer-events: auto;
}

.arkiv-search__range-track input[type='range']::-webkit-slider-runnable-track {
  background: transparent;
}

.arkiv-search__range-track input[type='range']::-moz-range-track {
  background: transparent;
}

.arkiv-search__sidebar-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  margin-top: 6px;
  border-top: 1px solid var(--gray30, #d1d1d1);
  font-size: 15px;
  color: var(--black-95, #1c1b1b);
}

/* ──────────────────────────────────────────────
   Main content column
────────────────────────────────────────────── */
.arkiv-search__main {
  position: relative;
  min-width: 0;
}

.arkiv-search__main-inner {
  padding-right: 44px;
  padding-left: 64px;
  padding-top: 44px;
}

.arkiv-search__heading {
  font-size: 33px;
  margin: 0 0 24px;
}

.arkiv-search__heading-divider {
  margin: 0 6px;
}

.arkiv-search__heading-mobile {
  display: none;
}

.arkiv-search__intro {
  max-width: 640px;
  padding: 28px 32px;
  background: var(--sandLight, #fffbf5);
  border: 1px solid var(--gray30, #d1d1d1);
  border-radius: 8px;
}

.arkiv-search__intro h2 {
  font-size: 24px;
  margin: 0 0 12px;
}

.arkiv-search__intro p {
  white-space: pre-line;
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.arkiv-search__intro p + p {
  margin-top: 12px;
}

.arkiv-search__intro a {
  color: var(--primary, #ED7575);
  text-decoration: underline;
}

/* ──────────────────────────────────────────────
   Loading / spinner
────────────────────────────────────────────── */
.arkiv-search__loading {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--black-95, #1c1b1b);
  font-size: 16px;
}

.arkiv-search__loading.is-visible {
  display: inline-flex;
}

.arkiv-search__spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--gray30, #d1d1d1);
  border-top-color: var(--black-95, #1c1b1b);
  animation: arkiv-search-spin 0.8s linear infinite;
}

@keyframes arkiv-search-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ──────────────────────────────────────────────
   Results
────────────────────────────────────────────── */
.arkiv-search__results {
  display: flex;
  flex-direction: column;
}

.arkiv-search__result {
  display: grid;
  grid-template-columns: 110px 1fr 200px;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--gray30, #d1d1d1);
  text-decoration: none;
  color: inherit;
}

/* Desktop / mobile split: same data, two DOM trees; JS fills both */
.arkiv-search__result-desktop {
  display: contents;
}

.arkiv-search__result-mobile {
  display: none;
}

.arkiv-search__result-thumb {
  position: relative;
  width: 110px;
  height: 110px;
  background: var(--gray20, #e5e5e5);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arkiv-search__result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.arkiv-search__result-thumb--empty,
.arkiv-search__result-mobile__thumb.arkiv-search__result-thumb--empty {
  background-color: rgba(40, 46, 103, 1);
  background-image: url("svg/Multi-star.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

.arkiv-search__result-star {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48%;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

.arkiv-search__result-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.arkiv-search__result-title {
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 8px;
}

.arkiv-search__result-summary {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--black-95, #1c1b1b);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.arkiv-search__result-badge {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
}

.arkiv-search__result-badge svg {
  display: block;
}


.arkiv-search__heading-desktop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray30, #d1d1d1);
  position: sticky;
}

.arkiv-search__result-meta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  color: var(--black-95, #1c1b1b);
}

.arkiv-search__result-meta-group {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 5px;
  align-items: baseline;
}

.arkiv-search__result-meta-key {
  color: var(--gray60, #6e6e6e);
  font-size: 12px;
}

.arkiv-search__result-meta-key--oswald {
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--black-95, #1c1b1b);
}

.arkiv-search__result-meta-group--top .arkiv-search__result-meta-value {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  color: var(--gray60, #6e6e6e);
  font-weight: 400;
}

.arkiv-search__result-meta-group--bottom .arkiv-search__result-meta-value {
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  color: var(--gray60, #6e6e6e);
}

.arkiv-search__empty {
  padding: 32px 0;
  color: var(--gray60, #6e6e6e);
  font-size: 16px;
}

.arkiv-search__more-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 0 16px;
}

.arkiv-search__more-wrap:has(.arkiv-search__more[hidden]) {
  display: none;
}

.arkiv-search__more:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ──────────────────────────────────────────────
   Mobile (≤991px)
────────────────────────────────────────────── */
@media (max-width: 991px) {
  .arkiv-search__heading-mobile {
    display: block;
  }
  .arkiv-search__heading-mobile h3 {
    font-size: 19px;
    margin: 0;
  }

  /* ── Drawer: sticky header, collapsible body ── */

  .arkiv-search__heading-desktop {
    display: none;
  }
  .arkiv-search__heading {
    margin-bottom: 18px;
  }

  .arkiv-search__layout {
    padding: 0;
  }

  .arkiv-search__drawer {
    display: block;
    position: sticky;
    top: var(--headerHeight);
    z-index: 20;
    background: var(--sandLight, #fffbf5);
  }

  .arkiv-search__drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
  }

  /* Body is hidden by default; becomes an absolute overlay when open */
  .arkiv-search__drawer-body {
    display: none;
  }

  .arkiv-search__drawer.is-open .arkiv-search__drawer-body {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    background: var(--sandLight, #fffbf5);
    z-index: 20;
    max-height: calc(100vh - 54px);
    overflow-y: auto;
  }

  .arkiv-search__drawer-body .arkiv-search__sidebar-hr {
    display: block;
    margin: 0 20px 4px;
  }

  .arkiv-search__drawer-body .arkiv-search__form {
    padding: 12px 20px 24px;
  }

  /* Toggle pill button */
  .arkiv-search__filter-toggle {
    display: inline-flex;
    align-items: center;
    background: var(--primary, #d94f3d);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
  }

  /* Hide desktop sidebar */
  .arkiv-search__sidebar {
    display: none;
  }

  /* Single-column layout */
  .arkiv-search__layout {
    grid-template-columns: 1fr;
  }

  /* Dim overlay behind the open drawer */
  .arkiv-search__overlay.is-visible {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10;
  }

  .arkiv-search__main-inner {
    padding: 21px 0px 34px;
  }

  .arkiv-search__intro {
    margin: 0 20px;
    padding: 22px 20px;
  }

  .arkiv-search__heading {
    font-size: 27px;
  }

  .arkiv-search__result {
    display: block;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray30, #d1d1d1);
    background: var(--sandLight, #fffbf5);
  }

  .arkiv-search__result-desktop {
    display: none;
  }

  .arkiv-search__result-mobile {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
  }

  .arkiv-search__result-mobile__left {
    flex-shrink: 0;
    width: 104px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .arkiv-search__result-mobile__thumb {
    position: relative;
    width: 104px;
    height: 104px;
    background: var(--gray20, #e5e5e5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .arkiv-search__result-mobile__thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
  }

  .arkiv-search__result-mobile__type {
    margin-top: 8px;
    width: 100%;
  }

  .arkiv-search__result-mobile__type .arkiv-search__result-badge {
    margin-top: 0;
  }

  .arkiv-search__result-mobile__type .arkiv-search__result-badge svg {
    display: block;
    max-width: 100%;
    height: auto;
  }

  .arkiv-search__result-mobile__right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .arkiv-search__result-mobile__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 8px;
    color: var(--black-95, #1c1b1b);
  }

  .arkiv-search__result-mobile__summary {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
    color: var(--black-95, #1c1b1b);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .arkiv-search__result-mobile__footer {
    margin-top: auto;
    padding-top: 12px;
    font-size: 14px;
    line-height: 1.35;
  }

  .arkiv-search__result-mobile__footer-label {
    font-weight: 700;
    color: var(--black-95, #1c1b1b);
    margin-right: 6px;
  }

  .arkiv-search__result-mobile__footer-value {
    font-weight: 400;
    color: var(--gray60, #6e6e6e);
  }
}
