/* ==========================================================================
   SENTINEL GOVCON SOLUTIONS - CAREERS PAGE (css/careers.css)
   --------------------------------------------------------------------------
   Rules used only by careers.html. Loaded after css/site.css, which supplies
   the colours, fonts and every shared component (buttons, cards, panel, spec
   table, chips, badges, notice, accordion ...). The FAQ and the closing call
   to action reuse .faq__head and .cta from site.css as they are.

   INDEX
     1. Page hero ........ buttons and the three short points
     2. Overview ......... the three cards
     3. Job board ........ built by js/careers.js inside <div id="job-board">
          3.1 Frame and notices      3.5 Detail panel
          3.2 Toolbar (filters)      3.6 "Don't see your fit?" line
          3.3 The two panes          3.7 Print
          3.4 Role list

   THE 1000px MARK
     From 1000px wide the job board shows two panes (list on the left, role
     detail on the right). Below that, the detail opens under the pressed
     row. js/careers.js uses the same number (WIDE_QUERY): change both
     together.

   NAMING
     .careers-...   parts of the page outside the job board
     .jobs          the job board      .jobs__row   a piece of it
     .is-selected   a state set by js/careers.js
   ========================================================================== */


/* ==========================================================================
   1. PAGE HERO
   ========================================================================== */

.careers-hero__actions {
  gap: 12px;
  margin-top: 32px;
}

/* The three points reuse the .titleblock component: numbered cells divided
   by hairlines. One column on phones, three in a row from 600px. */
.careers-hero__points {
  grid-template-columns: minmax(0, 1fr);
  margin: clamp(36px, 4vw, 48px) 0 0;
  padding: 0;
  list-style: none;
}

.careers-hero__points .titleblock__label,
.careers-hero__points .titleblock__value {
  display: block;
}

@media (min-width: 600px) {
  .careers-hero__points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* ==========================================================================
   2. OVERVIEW
   ========================================================================== */

/* These cards have three parts (head, title, text) where the shared joined
   grid expects four, so each card borrows three rows instead. */
@supports (grid-template-rows: subgrid) {
  .careers-overview__grid > .card {
    grid-row: span 3;
  }
}

/* Three cards in two columns would leave a hole. So: one column until
   there is room for all three side by side (720px), then three. */
@media (min-width: 600px) and (max-width: 719.98px) {
  .careers-overview__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 720px) {
  .careers-overview__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* ==========================================================================
   3. JOB BOARD
   ========================================================================== */

/* --- 3.1 Frame and notices ------------------------------------------------- */

/* "min-height": for a visitor who is coming back to the page (reload, Back,
   Forward), js/boot.js may hand over the height the board had last time,
   as --held-height. The empty box then holds that space until js/careers.js
   has built the board, and the browser can put the visitor back in the
   right place. With no such height the line changes nothing ("auto" is
   what min-height is when it is not set at all). The name --held-height
   is also written in js/boot.js and js/careers.js: change all three
   together. */
.jobs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  min-height: var(--held-height, auto);
}

.jobs__notice-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Bullets throughout the board are short drafting ticks, like .ticklist
   but without the hairline between items. */
.jobs__notice-list > li,
.jobs__bullets > li {
  position: relative;
  padding-left: 24px;
}

.jobs__notice-list > li::before,
.jobs__bullets > li::before {
  content: "";
  position: absolute;
  top: 0.8em;
  left: 0;
  width: 12px;
  border-top: 1px solid var(--trace);
}


/* --- 3.2 Toolbar ---------------------------------------------------------------
   Laid out like a spec table: a label on the left, the control on the right,
   a hairline under each row. The last row holds the result count and the
   "Clear filters" button. Chips wrap onto more rows when they need to,
   except on phones (see the 600px rule below). */

.jobs__toolbar {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
}

.jobs__tool {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.jobs__tool-label {
  font: 500 0.75rem/1.5 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Search boxes get rounded corners and extra padding in some browsers. */
.jobs__search {
  -webkit-appearance: none;
  appearance: none;
}

.jobs__chips {
  gap: 8px;
}

/* A little taller than the standard chip: easier to hit with a finger. */
.jobs__chip {
  min-height: 44px;
  text-align: left;
}

/* The number on a chip. It inherits the chip's colour when the chip is
   pressed (dark on amber) so that it stays readable. */
.jobs__chip-count {
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.jobs__chip[aria-pressed="true"] .jobs__chip-count {
  color: inherit;
}

/* With a mouse or trackpad only, like the chip's own hover look (the reason
   is given at the Menu button, .nav-toggle:hover, in css/site.css). */
@media (hover: hover) {
  .jobs__chip:hover .jobs__chip-count {
    color: inherit;
  }
}

.jobs__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 60px;   /* tall enough for the button, so nothing jumps when it appears */
  padding: 10px 16px;
}

.jobs__count {
  font: 500 0.75rem/1.5 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Phones (below 600px): keep the toolbar short, so the roles are not far
   below it. Each group of chips becomes ONE row that scrolls sideways
   instead of wrapping onto several rows. The row runs out to the right-hand
   edge of the toolbar, and a small arrow there shows when more chips are
   out of sight. Only the row scrolls: the page itself never moves sideways. */
@media (max-width: 599.98px) {
  .jobs__tool {
    grid-template-columns: minmax(0, 1fr);   /* the row may not widen the toolbar */
    padding-block: 12px;
  }

  .jobs__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;   /* a sideways swipe stays in this row */
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;

    /* A scrolling box cuts off whatever sticks out of it, including the
       focus ring drawn 5px outside a chip. The padding makes room for the
       ring; the equal negative margin puts the chips back where they were.
       On the right, 16px takes the row across the toolbar's own padding. */
    margin: -6px -16px -6px -6px;
    padding: 6px 16px 6px 6px;
    scroll-padding-inline: 6px 40px;   /* a chip scrolled to by keyboard focus stays clear of the arrow */
  }

  /* Chips keep their size: no shrinking, no text wrapping. */
  .jobs__chip {
    flex: none;
    white-space: nowrap;
  }

  /* "More this way" arrow. While chips are out of sight to the right,
     js/careers.js puts the class "has-more" on the row, and these two
     shapes are drawn over the row's right-hand edge: a fade in the toolbar
     colour (::before) with a small arrowhead on top of it (::after). They
     are pictures only, so a press passes straight through to the chip
     underneath. When the row has been slid to its end, both disappear. */
  .jobs__tool--chips {
    position: relative;
  }

  .jobs__tool--chips.has-more::before,
  .jobs__tool--chips.has-more::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }

  .jobs__tool--chips.has-more::before {
    right: 0;
    bottom: 6px;      /* covers the chip row and the room left for focus rings */
    width: 40px;
    height: 56px;
    background: linear-gradient(to right, transparent, var(--bg-2) 50%);
  }

  /* The arrowhead: the top and right edges of a small square, turned 45
     degrees, level with the middle of the chips. */
  .jobs__tool--chips.has-more::after {
    right: 13px;
    bottom: 30px;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--ink);
    border-right: 2px solid var(--ink);
    transform: rotate(45deg);
  }
}

@media (min-width: 700px) {
  .jobs__tool {
    grid-template-columns: 124px minmax(0, 1fr);
    column-gap: 20px;
    align-items: start;
    padding: 14px 20px;
  }

  /* The label is as tall as the control beside it and centred on it, so it
     lines up with the first row of chips when they wrap. */
  .jobs__tool-label {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .jobs__tool--search .jobs__tool-label {
    min-height: 48px;
  }

  .jobs__status {
    padding-inline: 20px;
  }
}


/* --- 3.3 The two panes -------------------------------------------------------------
   Narrow: only the list; the detail panel is placed under the open row by
   the script. Wide: list (4 columns) + detail (6 columns). The detail column
   is "sticky": it stays in view below the site header while the list scrolls. */

.jobs__panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.jobs__aside {
  display: none;
}

@media (min-width: 1000px) {
  .jobs__panes {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    column-gap: var(--gap);
    align-items: start;
  }

  .jobs__list {
    grid-column: span 4;
  }

  .jobs__aside {
    display: block;
    grid-column: span 6;
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }

  /* No matching roles: the "nothing found" box takes the full width. */
  .jobs__panes.is-empty .jobs__list {
    grid-column: 1 / -1;
  }

  .jobs__panes.is-empty .jobs__aside {
    display: none;
  }
}


/* --- 3.4 Role list ---------------------------------------------------------------------
   Reads like the parts list of a drawing: item number, description, and a
   hairline under every row. */

.jobs__group + .jobs__group {
  margin-top: 36px;
}

/* Group heading: "FORT MEADE, MARYLAND · 11 ROLES" (also has class .label). */
.jobs__group-title {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
}

.jobs__group-count {
  color: var(--ink-3);
  white-space: nowrap;
}

.jobs__rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.jobs__item {
  border-bottom: 1px solid var(--line);
}

/* A row is a real <button>, so it works with a keyboard out of the box. */
.jobs__row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 64px;
  padding: 14px 10px 14px 12px;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* With a mouse or trackpad only. On a touch screen a tap leaves a hover
   look switched on until the next tap somewhere else, so a row that had
   just been closed would still look half selected. (The same is done for
   every control that switches on and off: see the Menu button,
   .nav-toggle:hover, in css/site.css.) */
@media (hover: hover) {
  .jobs__row:hover {
    background: var(--bg-2);
  }
}

/* The selected (wide) or open (narrow) row: raised surface, amber edge. */
.jobs__row.is-selected {
  background: var(--bg-3);
  border-left-color: var(--amber);
}

.jobs__row:focus-visible {
  outline-offset: -2px;   /* keeps the focus ring inside the list's edges */
}

.jobs__row-no {
  font: 500 0.75rem/1.35rem var(--font-mono);   /* same line height as the title beside it */
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.jobs__row-main {
  display: block;
  min-width: 0;
}

.jobs__row-flag {
  margin-bottom: 8px;
  white-space: normal;   /* may wrap on the narrowest phones */
}

.jobs__row-title {
  display: block;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35rem;
  overflow-wrap: break-word;
}

/* Meta line: "ON-SITE DAILY · ACTIVE TS/SCI WITH CI POLYGRAPH".
   Every part carries a dot in a 22px slot on its left. The parts are pulled
   22px to the left and the line clips whatever sticks out, so the dot of
   the FIRST part on each line is hidden. Result: one line with a dot
   between the parts when there is room, two tidy lines without it when
   there is not. */
.jobs__row-meta {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  font: 400 0.6875rem/1.55 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.jobs__row-meta-parts {
  display: flex;
  flex-wrap: wrap;
  margin-left: -22px;
}

.jobs__row-meta-part {
  position: relative;
  padding-left: 22px;
}

.jobs__row-meta-part::before {
  content: "\00B7";
  content: "\00B7" / "";   /* the dot is decoration: not read aloud */
  position: absolute;
  left: 0;
  width: 22px;
  text-align: center;
}

/* The sentence between the featured role and the supporting roles (only
   shown while the featured role is in the list). */
.jobs__note {
  padding: 12px 10px 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-3);
}

/* Narrow layout: a plus sign in a small square that becomes an amber minus
   while the row is open (the same marker as the FAQ accordion). */
@media (max-width: 999.98px) {
  .jobs__row-icon {
    position: relative;
    width: 28px;
    height: 28px;
    margin-top: -3px;
    border: 1px solid var(--line-2);
    color: var(--ink);
    transition: border-color 0.15s ease, color 0.15s ease;
  }

  .jobs__row-icon::before,
  .jobs__row-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    margin: -0.75px 0 0 -6px;
    border-top: 1.5px solid currentColor;
    transition: transform 0.2s ease;
  }

  .jobs__row-icon::after {
    transform: rotate(90deg);
  }

  /* With a mouse or trackpad only, like the row's own hover look above.
     Keep this rule above the next one: when two rules disagree the later
     one wins, and that keeps an open row's square amber under the pointer. */
  @media (hover: hover) {
    .jobs__row:hover .jobs__row-icon {
      border-color: var(--ink);
    }
  }

  .jobs__row[aria-expanded="true"] .jobs__row-icon {
    border-color: var(--amber);
    color: var(--amber);
  }

  .jobs__row[aria-expanded="true"] .jobs__row-icon::after {
    transform: rotate(0deg);
  }
}

/* Wide layout: an arrow pointing at the detail pane; amber on the selected row. */
@media (min-width: 1000px) {
  .jobs__row-icon {
    font: 500 0.8125rem/1.35rem var(--font-mono);
    color: var(--ink-3);
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .jobs__row-icon::before {
    content: "\2192";
  }

  .jobs__row:hover .jobs__row-icon,
  .jobs__row:focus-visible .jobs__row-icon {
    opacity: 1;
  }

  .jobs__row.is-selected .jobs__row-icon {
    opacity: 1;
    color: var(--amber);
  }
}

/* Nothing matches the filters. */
.jobs__empty {
  display: grid;
  gap: 16px;
  justify-items: start;
  padding: clamp(24px, 4vw, 40px);
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
}

.jobs__empty-text {
  color: var(--ink);
  font-size: 1.0625rem;
}


/* --- 3.5 Detail panel ----------------------------------------------------------------------
   One panel (.panel.ticks from site.css) that shows the selected role.
   .jobs__detail          the frame; keeps its corner ticks in place
   .jobs__detail-scroll   the contents; scrolls inside the frame on wide
                          screens when the role is taller than the window */

.jobs__detail-scroll {
  padding: 20px 18px 24px;
}

/* A short fade when a different role is shown (class set by the script). */
.jobs__detail.is-entering > .jobs__detail-scroll {
  animation: jobs-detail-in 0.22s ease;
}

@keyframes jobs-detail-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* Narrow layout: the panel sits under its row, inside the list. */
.jobs__item > .jobs__detail {
  margin-bottom: 20px;
  border-top: 0;
}

.jobs__detail-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.jobs__detail-title {
  margin-top: 12px;
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.625rem);
  line-height: 1.15;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

/* The title receives keyboard focus after a row is chosen from the keyboard.
   It is a landing place, not a control, so instead of the full focus ring
   it shows a short amber bar in the margin beside it. */
.jobs__detail-title:focus {
  outline: none;
}

.jobs__detail-title:focus-visible {
  /* -14px + 3px + 11px = 0, so the text itself does not move */
  margin-left: -14px;
  padding-left: 11px;
  border-left: 3px solid var(--amber);
}

.jobs__posted {
  margin-top: 10px;
  font-size: 0.9375rem;
  color: var(--ink-3);
}

.jobs__posted-title {
  color: var(--ink);
}

.jobs__spec {
  margin-top: 22px;
}

.jobs__spec .spec__row {
  padding-block: 11px;
}

.jobs__spec .spec__desc {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.jobs__desc {
  margin-top: 24px;
}

.jobs__summary + .jobs__summary {
  margin-top: 1em;
}

.jobs__on-request {
  padding: 14px 18px;
  border: 1px dashed var(--line-2);
  color: var(--ink);
}

/* Section headings inside a role ("Responsibilities", "How to apply"):
   a small monospace label followed by a leader line. */
.jobs__subhead {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 30px 0 14px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-stretch: 100%;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-wrap: wrap;
}

.jobs__subhead::after {
  content: "";
  flex: 1;
  min-width: 16px;
  border-top: 1px solid var(--line-2);
}

.jobs__bullets {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* Compensation: a small boxed data cell. */
.jobs__comp {
  margin-top: 30px;
  padding: 16px 18px 18px;
  background: var(--bg);
  border: 1px solid var(--line-2);
}

.jobs__comp-range {
  margin-top: 4px;
  color: var(--ink);
  font: 500 1.25rem/1.4 var(--font-mono);
  font-size: clamp(1.0625rem, 0.7rem + 1.9vw, 1.25rem);   /* fits on one line on small phones */
  letter-spacing: 0.02em;
}

.jobs__comp-note {
  margin-top: 10px;
}

.jobs__apply-intro {
  margin-bottom: 12px;
  font-size: 0.9375rem;
}

.jobs__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

/* "Link copied" */
.jobs__copied {
  font: 500 0.75rem/1.5 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}

.jobs__copied:empty {
  display: none;
}

.jobs__security {
  margin-top: 24px;
  font-size: 0.8125rem;
}

/* "Back to role list": a text button. The arrow points up on narrow screens
   (the row is above) and left on wide screens (the list is to the left). */
.jobs__back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 16px;
  padding: 6px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--trace-2);
  border-radius: 0;
  color: var(--ink);
  font: 500 0.8125rem/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.jobs__back::before {
  content: "\2191";
  content: "\2191" / "";   /* the arrow is decoration: not read aloud */
}

.jobs__back:hover {
  border-bottom-color: var(--amber);
  color: var(--amber);
}

@media (min-width: 600px) {
  .jobs__detail-scroll {
    padding: 26px 28px 28px;
  }
}

@media (min-width: 1000px) {
  /* The panel is never taller than the space below the site header. Its
     contents scroll inside it instead. */
  .jobs__detail {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--header-h) - 32px);
    /* Where the browser knows the unit: the height that can be seen right
       now, which is less on a tablet while its address bar is showing. */
    max-height: calc(100dvh - var(--header-h) - 32px);
  }

  .jobs__detail-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
  }

  .jobs__back::before {
    content: "\2190";
    content: "\2190" / "";
  }
}


/* --- 3.6 "Don't see your fit?" line ------------------------------------------------------------ */

.careers-fit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.careers-fit__text {
  color: var(--ink);
  font-size: 1.0625rem;
}


/* --- 3.7 Print --------------------------------------------------------------------------------------
   On paper the filters and buttons are no use, and the detail panel must
   show all of its text instead of scrolling.

   Paper is narrower than 1000px, so a page printed from a wide window
   falls back to the narrow layout, where the detail column is hidden. The
   selected role would then be missing from the printout. So on paper the
   two panes are always stacked: the whole list first, then the selected
   role's detail below it. (Printed from a phone, the open role is already
   inside the list, under its row, and the column below is empty.)
   js/careers.js leaves the board alone while the page is being printed
   (see onLayoutChange), so these rules decide the printed layout. */

@media print {
  .jobs__toolbar,
  .jobs__row-icon,
  .jobs__actions,
  .jobs__back,
  .jobs__empty .btn {
    display: none !important;
  }

  .jobs__panes {
    display: block;
  }

  .jobs__aside {
    display: block;
    position: static;
  }

  .jobs__aside > .jobs__detail {
    margin-top: 24px;
  }

  /* A role can be longer than a sheet: let it run on to the next one
     (site.css keeps other panels in one piece). */
  .jobs__detail {
    display: block;
    max-height: none;
    break-inside: auto;
  }

  .jobs__detail-scroll {
    overflow: visible;
  }

  /* A row is never split across two sheets. (The rule is on the row, not on
     its list item, because on a phone the item also holds the open role.) */
  .jobs__row {
    break-inside: avoid;
  }
}
