/* 
 * 4Core Energy & Maintenance - OHS Program Custom Styles
 * docs/style.css
 */

/* Import your existing styles if any */
/* @import url('custom-fonts.css'); */

/* ===== BRANDING OVERRIDES ===== */
:root {
  /* 4Core Official Brand Colors */
  --4core-primary: #f05f00;    /* Your exact orange: f05f00 */
  --4core-primary-dark: #424648; /* Your exact dark grey: 424648 */
  --4core-accent: #838a8d;     /* Your exact silver: 838a8d */
  --4core-black: #000000;      /* Pure black */
  --4core-white: #ffffff;      /* Pure white */
  
  /* Light tints for backgrounds (optional) */
  --4core-primary-light: #ff8a40; /* Lighter tint of your orange */
  --4core-grey-light: #f0f2f3;   /* Very light grey for table bands */
  --4core-grey-medium: #d0d3d5;  /* Medium grey for borders */
  
  /* Override Material theme with 4Core colors */
  --md-primary-fg-color: var(--4core-primary);
  --md-primary-fg-color--dark: var(--4core-primary-dark);
  --md-primary-fg-color--light: var(--4core-primary-light);
  --md-accent-fg-color: var(--4core-accent);
  --md-default-fg-color: var(--4core-black);
  --md-default-bg-color: var(--4core-white);
  
  /* Typography */
  --md-typeset-color: var(--4core-black);
  --md-typeset-a-color: var(--4core-primary);
}

/* Dark mode overrides */
[data-md-color-scheme="slate"] {
  --4core-primary: #ff7a33;    /* Brighter orange for dark mode */
  --4core-primary-dark: #5a5e60; /* Lighter dark grey for dark mode */
  --4core-accent: #a0a7ab;     /* Lighter silver for dark mode */
  
  --md-primary-fg-color: var(--4core-primary);
  --md-primary-fg-color--dark: var(--4core-primary-dark);
  --md-accent-fg-color: var(--4core-accent);
  --md-default-fg-color: #e0e0e0;  /* Light text on dark */
  --md-default-bg-color: #1a1a1a;  /* Very dark background */
  --md-typeset-color: #e0e0e0;
  --md-typeset-a-color: var(--4core-primary);
}

/* ===== TABLE BANDING ===== */
.md-typeset table:not([class]) tr:nth-child(even) {
  background-color: var(--4core-grey-light);
}

.md-typeset table:not([class]) {
  border: 1px solid var(--4core-grey-medium);
  border-collapse: collapse;
}

.md-typeset table:not([class]) th {
  background-color: var(--4core-primary-dark);
  color: var(--4core-white);
  border-bottom: 2px solid var(--4core-primary);
}

.md-typeset table:not([class]) td {
  border-bottom: 1px solid var(--4core-grey-medium);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.05);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background-color: var(--4core-primary-dark);
  color: var(--4core-white);
}

/* ===== LOGO STYLING ===== */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 2.5rem;
  width: auto;
  transition: transform 0.2s ease;
}

.md-header__button.md-logo:hover img,
.md-header__button.md-logo:hover svg {
  transform: scale(1.05);
}

/* ===== SAFETY ICON STYLES ===== */
/* ISO 7010 Icon containers */
.iso-icon {
  display: inline-block;
  vertical-align: middle;
  margin: 0 0.5rem;
}

.iso-icon-large {
  width: 64px;
  height: 64px;
}

.iso-icon-medium {
  width: 48px;
  height: 48px;
}

.iso-icon-small {
  width: 32px;
  height: 32px;
}

/* Safety sign categories */
.safety-sign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.safety-sign-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: white;
}

.safety-sign-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

[data-md-color-scheme="slate"] .safety-sign-card {
  border-color: #444;
  background: #2d2d2d;
}

/* Category-specific styling */
.safety-emergency {
  border-top: 4px solid #009933; /* Green */
}

.safety-fire {
  border-top: 4px solid #ff3333; /* Red */
}

.safety-mandatory {
  border-top: 4px solid #0066cc; /* Blue */
}

.safety-prohibition {
  border-top: 4px solid #cc0000; /* Dark Red */
}

.safety-warning {
  border-top: 4px solid #ff9900; /* Orange */
}

/* ===== CUSTOM ADMONITIONS ===== */
/* 4Core branded admonitions */
.admonition.4core-tip {
  border-left-color: var(--4core-accent);
  background-color: rgba(255, 193, 7, 0.1);
}

.admonition.4core-tip .admonition-title {
  background-color: rgba(255, 193, 7, 0.2);
  color: var(--4core-accent-dark);
}

.admonition.4core-warning {
  border-left-color: var(--4core-primary);
  background-color: rgba(255, 87, 34, 0.1);
}

.admonition.4core-warning .admonition-title {
  background-color: rgba(255, 87, 34, 0.2);
  color: var(--4core-primary-dark);
}

/* ===== TYPOGRAPHY ===== */
.md-typeset h1 {
  color: var(--4core-primary);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.md-typeset h2 {
  color: var(--4core-primary-dark);
  border-bottom: 2px solid var(--4core-primary-light);
  padding-bottom: 0.5rem;
  margin-top: 2.5rem;
}

.md-typeset h3 {
  color: var(--4core-primary);
}

/* ===== TABLES ===== */
.md-typeset table:not([class]) {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
}

.md-typeset table:not([class]) th {
  background-color: var(--4core-primary);
  color: white;
  font-weight: 600;
}

.md-typeset table:not([class]) tr:nth-child(even) {
  background-color: rgba(255, 87, 34, 0.05);
}

/* ===== CODE BLOCKS ===== */
.md-typeset pre > code {
  border-radius: 8px;
  border-left: 4px solid var(--4core-accent);
}

/* ===== PRINT STYLES ===== */
@media print {
  .no-print {
    display: none !important;
  }
  
  .md-sidebar {
    display: none !important;
  }
  
  .md-content {
    margin-left: 0 !important;
    max-width: 100% !important;
  }
  
  .safety-sign-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
  
  /* Ensure logos print well */
  img {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media screen and (max-width: 76.1875em) {
  .md-nav--primary .md-nav__title {
    background-color: var(--4core-primary);
  }
  
  .safety-sign-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 480px) {
  .safety-sign-grid {
    grid-template-columns: 1fr;
  }
  
  .md-header__button.md-logo img,
  .md-header__button.md-logo svg {
    height: 2rem;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-4core-primary {
  color: var(--4core-primary) !important;
}

.text-4core-accent {
  color: var(--4core-accent) !important;
}

.bg-4core-primary {
  background-color: var(--4core-primary) !important;
  color: white !important;
}

.bg-4core-accent {
  background-color: var(--4core-accent) !important;
  color: #333 !important;
}

.border-4core {
  border: 2px solid var(--4core-primary) !important;
}

.shadow-4core {
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.2) !important;
}
