/* Enlist route pages. Every selector is scoped under .enlist-route so nothing leaks
   into the hub chrome. Tokens, paper cards, stamps and crest come from the Enlist app
   (enlist/styles.css); layout and order follow enlist/design/mockups/Route.dc.html. */
.enlist-route {
  --olive: #2B2F22; --paper: #E6DCC3; --paper-2: #D9CEB2; --paper-rule: #B9AE93;
  --ink: #1C1D18; --ink-muted: #5A5444; --line: #6B6E58; --muted: #A8A48F;
  --soft: #CFC6AE; --seg-off: #474B39; --accent: #E8641B; --crest-dash: #8C846C;
  /* alternate accents: #D9A21B, #C2412D */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='.33 .33 .33 0 0  .33 .33 .33 0 0  .33 .33 .33 0 0  0 0 0 0 1'/></filter><rect width='100%25' height='100%25' filter='url%28%23n%29'/></svg>");
  --f-display: 'Stardos Stencil', Impact, sans-serif;
  --f-mono: 'Courier Prime', ui-monospace, monospace;
  --f-body: Barlow, system-ui, sans-serif;
  --f-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  display: block;
  width: 100%;
  background-color: var(--olive);
  background-image: var(--grain);
  background-blend-mode: soft-light;
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.4;
  box-sizing: border-box;
  color-scheme: dark;
}
.enlist-route *, .enlist-route *::before, .enlist-route *::after { box-sizing: border-box; }
.enlist-route .er-wrap { display: flex; flex-direction: column; gap: 18px; max-width: 720px; margin: 0 auto; padding: 20px 20px 24px; }
.enlist-route a { color: var(--paper); }
.enlist-route a:hover { color: #fff; }
.enlist-route :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.enlist-route button { font: inherit; }
.enlist-route p { margin: 0; }

/* header strip */
.enlist-route .er-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.enlist-route .er-strip a { color: var(--muted); text-decoration: none; }
.enlist-route .er-strip a:hover { color: var(--paper); }

/* paper card */
.enlist-route .er-paper {
  background-color: var(--paper); background-image: var(--grain); background-blend-mode: soft-light;
  color: var(--ink);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  position: relative;
}
/* Weathering: per-card SVG set as --wear by assets/js/enlist-route.js, so no two cards match. */
.enlist-route .er-paper::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: var(--wear, none) center / 100% 100% no-repeat;
}
.enlist-route .er-paper > * { position: relative; }
.enlist-route .er-paper-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-muted);
  border-bottom: 1px solid var(--paper-rule); padding-bottom: 8px;
}
.enlist-route .er-mono { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-muted); }

/* hero: the posting orders card */
.enlist-route .er-hero { padding: 20px 18px; gap: 14px; }
.enlist-route .er-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.enlist-route .er-hero-top > div { display: flex; flex-direction: column; gap: 4px; }
.enlist-route .er-report { font-family: var(--f-display); font-weight: 700; font-size: 22px; letter-spacing: .06em; color: var(--ink); }
.enlist-route .er-posting { display: flex; flex-direction: column; gap: 2px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 12px 0; }
.enlist-route h1 { margin: 0; padding: 0; border: 0; font-family: var(--f-display); font-weight: 700; font-size: 44px; line-height: .95; color: var(--ink); text-transform: uppercase; overflow-wrap: anywhere; }
.enlist-route .er-line { font-family: var(--f-mono); font-size: 13px; color: var(--ink-muted); }
.enlist-route .er-lede p { font-size: 16px; line-height: 1.45; color: var(--ink); }
.enlist-route .er-lede p + p { margin-top: 8px; }
.enlist-route .er-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-family: var(--f-mono); font-size: 11px; line-height: 1.3; color: var(--ink-muted); }
.enlist-route .er-stats > div { border-top: 2px solid var(--ink); padding-top: 6px; }
.enlist-route .er-stats b { display: block; font-size: 16px; color: var(--ink); }

/* crest: only the image; the dashed circle shows only if the image fails */
.enlist-route .er-crest { width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%; overflow: hidden; display: block; }
.enlist-route .er-crest img { width: 100%; height: 100%; object-fit: contain; display: block; margin: 0; border: 0; }
.enlist-route .er-crest.fallback { border: 2px dashed var(--crest-dash); }

/* stamps */
.enlist-route .er-stamp {
  border: 3px solid var(--accent); color: var(--accent);
  font-family: var(--f-display); font-weight: 700; letter-spacing: .12em; pointer-events: none; line-height: 1.2;
}
.enlist-route .er-paper > .er-stamp-approved { position: absolute; }
.enlist-route .er-stamp-approved { right: 16px; top: 128px; transform: rotate(-10deg); font-size: 22px; letter-spacing: .14em; padding: 2px 10px; opacity: .9; }
.enlist-route .er-stamp-approved { animation: er-slam .45s cubic-bezier(.2, .8, .3, 1) .25s both; }
@keyframes er-slam {
  0%   { transform: rotate(-10deg) scale(2.2); opacity: 0; }
  60%  { transform: rotate(-10deg) scale(.94); opacity: .95; }
  100% { transform: rotate(-10deg) scale(1); opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  .enlist-route .er-stamp-approved { animation: none; }
}
.enlist-route .er-stamp-classified { transform: rotate(-6deg); font-size: 12px; padding: 0 6px; border-width: 2px; flex-shrink: 0; }

/* route link */
.enlist-route .er-link { display: flex; flex-direction: column; gap: 8px; border: 1.5px dashed var(--line); padding: 12px 14px; }
.enlist-route .er-link-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.enlist-route .er-link-row { display: flex; gap: 8px; align-items: center; }
.enlist-route .er-link-url { flex-grow: 1; min-width: 0; font-family: var(--f-mono); font-size: 13px; overflow-wrap: anywhere; }
.enlist-route [data-copy-route] { height: 44px; padding: 0 14px; background: var(--accent); color: var(--ink); border: 0; font-family: var(--f-cond); font-weight: 700; font-size: 15px; letter-spacing: .1em; cursor: pointer; }
.enlist-route [data-copy-route]:hover { filter: brightness(1.08); }
.enlist-route .er-link-note { font-size: 12px; line-height: 1.4; color: var(--muted); }
.enlist-route .er-copied { margin-left: 8px; color: var(--accent); }

/* phases */
.enlist-route .er-phase { display: flex; flex-direction: column; gap: 6px; }
.enlist-route .er-phase-archives { gap: 8px; }
.enlist-route .er-phase-head { display: flex; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.enlist-route .er-phase-num { font-family: var(--f-mono); font-weight: 700; font-size: 13px; color: var(--accent); }
.enlist-route h2 { margin: 0; padding: 0; border: 0; flex-grow: 1; font-family: var(--f-cond); font-weight: 700; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; color: var(--paper); }
.enlist-route .er-phase-count { font-family: var(--f-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.enlist-route .er-archives-desc { font-size: 14px; line-height: 1.45; color: var(--soft); }

.enlist-route .er-unit { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.enlist-route .er-unit-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex-grow: 1; }
.enlist-route .er-unit-name { font-size: 16px; font-weight: 600; line-height: 1.25; color: var(--paper); }
.enlist-route .er-unit-meta { display: flex; gap: 8px; align-items: center; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.enlist-route .er-badge { border: 1px solid var(--line); padding: 0 5px; letter-spacing: .08em; }
.enlist-route .er-unit-note { font-size: 13px; line-height: 1.4; color: var(--soft); }

.enlist-route details.archives > summary { display: flex; align-items: center; justify-content: center; height: 48px; border: 1.5px solid var(--line); color: var(--paper); font-family: var(--f-cond); font-weight: 700; font-size: 16px; letter-spacing: .12em; cursor: pointer; list-style: none; }
.enlist-route details.archives > summary::-webkit-details-marker { display: none; }
.enlist-route details.archives > summary:hover { border-color: var(--accent); }
.enlist-route details.archives[open] > summary { margin-bottom: 6px; }

.enlist-route .enlist-ad { margin: 4px 0; min-height: 0; overflow: hidden; }

/* further training + other postings */
.enlist-route .er-further, .enlist-route .er-others { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.enlist-route .er-kicker { font-family: var(--f-cond); font-weight: 700; font-size: 15px; letter-spacing: .22em; color: var(--accent); }
.enlist-route .er-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.enlist-route .er-grid a, .enlist-route .er-others li a { display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--line); color: var(--paper); text-decoration: none; }
.enlist-route .er-grid a:hover, .enlist-route .er-others li a:hover { border-color: var(--accent); }
.enlist-route .er-grid b, .enlist-route .er-others b { font-size: 15px; }
.enlist-route .er-grid span, .enlist-route .er-others li span { font-size: 12px; color: var(--muted); }
.enlist-route .er-others ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.enlist-route .er-others li { margin: 0; padding: 0; }

.enlist-route .er-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding-top: 4px; }
.enlist-route .er-foot a { color: var(--muted); }
.enlist-route .er-foot a:hover { color: var(--paper); }
.enlist-route .er-error { background: #C2412D; color: #fff; padding: 16px; margin: 20px; }

@media (max-width: 420px) {
  .enlist-route .er-others ul { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 359px) {
  .enlist-route h1 { font-size: 38px; }
}

.enlist-route .er-find { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 14px; padding: 12px 16px; background: var(--accent); color: var(--ink); text-align: center; text-decoration: none; }
.enlist-route .er-find[hidden] { display: none; }
.enlist-route .er-find:hover { filter: brightness(1.08); }
.enlist-route .er-find-main { font-family: var(--f-cond); font-weight: 700; font-size: 20px; letter-spacing: .1em; }
.enlist-route .er-find-sub { font-family: var(--f-mono); font-size: 12px; }
