/* ============================================================================
   Texas Fire Salaries — Department detail page.
   Dark hero with the headline stat, sticky section nav, two-column content
   (main column + sticky confidence sidebar). Ported from the ChatGPT-handoff
   design concept and adapted onto the shared token system + existing chip/
   badge components (so confidence/freshness labels keep working unchanged).
   ========================================================================== */

/* ---------------- Hero ---------------- */
.dept-hero {
  color: #fff;
  background-color: var(--navy);
  background-image:
    radial-gradient(circle at 85% 10%, rgba(232,74,58,.15), transparent 27%),
    linear-gradient(115deg, transparent 0 50%, rgba(255,255,255,.025) 50% 51%, transparent 51% 100%);
  position: relative;
  overflow: hidden;
}
.dept-hero::after {
  content: ""; position: absolute; inset: 0; opacity: .25; pointer-events: none;
  background-image: repeating-linear-gradient(8deg, transparent 0 64px, rgba(255,255,255,.055) 65px, transparent 66px);
}
.dept-hero-inner { max-width: var(--maxw); margin: 0 auto; padding: var(--sp-4) var(--sp-5) 1.75rem; position: relative; z-index: 1; }
.dept-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #8e9aad; font-size: 12px; font-weight: 650; letter-spacing: .04em; margin-bottom: 1.1rem; }
.dept-breadcrumb a { color: #8e9aad; }
.dept-breadcrumb a:hover { color: #fff; text-decoration: none; }
.dept-breadcrumb span:last-child { color: #cad1dc; }
.dept-hero-grid { display: grid; grid-template-columns: 1fr 400px; align-items: end; gap: var(--sp-8); }
.dept-hero .eyebrow { color: var(--red); }
.dept-hero h1 { margin: 8px 0 10px; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.05em; line-height: .98; color: #fff; }
.dept-hero-loc { color: #adb7c6; font-size: 1rem; margin: 0; }
.dept-hero-loc span { color: #556278; margin: 0 7px; }
.dept-status-row { display: flex; gap: 10px; margin-top: var(--sp-4); flex-wrap: wrap; }
.dept-status-row .chip, .dept-status-row .badge-dept-maintained {
  background: #172236; border-color: #364157; color: #d8dee8;
}
.dept-hero-buttons { display: flex; gap: 12px; margin-top: 1.25rem; flex-wrap: wrap; }
.dept-hero-buttons .btn { min-height: 46px; }
.dept-hero-buttons .btn-light { background: #fff; color: var(--navy); }
.dept-hero-buttons .btn-light:hover { background: #f2f2f2; }
.dept-hero-buttons .btn-ghost-dark { border: 1px solid #3b465b; color: #fff; background: transparent; }
.dept-hero-buttons .btn-ghost-dark:hover { background: #ffffff0a; border-color: #56637b; color: #fff; }

.dept-hero-stat { border-left: 1px solid #39455b; padding-left: var(--sp-6); }
.dept-hero-stat-label { color: #aab4c3; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 750; }
.dept-hero-stat-value { font-family: var(--font-mono); font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.05em; line-height: 1.1; margin: 16px 0 .9rem; color: #fff; }
.dept-hero-stat-value sup { color: var(--orange); font-size: 40%; position: relative; top: -.4em; margin-right: 2px; }
.dept-hero-stat-bottom { border-top: 1px solid #39455b; padding-top: 13px; display: flex; align-items: baseline; gap: 7px; }
.dept-hero-stat-bottom strong { font-family: var(--font-mono); font-size: 18px; font-weight: 550; color: #fff; }
.dept-hero-stat-bottom small { color: #8f9aad; font-family: var(--font-body); font-size: 12px; }
.dept-hero-stat-note { color: #8b96a9; font-size: 11px; margin: 10px 0 0; text-align: right; }
.dept-hero-empty { color: #aab4c3; font-size: .95rem; line-height: 1.6; }

/* ---------------- Two-column content ---------------- */
.dept-grid { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--sp-5); display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-8); align-items: start; }
.dept-section { padding: var(--sp-6) 0; border-bottom: 1px solid var(--border); scroll-margin-top: calc(var(--nav-h) + 16px); }
.dept-section.first { padding-top: 3rem; }
.dept-section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-4); margin-bottom: var(--sp-6); flex-wrap: wrap; }
.dept-section-heading h2 { font-size: 2rem; margin: 8px 0 0; }
.dept-section-heading.compact { margin-bottom: var(--sp-5); align-items: flex-start; }
.dept-section-heading.compact h2 { font-size: 1.6rem; }
.dept-section-heading > a { color: var(--text-soft); font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border-strong); padding-bottom: 2px; }
.dept-section-heading > a:hover { color: var(--red); border-color: var(--red); text-decoration: none; }
.dept-section-intro { max-width: 700px; color: var(--text-soft); line-height: 1.7; font-size: 1rem; margin: -.8rem 0 1.9rem; }

/* Mono salary cards */
.salary-cards { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--card); }
.salary-cards article { min-height: 162px; padding: var(--sp-5) var(--sp-4) var(--sp-4); display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.salary-cards article:last-child { border-right: 0; }
.salary-cards article > span { color: var(--text-faint); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; }
.salary-cards article strong { font-family: var(--font-mono); font-size: 1.5rem; letter-spacing: -.05em; margin: 1.3rem 0 auto; }
.salary-cards article small { color: var(--text-faint); font-size: 12px; }
.salary-cards article strong em { font-size: .85rem; font-style: normal; color: var(--text-faint); }
@media (max-width: 860px) {
  .salary-cards { grid-template-columns: 1fr 1fr; }
  .salary-cards article:nth-child(2) { border-right: 0; }
  .salary-cards article:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 500px) {
  .salary-cards { grid-template-columns: 1fr; }
  .salary-cards article { border-right: 0; border-bottom: 1px solid var(--border); }
}

.dept-context-note { display: flex; gap: 14px; padding: 19px 20px; margin-top: var(--sp-4); background: var(--bg-sunken); border-radius: var(--r-md); }
.dept-context-note .note-icon { width: 21px; height: 21px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; font-family: Georgia, serif; font-size: 12px; color: var(--text-soft); }
.dept-context-note p { margin: 1px 0 0; color: var(--text-soft); font-size: 13px; line-height: 1.6; }
.dept-context-note strong { color: var(--text); }

/* Career earnings */
.earnings-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px 1.6rem; }
.earnings-row { display: grid; grid-template-columns: 96px 1fr 135px; align-items: center; gap: var(--sp-4); padding: var(--sp-5) 0; border-bottom: 1px solid var(--border); }
.earnings-row:last-child { border: 0; }
.earnings-row .years { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 650; }
.earnings-row .years small { display: block; font-family: var(--font-body); color: var(--text-faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.earnings-bar-track { height: 8px; background: var(--bg-sunken); overflow: hidden; border-radius: 4px; }
.earnings-bar-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--orange)); }
.earnings-row strong { font-family: var(--font-mono); font-size: 1.05rem; text-align: right; }
.dept-fine-print { color: var(--text-faint); font-size: 12px; margin: 12px 0 0; }
@media (max-width: 780px) {
  .earnings-card { padding: 6px 1.1rem; }
  .earnings-row { grid-template-columns: 70px 1fr; gap: var(--sp-3); }
  .earnings-row strong { grid-column: 2; grid-row: 2; text-align: left; }
  .earnings-bar-track { grid-column: 2; }
  .earnings-row .years { grid-row: 1 / 3; }
}

/* Salary history timeline */
.history-timeline { display: flex; flex-direction: column; gap: var(--sp-4); }
.history-card { display: grid; grid-template-columns: 70px 22px 1fr; gap: 14px; }
.history-card:last-child .history-line::before { display: none; }
.history-date { padding-top: 3px; }
.history-date strong { display: block; font-family: var(--font-mono); font-size: 15px; }
.history-date span { color: var(--text-faint); font-size: 12px; }
.history-line { position: relative; display: flex; justify-content: center; }
.history-line::before { content: ""; position: absolute; top: 8px; bottom: -20px; width: 1px; background: var(--border-strong); }
.history-line i { position: relative; z-index: 1; width: 11px; height: 11px; border: 3px solid var(--bg); border-radius: 50%; background: var(--red); box-shadow: 0 0 0 1px var(--red); font-style: normal; }
.history-details { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); }
.history-details.superseded { opacity: .72; }
.history-title { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); }
.history-title > div { display: flex; flex-direction: column; gap: 5px; }
.history-title > div strong { font-size: 15px; }
.history-title > div span { color: var(--text-faint); font-size: 12px; }
.history-current-pill { border: 1px solid #acd3c6; background: #e8f2ee; color: #1c7059; border-radius: var(--r-pill); padding: 6px 9px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; white-space: nowrap; }
.history-superseded-pill { border: 1px solid var(--border-strong); background: var(--bg-sunken); color: var(--text-faint); border-radius: var(--r-pill); padding: 6px 9px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; white-space: nowrap; }
.history-values { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: end; gap: var(--sp-5); }
.history-values span { font-family: var(--font-mono); font-size: 16px; font-weight: 650; }
.history-values small { display: block; color: var(--text-faint); font-family: var(--font-body); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.history-values a { color: var(--red); font-size: 12px; font-weight: 750; margin-left: auto; }
/* A schedule change carries free text, not a figure — mono at 16px suits
   "$76,529" but not "Modified 24-hour Schedule (24 on, 72 off; 48 on, 72 off)".
   Given its own line so a long rotation can't squeeze the money chips beside it. */
.history-values .chg-text { flex: 1 1 100%; font-family: var(--font-body); font-size: 13px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }

/* Department detail grid */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
/* min-height was 170px with `margin-bottom:auto` on the value, which pinned the
   value upward and dumped every spare pixel BELOW it — most obvious on a
   five-character ZIP. Grid rows already stretch their cards to a common height,
   so a smaller floor plus `margin-top:auto` lets each card size to its content
   and puts the value on the baseline, turning that dead band into deliberate
   spacing between label and figure. */
.detail-grid .detail-card { min-height: 118px; padding: var(--sp-5); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); }
.detail-grid .detail-card strong { font-family: var(--font-mono); font-size: 1.9rem; margin: 1.1rem 0 0; letter-spacing: -.05em; }
.detail-grid .detail-card p { color: var(--text-faint); font-size: 12px; line-height: 1.55; margin: 0; }
.detail-grid .detail-card.accent-card { border-top: 3px solid var(--red); }
.detail-grid .detail-card .detail-text { font-family: var(--font-body); font-size: 1.6rem; letter-spacing: -.03em; }
/* A value long enough to be a sentence — "Modified 24-hour Schedule (24 on, 72
   off; 48 on, 72 off)" — can't wear the big mono numeral treatment: at 1.9rem in
   a third-width card it overwhelms the section and wraps into a wall. Sized to
   read as text, and allowed to break mid-word so an unbroken run can't push past
   the card edge. */
.detail-grid .detail-card .detail-long { font-family: var(--font-body); font-size: 1.02rem; line-height: 1.35; letter-spacing: 0; margin-top: .7rem; overflow-wrap: anywhere; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }

/* Claim CTA band */
.dept-claim-panel { display: flex; justify-content: space-between; align-items: center; gap: 35px; padding: 2rem 2.2rem; margin: 1.5rem 0; color: var(--text); background: var(--bg-inset); border-radius: var(--r-lg); flex-wrap: wrap; }
.dept-claim-panel h3 { margin: 9px 0 7px; font-size: 1.4rem; }
.dept-claim-panel p { margin: 0; color: var(--text-soft); font-size: .95rem; max-width: 46ch; }
.dept-claim-panel .btn { flex: 0 0 auto; }
.dept-claimed-notice { display: flex; gap: 14px; align-items: flex-start; padding: 1.4rem 1.6rem; margin: 1.5rem 0; background: var(--c-dept-bg); border: 1px solid color-mix(in srgb, var(--c-dept-fg) 30%, transparent); border-radius: var(--r-lg); }
.dept-claimed-notice strong { color: var(--c-dept-fg); }
.dept-claimed-notice p { margin: .2rem 0 0; color: var(--text-soft); font-size: .95rem; }

/* ---------------- Sidebar: confidence card ---------------- */
.dept-side-column { padding-top: 3.75rem; position: sticky; top: calc(var(--nav-h) + 60px); }
.confidence-card { border-radius: var(--r-lg); overflow: hidden; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.confidence-header { background: var(--navy); color: #fff; padding: var(--sp-5); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.confidence-header > div:first-child { display: flex; flex-direction: column; gap: 8px; }
.confidence-header > div:first-child span { color: #929daf; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; }
.confidence-header > div:first-child strong { font-size: 17px; }
.confidence-ring { width: 62px; height: 62px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: conic-gradient(var(--orange) calc(var(--ring-pct, 0) * 1%), #344058 0); position: relative; flex: 0 0 auto; }
.confidence-ring::before { content: ""; position: absolute; inset: 5px; background: var(--navy); border-radius: 50%; }
.confidence-ring span, .confidence-ring small { position: relative; z-index: 1; }
.confidence-ring span { font-family: var(--font-mono); font-size: 17px; line-height: 1; color: #fff; }
.confidence-ring small { display: block; color: #99a4b5; font-size: 9px; margin-top: 3px; }
.confidence-list { padding: 12px var(--sp-5); }
.confidence-list > div { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); border-bottom: 1px solid var(--border); font-size: 13px; }
.confidence-list > div:last-child { border: 0; }
.confidence-list span { color: var(--text-faint); }
.confidence-list strong { font-size: 13px; }
.confidence-list .positive { color: var(--green); }
.confidence-list a { color: var(--red); font-weight: 800; }
.confidence-side-alert { display: flex; gap: 12px; margin: 4px var(--sp-5) 18px; padding: 13px; border-radius: var(--r-md); background: var(--f-update-bg); }
.confidence-side-alert .alert-dot { width: 8px; height: 8px; background: #e38a23; border-radius: 50%; margin-top: 3px; flex: 0 0 auto; box-shadow: 0 0 0 4px #f5dfbd; }
.confidence-side-alert strong { color: var(--f-update-fg); font-size: 12px; }
.confidence-side-alert p { color: var(--f-update-fg); font-size: 12px; margin: 3px 0 0; opacity: .85; }
.confidence-card .btn.full { margin: 0 var(--sp-5) 0; width: calc(100% - 2 * var(--sp-5)); }
.confidence-card-disclaimer { color: var(--text-faint); text-align: center; font-size: 11px; line-height: 1.55; margin: 14px 1.6rem 1.2rem; }
.confidence-card .gate { margin: 0 var(--sp-5) var(--sp-4); }
.confidence-actions-side { display: flex; flex-direction: column; gap: 8px; margin: 0 var(--sp-5) var(--sp-4); }
.confidence-actions-side .btn { width: 100%; }
.compare-card-link { display: flex; flex-direction: column; gap: 6px; padding: 19px 21px; margin-top: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-inset); transition: transform .2s, border-color .2s; }
.compare-card-link:hover { transform: translateY(-2px); border-color: var(--border-strong); text-decoration: none; }
.compare-card-link span { color: var(--text-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; }
.compare-card-link strong { font-size: 13px; color: var(--text); }

@media (max-width: 960px) {
  /* Once this stacks, every gap that read as generous side-by-side becomes
     stacked vertical height — the hero was filling ~75% of a phone screen
     before the salary figure appeared. Tightened so the number people came
     for is comfortably above the fold even on a small phone. */
  .dept-hero-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .dept-hero-stat { border-left: 0; border-top: 1px solid #39455b; padding: 1.1rem 0 0; }
  .dept-hero-stat-note { text-align: left; }
  .dept-hero-inner { padding-bottom: 1.25rem; }
  .dept-breadcrumb { margin-bottom: .6rem; }
  .dept-status-row { margin-top: .75rem; }
  .dept-hero-buttons { margin-top: 1rem; }
  .dept-hero-stat-value { margin: 10px 0 .7rem; }
  /* minmax(0, 1fr), not 1fr — a bare `1fr` track floors at min-content, and
     the pay-step table's `min-width: 520px` (components CSS) then forces the
     whole single-column grid to 520px+ on a 390px screen, scrolling the
     entire page sideways instead of letting .table-scroll scroll on its own. */
  .dept-grid { grid-template-columns: minmax(0, 1fr); }
  .dept-side-column { position: relative; top: auto; padding-top: 2rem; order: -1; }
  /* 4rem top AND bottom stacked up to ~8rem of empty space between sections
     on a phone, which read as the page having ended. */
  .dept-section { padding: var(--sp-5) 0; }
  .dept-section.first { padding-top: var(--sp-5); }
  /* The confidence card's header was scaled for a narrow 340px desktop rail.
     At full width on a phone it became a tall dark hero block that dwarfed
     the salary cards it sits next to; trimmed so it reads as a peer card. */
  .confidence-header { padding: var(--sp-4); }
  .confidence-header > div:first-child strong { font-size: 15px; }
  .confidence-ring { width: 52px; height: 52px; }
  .confidence-ring span { font-size: 15px; }
  .confidence-list { padding: 4px var(--sp-4); }
  .confidence-list > div { min-height: 38px; }
  .confidence-side-alert { margin-inline: var(--sp-4); }
  .confidence-card .btn.full { margin-inline: var(--sp-4); width: calc(100% - 2 * var(--sp-4)); }
  .confidence-actions-side { margin-inline: var(--sp-4); }
  .confidence-card-disclaimer { margin-inline: var(--sp-4); }
}
@media (max-width: 500px) {
  /* Side-by-side rather than two stacked full-width buttons: halves this
     block's height (104px -> 46px) and pulls the salary figure that much
     further up the first screen. Both labels fit at 390px; flex-wrap keeps a
     third button (a department with a careers URL) from overflowing. */
  .dept-hero-buttons { flex-direction: row; flex-wrap: wrap; gap: 10px; }
  .dept-hero-buttons .btn { flex: 1 1 auto; min-width: 0; padding-inline: 10px; }
  .dept-claim-panel { flex-direction: column; align-items: flex-start; }
  .history-card { grid-template-columns: 51px 14px 1fr; gap: 7px; }
}

/* Supplemental pay table.
   It carried a `pay-table` class that no stylesheet ever defined, so it fell
   back to a bare browser table: shrink-to-content width, sitting squashed
   against the left edge of its section while the rest of the card ran full
   width. It now shares the same `data` styling as the pay-step table above it.
   The 520px floor that class carries exists for that six-column table; these
   three narrow columns fit a phone comfortably, so the floor is dropped rather
   than forcing a pointless sideways scroll. */
#supplemental table.pay-table { min-width: 0; }
