/* Custom CSS for GCP Billing Agent Documentation */

/* Fix spacing and formatting for lists */
.page-content ul,
.page-content ol {
  margin-bottom: 1.5em;
  padding-left: 2em;
}

.page-content li {
  margin-bottom: 0.5em;
  line-height: 1.6;
}

/* Fix navigation links spacing */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0.5em 0;
  line-height: 1.5;
}

.site-nav a {
  display: inline-block;
  margin: 0 0.5em;
  padding: 0.25em 0.5em;
  color: #0366d6;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* Hide any unformatted navigation text that might appear */
.site-nav > :not(a):not(button) {
  display: none;
}

/* Ensure navigation is properly formatted */
.site-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-nav li {
  margin: 0 0.5em;
}

/* Fix header layout */
.site-header .wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

/* Hide any text nodes in header that aren't properly formatted */
.site-header .wrapper > :not(.site-title):not(.site-nav):not(.trigger) {
  display: none;
}

/* Fix any duplicate content issues */
.site-header .site-title {
  margin: 0;
}

/* Hide duplicate site title if it appears in content */
.page-content > h1:first-child + h1 {
  display: none;
}

/* Hide site title duplication in header */
.site-header .site-title:first-child + .site-title {
  display: none;
}

/* Fix site header layout */
.site-header {
  border-top: 3px solid #424242;
  border-bottom: 1px solid #e8e8e8;
  min-height: 56px;
  position: relative;
}

.site-header .wrapper {
  padding-left: 1em;
  padding-right: 1em;
}

/* Ensure header title doesn't appear duplicated in content */
.page-content {
  padding: 2rem 0;
}

/* Improve table formatting */
.page-content table {
  margin: 1.5em auto;
  border-collapse: collapse;
  width: auto;
  max-width: 100%;
}

.page-content table th,
.page-content table td {
  padding: 0.75em 1em;
  border: 1px solid #e0e0e0;
  text-align: center;
}

.page-content table th {
  background-color: #f5f5f5;
  font-weight: bold;
}

.page-content table td {
  background-color: #ffffff;
}

/* Hide table separator lines if they're being rendered incorrectly */
.page-content table tr:first-of-type + tr:has(td[colspan]),
.page-content table tbody tr:empty {
  display: none;
}

/* Fix heading spacing */
.page-content h1 {
  margin-top: 0;
  margin-bottom: 0.75em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid #e0e0e0;
}

.page-content h2 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  padding-top: 0.5em;
}

.page-content h3 {
  margin-top: 1.25em;
  margin-bottom: 0.5em;
}

/* Fix link formatting */
.page-content a {
  color: #0366d6;
  text-decoration: none;
}

.page-content a:hover {
  text-decoration: underline;
}

/* Fix code block spacing */
.page-content pre {
  margin: 1.5em 0;
  padding: 1em;
  background-color: #f6f8fa;
  border-radius: 3px;
  overflow-x: auto;
}

.page-content code {
  background-color: #f6f8fa;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

/* Fix paragraph spacing */
.page-content p {
  margin-bottom: 1em;
  line-height: 1.6;
}

/* Fix horizontal rule spacing */
.page-content hr {
  margin: 2em 0;
  border: none;
  border-top: 1px solid #e0e0e0;
}

/* Center divs with align="center" */
div[align="center"] {
  text-align: center;
  margin: 1.5em 0;
}

/* Fix nested list spacing */
.page-content ul ul,
.page-content ol ol,
.page-content ul ol,
.page-content ol ul {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Remove duplicate heading issues */
.page-content h1 + h1,
.page-content h2 + h1 {
  display: none;
}

/* Fix any auto-generated navigation lists */
.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0.5em 0;
}

.site-nav ul li {
  display: inline-block;
  margin: 0 0.5em;
}

/* Hide any problematic auto-generated content blocks */
.page-content > p:first-of-type a[href*=".md"] {
  display: none;
}

/* Improve documentation sections formatting */
.page-content .documentation-section {
  margin-bottom: 2em;
}

.page-content .documentation-section h3 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  color: #24292e;
}

