@import "styles.css";

@font-face {
  font-family: 'Code';
  src: url(resources/DroidSansMonoRegular.ttf) format('truetype');
}

ol.alpha{
    list-style-type:lower-alpha;
}
/*code-font*/
*[class~='pr-d/codeblock'],
*[class~='codeblock'],
*[class~='pr-d/codeph'],
*[class~='codeph'] {
  font-family: 'Code', monospace;
}

@media print {
  p {
       text-align: justify;
  }

  *[class ~= "topic/p"], *[class ~= "topic/note"], *[class ~= "topic/section"]
  {
      text-align: justify;
  }

  .dark-only {
      display: none !important;
  }
}

@media screen {
  *[class ~= "wh_logo"]
  {
      width: 20rem;
  } 
  
  /*Displays book part number as breadcrumb root*/
  *[class ~= "home"] span{
      display: none;
  }
  *[class ~= "home"] >  :after {
      content: "Home \2302";
  }
  
    math {
  font-size: x-large;
}
}

*[class ~= "front-page/front-page"]:before(2) {

    background-image: url("./resources/logo.svg");

    margin-top: 2cm;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 8cm 100%;
    height: 3cm;
    width: 12.8cm;
    display: inline-block;
    content: "";

}

*[class ~= "front-page/front-page"]:before {

    background-image: url(oxy_xpath('//*[contains(@class, " bookmap/bookmeta ")]//*[contains(@name, "feature.image")]/@value'));
    background-position: center;
    margin-top: 1cm;
    background-repeat: no-repeat;
    background-size: 12.8cm 7cm;
    display: block;
    width: 12.8cm;
    height: 7cm;
    content: "";
}


*[class ~= "front-page/front-page-title"]:before(2) {
    margin-top: 1cm;
    font-family: BrandingFont;
    line-height: 1em;
    width: 10cm;
    display: block;
    margin-left: auto;
    margin-right: auto;
    content: oxy_xpath('//*[contains(@class, " bookmap/bookmeta ")]//*[contains(@name, "title.type")]/@value');
}
*[class ~= "front-page/front-page-title"]:before(1) {
    font-family: BrandingFont;
    line-height: 1em;
    width: 10cm;
    display: block;
    margin-left: auto;
    margin-right: auto;
    content: oxy_xpath('//*[contains(@class, " bookmap/bookmeta ")]//*[contains(@name, "title.products")]/@value');
}

*[class ~= "front-page/front-page-title"] {
    margin-top: 0cm;
    content: '';
}

*[class ~= "front-page/front-page-title"]:after {
    font-family: BrandingFont;
    color: var(--brand-front-page-subtitle);
    font-size: 10pt;
    font-style: italic;
    content: oxy_xpath('//*[contains(@class, " bookmap/bookmeta ")]/*[contains(@class, " bookmap/bookid ")]/*[contains(@class, " bookmap/bookpartno ")]/text()')
 " (" oxy_xpath('//*[contains(@class, " bookmap/bookmeta ")]//*[contains(@class, " topic/revised ")]/@modified') " )";
}

.metadata-container {
    display: flex;
    align-items: center;
    gap: 20px; /* Space between elements */
    padding: 10px;
    margin-bottom: 15px;
    background: var(--brand-metadata-bg);
    border-radius: 5px;
    border-left: 4px solid var(--brand-metadata-border);
}

.metadata {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.metadata .icon {
    display: inline-flex;
    align-items: center;
    margin-right: 5px;
    color: var(--brand-metadata-border);
}

.metadata .label {
    font-weight: bold;
    margin-right: 5px;
}

.metadata .value {
    color: var(--brand-metadata-value);
}

/* Override oxygen.css base skin rules that weren't active in production
   (oxygen.css was previously only a resource file, not a linked stylesheet).
   Now that it's loaded for dark mode variable support, we override the
   rules that conflict with our Styles Basket customizations. */
.wh_top_menu {
    text-transform: none;
}
.wh_tile {
    font-weight: normal;
}
.wh_main_page .wh_search_input {
    padding: 20px 0;
}
.wh_tools {
    background-color: var(--wh-primary-bg);
}
.wh_publication_title > a {
    color: var(--wh-link-color);
}
.wh_publication_toc {
    border-radius: 0;
}
.webhelp_full_width_link {
    display: none;
}

/* Definition lists: grid layout — term in narrow left column, definition beside it.
   Force all dd into column 2 so multiple consecutive dd elements (e.g. expanded
   descriptions in DITA dlentry) don't wrap into the term column. */
dl {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1.5em;
    row-gap: 0.4em;
    align-items: baseline;
}
dl > dt {
    grid-column: 1;
    margin: 0;
    font-weight: bold;
}
dl > dt::after {
    content: " :";
}
dl > dd {
    grid-column: 2;
    margin: 0;
}

/* Full-width tables — DITA pgwide="1" produces this class but Oxygen WebHelp
   doesn't ship a default rule for it.  Force 100 % so every table with the
   attribute fills its container and columns align across sibling tables. */
.table--pgwide-1 {
    width: 100%;
}

/* Image sizing utilities — use via outputclass on <image> */
.half-width {
    width: 50%;
}

/* Drift table — section headers (merged rows separating as-found / Δ / En).
   Reuse brand table-header variables so they match the rest of the theme. */
td.drift-section-header {
    background-color: var(--brand-table-header-bg);
    color: var(--wh-strong-color);
    font-weight: bold;
    font-size: 0.85em;
}

/* Drift table — continuous Dev/Spec gradient highlighting.
   Color = conformity (blue=in-spec, red=out-of-spec).
   Opacity = |Dev/Spec| (proximity to specification limit).
   --ds CSS custom property is injected by XSLT extension.
   Clamped to [0, 1.5]: full intensity at 1.5x spec. */
td.drift-in-spec {
    background-color: rgba(var(--brand-drift-sig-rgb),
        calc(clamp(0, var(--ds, 0), 1.5) / 1.5 * 0.30));
}
td.drift-out-of-spec {
    background-color: rgba(var(--brand-drift-fail-rgb),
        calc(clamp(0, var(--ds, 0), 1.5) / 1.5 * 0.35));
    color: var(--brand-drift-fail-color);
    font-weight: bold;
}

/* Legacy: out-of-spec without gradient (non-drift tables) */
td.out-of-spec {
    background-color: rgba(var(--brand-drift-fail-rgb), 0.12);
    color: var(--brand-drift-fail-color);
    font-weight: bold;
}

/* ---------------------------------------------------------------
   Calibration due-date badges
   Injected by cal-due-badge.js on elements with class "cal-due".
   Three tiers: green (>30 days), amber (≤30 days), red (overdue).
   Hidden in print — PDF keeps the raw date only.
   --------------------------------------------------------------- */
.cal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    margin-left: 0.5em;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    font-size: 0.82em;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: baseline;
    line-height: 1.4;
}
.cal-badge__icon {
    flex-shrink: 0;
}
.cal-badge--green {
    background: var(--cal-green-bg);
    color: var(--cal-green-color);
}
.cal-badge--amber {
    background: var(--cal-amber-bg);
    color: var(--cal-amber-color);
}
.cal-badge--red {
    background: var(--cal-red-bg);
    color: var(--cal-red-color);
    animation: cal-pulse 2s ease-in-out infinite;
}
.cal-badge--inactive {
    background: var(--cal-inactive-bg);
    color: var(--cal-inactive-color);
}
@keyframes cal-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
@media print {
    .cal-badge { display: none; }
}

/* ---------------------------------------------------------------
   Forecast trend indicators in drift tables
   Applied via outputclass on <entry> → becomes class on <td>.
   Four tiers: warning (imminent), caution (distant), ok, n/a.
   --------------------------------------------------------------- */
td.forecast-warning {
    background: var(--forecast-warning-bg);
    color: var(--forecast-warning-color);
    font-weight: 600;
}
td.forecast-caution {
    background: var(--forecast-caution-bg);
    color: var(--forecast-caution-color);
    font-weight: 600;
}
td.forecast-ok {
    color: var(--forecast-ok-color);
}
td.forecast-na {
    color: var(--forecast-na-color);
}

/* ---------------------------------------------------------------
   Navigation icons — Equipment section
   outputclass on <topicref>/<topichead> → class on nav <div>.
   Lucide icons via mask + currentColor for automatic theme support.
   --------------------------------------------------------------- */

/* Shared base for all nav icons */
.wh_publication_toc [class*="nav-"] > .title > a::before {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.35em;
    vertical-align: -0.15em;
    background: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* folder — equipment category */
.wh_publication_toc .nav-category > .title > a::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E");
}

/* file-text — category-level topic (procedures, maintenance guides) */
.wh_publication_toc .nav-category-topic > .title > a::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z'/%3E%3Cpath d='M14 2v5a1 1 0 0 0 1 1h5'/%3E%3Cpath d='M10 9H8'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z'/%3E%3Cpath d='M14 2v5a1 1 0 0 0 1 1h5'/%3E%3Cpath d='M10 9H8'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3C/svg%3E");
}

/* gauge — device (measurement instrument) */
.wh_publication_toc .nav-device > .title > a::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 14 4-4'/%3E%3Cpath d='M3.34 19a10 10 0 1 1 17.32 0'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 14 4-4'/%3E%3Cpath d='M3.34 19a10 10 0 1 1 17.32 0'/%3E%3C/svg%3E");
}

/* wrench — maintenance log */
.wh_publication_toc .nav-maintenance > .title > a::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z'/%3E%3C/svg%3E");
}

/* trending-up — drift analysis */
.wh_publication_toc .nav-drift > .title > a::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 7h6v6'/%3E%3Cpath d='m22 7-8.5 8.5-5-5L2 17'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 7h6v6'/%3E%3Cpath d='m22 7-8.5 8.5-5-5L2 17'/%3E%3C/svg%3E");
}

/* archive — event group (Calibrations, Intermediate Checks) */
.wh_publication_toc .nav-event-group > .title > a::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='5' x='2' y='3' rx='1'/%3E%3Cpath d='M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8'/%3E%3Cpath d='M10 12h4'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='5' x='2' y='3' rx='1'/%3E%3Cpath d='M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8'/%3E%3Cpath d='M10 12h4'/%3E%3C/svg%3E");
}

/* file-badge — individual event (calibration certificate, check report) */
.wh_publication_toc .nav-event > .title > a::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 22h5a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.3'/%3E%3Cpath d='M14 2v5a1 1 0 0 0 1 1h5'/%3E%3Cpath d='m7.69 16.479 1.29 4.88a.5.5 0 0 1-.698.591l-1.843-.849a1 1 0 0 0-.879.001l-1.846.85a.5.5 0 0 1-.692-.593l1.29-4.88'/%3E%3Ccircle cx='6' cy='14' r='3'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 22h5a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.3'/%3E%3Cpath d='M14 2v5a1 1 0 0 0 1 1h5'/%3E%3Cpath d='m7.69 16.479 1.29 4.88a.5.5 0 0 1-.698.591l-1.843-.849a1 1 0 0 0-.879.001l-1.846.85a.5.5 0 0 1-.692-.593l1.29-4.88'/%3E%3Ccircle cx='6' cy='14' r='3'/%3E%3C/svg%3E");
}

/* Hide icons in print (PDF keeps text-only nav) */
@media print {
    .wh_publication_toc [class*="nav-"] > .title > a::before {
        display: none;
    }
}
