/* OBSCURA OS: CV.
 *
 * The site bar, the app header and a tool row from app-chrome.css, then
 * two panes: the form on the left and the page on the right, each
 * scrolling on its own so the header and the tools stay put. The page is
 * white whatever the site's theme, because it is a document, and it is
 * laid out at paper width and scaled to fit, so what is shown is what
 * prints.
 */

.cv-shell {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--cv-top, 56px));
  height: calc(100dvh - var(--cv-top, 56px));
  min-height: 520px;
  background: var(--paper);
  color: var(--ink);
}
.cv-name { cursor: default; }
.cv-menu-wrap { position: relative; }
.cv-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px;
  background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 6px;
}
.cv-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer;
}
.cv-menu button:hover, .cv-menu button:focus-visible { background: var(--paper-inset); outline: none; }
.cv-menu small { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 2px; }

/* ------------------------------------------------------------ tool row */
.cv-tools .app-mi.on { font-weight: 600; }
.cv-tl { font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; margin: 0 4px 0 6px; }
.cv-swatches { display: inline-flex; gap: 6px; align-items: center; margin: 0 4px; }
/* The dot is drawn inside a button that is bigger than it, so a finger
   has the button to press and the eye has the dot. */
.cv-swatch { position: relative; width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer; padding: 0; border-radius: 50%; }
.cv-swatch::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 1px var(--rule); }
.cv-swatch.on::before { box-shadow: 0 0 0 2px var(--ink); }
.cv-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cv-view { display: none; }

/* ------------------------------------------------------------ panes */
.cv-app {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: minmax(300px, 440px) minmax(0, 1fr);
}
.cv-app.drop { box-shadow: inset 0 0 0 3px var(--accent); }
.cv-form {
  overflow-y: auto; padding: 14px 16px 40px; border-right: 1px solid var(--rule);
  background: var(--paper-raised); font-size: 13.5px;
}
.cv-form-top { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.cv-card { border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); padding: 12px 14px 14px; margin: 0 0 12px; }
.cv-card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin: 0 0 10px; }
.cv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.cv-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cv-f.wide { grid-column: 1 / -1; }
.cv-f > span { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.cv-f small { font-size: 11.5px; color: var(--ink-faint); line-height: 1.4; }
.cv-form input[type="text"], .cv-form input[type="email"], .cv-form input[type="tel"], .cv-form textarea, .cv-form select {
  width: 100%; min-height: 34px; padding: 6px 9px; border: 1px solid var(--rule); border-radius: 7px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 13.5px; line-height: 1.4; box-sizing: border-box;
}
.cv-form textarea { resize: vertical; min-height: 60px; }
.cv-form input:focus, .cv-form textarea:focus, .cv-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.cv-form input:disabled { color: var(--ink-faint); background: var(--paper-inset); }
.cv-sec-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.cv-form .cv-sec-title { flex: 1 1 auto; font-weight: 600; font-size: 14px; }
.cv-kind { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }
.cv-sec-btns, .cv-item-btns { display: inline-flex; gap: 2px; flex: none; }
.cv-ib {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer; padding: 0;
}
.cv-ib svg { width: 15px; height: 15px; }
.cv-ib:hover { background: var(--paper-inset); color: var(--ink); border-color: var(--rule); }
.cv-ib:disabled { opacity: .3; cursor: default; }
.cv-ib:disabled:hover { background: transparent; border-color: transparent; }
.cv-ib:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cv-item { position: relative; border-top: 1px dashed var(--rule); padding: 12px 0 4px; }
.cv-item:first-of-type { border-top: 0; padding-top: 0; }
.cv-item .cv-item-btns { justify-content: flex-end; width: 100%; margin-top: 4px; }
.cv-dates-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cv-dates-row input[type="text"] { width: 72px; flex: none; }
.cv-dash { color: var(--ink-faint); }
.cv-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.cv-add-item { margin-top: 10px; }
.cv-add-sec { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.cv-add-label { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.cv-add-sec select { width: auto; flex: 1 1 160px; }

/* ------------------------------------------------------------ the page */
.cv-stage { overflow: auto; padding: 16px; background: var(--paper-inset); display: flex; flex-direction: column; align-items: center; }
.cv-stage-note { font-size: 12px; color: var(--ink-faint); margin: 0 0 10px; flex: none; }
.cv-paper { position: relative; flex: none; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.cv-page {
  --cv-accent: #1f4fd8; --cv-w: 794px; --cv-h: 1123px;
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  width: var(--cv-w); min-height: var(--cv-h); box-sizing: border-box; padding: 52px 58px;
  background: #fff; color: #161616;
  font-family: var(--font-sans); font-size: 10.5pt; line-height: 1.45;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
/* Where the paper would end: a faint line every page height, so a CV
   that runs a line onto a second page can be seen doing it. */
.cv-page::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--cv-h) - 1px), rgba(0, 0, 0, .28) calc(var(--cv-h) - 1px), rgba(0, 0, 0, .28) var(--cv-h));
  background-size: 100% var(--cv-h);
  background-position: 0 -1px;
}
.cv-page a { color: inherit; text-decoration: none; }
.cv-page .cv-h1 { font-size: 24pt; line-height: 1.15; margin: 0 !important; font-weight: 700; letter-spacing: -.01em; }
.cv-page h2 { font-size: 10pt; text-transform: uppercase; letter-spacing: .09em; color: var(--cv-accent); margin: 16pt 0 6pt; padding-bottom: 3pt; border-bottom: 1.5px solid var(--cv-accent); }
.cv-page p { margin: 0 0 5pt; }
.cv-page ul { margin: 3pt 0 4pt; padding-left: 14pt; }
.cv-page li { margin: 0 0 2pt; }
.cv-headline { font-size: 12pt; color: #3a3a3a; margin: 2pt 0 0 !important; }
.cv-contact { color: #3a3a3a; margin: 4pt 0 0 !important; font-size: 9.5pt; }
.cv-entry { margin: 0 0 8pt; }
.cv-entry-head { display: flex; justify-content: space-between; gap: 12pt; align-items: baseline; }
.cv-entry-t { min-width: 0; }
.cv-org { color: #3a3a3a; }
.cv-when { flex: none; color: #555; font-size: 9.5pt; white-space: nowrap; }
.cv-pairs { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 2pt 10pt; }
.cv-pairs div { display: contents; }
.cv-pairs dt { font-weight: 600; }
.cv-pairs dd { margin: 0; }

/* Classic: centred name, serif, ruled headings. */
.t-classic .cv-h1 { font-family: var(--font-serif); text-align: center; font-size: 26pt; }
.t-classic .cv-headline, .t-classic .cv-contact { text-align: center; }
.t-classic h2 { font-family: var(--font-serif); text-transform: none; letter-spacing: 0; font-size: 12.5pt; color: #161616; border-bottom-color: var(--cv-accent); }

/* Modern: a narrow accent column for the short things. */
.t-modern { padding: 0; }
.t-modern .cv-head { background: var(--cv-accent); color: #fff; padding: 40px 58px 26px; }
.t-modern .cv-head .cv-headline { color: rgba(255, 255, 255, .88); }
.t-modern .cv-cols { display: grid; grid-template-columns: 200px 1fr; min-height: calc(var(--cv-h) - 130px); }
.t-modern .cv-aside { background: color-mix(in srgb, var(--cv-accent) 8%, #fff); padding: 20px 22px 40px; font-size: 9.5pt; }
.t-modern .cv-main { padding: 20px 58px 40px 30px; }
.t-modern .cv-aside h2 { font-size: 9pt; margin-top: 10pt; }
.t-modern .cv-aside h2:first-child, .t-modern .cv-main h2:first-child { margin-top: 0; }
.t-modern .cv-aside .cv-pairs { grid-template-columns: 1fr; gap: 0; }
.t-modern .cv-aside dt { margin-top: 4pt; }
.t-modern .cv-aside dd { color: #3a3a3a; margin-bottom: 2pt; }
.t-modern ul.cv-contact { list-style: none; padding: 0; margin: 0 !important; word-break: break-word; }
.t-modern ul.cv-contact li { margin: 0 0 3pt; }

/* Compact: for the one-page CV. */
.t-compact { font-size: 9.5pt; line-height: 1.35; padding: 40px 48px; }
.t-compact .cv-h1 { font-size: 20pt; }
.t-compact h2 { margin: 10pt 0 4pt; font-size: 9pt; }
.t-compact .cv-entry { margin-bottom: 5pt; }
.t-compact .cv-page ul, .t-compact ul { margin: 2pt 0 2pt; }
.t-compact .cv-summary p { margin-bottom: 3pt; }

/* ------------------------------------------------------------ print */
@media print {
  /* The body is kept a viewport tall for the site; on paper a viewport
     is a sheet, and that minimum put a blank second sheet after every CV. */
  html, body { background: #fff !important; height: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
  .os-topbar, .app-head, .app-menu, .cv-form, .cv-stage-note, .os-rel, .os-faq-link, .os-guides, #ppBadge, .pp-badge, #lsBar, .os-licence-note, #obLicenceNote, #obscuraNotice, .skip-link { display: none !important; }
  main, .cv-shell, .cv-app, .cv-stage, .cv-paper { display: block !important; height: auto !important; min-height: 0 !important; width: auto !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; box-shadow: none !important; background: #fff !important; }
  .cv-page { position: static !important; transform: none !important; width: auto !important; min-height: 0 !important; }
  .cv-page::after { display: none; }
  .cv-page, .t-modern .cv-head, .t-modern .cv-aside { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .t-modern .cv-cols { min-height: 0; }
  .cv-entry, .cv-pairs div, .cv-page li { break-inside: avoid; page-break-inside: avoid; }
  .cv-page h2 { break-after: avoid; page-break-after: avoid; }
}

/* ------------------------------------------------------------ phones */
@media (max-width: 900px) {
  .cv-app { grid-template-columns: minmax(0, 1fr); }
  /* The switch between the form and the page goes first, where a thumb
     finds it without scrolling the row. */
  .cv-view { display: inline-flex; order: -1; }
  .cv-app[data-view="preview"] .cv-form { display: none; }
  .cv-app:not([data-view="preview"]) .cv-stage { display: none; }
  .cv-form { border-right: 0; }
  .cv-grid { grid-template-columns: 1fr; }
  .cv-f.wide { grid-column: auto; }
  .cv-shell { min-height: 0; }
}
@media (pointer: coarse) {
  .cv-ib { width: 44px; height: 44px; }
  .cv-swatch { width: 44px; height: 44px; }
  .cv-swatch::before { inset: 10px; }
  .cv-swatches { gap: 0; }
  .cv-form input[type="text"], .cv-form input[type="email"], .cv-form input[type="tel"], .cv-form select { min-height: 44px; }
  .cv-check input { width: 22px; height: 22px; }
  .cv-menu button { min-height: 44px; }
}
