/**
 * Documentation styles for SheetRocks public-facing docs
 * 
 * Provides typography, code blocks, tables, and layout for documentation pages
 * Works with base.css theme system (uses CSS variables from theme)
 */
/* ========================================
   DOCUMENTATION LAYOUT
   ======================================== */
.docs-container {
  max-width: 56.25rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  font-family: var(--font-family);
  color: var(--theme-text);
  background-color: var(--theme-background);
  line-height: 1.7;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
.docs-container h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--theme-primary);
  border-bottom: 0.1875rem solid var(--theme-primary);
  padding-bottom: 0.5rem;
}

.docs-container h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--theme-primary);
  border-bottom: 0.125rem solid var(--theme-accent);
  padding-bottom: 0.5rem;
}

.docs-container h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--theme-accent);
}

.docs-container h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--theme-accent);
}

.docs-container h5 {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--theme-text-light);
}

.docs-container p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.docs-container strong {
  font-weight: 600;
  color: var(--theme-text-strong);
}

.docs-container em {
  font-style: italic;
}

.docs-container a {
  color: var(--theme-accent);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
}

.docs-container a:hover {
  color: var(--theme-darker-primary);
  text-decoration: underline;
}

/* ========================================
   CODE BLOCKS AND INLINE CODE
   ======================================== */
.docs-container code {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.9em;
  background-color: var(--theme-background-darkest);
  border: 0.0625rem solid var(--theme-border);
  padding: 0.125rem 0.375rem;
  border-radius: 0.1875rem;
  color: var(--theme-text);
}

.docs-container pre {
  background-color: var(--theme-background-darkest);
  border: 0.0625rem solid var(--theme-border);
  border-radius: 0.3125rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  box-shadow: 0 0.125rem 0.25rem var(--theme-transparent-contrast);
}

.docs-container pre code {
  background-color: transparent;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  display: block;
}

/* Syntax highlighting for code blocks - GitHub-style */
.docs-container .hljs {
  background-color: transparent;
  color: var(--theme-text);
}

.docs-container .hljs-comment,
.docs-container .hljs-quote {
  color: var(--theme-text-light);
  font-style: italic;
}

.docs-container .hljs-keyword,
.docs-container .hljs-selector-tag,
.docs-container .hljs-subst {
  color: var(--theme-accent);
  font-weight: 600;
}

.docs-container .hljs-number,
.docs-container .hljs-literal,
.docs-container .hljs-variable {
  color: var(--theme-accent);
}

.docs-container .hljs-string,
.docs-container .hljs-doctag {
  color: var(--theme-secondary);
}

.docs-container .hljs-title,
.docs-container .hljs-section {
  color: var(--theme-darker-primary);
  font-weight: 600;
}

.docs-container .hljs-built_in,
.docs-container .hljs-function {
  color: var(--theme-accent);
}

.docs-container .hljs-params {
  color: var(--theme-text);
}

.docs-container .hljs-attr,
.docs-container .hljs-attribute {
  color: var(--theme-secondary);
}

/* ========================================
   LISTS
   ======================================== */
.docs-container ul,
.docs-container ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.docs-container li {
  margin-bottom: 0.5rem;
}

.docs-container ul ul,
.docs-container ol ol,
.docs-container ul ol,
.docs-container ol ul {
  margin: 0.5rem 0;
}

/* ========================================
   TABLES
   ======================================== */
.docs-container table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border: 0.0625rem solid var(--theme-border);
  box-shadow: 0 0.0625rem 0.1875rem var(--theme-transparent-contrast);
}

.docs-container thead {
  background-color: var(--theme-header);
  border-bottom: 0.125rem solid var(--theme-border-darker);
}

.docs-container th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 0.125rem solid var(--theme-border-darker);
  color: var(--theme-text);
  background-color: var(--theme-header);
}

.docs-container td {
  padding: 0.75rem 1rem;
  border-bottom: 0.0625rem solid var(--theme-light-border);
  vertical-align: top;
}

.docs-container td code {
  background-color: var(--theme-background-darker);
  padding: 0.125rem 0.375rem;
  border-radius: 0.1875rem;
  font-size: 0.85em;
}

.docs-container tbody tr:hover {
  background-color: var(--theme-hover);
  transition: background-color 0.2s;
}

.docs-container tbody tr:last-child td {
  border-bottom: none;
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.docs-breadcrumbs {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  color: var(--theme-text-light);
}

.docs-breadcrumbs a {
  color: var(--theme-accent);
}

.docs-breadcrumbs .separator {
  margin: 0 0.5rem;
  color: var(--theme-text-light);
}

/* ========================================
   NAVIGATION HEADER
   ======================================== */
.docs-subheader {
  background-color: var(--theme-background-darker);
  border-bottom: 1px solid var(--theme-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: center;
}

.docs-subheader nav {
  display: flex;
  gap: 2rem;
}
@media (max-width: 48rem) {
  .docs-subheader nav {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

.docs-subheader nav a {
  color: var(--theme-text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
  font-weight: 500;
}

.docs-subheader nav a:hover {
  color: var(--theme-accent);
}

/* ========================================
   FUNCTION REFERENCE SPECIFIC
   ======================================== */
.help-function-example {
  margin: 1.5rem 0;
}

.help-function-example .example-description {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--theme-text);
  margin: 0 0 0.5rem 0;
  font-weight: 500;
}

.help-function-example .example-formula-bar {
  background-color: var(--theme-background);
  border: 1px solid var(--theme-border);
  border-radius: 0.25rem 0.25rem 0 0;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", monospace;
  font-size: 0.875rem;
  color: var(--theme-text);
}

.help-function-example .example-formula-bar .formula-text {
  color: var(--theme-text);
}

.help-function-example .example-result {
  background-color: var(--theme-background-lighter);
  border: 1px solid var(--theme-border);
  border-top: none;
  border-radius: 0 0 0.25rem 0.25rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.help-function-example .example-result .result-label {
  color: var(--theme-text-light);
  font-weight: 500;
  margin-right: 0.5rem;
}

.help-function-example .example-result .result-value {
  color: var(--theme-text);
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", monospace;
}

.help-function-example .example-setup-data {
  margin-top: 0.75rem;
}

.help-function-example .example-setup-data .setup-data-table {
  width: auto;
  border-collapse: collapse;
  font-size: 0.875rem;
  border: 1px solid var(--theme-border);
}

.help-function-example .example-setup-data .setup-data-table tr:nth-child(even) {
  background-color: var(--theme-background-lighter);
}

.help-function-example .example-setup-data .setup-data-table td {
  border: 1px solid var(--theme-border);
  padding: 0.375rem 0.5rem;
  text-align: left;
}

.help-function-example .example-setup-data .setup-data-table td.row-header {
  background-color: var(--theme-header);
  color: var(--theme-header-text);
  font-weight: 500;
  text-align: center;
  width: 2.5rem;
  min-width: 2.5rem;
}

.help-function-example .example-setup-data .setup-data-table td.column-header {
  background-color: var(--theme-header);
  color: var(--theme-header-text);
  font-weight: 500;
  text-align: center;
  min-width: 5rem;
}

.help-function-example .example-setup-data .setup-data-table td.corner-header {
  background-color: var(--theme-header);
  color: var(--theme-header-text);
  width: 2.5rem;
  min-width: 2.5rem;
}

.help-function-example .example-setup-data .setup-data-table td.data-cell {
  background-color: var(--theme-background);
  color: var(--theme-text);
  text-align: center;
}

.function-signature {
  background-color: var(--theme-selected-background-tinted);
  border-left: 4px solid var(--theme-accent);
  padding: 1rem;
  margin: 1rem 0;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 1rem;
  border-radius: 4px;
}

.function-category-badge {
  display: inline-block;
  background-color: var(--theme-accent);
  color: var(--theme-background);
  padding: 0.25rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.function-example {
  background-color: var(--theme-background-dark);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
}

.function-example-title {
  font-weight: 600;
  color: var(--theme-darker-primary);
  margin-bottom: 0.5rem;
}

.function-example pre {
  margin: 0.5rem 0;
  background-color: var(--theme-background-darkest);
}

.related-functions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--theme-border);
}

.related-functions h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.related-functions ul {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related-functions li {
  margin-bottom: 0;
}

.related-functions a {
  display: inline-block;
  background-color: var(--theme-background-darker);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--theme-border);
  transition: all 0.2s;
}

.related-functions a:hover {
  background-color: var(--theme-hover);
  border-color: var(--theme-accent);
  text-decoration: none;
}

/* ========================================
   FORMULA INDEX
   ======================================== */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}
@media (max-width: 64rem) {
  .formula-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 48rem) {
  .formula-grid {
    grid-template-columns: 1fr;
  }
}

.formula-card {
  background-color: var(--theme-background-darker);
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  padding: 1rem;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}

.formula-card:hover {
  border-color: var(--theme-accent);
  box-shadow: 0 0.125rem 0.5rem var(--theme-transparent-contrast);
  text-decoration: none;
  transform: translateY(-0.125rem);
}

.formula-card-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--theme-accent);
  margin-bottom: 0.5rem;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
}

.formula-card-description {
  font-size: 0.9rem;
  color: var(--theme-text-light);
  line-height: 1.4;
}

.formula-category-section {
  margin: 2.5rem 0;
}

.formula-category-section h2 {
  color: var(--theme-primary);
  border-bottom: 2px solid var(--theme-border);
  padding-bottom: 0.5rem;
}

/* ========================================
   BLOCKQUOTES / CALLOUTS
   ======================================== */
.docs-container blockquote {
  border-left: 4px solid var(--theme-accent);
  background-color: var(--theme-background-dark);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.docs-container blockquote p:last-child {
  margin-bottom: 0;
}

/* ========================================
   FOOTER
   ======================================== */
.docs-footer {
  border-top: 1px solid var(--theme-border);
  margin-top: 3rem;
  padding-top: 1.5rem;
  text-align: center;
  color: var(--theme-text-light);
  font-size: 0.9rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 48rem) {
  .docs-container {
    padding: 1rem;
  }
  .docs-container h1 {
    font-size: 2rem;
  }
  .docs-container h2 {
    font-size: 1.75rem;
  }
  .docs-container h3 {
    font-size: 1.25rem;
  }
  .formula-grid {
    grid-template-columns: 1fr;
  }
  .docs-header nav a {
    display: block;
    margin: 0.5rem 0;
  }
}
/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .docs-header,
  .docs-breadcrumbs,
  .docs-footer {
    display: none;
  }
  .docs-container {
    max-width: 100%;
    padding: 0;
  }
  .docs-container a {
    color: var(--text);
    text-decoration: underline;
  }
}
