/**
 * Chemesis Core — Documentation Centre styles.
 * Port of the approved Vercel /documentation explorer. Prefix: .chd-*.
 */

.chd-section {
  background: var(--ch-paper);
  padding-block: 2.5rem;
}

@media (min-width: 768px) {
  .chd-section {
    padding-block: 3.5rem;
  }
}

/* Control bar */
.chd-bar {
  border-top: 1px solid var(--ch-line);
  border-bottom: 1px solid var(--ch-line);
  padding-block: 1rem;
}

.chd-bar-top {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 1024px) {
  .chd-bar-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.chd-search {
  position: relative;
  width: 100%;
}

@media (min-width: 1024px) {
  .chd-search {
    max-width: 24rem;
  }
}

.chd-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ch-faint);
  pointer-events: none;
}

.chd-input {
  height: 3rem;
}

.chd-search-input {
  padding-left: 2.5rem;
}

.chd-count {
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-mono);
  color: var(--ch-faint);
}

.chd-filters {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.chd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.chd-chip {
  border-radius: 9999px;
  border: 1px solid var(--ch-line);
  background: #fff;
  color: var(--ch-muted);
  padding: 0.625rem 1rem;
  font-size: var(--ch-type-body-sm);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.3s var(--ch-ease-expo), background-color 0.3s var(--ch-ease-expo), color 0.3s var(--ch-ease-expo);
}

.chd-chip:hover {
  border-color: rgba(0, 12, 48, 0.3);
  color: var(--ch-ink-900);
}

.chd-chip.is-active {
  border-color: var(--ch-ink-900);
  background: var(--ch-ink-900);
  color: #fff;
}

.chd-select {
  width: 100%;
  height: 3rem;
  font-size: var(--ch-input-font);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234b556a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

@media (min-width: 640px) {
  .chd-select {
    width: 16rem;
  }
}

.chd-reset {
  border: 0;
  background: transparent;
  font-size: var(--ch-type-body-sm);
  font-weight: 500;
  color: var(--ch-blue-600);
  cursor: pointer;
  padding: 0;
}

.chd-reset[hidden] {
  display: none;
}

.chd-reset:hover {
  color: var(--ch-blue-700);
}

/* Panel */
.chd-panel {
  margin-top: 1.5rem;
  overflow: hidden;
  border-radius: var(--ch-radius-md);
  border: 1px solid var(--ch-line);
  background: #fff;
  transition: opacity 0.25s var(--ch-ease-expo);
}

.chd-panel.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.chd-head {
  display: none;
}

@media (min-width: 1024px) {
  .chd-head {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) minmax(0, 1.25fr) 72px;
    gap: 1rem;
    border-bottom: 1px solid var(--ch-line);
    background: var(--ch-paper);
    padding: 0.75rem 1.25rem;
  }
}

.chd-head span {
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-faint);
}

.chd-col-type {
  grid-column: auto;
}

.chd-col-prod {
  grid-column: auto;
}

.chd-col-file {
  grid-column: auto;
}

.chd-col-dl {
  grid-column: auto;
  text-align: right;
}

.chd-list-ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chd-row-wrap {
  border-bottom: 1px solid var(--ch-line);
}

.chd-row-wrap:last-child {
  border-bottom: 0;
}

.chd-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: background-color 0.3s var(--ch-ease-expo);
}

@media (min-width: 1024px) {
  .chd-row {
    grid-template-columns: 230px minmax(0, 1fr) minmax(0, 1.25fr) 72px;
  }
}

.chd-row:hover {
  background: var(--ch-paper);
}

.chd-type {
  grid-column: span 12;
}

@media (min-width: 1024px) {
  .chd-type {
    grid-column: auto;
  }
}

.chd-prod {
  grid-column: span 8;
  font-size: var(--ch-type-body);
  font-weight: 500;
  color: var(--ch-ink-900);
}

@media (min-width: 1024px) {
  .chd-prod {
    grid-column: auto;
  }
}

.chd-file {
  grid-column: span 10;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-mono);
  color: var(--ch-faint);
}

@media (min-width: 1024px) {
  .chd-file {
    grid-column: auto;
  }
}

.chd-file svg {
  margin-right: 0.375rem;
  display: inline;
  vertical-align: -1px;
}

.chd-dl-wrap {
  grid-column: span 2;
  display: flex;
  justify-content: flex-end;
}

@media (min-width: 1024px) {
  .chd-dl-wrap {
    grid-column: auto;
  }
}

.chd-dl {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid var(--ch-line);
  color: var(--ch-muted);
  transition: border-color 0.3s var(--ch-ease-expo), color 0.3s var(--ch-ease-expo);
}

.chd-row:hover .chd-dl {
  border-color: var(--ch-blue);
  color: var(--ch-blue);
}

/* Empty state */
.chd-empty {
  padding: 4rem 1.5rem;
  text-align: center;
}

.chd-empty-title {
  font-family: var(--ch-font-display);
  font-size: var(--ch-type-h4);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ch-ink-900);
}

.chd-empty-text {
  margin-top: 0.5rem;
  font-size: var(--ch-type-body);
  color: var(--ch-muted);
}

.chd-empty .ch-btn {
  margin-top: 1.25rem;
}

/* COA note */
.chd-note {
  margin-top: 1.5rem;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-caption);
  line-height: 1.6;
  color: var(--ch-faint);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .chd-panel,
  .chd-row,
  .chd-dl,
  .chd-chip {
    transition: none;
  }
}

/* Elementor kit/theme button shield */
body :is(.chd-section) button,
body :is(.chd-section) button:hover,
body :is(.chd-section) button:focus,
body :is(.chd-section) button:focus-visible {
  background: transparent;
  color: inherit;
  padding: 0;
}

body .chd-section .chd-chip,
body .chd-section .chd-chip:hover,
body .chd-section .chd-chip:focus,
body .chd-section .chd-chip:focus-visible {
  padding: 0.625rem 1rem;
  border-radius: 9999px;
  color: var(--ch-muted);
}

body .chd-section .chd-chip:hover {
  border-color: rgba(0, 12, 48, 0.3);
  color: var(--ch-ink-900);
}

body .chd-section .chd-chip.is-active {
  border-color: var(--ch-ink-900);
  background: var(--ch-ink-900);
  color: #fff;
}

body .chd-section .chd-empty .ch-btn-outline {
  background: transparent;
  color: var(--ch-ink-900);
  padding: 0.55rem 1.05rem;
}
