/**
 * Technical Info library (Figma 352:4810).
 *
 * @package Atsko
 */

/* —— Full-bleed when used inside page shell —— */
.container .tech-info-library.alignfull,
.entry-content .tech-info-library.alignfull,
.page-main__content > .tech-info-library.alignfull,
.page-main__content > .tech-info-library,
.page-main__content > .wp-block-group.alignfull:has(.tech-info-library),
.page-main__content > .tech-info.alignfull,
.page-main__content > .tech-info {
  width: 100%;
  max-width: none;
}

.page-main__content > .wp-block-group.alignfull:has(.tech-info-library),
.page-main__content > .tech-info-library {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.tech-info-library {
  background: var(--atsko-white);
  box-sizing: border-box;
}

.tech-info {
  padding: 1.5rem max(2rem, calc((100% - var(--atsko-container)) / 2)) 5rem;
  box-sizing: border-box;
}

/* —— Filters bar —— */
.tech-info-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 1rem;
  margin: 0 0 2.5rem;
  box-sizing: border-box;
}

.tech-info-filters__search {
  position: relative;
  flex: 1 1 18rem;
  display: flex;
  align-items: center;
  min-width: 0;
}

.tech-info-filters__search-icon {
  position: absolute;
  left: 0.875rem;
  width: 1.25rem;
  height: 1.25rem;
  pointer-events: none;
  opacity: 0.55;
}

.tech-info-filters__input {
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid var(--atsko-charcoal);
  border-radius: 4px;
  background: #ffffff;
  font-family: var(--atsko-font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--atsko-charcoal);
  box-sizing: border-box;
}

.tech-info-filters__input::placeholder {
  color: var(--atsko-gray-400);
}

.tech-info-filters__input:focus {
  outline: 2px solid var(--atsko-link-light);
  outline-offset: 1px;
}

.tech-info-filters__selects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex: 0 1 auto;
}

.tech-info-filters__select-wrap {
  position: relative;
  min-width: 11rem;
}

.tech-info-filters__select {
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 1px solid var(--atsko-charcoal);
  border-radius: 4px;
  background: var(--atsko-white);
  font-family: var(--atsko-font-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--atsko-charcoal);
  cursor: pointer;
  box-sizing: border-box;
}

.tech-info-filters__select-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 1.25rem;
  height: 1.25rem;
  transform: translateY(-50%);
  pointer-events: none;
}

/* —— Two-column layout —— */
.tech-info__layout {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

/* —— Sidebar —— */
.tech-info-sidebar {
  position: sticky;
  top: calc(var(--atsko-header-height, 6.5rem) + 1rem);
  padding: 0.25rem 0;
}

.tech-info-sidebar__label {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--atsko-blue-highlight);
}

.tech-info-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tech-info-sidebar__list li {
  margin: 0;
}

.tech-info-sidebar__link {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--atsko-charcoal);
  text-decoration: none;
}

.tech-info-sidebar__link:hover,
.tech-info-sidebar__link:focus-visible,
.tech-info-sidebar__link.is-active {
  color: var(--atsko-blue);
  text-decoration: underline;
}

/* —— Brand accordion —— */
.tech-info-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tech-info-brand {
  border-radius: 4px;
  overflow: hidden;
  background: var(--atsko-white);
}

.tech-info-brand[hidden],
.tech-info-brand.is-filtered-out {
  display: none;
}

.tech-info-brand__header {
  margin: 0;
}

.tech-info-brand__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin: 0;
  padding: 1rem 1.25rem;
  border: 0;
  background: #f5fbff;
  cursor: pointer;
  text-align: left;
  font-family: var(--atsko-font-sans);
}

.tech-info-brand__title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--atsko-charcoal);
}

.tech-info-brand__icon {
  position: relative;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
}

.tech-info-brand__icon::before,
.tech-info-brand__icon::after {
  content: "";
  position: absolute;
  background: var(--atsko-charcoal);
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.tech-info-brand__icon::before {
  left: 0;
  top: 50%;
  width: 100%;
  height: 2px;
  transform: translateY(-50%);
}

.tech-info-brand__icon::after {
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
}

.tech-info-brand.is-open .tech-info-brand__icon::after {
  opacity: 0;
  transform: translateX(-50%) scaleY(0);
}

.tech-info-brand__panel {
  padding: 0.25rem 0 0.5rem;
}

.tech-info-brand__panel[hidden] {
  display: none;
}

/* —— Content-type groups —— */
.tech-info-group {
  padding: 1rem 0.25rem 0.5rem;
}

.tech-info-group[hidden],
.tech-info-group.is-filtered-out {
  display: none;
}

.tech-info-group__label {
  margin: 0 0 0.5rem;
  padding: 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--atsko-gray-400);
}

.tech-info-group__count {
  margin-left: 0.35rem;
}

/* —— Document rows —— */
.tech-info-docs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tech-info-doc {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--atsko-gray-200);
  box-sizing: border-box;
}

.tech-info-doc[hidden],
.tech-info-doc.is-filtered-out {
  display: none;
}

.tech-info-doc__icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
}

.tech-info-doc__copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.25rem;
}

.tech-info-doc__title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--atsko-charcoal);
  text-decoration: none;
}

.tech-info-doc__title:hover {
  color: var(--atsko-blue);
  text-decoration: underline;
}

.tech-info-doc__updated {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--atsko-gray-400);
  white-space: nowrap;
}

.tech-info-doc__view {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 1.25rem;
  border: 1px solid var(--atsko-charcoal);
  border-radius: 999px;
  background: var(--atsko-white);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--atsko-charcoal);
  text-decoration: none;
}

.tech-info-doc__view:hover {
  background: var(--atsko-blue);
  border-color: var(--atsko-blue);
  color: var(--atsko-white);
}

.tech-info__empty {
  margin: 2rem 0;
  font-size: 1.125rem;
  color: var(--atsko-gray-400);
}

@media (max-width: 900px) {
  .tech-info__layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .tech-info-sidebar {
    position: static;
  }

  .tech-info-sidebar__list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }
  .tech-info-filters__search {
    flex: 1 1 100%;
  }
}

@media (max-width: 700px) {
  .tech-info {
    padding-inline: 1rem;
    padding-bottom: 3.5rem;
  }

  .tech-info-filters {
    flex-direction: column;
  }

  .tech-info-filters__selects {
    width: 100%;
  }

  .tech-info-filters__select-wrap {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .tech-info-doc {
    /* flex-wrap: wrap; */
    align-items: flex-start;
  }

  .tech-info-doc__view {
    margin-left: auto;
    display: none;
  }
}
