/* ── Primary colour (change here only) ── */
:root {
  --primary: #2270A8;
  --primary-light: #3588c0;
  --primary-dark: #1a5a87;
  --primary-rgb: 34, 112, 168;
}

/* ── Light mode ── */
[data-md-color-scheme="default"] {
  --md-primary-fg-color: #0087FE;
  --md-primary-fg-color--light: #339ffe;
  --md-primary-fg-color--dark: #0066bf;
  --md-accent-fg-color: var(--primary);
  --md-typeset-a-color: var(--primary);
  --md-default-bg-color: #F1F3F5;
}

/* ── Dark mode ── */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #0087FE;
  --md-primary-fg-color--light: #339ffe;
  --md-primary-fg-color--dark: #0066bf;
  --md-accent-fg-color: var(--primary-light);
  --md-typeset-a-color: var(--primary-light);
}

/* Active tab — background shade of primary colour */
.md-typeset .tabbed-alternate .tabbed-labels label.active,
.md-typeset .tabbed-alternate input:nth-child(1):checked ~ .tabbed-labels label:nth-child(1),
.md-typeset .tabbed-alternate input:nth-child(2):checked ~ .tabbed-labels label:nth-child(2),
.md-typeset .tabbed-alternate input:nth-child(3):checked ~ .tabbed-labels label:nth-child(3),
.md-typeset .tabbed-alternate input:nth-child(4):checked ~ .tabbed-labels label:nth-child(4) {
  background-color: rgba(var(--primary-rgb), 0.25);
  border-radius: 4px 4px 0 0;
}

/* Widen the overall page container to use full screen width */
.md-grid {
  max-width: 100%;
}

/* Slim down the left nav sidebar */
.md-sidebar--primary {
  width: 11rem;
}
.md-sidebar--primary .md-sidebar__scrollwrap {
  width: 11rem;
}

/* Slim down the right TOC sidebar */
.md-sidebar--secondary {
  width: 11rem;
}
.md-sidebar--secondary .md-sidebar__scrollwrap {
  width: 11rem;
}

/* Bold the right-side table of contents */
.md-sidebar--secondary .md-nav__link {
  font-weight: 600;
}

/* Headings — primary colour, bold */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  color: var(--primary);
  font-weight: 700;
}

/* Dark mode headings — use lighter shade for readability */
[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3 {
  color: var(--primary-light);
}

[data-md-color-scheme="slate"] .md-typeset h4 {
  color: var(--primary-light);
}

/* Subtle divider above step headings */
.md-typeset h3 {
  border-top: 1px solid #D1D5DB;
  padding-top: 1.5rem;
  margin-top: 2rem;
}

[data-md-color-scheme="slate"] .md-typeset h3 {
  border-top-color: #404040;
}

.md-typeset h4 {
  color: var(--primary);
  font-weight: 600;
}

/* Left nav — bolder text */
.md-sidebar--primary .md-nav__link {
  font-weight: 600;
}

/* Left nav — active page: primary colour text + highlighted row */
.md-sidebar--primary .md-nav__link--active,
.md-sidebar--primary .md-nav__item--active > .md-nav__link {
  color: var(--primary);
  font-weight: 700;
  background-color: rgba(var(--primary-rgb), 0.12);
  border-radius: 4px;
}

[data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__link--active,
[data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__item--active > .md-nav__link {
  color: var(--primary-light);
}

/* Reduce nav font size to fit narrower sidebar */
.md-nav {
  font-size: 0.65rem;
}

/* ── Homepage logo banner ── */
.logo-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.logo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 180px;
}

.logo-col img {
  height: 85px;
  width: auto;
}

.logo-center img {
  height: 180px;
  width: auto;
}

/* ══════════════════════════════════════════════
   Project-specific styles (RCIIS DevOps)
   ══════════════════════════════════════════════ */

/* Custom admonition styles */
.md-typeset .admonition.rciis {
  border-color: var(--primary);
}

.md-typeset .admonition.rciis > .admonition-title {
  background-color: var(--primary);
  color: white;
}

/* Code block enhancements */
.md-typeset .highlight .filename {
  background-color: var(--md-code-bg-color);
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  color: var(--md-code-fg-color);
  font-size: 0.85em;
  font-weight: 500;
  padding: 0.5rem 1rem;
  margin: 0;
}

/* Mermaid diagram styling */
.mermaid {
  text-align: center;
  margin: 1rem 0;
}

/* Table enhancements */
.md-typeset table:not([class]) {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.2rem;
}

.md-typeset table:not([class]) th {
  background-color: var(--md-default-fg-color--lightest);
  border-bottom: 2px solid var(--md-default-fg-color--light);
  font-weight: 600;
}

/* Command line styling */
.md-typeset .command-line {
  background-color: #2d3748;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.375rem;
  font-family: 'Roboto Mono', monospace;
  overflow-x: auto;
}

.md-typeset .command-line::before {
  content: "$ ";
  color: #68d391;
  font-weight: bold;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.running {
  background-color: #4caf50;
  color: white;
}

.status-badge.pending {
  background-color: #ff9800;
  color: white;
}

.status-badge.error {
  background-color: #f44336;
  color: white;
}

/* Environment indicators */
.env-tag {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 0.125rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 0.25rem;
}

.env-tag.local {
  background-color: #e3f2fd;
  color: #1976d2;
}

.env-tag.testing {
  background-color: #fff3e0;
  color: #f57c00;
}

.env-tag.staging {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.env-tag.production {
  background-color: #ffebee;
  color: #d32f2f;
}

/* Navigation enhancements */
.md-nav__item .md-nav__item {
  border-left: 2px solid transparent;
  transition: border-color 0.2s;
}

.md-nav__item .md-nav__item:hover {
  border-left-color: var(--primary);
}

/* Search result highlighting */
[data-md-color-scheme="default"] .md-search-result__teaser mark {
  background-color: #42a5f5;
  color: white;
}

[data-md-color-scheme="slate"] .md-search-result__teaser mark {
  background-color: var(--primary);
  color: white;
}

/* Responsive video embeds */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Print styles */
@media print {
  .md-sidebar,
  .md-nav,
  .md-footer,
  .md-header {
    display: none !important;
  }

  .md-content {
    margin: 0 !important;
  }

  .md-typeset .highlight {
    overflow: visible !important;
  }
}
