/* ==========================================================================
   Careers portal — visual system
   Brand orange #FC6812 · Ink #16181D · Cool mist #F2F3F5
   Orange carries the brand on plates and accents; text-weight orange is the
   deep shade so it stays readable. Headings: transitional serif. Body: system sans.
   ========================================================================== */

:root {
  --ink: #16181D;
  --ink-soft: #5A6068;
  --ink-faint: #8B9199;
  --mist: #F2F3F5;
  --paper: #ffffff;
  --line: #DEE1E5;
  --line-soft: #EAECEF;
  --brand: #FC6812;
  --brand-deep: #B54206;
  --brand-wash: #FEF0E7;
  --alert: #9F1D14;
  --amber: #8A6209;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shell: 68rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--mist);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
}
body > main { flex: 1 0 auto; }
body > .footer { flex: none; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.22; margin: 0 0 .5em; }
h1 { font-size: 2rem; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--brand-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
small { font-size: .82rem; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 1.25rem; }
.page { padding-top: 2.25rem; padding-bottom: 4rem; }
.narrow { max-width: 38rem; margin: 0 auto; }
.mid { max-width: 50rem; margin: 0 auto; }

/* ------------------------------------------------------------- masthead */

.masthead { background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: inset 0 -3px 0 var(--brand); }
.masthead-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; flex-wrap: wrap; }
.wordmark { display: flex; align-items: center; gap: .6rem; font-family: var(--serif); font-size: 1.22rem; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.wordmark img { display: block; width: 36px; height: 36px; }
.adminbar .wordmark img { width: 30px; height: 30px; }
.mainnav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.mainnav a { color: var(--ink-soft); text-decoration: none; font-size: .93rem; }
.mainnav a:hover { color: var(--ink); }
.mainnav a.quiet { color: var(--ink-faint); }
.mainnav .btn { color: var(--ink); }

.footer { border-top: 1px solid var(--line); background: var(--paper); padding: 1.5rem 0; color: var(--ink-soft); font-size: .88rem; }
.footer .shell { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer p { margin: 0; }

/* ----------------------------------------------------------------- hero */

.hero { padding: .5rem 0 1.75rem; border-bottom: 1px solid var(--line); margin-bottom: 1.75rem; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); max-width: 22ch; }
.hero p { color: var(--ink-soft); max-width: 58ch; margin: 0; }
.hero-count { font-family: var(--serif); color: var(--brand); }

/* ---------------------------------------------------------------- cards */

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 1.75rem; }
.card + .card { margin-top: 1rem; }

.joblist { display: grid; gap: .85rem; }
.jobrow {
  background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: 4px; padding: 1.2rem 1.35rem; display: block; text-decoration: none; color: inherit;
}
.jobrow:hover { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.jobrow h2 { margin-bottom: .3rem; font-size: 1.22rem; color: var(--ink); }
.jobrow p { margin: .45rem 0 0; color: var(--ink-soft); font-size: .93rem; }
.jobmeta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .88rem; color: var(--ink-soft); }
.jobmeta b { font-weight: 600; color: var(--ink); }

.empty { background: var(--paper); border: 1px dashed var(--line); border-radius: 6px; padding: 3rem 1.5rem; text-align: center; color: var(--ink-soft); }

/* ------------------------------------------------------------ job detail */

.jobhead { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1.75rem; margin-bottom: 1.25rem; }
.jobhead h1 { margin-bottom: .6rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line-soft); }
.fact dt { font-size: .8rem; color: var(--ink-faint); margin-bottom: .15rem; }
.fact dd { margin: 0; font-weight: 600; }

.prose { line-height: 1.7; }
.prose h2, .prose h3, .prose h4 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1.2em 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--ink-soft); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.8em 0; }

/* ---------------------------------------------------------------- forms */

.field { margin-bottom: 1.2rem; }
.field > label, .field > .label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .4rem; color: var(--ink); }
.hint { color: var(--ink-soft); font-size: .82rem; line-height: 1.5; margin: .4rem 0 0; }
.req { color: var(--brand-deep); font-weight: 700; }

/* Matches every text-like control, including inputs written without a type
   attribute — an earlier selector missed those and left them unstyled. */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]),
select,
textarea {
  width: 100%;
  padding: .72rem .85rem;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:hover:not([disabled]), select:hover, textarea:hover { border-color: #C2C8CE; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(252,104,18,.18);
}
input[disabled] { background: var(--mist); color: var(--ink-soft); cursor: not-allowed; }
textarea { min-height: 7.5rem; resize: vertical; line-height: 1.6; }
select {
  appearance: none; cursor: pointer; padding-right: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 19px) 55%, calc(100% - 14px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* File pickers: the native control, dressed so it reads as a drop area */
input[type=file] {
  width: 100%; padding: .95rem; font-size: .9rem; color: var(--ink-soft);
  background: #FAFBFC; border: 1px dashed #C2C8CE; border-radius: 8px; cursor: pointer;
}
input[type=file]:hover { border-color: var(--brand); background: var(--brand-wash); }
input[type=file]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(252,104,18,.18); }
input[type=file]::file-selector-button {
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink);
  padding: .5rem 1rem; margin-right: 1rem; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: 5px;
}
input[type=file]::file-selector-button:hover { background: var(--mist); border-color: var(--ink-faint); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.15rem; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1.15rem; }
@media (max-width: 680px) { .row, .row-3 { grid-template-columns: 1fr; } }

/* Single-choice pills for short, mutually exclusive answers */
.choices { display: flex; flex-wrap: wrap; gap: .55rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: block; padding: .6rem 1.1rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: .92rem; background: var(--paper); cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.choice:hover span { border-color: var(--ink-faint); }
.choice input:checked + span {
  background: var(--brand); border-color: var(--brand); color: var(--ink); font-weight: 600;
}
.choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Checkbox rows are large enough to tap and light up when ticked */
.check {
  display: flex; gap: .8rem; align-items: flex-start; padding: .95rem 1.05rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); margin-bottom: .65rem;
  transition: background .12s ease, border-color .12s ease;
}
.check:hover { border-color: var(--ink-faint); }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-wash); }
.check input { margin-top: .2rem; flex: none; width: 1.1rem; height: 1.1rem; accent-color: var(--brand); cursor: pointer; }
.check label { font-size: .94rem; cursor: pointer; }
.check .hint { margin-top: .2rem; }

/* Form sections: a hairline and a short orange tick carry the grouping */
fieldset { border: 0; margin: 0 0 1.75rem; padding: 1.75rem 0 0; border-top: 1px solid var(--line-soft); }
fieldset:first-of-type { border-top: 0; padding-top: 0; }
fieldset:last-of-type { margin-bottom: 1rem; }
legend {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  font-family: var(--serif); font-size: 1.15rem; font-weight: 600; padding: 0; margin-bottom: 1.1rem;
}
legend::before { content: ""; flex: none; width: 20px; height: 3px; border-radius: 2px; background: var(--brand); }
.legend-note { color: var(--ink-soft); font-size: .86rem; margin: -.75rem 0 1.2rem; }

/* Action bar closing a form: the submit sits apart from the fields, with the
   one thing worth saying at the point of submitting beside it. A sticky version
   was tried and dropped — it floated over section headings on long forms. */
.formbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin: 1.75rem -1.75rem -1.75rem; padding: 1.15rem 1.75rem;
  background: #FAFBFC; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px;
}
.formbar .btn { flex: none; }
@media (max-width: 560px) {
  .formbar { flex-direction: column-reverse; align-items: stretch; }
  .formbar .btn { width: 100%; text-align: center; }
}
.formbar .hint { margin: 0; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-block; padding: .72rem 1.3rem; border: 1px solid var(--brand); border-radius: 6px;
  background: var(--brand); color: var(--ink); font: inherit; font-size: .95rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #E85D0B; border-color: #E85D0B; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .42rem .9rem; font-size: .88rem; border-radius: 5px; }
.btn-ghost { background: transparent; color: var(--brand-deep); }
.btn-ghost:hover { background: var(--brand-wash); color: var(--ink); }
.btn-danger { background: var(--alert); border-color: var(--alert); }
.btn-danger:hover { background: #7C160F; border-color: #7C160F; }
.btn-plain { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-plain:hover { background: var(--mist); border-color: var(--ink-faint); color: var(--ink); }
.btnbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------------- notices */

.note { padding: .85rem 1rem; border-radius: 4px; margin-bottom: 1.25rem; font-size: .94rem; border: 1px solid; }
.note-ok { background: #EDF6F2; border-color: #B9D9CD; color: #17493C; }
.note-error { background: #FAEDEC; border-color: #E2BCB7; color: #7C160F; }
.note-info { background: var(--brand-wash); border-color: #F5C39E; color: #8A3B08; }
.note ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* ----------------------------------------------------------------- pills */

.pill { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid; }
.pill-pending { background: #fdf5e3; border-color: #e6d09a; color: var(--amber); }
.pill-accepted { background: #E9F4EF; border-color: #A9D2C1; color: #17493C; }
.pill-rejected { background: #FAEDEC; border-color: #E2BCB7; color: var(--alert); }
.pill-open { background: #e9f4ef; border-color: #a9d2c1; color: #14524a; }
.pill-closed { background: #eef1f2; border-color: var(--line); color: var(--ink-soft); }
.pill-yes { background: #e9f4ef; border-color: #a9d2c1; color: #14524a; }
.pill-no { background: #eef1f2; border-color: var(--line); color: var(--ink-soft); }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: .78rem; font-weight: 600; color: var(--ink-faint); background: #f7f9fa; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

dl.spec { display: grid; grid-template-columns: 12rem 1fr; gap: .1rem 1rem; margin: 0; }
dl.spec dt { color: var(--ink-soft); font-size: .9rem; padding: .45rem 0; border-bottom: 1px solid var(--line-soft); }
dl.spec dd { margin: 0; padding: .45rem 0; border-bottom: 1px solid var(--line-soft); font-size: .95rem; }
@media (max-width: 640px) { dl.spec { grid-template-columns: 1fr; } dl.spec dt { border: 0; padding-bottom: 0; } }

/* ------------------------------------------------------------ admin chrome */

body.admin { background: var(--mist); }
.adminbar { background: var(--ink); color: #fff; }
.adminbar .shell { display: flex; align-items: center; justify-content: space-between; min-height: 58px; gap: 1rem; flex-wrap: wrap; }
.adminbar a { color: #B9BEC6; text-decoration: none; font-size: .93rem; }
.adminbar a:hover { color: #fff; }
.adminbar .wordmark { color: #fff; font-size: 1.1rem; }
.adminnav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.adminnav a.on { color: #fff; box-shadow: inset 0 -2px 0 var(--brand); padding-bottom: 3px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .85rem; margin-bottom: 1.75rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.2rem; }
.stat b { display: block; font-family: var(--serif); font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.stat span { color: var(--ink-soft); font-size: .86rem; }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.pagehead h1 { margin: 0; }
.pagehead p { margin: .25rem 0 0; color: var(--ink-soft); font-size: .93rem; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; margin-bottom: 1.1rem; }
.filters .field { margin: 0; min-width: 12rem; }

.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.1rem; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.backlink { display: inline-block; margin-bottom: .9rem; font-size: .9rem; }

/* ---------------------------------------------------------- text editor */

.editor-tools { display: flex; flex-wrap: wrap; gap: .3rem; padding: .5rem; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: #F7F9FA; }
.editor-tools button {
  font: 600 .85rem/1 var(--sans); min-width: 2.1rem; padding: .5rem .7rem; background: var(--paper);
  border: 1px solid var(--line); border-radius: 5px; cursor: pointer; color: var(--ink);
}
.editor-tools button:hover { background: var(--mist); border-color: var(--ink-faint); }
.editor-area {
  min-height: 23rem; padding: 1.1rem 1.15rem; background: var(--paper); border: 1px solid var(--line);
  border-radius: 0 0 6px 6px; line-height: 1.7; overflow-y: auto;
}
.editor-area:focus { outline: 2px solid rgba(252,104,18,.25); border-color: var(--brand); }
.editor-area:empty::before { content: attr(data-placeholder); color: var(--ink-faint); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Progressive enhancement: the toolbar appears only when JavaScript can drive it.
   Without JS the writer gets a plain HTML box instead, so posting a job never breaks. */
.editor-tools, .editor-area { display: none; }
.editor-sink { display: block; min-height: 12rem; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86rem; }
.js-on .editor-tools { display: flex; }
.js-on .editor-area { display: block; }
.js-on .editor-sink { display: none; }


/* ---------------------------------------------------- account pages */

body.auth > main { display: flex; flex-direction: column; justify-content: center; }

/* Signing up is the one moment a candidate needs reassurance, so the form
   sits beside a short statement of what the account actually does. */
.authcard {
  display: grid; grid-template-columns: .82fr 1fr;
  max-width: 56rem; margin: 0 auto; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}
.authcard .brandpane { background: var(--ink); color: #fff; padding: 2.5rem 2.1rem; display: flex; flex-direction: column; }
.authcard .brandpane img { display: block; width: 48px; height: 48px; margin-bottom: 1.5rem; }
.authcard .brandpane h1 { color: #fff; font-size: 1.62rem; margin-bottom: .6rem; }
.authcard .brandpane p { color: #B9BEC6; font-size: .93rem; margin-bottom: 1.6rem; }
.authcard .brandpane ul { list-style: none; margin: 0 0 auto; padding: 0; }
.authcard .brandpane .panefoot { margin: 2rem 0 0; font-size: .84rem; color: #8B9199; }
.authcard .brandpane .panefoot a { color: #D7DBE0; }
.authcard .brandpane li { position: relative; padding-left: 1.4rem; margin-bottom: .85rem; font-size: .9rem; color: #D7DBE0; line-height: 1.5; }
.authcard .brandpane li::before { content: ""; position: absolute; left: 0; top: .55em; width: 9px; height: 2px; background: var(--brand); }
.authcard .formpane { padding: 2.4rem 2.2rem; }
.authcard .formpane h2 { font-size: 1.28rem; margin-bottom: 1.4rem; }
.authcard .formpane .btn { width: 100%; text-align: center; }
.authfoot { margin: 1.2rem 0 0; font-size: .89rem; color: var(--ink-soft); }

@media (max-width: 800px) {
  .authcard { grid-template-columns: 1fr; }
  .authcard .brandpane { padding: 1.9rem 1.6rem 1.7rem; }
  .authcard .brandpane ul, .authcard .brandpane .panefoot { display: none; }
  .authcard .brandpane p { margin-bottom: 0; }
  .authcard .formpane { padding: 1.8rem 1.6rem 2rem; }
}

/* ------------------------------------------------ job composer layout */

.composer { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.25rem; align-items: start; }
.composer .sidecol { position: sticky; top: 1.25rem; display: grid; gap: 1rem; }
.composer .sidecol .card { padding: 1.35rem; }
.composer .sidecol h2 { font-size: 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .55rem; }
.composer .sidecol h2::before { content: ""; flex: none; width: 16px; height: 3px; border-radius: 2px; background: var(--brand); }
.composer .sidecol .field:last-child { margin-bottom: 0; }
.composer .row { grid-template-columns: 1fr; }
@media (max-width: 900px) {
  .composer { grid-template-columns: 1fr; }
  .composer .sidecol { position: static; }
}

/* A figure the candidate must stay under deserves to be read at a glance */
.capnote {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  padding: .9rem 1.1rem; margin-bottom: 1.3rem;
  background: var(--brand-wash); border: 1px solid #F5C39E; border-radius: 8px;
}
.capnote b { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); }
.capnote span { font-size: .87rem; color: #8A3B08; }

/* A tall editor is helpful on a desktop and just a lot of scrolling on a phone. */
@media (max-width: 700px) { .editor-area { min-height: 14rem; } }
