/* Applications — shared styles
   Identity carried from the shortlist PDFs: ink navy + Georgia display,
   system-sans working UI. Mobile-first, iPhone-native bottom tab bar. */

:root {
  --ink:    #0b2a4a;
  --slate:  #14507e;
  --paper:  #f6f8fb;
  --card:   #ffffff;
  --line:   #dce4ec;
  --muted:  #5f7183;
  --amber:  #d98a00;

  --maxw: 880px;
  --bar-h: 60px;

  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  min-height: 100vh;
  /* leave room for the fixed bottom tab bar on mobile */
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.wordmark .badge {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--ink);
  padding: 4px 7px;
  border-radius: 6px;
}
.wordmark .name {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.2px;
}

/* Inline nav — desktop / wide screens only */
.nav-inline {
  display: none;
  gap: 4px;
}
.nav-inline a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.nav-inline a:hover { color: var(--ink); background: var(--paper); }
.nav-inline a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--ink);
}

/* ---------- Content ---------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px max(16px, env(safe-area-inset-left)) 40px max(16px, env(safe-area-inset-right));
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 6px;
}

h1.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  line-height: 1.15;
  margin: 0 0 20px;
  color: var(--ink);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- File / document blocks ---------- */
.block { margin-bottom: 28px; }
.block-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--ink);
  margin: 0 0 3px;
}
.block-note {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Row with a label on the left and one or more action chips on the right */
.file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 52px;
}
.file-name { font-size: 15px; font-weight: 600; }
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }

.chip {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--slate);
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 0 12px;
  border-radius: 8px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}
a.chip:hover { border-color: var(--slate); color: var(--ink); background: #eef3f8; }

/* Whole-row link (used for the location shortlists) */
a.doc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 52px;
}
a.doc:hover { border-color: var(--slate); background: #f9fbfd; }
a.doc .file-name { font-weight: 600; }
a.doc .chip { pointer-events: none; }

/* ---------- Bottom tab bar — mobile ---------- */
.nav-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-tabs a {
  flex: 1 1 0;
  min-height: var(--bar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  padding: 6px 4px;
}
.nav-tabs .code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--muted);
}
.nav-tabs .lbl {
  font-size: 11px;
  line-height: 1;
}
.nav-tabs a[aria-current="page"] { color: var(--ink); }
.nav-tabs a[aria-current="page"] .code {
  background: var(--ink);
  color: #fff;
}

/* ---------- Focus & motion ---------- */
a:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 2px;
  border-radius: 6px;
}

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

/* ---------- Wider screens: inline nav, no bottom bar ---------- */
@media (min-width: 640px) {
  body { padding-bottom: 0; }
  .nav-inline { display: flex; }
  .nav-tabs { display: none; }
  main { padding-top: 36px; }
}

/* ---------- Location groups (dated shortlists) ---------- */
/* Rows are generated from the filenames in ads/, so this scales as
   more shortlists are added. Each row: date, PDF, Confirmations. */
.locs {
  list-style: none;
  /* Matches the gap the CV block gets from its note line, so both
     sections sit on the same rhythm now that this one has no note. */
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.loc-name {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 7px 2px;
}

.loc .files { gap: 6px; }

/* Tabular figures so the dates line up down the column. */
.doc-date {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

/* The newest entry in each location reads slightly stronger. */
.loc .files > li:first-child { border-color: #c6d5e4; background: #fcfdfe; }
.loc .files > li:not(:first-child) .doc-date {
  font-weight: 500;
  color: var(--muted);
}

/* Chip that is a <button> rather than a link. */
.chip-btn {
  font-family: var(--sans);
  cursor: pointer;
  appearance: none;
}
.chip-btn:hover { border-color: var(--slate); color: var(--ink); background: #eef3f8; }

/* ---------- Confirmations dialog ---------- */
body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 42, 74, 0.45);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.modal-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0;
}
.modal-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.modal-x {
  flex-shrink: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 8px;
}
.modal-x:hover { color: var(--ink); background: var(--paper); }

.modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px calc(14px + env(safe-area-inset-bottom, 0px));
}
.modal-loading {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 28px 0;
}

/* One job row inside the dialog */
.job {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
}
.job:last-child { border-bottom: 0; }

.job-n {
  flex-shrink: 0;
  width: 22px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.job-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.job-emp { font-size: 14px; font-weight: 600; color: var(--ink); }
.job-role {
  font-size: 12.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.job-when {
  flex-shrink: 0;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}

.applied-btn {
  flex-shrink: 0;
  min-width: 76px;
  min-height: 36px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.applied-btn:hover { border-color: var(--slate); color: var(--ink); background: #eef3f8; }
.applied-btn.on {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  font-size: 15px;
}
.applied-btn.on:hover { background: var(--slate); border-color: var(--slate); }
.applied-btn[disabled] { opacity: 0.5; cursor: wait; }

.job.is-applied .job-emp { color: var(--slate); }

/* Wider screens: centre the dialog rather than sitting it at the bottom */
@media (min-width: 640px) {
  .modal { align-items: center; }
  .modal-card { border-radius: 14px; max-height: 82vh; }
}
