/* --- 1. GLOBAL FONTS & RESET --- */
body, input { 
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 
    font-weight: 300; 
}

.md-typeset strong,
.md-typeset b {
    font-weight: 700 !important;
    color: #000;
}

/* --- 2. HEADER & NAVIGATION --- */
.md-header, .md-tabs { 
    background-color: #004B8D !important; 
    border: none !important; 
}

/* SMART H1 LOGIC */
.hero-text-container + h1, 
.md-content__inner > h1:first-child:has(+ .hero-text-container) {
    display: none !important;
}

/* Style the restored H1 for SOG and Procedure pages */
.md-typeset h1 {
    display: block !important;
    font-size: 1.6rem !important; /* Reduced from 2.2rem */
    line-height: 1.3 !important;  /* Better spacing for multi-line titles */
    font-weight: 800 !important;
    color: #004B8D !important;
    margin-bottom: 0.8rem !important;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}

.md-header__title, .md-breadcrumb { 
    display: none !important; 
}

.md-header__inner { 
    display: flex !important; 
    align-items: center !important; 
    padding: 0 20px !important; 
}

/* LOGO IN TOP NAV */
.md-header__button.md-logo { 
    margin-right: auto !important; 
}

.md-header__button.md-logo img { 
    filter: brightness(0) invert(1); 
    height: 2.8rem !important; 
}

/* --- 3. SEARCH & DARK MODE (ALIGNED RIGHT) --- */
.md-header__search { 
    width: 340px !important; 
    margin-right: 15px !important; 
    order: 2 !important; 
}

.md-header__option { 
    order: 3 !important; 
    display: flex !important; 
    align-items: center !important; 
}

.md-search__form { 
    background-color: rgba(255,255,255,0.15) !important; 
    border-radius: 24px !important; 
}

.md-search__input { 
    color: white !important; 
    height: 2.2rem !important; 
    padding-left: 2.8rem !important; 
}

/* ECG SEARCH ICON */
.md-search__icon svg { display: none !important; }
.md-search__icon[for="__search"]::before {
    background-color: #FF0000;
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3,13H5.79L8,18L13,6L16,13H21V15H15.21L13,10L8,22L5,15H3V13Z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3,13H5.79L8,18L13,6L16,13H21V15H15.21L13,10L8,22L5,15H3V13Z"/></svg>');
    content: ""; display: block; width: 1.3rem; height: 1.3rem; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
}

/* --- 4. HERO & LOGO --- */
.hero-text-container {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 20px;
}

.hero-logo-small {
    width: 250px !important; 
    display: block;
    margin: 0 auto 15px auto;
}

.hero-welcome {
    font-size: 1.8rem !important;
    font-weight: 800;
    color: #004B8D;
    display: block;
    margin-bottom: 5px;
}

.hero-tagline {
    font-size: 1.1rem;
    font-style: italic;
    color: #666;
    display: block;
}

/* --- 5. SECTION HEADERS (HOME & PROCEDURES) --- */
.md-typeset h2 {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: #004B8D !important;
    margin-top: 2rem !important;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* --- 6. CATEGORY LETTERS (SUB-PAGE INDEXES ONLY) --- */
.category-letter {
    display: block !important;
    font-size: 2rem !important;
    font-weight: 900 !important;
    color: #004B8D !important;
    border-bottom: 3px solid #004B8D;
    margin-top: 40px !important;
    margin-bottom: 15px !important;
    padding-bottom: 5px;
}

/* --- 7. INDEX GRID --- */
.index-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px 40px !important;
    margin-bottom: 30px !important;
}

.index-grid a { 
    font-size: 1rem; 
    font-weight: 500; 
    color: #004B8D !important; 
    text-decoration: none !important; 
}


.md-footer, .md-footer-meta { background-color: #004B8D !important; }
.md-copyright { display: none !important; }
.md-footer-meta__inner { 
    display: flex !important; 
    justify-content: center !important; 
    color: white !important; 
    padding: 20px 0 !important; 
}

.md-footer-meta__inner::after { 
    content: "Internal Use Only | © 2026 BC Emergency Health Services"; 
    font-size: 0.85rem; 
}

/* --- 9. SEARCH RESULTS STYLING --- */

/* Decrease the main title in search results */
.md-search-result__article h1 {
    font-size: 1.1rem !important; /* Matches a standard link size */
    font-weight: 700 !important;
    margin-bottom: 0.2rem !important;
    border-bottom: none !important; /* Remove the thick underline from results */
    padding-bottom: 0 !important;
    color: #004B8D !important;
}

/* Decrease the category letters (B, C, etc.) in search results */
.md-search-result__article h2 {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.1rem !important;
    border-bottom: none !important;
    color: #666 !important; /* Use a subtle grey for sub-headers in search */
}

/* Adjust spacing between search items */
.md-search-result__item {
    padding: 10px 0 !important;
    border-bottom: 1px solid #f0f0f0;
}

/* Shrink those tags/keywords in search results */
.md-search-result__meta {
    font-size: 0.75rem !important;
    margin-top: 5px !important;
}

/* Subtle External Link Style */
.external-link {
    color: #004B8D !important;
    text-decoration: underline !important;
    font-weight: 600;
}

.external-link::after {
    content: " ↗"; /* Adds a small arrow so staff know it's external */
    font-size: 0.8rem;
}

/* Center-align tables and prevent them from stretching full-width */
.md-typeset table {
    margin-left: auto !important;
    margin-right: auto !important;
    display: table !important;
    width: auto !important;
}

/* Ensure table headers are also centered if using :---: in Markdown */
.md-typeset th {
    text-align: center !important;
}

/* Indicate that images are clickable/zoomable */
.md-typeset img {
    max-width: 100%;
    height: auto;
    border-radius: 4px; /* Optional: softens the edges of SAR diagrams */
}

.md-typeset img:hover {
    opacity: 0.9;
}

.md-search__input {
    color: rgba(0, 0, 0, 0.87) !important; /* Force black text */
}
[data-md-color-scheme="slate"] .md-search__input {
    color: white !important; /* Keep it white for dark mode users */
}

/* This makes the phone icon red */
.red-icon {
  color: #d32f2f; /* BCEHS Red */
  vertical-align: middle;
}

/* Center alignment for Grid Cards */
.text-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.text-center .md-button {
  margin-top: 10px;
  width: fit-content;
}

/* Force Grid Cards to be identical width and centered */
.grid.cards > ul > li {
    min-width: 320px; /* Adjust this number if you want them wider/narrower */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Ensure the button stays centered within that fixed width */
.grid.cards .md-button {
    margin-left: auto;
    margin-right: auto;
    width: 200px; /* Fixed width for the buttons to match */
}

/* Ensure both cards are the same width */
.grid.cards > ul > li {
    min-width: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Fix the button text stacking and alignment */
.grid.cards .md-button {
    min-width: 220px; /* Forces buttons to be identical width */
    white-space: nowrap; /* Prevents text from wrapping to a second line */
    text-align: center;
    margin-top: 15px;
}


/* Force the grid items to be identical twins */
.grid.cards > ul {
    display: flex !important;
    align-items: stretch !important; /* Forces same height */
    gap: 20px;
}

.grid.cards > ul > li {
    flex: 1; /* Forces same width */
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important; /* Pushes button to bottom */
    padding: 30px !important;
    text-align: center;
}

/* Ensure buttons are identical in size */
.grid.cards .md-button {
    margin: 20px auto 0 auto !important;
    width: 220px !important; /* Fixed width for symmetry */
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Make the sidebar look like a clean category menu */
.md-nav__link--active {
    font-weight: bold;
    color: #003366 !important; /* BCEHS Blue */
}

/* Hide the 'Paramedic Specialists' title in the sidebar if it feels redundant */
.md-sidebar--primary .md-nav__title {
    display: none;
}

/* Responsive fix for mobile screens (phones) */
@media screen and (max-width: 76.25em) {
    .grid.cards > ul {
        display: flex !important;
        flex-direction: column !important; /* Stack them vertically */
        align-items: center !important;
    }

    .grid.cards > ul > li {
        width: 100% !important; /* Use the full width of the phone */
        min-width: unset !important; /* Remove the desktop width restriction */
        margin-bottom: 20px;
    }

    .grid.cards .md-button {
        width: 100% !important; /* Make the button easy to tap with a thumb */
        max-width: 300px;
    }
}

/* --- CLINICAL ACCORDION STYLING --- */
details.details {
    border-bottom: 1px solid #eee !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

details.details summary {
    background-color: transparent !important;
    color: #004B8D !important; /* BCEHS Blue */
    font-size: 1.1rem;
    font-weight: 500;
    padding: 15px 0 !important;
}

/* Change the arrow color and position */
details.details summary::after {
    color: #666 !important;
}

/* Remove background color from the expanded content */
details.details[open] {
    background-color: #fafafa;
    padding-bottom: 20px;
}

/* --- Custom PDF Admonition Icon --- */
.md-typeset .pdf > .admonition-title::before,
.md-typeset .pdf > summary::before {
  background-color: #2e7d32; /* Matches the green theme in your photo */
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6m4 18H6V4h7v5h5v11m-10-9h8v2H8v-2m0 4h8v2H8v-2m0 4h5v2H8v-2Z"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6m4 18H6V4h7v5h5v11m-10-9h8v2H8v-2m0 4h8v2H8v-2m0 4h5v2H8v-2Z"/></svg>');
  content: "";
}

/* Optional: Keep the border green to match your screenshot */
.md-typeset .admonition.pdf,
.md-typeset details.pdf {
  border-color: #2e7d32;
}

.md-typeset .pdf > .admonition-title,
.md-typeset .pdf > summary {
  background-color: rgba(46, 125, 50, 0.1);
}

/* --- SEARCH BOX TEXT COLOR FIX --- */
.md-search__input {
    color: white !important;
    /* Fixes text color in Chrome/Edge */
    -webkit-text-fill-color: white !important; 
}

.md-search__input::placeholder {
    /* Makes "Search TangoPulse..." readable but subtle */
    color: rgba(255, 255, 255, 0.7) !important;
}

.md-search__input {
    /* Keeps the blinking typing cursor white */
    caret-color: white !important;
}

/* --- 8. OFFICIAL TOP BUTTON (LEFT ALIGNED) --- */
.md-top {
    left: 20px !important;  /* Pushes it to the left side */
    right: auto !important; /* Disables the default right-side position */
    background-color: #004B8D !important; /* BCEHS Blue */
    color: white !important;
}

/* Ensures the arrow icon inside is white */
.md-top svg {
    fill: white !important;
}

/* --- SEARCH BAR: COLOR & VISIBILITY REPAIR --- */

/* Restores the blue background for the search bar */
.md-search__input {
    background-color: #004B8D !important; /* BCEHS Blue */
    color: white !important; /* White text for contrast[cite: 3] */
}

/* Forces the text to stay white on mobile devices like Brave[cite: 3] */
input.md-search__input {
    -webkit-text-fill-color: white !important;
}

/* Makes the "Search" placeholder text light grey so it's readable[cite: 3] */
.md-search__input::placeholder {
    color: #e0e0e0 !important;
    opacity: 1;
}

/* Ensures the search results area remains white with dark text[cite: 3] */
.md-search__output {
    background-color: white !important;
    color: #333 !important;
}

/* Green YES Button */
.md-typeset .btn-yes {
  background-color: #2e7d32;
  color: #ffffff !important;
  border-color: #2e7d32;
  font-weight: bold;
}
.md-typeset .btn-yes:hover {
  background-color: #1b5e20;
  border-color: #1b5e20;
}

/* Red NO Button */
.md-typeset .btn-no {
  background-color: #c62828;
  color: #ffffff !important;
  border-color: #c62828;
  font-weight: bold;
}
.md-typeset .btn-no:hover {
  background-color: #b71c1c;
  border-color: #b71c1c;
}

/* 3-Column Horizontal Grid Container */
.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
  gap: 16px;
  margin: 20px 0;
}

/* Base Card Style */
.status-card {
  border-radius: 8px;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.status-card h4 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.1rem;
  font-weight: bold;
}

/* Red Card (Result) */
.card-red {
  background-color: #ffb6c1; /* Soft Red / Pink */
  border-color: #d32f2f;
  color: #111;
}

/* Green Card (Action) */
.card-green {
  background-color: #c8e6c9; /* Soft Green */
  border-color: #2e7d32;
  color: #111;
}

/* Yellow Card (Advice) */
.card-yellow {
  background-color: #fff9c4; /* Soft Yellow */
  border-color: #fbc02d;
  color: #111;
}

/* Responsive adjustment for mobile screens */
@media (max-width: 900px) {
  .card-grid-3 {
    grid-template-columns: 1fr; /* Stack vertically on small screens */
  }
}

.decision-label {
    color: #d32f2f;
    font-weight: 700;
    font-size: 1.2em;
    text-align: center;
    margin: 0.5rem 0;
}

/* ==========================================================================
   CLINICAL HUB COMPONENTS
   ========================================================================== */

/* --------------------------------------------------
   Decision Label
---------------------------------------------------*/

.decision-label {
    text-align: center;
    color: #c62828;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0.5rem 0 1.25rem;
}

/* --------------------------------------------------
   Clinical Card Grid
---------------------------------------------------*/

.decision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* --------------------------------------------------
   Base Card
---------------------------------------------------*/

.decision-card {
    background: #ffffff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Card headings */

.decision-card h3 {
    margin: 0 0 15px;
    text-align: center;
    color: #003f72;
    font-size: 1.25rem;
}

/* Lists */

.decision-card ul {
    margin: 0;
    padding-left: 1.4rem;
}

.decision-card li {
    margin-bottom: .45rem;
    line-height: 1.4;
}

/* Last bullet */

.decision-card li:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------
   Card Colours
---------------------------------------------------*/

.activate-card {
    border-left: 8px solid #c62828;
}

.activate-card h3 {
    color: #c62828;
}

.standard-card {
    border-left: 8px solid #1565c0;
}

.standard-card h3 {
    color: #1565c0;
}

/* Grey reference card */

.reference-card {
    border-left: 8px solid #757575;
}

.reference-card h3 {
    color: #424242;
}

/* Green action card */

.success-card {
    border-left: 8px solid #2e7d32;
}

.success-card h3 {
    color: #2e7d32;
}

/* --------------------------------------------------
   Compact Lists
---------------------------------------------------*/

.compact-list {
    margin: 0;
    padding-left: 1.3rem;
}

.compact-list li {
    margin-bottom: .3rem;
    line-height: 1.35;
}

/* --------------------------------------------------
   Symptoms Cards
---------------------------------------------------*/

.symptom-card ul {
    padding-left: 1.2rem;
    margin: 0;
}

.symptom-card li {
    margin-bottom: .3rem;
    line-height: 1.3;
}

/* --------------------------------------------------
   Mobile
---------------------------------------------------*/

@media (max-width: 900px) {

    .decision-grid {
        grid-template-columns: 1fr;
    }

}


/* ==========================================================================
   Reference Cards (Clinical Hub)
   ========================================================================== */

.reference-card {
    background: #f8f9fa;
    border: 1px solid #d8dde3;
    border-left: 5px solid #9aa5b1;
    border-radius: 6px;
    padding: 14px 18px;
    box-shadow: none;
}

.reference-card h3 {
    margin: 0 0 .5rem;
    color: #2f3b45;
    font-size: 1rem;
    font-weight: 700;
    text-align: left;
}

.reference-card p {
    margin: 0;
    font-size: .8rem;
    line-height: 1.45;
    color: #444;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 1rem 0 2rem;
}

/* ==========================================================================
   Key Facts Panel
   ========================================================================== */

.md-typeset .admonition.note hr {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid #d8dde3;
}

.md-typeset .admonition.note strong:first-child {
    display: block;
    margin-bottom: .35rem;
    font-size: .95rem;
}

/* ==========================================================================
   Symptom Cards
   ========================================================================== */

.symptom-card hr {
    margin: 1rem 0 .8rem;
    border: 0;
    border-top: 1px solid #d8dde3;
}

.high-risk-heading {
    color: #c62828;
    font-weight: 700;
    margin: 0 0 .35rem;
}

.high-risk-list {
    margin: 0;
    padding-left: 1.2rem;
}

.high-risk-list li {
    color: #c62828;
    margin-bottom: .25rem;
}

.md-typeset strong,
.md-typeset b {
    font-weight: 800 !important;
}

/* ==========================================================================
   Normalize admonition title typography
   ========================================================================== */

.md-typeset .admonition > .admonition-title,
.md-typeset .admonition > .admonition-title strong {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    line-height: 1.3;
}

.md-typeset .admonition hr,
.md-typeset details hr {
    margin: 0.8rem 0;
    border: 0;
    border-top: 1px solid rgba(0,0,0,.12);
}