/* ============================================================
   RPAH Drug Library — Custom Theme (MaterialX)
   SLHD / NSW Health Branding: Navy + Red
   ============================================================ */

:root {
  --md-primary-fg-color:        #002664;   /* SLHD Navy */
  --md-primary-bg-color:        #ffffff;
  --md-accent-fg-color:         #D7153A;   /* SLHD Red */
  --md-accent-fg-color--transparent: rgba(215, 21, 58, 0.1);
}

/* Force header and tabs to absolute SLHD Navy */
.md-header, .md-tabs {
  background-color: #002664 !important;
}

/* SLHD Red accent border below header (visible on all viewports) */
.md-header {
  border-bottom: 3px solid #D7153A !important;
}

.md-tabs {
  border-bottom: 3px solid #D7153A;
}

.md-header__button.md-logo img, .md-header__button.md-logo svg {
  color: #ffffff;
}

/* Dark mode adjustments — ensures readability while maintaining brand tone */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #2B80FF;   /* Accessible lighter navy for links */
  --md-accent-fg-color:         #FF5277;   /* Accessible soft red for alerts */
  
  /* Remove primary-bg-color override to allow the theme's dark background to work */
}

/* Ensure the top header stays dark navy in both modes for branding consistency */
[data-md-color-scheme="default"] .md-header, 
[data-md-color-scheme="default"] .md-tabs {
  background-color: #002664 !important;
}

[data-md-color-scheme="slate"] .md-header, 
[data-md-color-scheme="slate"] .md-tabs {
  background-color: #001A45 !important; /* Slightly deeper navy for dark mode bar */
}

/* Hide default "Made with Material for MkDocs" */
.md-footer-meta__inner > :last-child {
  display: none;
}

/* Admonitions — red accent for warnings */
.md-typeset .admonition.warning,
.md-typeset details.warning {
  border-left-color: #D7153A;
}

.md-typeset .admonition.warning > .admonition-title,
.md-typeset details.warning > summary {
  background-color: rgba(215, 21, 58, 0.08);
  color: #D7153A;
}

/* Code blocks */
.md-typeset code {
  background-color: rgba(0, 38, 100, 0.08);
  color: #D7153A;
}

/* ============================================================
   Print Stylesheet — Optimised for bedside clinical use
   ============================================================ */

@media print {
  /* Hide navigation, header, footer, and sidebar */
  .md-header,
  .md-tabs,
  .md-sidebar,
  .md-footer,
  .md-nav,
  .md-top,
  .md-search,
  .md-announce {
    display: none !important;
  }

  /* Reset content margins for full-width printing */
  .md-content {
    margin: 0 !important;
    padding: 0 !important;
  }

  .md-content__inner {
    padding: 0 !important;
    margin: 0 !important;
  }

  .md-main__inner {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Ensure tables have borders for print */
  .md-typeset table:not([class]) {
    border: 1px solid #000;
    box-shadow: none;
  }

  .md-typeset table:not([class]) th,
  .md-typeset table:not([class]) td {
    border: 1px solid #ccc;
    padding: 4pt 8pt;
  }

  /* Force white backgrounds */
  body,
  .md-typeset {
    background-color: #fff !important;
    color: #000 !important;
  }

  /* Show link URLs in print */
  .md-typeset a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #555;
  }

  /* Avoid page breaks inside important elements */
  .md-typeset table,
  .md-typeset .admonition,
  .md-typeset details {
    page-break-inside: avoid;
  }

  /* Add page break before major sections */
  .md-typeset h1 {
    page-break-before: always;
  }

  .md-typeset h1:first-of-type {
    page-break-before: avoid;
  }
}

/* Hide inline tags on pages (tags index page still works) */
.md-content__inner .md-tags {
  display: none !important;
}
