/* ── Shiphustle Brand Colors ─────────────────────────────────────────────── */

/* Light mode (default scheme) */
[data-md-color-scheme="shiphustle"] {
  --md-primary-fg-color: #1A1A2E;
  --md-primary-fg-color--light: #2A2A4E;
  --md-primary-fg-color--dark: #0E0E1A;
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: #ffffff;

  --md-accent-fg-color: #10B981;
  --md-accent-fg-color--transparent: rgba(16, 185, 129, 0.1);
  --md-accent-bg-color: #ffffff;

  --md-default-fg-color: #1A1A2E;
  --md-default-fg-color--light: #6B7280;
  --md-default-fg-color--lighter: #9CA3AF;
  --md-default-fg-color--lightest: rgba(26, 26, 46, 0.12);

  --md-default-bg-color: #F2F3F7;
  --md-default-bg-color--light: #F8F9FB;
  --md-default-bg-color--lighter: #ffffff;
  --md-default-bg-color--lightest: #ffffff;

  --md-typeset-a-color: #10B981;
}

/* Dark mode overrides */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #10B981;
  --md-primary-fg-color--light: #34D399;
  --md-primary-fg-color--dark: #059669;

  --md-accent-fg-color: #10B981;
  --md-accent-fg-color--transparent: rgba(16, 185, 129, 0.1);

  --md-typeset-a-color: #34D399;
}

/* ── Header & Navigation ────────────────────────────────────────────────── */

/* Header bar */
.md-header {
  background-color: #1A1A2E;
}

/* Navigation tabs (if enabled) */
.md-tabs {
  background-color: #1A1A2E;
}

/* Active nav link accent */
.md-nav__link--active,
.md-nav__link:hover {
  color: #10B981;
}

/* Sidebar active indicator */
.md-nav__item--active > .md-nav__link {
  color: #10B981;
  font-weight: 600;
}

/* ── Content Styling ────────────────────────────────────────────────────── */

/* Links */
.md-typeset a {
  color: #10B981;
}
.md-typeset a:hover {
  color: #059669;
}

/* Code inline */
.md-typeset code {
  border-radius: 6px;
}

/* ── Admonitions ────────────────────────────────────────────────────────── */

/* Tip admonitions use brand accent */
.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: #10B981;
}
.md-typeset .tip > .admonition-title,
.md-typeset .tip > summary {
  background-color: rgba(16, 185, 129, 0.1);
}
.md-typeset .tip > .admonition-title::before,
.md-typeset .tip > summary::before {
  background-color: #10B981;
}

/* ── Search ─────────────────────────────────────────────────────────────── */

.md-search__input:focus {
  border-color: #10B981;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.md-footer {
  background-color: #1A1A2E;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

/* Ensure all content blocks don't overflow on mobile */
.md-content img,
.md-content table,
.md-content pre {
  max-width: 100%;
  overflow-x: auto;
}

/* ── Task List / Checkbox Styling ───────────────────────────────────────── */

/* Make checkboxes larger and more printable */
.md-typeset .task-list-item input[type="checkbox"] {
  width: 1.2em;
  height: 1.2em;
  margin-right: 0.5em;
  vertical-align: middle;
  accent-color: #10B981;
}

/* Wider checkbox appearance for print — draw a visible box */
.md-typeset .task-list-item {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0.4em;
}

.md-typeset [dir="ltr"] .task-list-indicator::before,
.md-typeset .task-list-item input[type="checkbox"]::before {
  font-size: 1.1em;
}

/* ── Print Button ───────────────────────────────────────────────────────── */

.print-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  background-color: #10B981;
  color: white;
  border: none;
  border-radius: 2rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s, transform 0.1s;
}

.print-button:hover {
  background-color: #059669;
  transform: translateY(-1px);
}

.print-button:active {
  transform: translateY(0);
}

.print-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ── Print Styles ───────────────────────────────────────────────────────── */

@media print {
  /* Hide non-essential UI */
  .md-header,
  .md-tabs,
  .md-sidebar,
  .md-footer,
  .md-search,
  .md-top,
  .print-button,
  .md-source {
    display: none !important;
  }

  /* Full width content */
  .md-content {
    margin: 0 !important;
    max-width: 100% !important;
  }

  .md-main__inner {
    margin: 0 !important;
    padding: 0 !important;
  }

  .md-grid {
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* Make checkboxes visible as print-friendly boxes */
  .md-typeset .task-list-item input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 1.4em;
    height: 1.4em;
    border: 2px solid #333;
    border-radius: 3px;
    background: white;
    margin-right: 0.6em;
    vertical-align: middle;
    display: inline-block;
    position: relative;
  }

  /* Prevent page breaks inside checklist items */
  .md-typeset .task-list-item {
    page-break-inside: avoid;
  }

  /* Prevent page breaks inside sections */
  .md-typeset h2,
  .md-typeset h3 {
    page-break-after: avoid;
  }

  /* Ensure admonitions print nicely */
  .md-typeset .admonition,
  .md-typeset details {
    break-inside: avoid;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }

  /* Reasonable font sizing for print */
  .md-typeset {
    font-size: 11pt;
  }

  .md-typeset h1 {
    font-size: 20pt;
  }

  .md-typeset h2 {
    font-size: 16pt;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4pt;
  }

  .md-typeset h3 {
    font-size: 13pt;
  }

  /* Show link URLs in print */
  .md-typeset a[href]::after {
    content: none; /* Don't show full URLs - too noisy for checklist */
  }
}
