/* Custom styles for Helm Charts documentation */

/* ===========================================
   TYPOGRAPHY - Consistent font sizing
   Base: 0.8rem for content, scaled proportionally
   =========================================== */
:root {
  --docs-font-xs: 0.7rem;
  --docs-font-sm: 0.75rem;
  --docs-font-base: 0.8rem;
  --docs-font-md: 0.85rem;
  --docs-font-lg: 0.9rem;
}

/* Base typography adjustments */
.md-typeset {
  font-size: var(--docs-font-md);
  line-height: 1.6;
}

.md-typeset h1 {
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
}

.md-typeset h2 {
  font-size: 1.3rem;
  margin-top: 1.5rem;
}

.md-typeset h3 {
  font-size: 1.1rem;
}

.md-typeset h4 {
  font-size: 0.95rem;
}

/* Code blocks consistent sizing */
.md-typeset code,
.md-typeset pre code {
  font-size: var(--docs-font-sm);
}

/* Wider content area for better readability */
.md-grid {
  max-width: 100%;
}

.md-content {
  max-width: none;
}

/* Wider main content when sidebar is present */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary {
    width: 12.1rem;
  }

  .md-sidebar--secondary {
    width: 12.1rem;
    margin-left: 0;
  }

  /* Allow content to use full width */
  .md-content__inner {
    max-width: none;
    margin: 0 2rem;
  }
}

/* Values table specific styling - ensure full width */
.values-table {
  width: 100%;
  display: table;
  table-layout: auto;
  min-width: 100%;
  font-size: var(--docs-font-base);
}

.values-table th {
  font-size: var(--docs-font-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.6rem 0.8rem;
}

.values-table td {
  padding: 0.5rem 0.8rem;
  font-size: var(--docs-font-base);
  vertical-align: top;
}

.values-table th:nth-child(1),
.values-table td:nth-child(1) {
  width: 22%;
  word-break: break-word;
}

.values-table th:nth-child(2),
.values-table td:nth-child(2) {
  width: 8%;
  white-space: nowrap;
}

.values-table th:nth-child(3),
.values-table td:nth-child(3) {
  width: 15%;
  word-break: break-word;
}

.values-table th:nth-child(4),
.values-table td:nth-child(4) {
  width: 55%;
}

/* Value table enhancements */
.md-typeset table:not([class]) {
  font-size: var(--docs-font-base);
}

.md-typeset table:not([class]) th {
  background-color: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.md-typeset table:not([class]) td:first-child {
  font-family: var(--md-code-font-family);
  font-size: var(--docs-font-sm);
  white-space: nowrap;
}

/* Value key styling */
.value-key {
  font-family: var(--md-code-font-family);
  font-weight: 600;
  font-size: var(--docs-font-sm);
  color: var(--md-code-hl-name-color);
}

/* Type badge styling */
.type-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: var(--docs-font-xs);
  font-weight: 500;
  text-transform: lowercase;
}

.type-badge.string {
  background-color: #4caf50;
  color: white;
}

.type-badge.bool {
  background-color: #2196f3;
  color: white;
}

.type-badge.int {
  background-color: #ff9800;
  color: white;
}

.type-badge.object {
  background-color: #9c27b0;
  color: white;
}

.type-badge.list {
  background-color: #e91e63;
  color: white;
}

.type-badge.tpl {
  background-color: #00bcd4;
  color: white;
}

/* Section headers in values table */
.values-section-header {
  background-color: var(--md-default-fg-color--lightest) !important;
  font-weight: 600 !important;
  font-size: var(--docs-font-sm) !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Search result highlighting */
.md-search-result mark {
  background-color: var(--md-accent-fg-color);
  color: var(--md-accent-bg-color);
  padding: 0.1em 0.2em;
  border-radius: 2px;
}

/* Card grid for homepage */
.grid.cards>ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.grid.cards>ul>li {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.grid.cards>ul>li:hover {
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Anchor links for values */
.value-anchor {
  scroll-margin-top: 4rem;
}

.value-anchor:target {
  animation: highlight 2s ease;
}

@keyframes highlight {
  0% {
    background-color: var(--md-accent-fg-color--transparent);
  }

  100% {
    background-color: transparent;
  }
}

/* Collapsible sections */
details.values-section {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 4px;
  margin: 1rem 0;
  padding: 0;
}

details.values-section summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  background-color: var(--md-default-fg-color--lightest);
}

details.values-section[open] summary {
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

details.values-section>*:not(summary) {
  padding: 0 1rem;
}

/* Quick filter buttons */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.filter-btn {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--md-primary-fg-color);
  border-radius: 16px;
  background: transparent;
  color: var(--md-primary-fg-color);
  cursor: pointer;
  font-size: var(--docs-font-xs);
  transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
}

/* Interactive search box */
#values-search {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 2px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  font-size: var(--docs-font-md);
  margin-bottom: 1rem;
  transition: border-color 0.2s ease;
}

#values-search:focus {
  outline: none;
  border-color: var(--md-primary-fg-color);
}

/* Search results count */
.search-results-count {
  font-size: var(--docs-font-sm);
  color: var(--md-default-fg-color--light);
  margin-bottom: 1rem;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
  .md-typeset table:not([class]) td:first-child {
    white-space: normal;
    word-break: break-all;
  }

  .filter-buttons {
    justify-content: center;
  }

  .values-table td,
  .values-table th {
    font-size: var(--docs-font-xs);
    padding: 0.4rem 0.5rem;
  }
}