/* OptunaSharp overrides, loaded after the DocFX modern stylesheet. */

/* Bound both dimensions so a replacement image cannot enlarge the navbar. */
#logo,
.navbar-brand > img {
  width: auto;
  height: 30px;
  max-width: 44px;
  max-height: 30px;
  flex: 0 0 auto;
  margin-right: 0.5rem;
  object-fit: contain;
}

.ns-home {
  --ns-accent: #7040a0;
  --ns-accent-hover: #592d86;
}

[data-bs-theme="dark"] .ns-home {
  --ns-accent: #b69ad9;
  --ns-accent-hover: #ccb5e7;
}

.ns-home-intro {
  padding: 1rem 0 2rem;
}

.ns-home-kicker {
  margin: 0 0 1rem;
  color: var(--ns-accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.ns-home-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* DocFX wraps article images in links and sets their height to auto. */
.ns-home-title-row > a {
  flex: 0 0 auto;
}

.ns-home img.ns-home-logo {
  display: block;
  width: 70px;
  height: 48px;
  max-width: 70px;
  max-height: 48px;
  flex: 0 0 auto;
  object-fit: contain;
}

.ns-home h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
}

.ns-home-lede {
  margin: 1.25rem 0 0;
  color: var(--bs-secondary-color);
  font-size: 1.05rem;
  line-height: 1.65;
}

.ns-home-actions,
.ns-home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ns-home-actions {
  margin-top: 1.5rem;
}

.ns-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-weight: 600;
  text-decoration: none;
}

.ns-home-button:hover,
.ns-home-button:focus-visible {
  border-color: var(--ns-accent);
  color: var(--ns-accent);
  text-decoration: none;
}

.ns-home-button-primary {
  border-color: var(--ns-accent);
  background: var(--ns-accent);
  color: var(--bs-body-bg);
}

.ns-home-button-primary:hover,
.ns-home-button-primary:focus-visible {
  border-color: var(--ns-accent-hover);
  background: var(--ns-accent-hover);
  color: var(--bs-body-bg);
}

.ns-home-code,
.ns-home-section {
  padding: 2rem 0;
  border-top: 1px solid var(--bs-border-color);
}

.ns-home h2 {
  margin: 0;
  font-size: 1.5rem;
}

.ns-home-code-head,
.ns-home-section-head {
  margin-bottom: 1.25rem;
}

.ns-home-code-head p,
.ns-home-section-head p {
  margin: 0.5rem 0 0;
  color: var(--bs-secondary-color);
}

.ns-code-grid {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.ns-code-grid pre {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
}

.ns-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.ns-doc-card {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  color: var(--bs-body-color);
  text-decoration: none;
}

.ns-doc-card:hover,
.ns-doc-card:focus-visible {
  border-color: var(--ns-accent);
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  text-decoration: none;
}

.ns-doc-card span,
.ns-doc-card strong {
  display: block;
}

.ns-doc-card span {
  margin-bottom: 0.5rem;
  color: var(--ns-accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.ns-doc-card strong {
  font-size: 1.1rem;
}

.ns-doc-card p {
  margin: 0.75rem 0 0;
  color: var(--bs-secondary-color);
}

.ns-home-links {
  gap: 1rem;
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid var(--bs-border-color);
}

@media (max-width: 575.98px) {
  .ns-home-title-row {
    gap: 0.75rem;
  }

  .ns-home-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ns-card-grid {
    grid-template-columns: 1fr;
  }
}
