/* Résumé.rtf: a period word-processor window with a white page on a grey workspace, plus print. */

.app--document {
  --doc-ink: #1a1a1a;
  --doc-soft: #4a4a4a;
  --doc-rule: #3a6fd8;
  --doc-head: #0b3a9e;
  --doc-workspace: #8a8f99;
}

/* In a window the bars stay put and only the workspace scrolls. */
.js .app--document { height: 100%; min-height: 0; }

/* Format bar (decorative) */

.document__formatbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-bottom: 1px solid var(--face-dark);
  background: var(--face);
  font-size: 11px;
  user-select: none;
  -webkit-user-select: none;
}

.document__field {
  position: relative;
  padding: 1px 20px 1px 5px;
  border: 1px solid #7f9db9;
  background: #fff;
  line-height: 16px;
}

.document__field--font { min-width: 132px; }

.document__field--size { min-width: 44px; margin-right: 6px; }

/* Drop-down button: a blue gradient square with a CSS triangle. */
.document__field::after { content: ""; position: absolute; inset: 1px 1px 1px auto; width: 15px; border-radius: 2px; background: linear-gradient(180deg, #c6d8fc, #9cb8f4); box-shadow: inset 0 0 0 1px #b1c7f2; }

.document__field::before { content: ""; position: absolute; z-index: 1; top: 8px; right: 5px; border: 4px solid transparent; border-top-color: #4d6185; border-bottom-width: 0; }

.document__fmt { display: inline-grid; place-items: center; width: 22px; height: 20px; font-family: "Times New Roman", Georgia, serif; font-size: 14px; }

.document__fmt--b { font-weight: 700; }

.document__fmt--i { font-style: italic; }

.document__fmt--u { text-decoration: underline; }

/* Ruler: grey margins, white text area, tick marks every 12px with a major tick every 48px. */

.document__ruler,
.document__page { --doc-margin: 56px; }

.document__ruler {
  flex: none;
  padding: 3px 24px;
  border-bottom: 1px solid var(--face-shadow);
  background: var(--face);
  user-select: none;
  -webkit-user-select: none;
}

.document__scale {
  display: block;
  max-width: 680px;
  height: 14px;
  margin: 0 auto;
  border: 1px solid #a7a491;
  background:
    repeating-linear-gradient(90deg, #6b6b6b 0 1px, transparent 1px 48px) var(--doc-margin) 100% / calc(100% - 2 * var(--doc-margin)) 7px no-repeat,
    repeating-linear-gradient(90deg, #9b9b9b 0 1px, transparent 1px 12px) var(--doc-margin) 100% / calc(100% - 2 * var(--doc-margin)) 3px no-repeat,
    linear-gradient(90deg, #d8d5c8 var(--doc-margin), #fff var(--doc-margin) calc(100% - var(--doc-margin)), #d8d5c8 0);
}

/* Workspace and page */

.document__workspace {
  flex: 1;
  min-height: 0;
  padding: 24px;
  overflow: auto;
  background: var(--doc-workspace);
  box-shadow: inset 1px 1px 2px rgb(0 0 0 / 0.25);
  scrollbar-gutter: stable both-edges;
}

.document__page {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px var(--doc-margin) 56px;
  border: 1px solid #5f636b;
  background: #fff;
  box-shadow: 3px 3px 0 rgb(0 0 0 / 0.28), 0 6px 18px rgb(0 0 0 / 0.18);
  color: var(--doc-ink);
  font-family: Tahoma, Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  user-select: text;
  -webkit-user-select: text;
}

.document__page a { color: var(--link); }

.cv__header { padding-bottom: 6px; }

.cv__name {
  color: var(--doc-ink);
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.cv__role { margin-top: 4px; color: var(--doc-soft); font-size: 15px; }

.cv__contact { color: var(--doc-soft); font-size: 13px; overflow-wrap: anywhere; }

.cv__section { margin-top: 22px; }

.cv__title {
  margin-bottom: 10px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--doc-rule);
  color: var(--doc-head);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cv__entries { display: grid; gap: 12px; }

.cv__entries--tight { gap: 5px; }

.cv__entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; }

.cv__when {
  color: var(--doc-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.cv__desc { grid-column: 1 / -1; color: #333; }

.cv__skills { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 5px 14px; }

.cv__skills dt { font-weight: 700; }

/* Narrow windows and the 390px phone: the date drops under the title, margins shrink. */

@container (max-width: 560px) {
  .document__ruler,
  .document__page { --doc-margin: 22px; }

  .document__ruler { padding-inline: 10px; }

  .document__workspace { padding: 10px; }

  .document__page { padding-block: 26px 32px; }

  .cv__name { font-size: 25px; }

  .cv__entry { grid-template-columns: minmax(0, 1fr); }

  .cv__when { text-align: left; }

  .cv__skills { grid-template-columns: minmax(0, 1fr); gap: 0; }

  .cv__skills dd + dt { margin-top: 6px; }

  .document__field--font { min-width: 96px; }
}

/* No-JS: a plain flowing page; printing goes through the browser menu. */

.no-js .document__workspace { overflow: visible; }

.no-js [data-action="print"] { display: none; }

/* Print: only the résumé page, black on white, filling the paper. Applies while the window is open. */

@media print {
  @page { margin: 14mm 16mm; }

  html:has(#windows #resume),
  html:has(#windows #resume) body { height: auto; overflow: visible; background: #fff; }

  body:has(#windows #resume) > :not(#desktop),
  #desktop:has(#resume) > :not(#windows),
  #windows:has(#resume) > :not(:has(#resume)),
  .window:has(#resume) .window__titlebar,
  #resume > :not(.document__workspace) { display: none !important; }

  #desktop:has(#resume),
  #windows:has(#resume),
  .window:has(#resume),
  .window:has(#resume) .window__body {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0;
    background: #fff !important;
    box-shadow: none !important;
    animation: none;
  }

  #resume,
  #resume .document__workspace { height: auto; padding: 0; overflow: visible; background: #fff; box-shadow: none; }

  #resume .document__page { max-width: none; padding: 0; border: 0; box-shadow: none; font-size: 10pt; line-height: 1.4; }

  #resume .document__page *,
  #resume .document__page a { color: #000; text-decoration: none; }

  #resume .cv__name { font-size: 22pt; }

  #resume .cv__section { margin-top: 12pt; }

  #resume .cv__title { margin-bottom: 6pt; border-bottom-color: #000; break-after: avoid; }

  #resume .cv__entries { gap: 5pt; }

  #resume .cv__entries--tight { gap: 1pt; }

  #resume .cv__entry { break-inside: avoid; }
}
