/* CCT Labs Custom Styles for MkDocs */

:root {
  --cct-primary: #2c3e50;
  --cct-secondary: #3498db;
  --cct-accent: #e74c3c;
  --cct-text: #2c3e50;
  --cct-bg: #ffffff;
  --cct-sidebar-bg: #f8f9fa;
  --cct-border: #dee2e6;
  --cct-hover: #f1f3f4;
  --cct-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --cct-radius: 8px;
}

/* Dark Mode */
[data-theme="dark"],
html.dark {
  --cct-primary: #d1d5db;
  --cct-secondary: #3498db;
  --cct-accent: #e74c3c;
  --cct-text: #d1d5db;
  --cct-bg: #1a1a1a;
  --cct-sidebar-bg: #2d2d2d;
  --cct-border: #444;
  --cct-hover: #3d3d3d;
  --cct-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Base Typography */
body {
  font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.7;
  color: var(--cct-text);
  background-color: var(--cct-bg);
}

/* Links */
a {
  color: var(--cct-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--cct-accent);
  text-decoration: underline;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--cct-primary);
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2rem;
  border-bottom: 2px solid var(--cct-secondary);
  padding-bottom: 0.3em;
}

h2 {
  font-size: 1.6rem;
  border-bottom: 1px solid var(--cct-border);
  padding-bottom: 0.2em;
}

h3 {
  font-size: 1.3rem;
}

/* Content rhythm tweaks for authoring convenience */
.col-md-9 > h2,
[role="main"] > h2,
.md-content__inner > h2 {
  margin-top: 1.85rem;
}

.col-md-9 > h3,
[role="main"] > h3,
.md-content__inner > h3 {
  margin-top: 1.5rem;
}

/* Preserve heading hierarchy in content areas (Bootstrap defaults make h4 ~= h2) */
.col-md-9 h4,
[role="main"] h4,
.md-content__inner h4 {
  font-size: 1.1rem;
  line-height: 1.45;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--cct-primary);
}

.col-md-9 > p,
[role="main"] > p,
.md-content__inner > p {
  margin-top: 0;
  margin-bottom: 1.15rem;
}

/* Slightly larger gap only between consecutive paragraphs */
.col-md-9 > p + p,
[role="main"] > p + p,
.md-content__inner > p + p {
  padding-top: 0.15rem;
}

/* Make explicit <br> tags add visible breathing room in markdown paragraphs */
.col-md-9 > p br,
[role="main"] > p br,
.md-content__inner > p br {
  content: "";
  display: block;
  margin-top: 0.3rem;
}

/* Double line-breaks (<br><br>) get extra separation */
.col-md-9 > p br + br,
[role="main"] > p br + br,
.md-content__inner > p br + br {
  margin-top: 0.6rem;
}

/* Content Area */
main,
.md-content,
article {
  max-width: 900px;
  padding: 2rem;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--cct-secondary);
  margin: 1.5em 0;
  padding: 0.5em 1em;
  background-color: var(--cct-hover);
  border-radius: 0 var(--cct-radius) var(--cct-radius) 0;
}

blockquote p {
  margin: 0;
}

/* Code Blocks */
pre {
  background-color: var(--cct-sidebar-bg);
  border: 1px solid var(--cct-border);
  border-radius: var(--cct-radius);
  padding: 1em;
  overflow-x: auto;
}

code {
  font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
  font-size: 0.9em;
}

:not(pre)>code {
  background-color: var(--cct-hover);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95em;
}

th,
td {
  border: 1px solid var(--cct-border);
  padding: 0.75em 1em;
  text-align: left;
}

th {
  background-color: var(--cct-sidebar-bg);
  font-weight: 600;
  color: var(--cct-primary);
}

tr:nth-child(even) {
  background-color: var(--cct-hover);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--cct-radius);
  box-shadow: var(--cct-shadow);
}

figure {
  margin: 1.5em 0;
  text-align: center;
}

figcaption {
  font-size: 0.9em;
  color: #666;
  margin-top: 0.5em;
}

/* Lists */
ul,
ol {
  margin: 1em 0;
  padding-left: 2em;
}

li {
  margin-bottom: 0.5em;
}

/* Status badges */
.status-passed,
.status-green {
  color: #27ae60;
  font-weight: 600;
}

.status-pending,
.status-yellow {
  color: #f39c12;
  font-weight: 600;
}

.status-failed,
.status-red {
  color: #e74c3c;
  font-weight: 600;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  main,
  .md-content,
  article {
    padding: 1rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .col-md-9 > h2,
  [role="main"] > h2,
  .md-content__inner > h2 {
    margin-top: 1.6rem;
  }

  .col-md-9 > h3,
  [role="main"] > h3,
  .md-content__inner > h3 {
    margin-top: 1.3rem;
  }

  .col-md-9 h4,
  [role="main"] h4,
  .md-content__inner h4 {
    font-size: 1rem;
    margin-top: 1rem;
  }

  .col-md-9 > p,
  [role="main"] > p,
  .md-content__inner > p {
    margin-bottom: 1rem;
  }

  .col-md-9 > p + p,
  [role="main"] > p + p,
  .md-content__inner > p + p {
    padding-top: 0.1rem;
  }

  .col-md-9 > p br,
  [role="main"] > p br,
  .md-content__inner > p br {
    margin-top: 0.25rem;
  }

  .col-md-9 > p br + br,
  [role="main"] > p br + br,
  .md-content__inner > p br + br {
    margin-top: 0.5rem;
  }

  table {
    font-size: 0.85em;
  }

  th,
  td {
    padding: 0.5em;
  }

  pre {
    padding: 0.75em;
    font-size: 0.85em;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  a {
    color: inherit;
    text-decoration: underline;
  }

  .sidebar,
  nav,
  .toc {
    display: none;
  }
}
