/* HTML-резюме: Pandoc --standalone + рядом с HTML копия этого файла (build-resume.csx) */
:root {
  --text: #171717;
  --text-muted: #4a4a4a;
  --accent: #0b57d0;
  --accent-hover: #0842a0;
  --border: #d0d0d0;
  --border-strong: #b0b0b0;
  --section: #1a365d;
}

@page {
  margin: 1.4cm;
}

html {
  font-family: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  font-size: 11pt;
  line-height: 1.45;
  color: var(--text);
  max-width: 210mm;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2rem;
  -webkit-font-smoothing: antialiased;
}

/* Шапка из YAML: одно имя + подзаголовок */
header#title-block-header {
  margin: 0 0 1.1rem 0;
  padding: 0 0 1rem 0;
  border-bottom: 2px solid var(--border-strong);
}

header#title-block-header h1.title {
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 0.4rem 0;
  padding: 0;
  border: none;
  color: var(--text);
}

header#title-block-header p.subtitle {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Pandoc TOC */
nav#TOC {
  margin: 0.85rem 0 1.15rem 0;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(127, 127, 127, 0.05);
}

nav#TOC > ul {
  margin: 0.25rem 0 0 0;
  padding-left: 1.15rem;
}

nav#TOC li {
  margin: 0.15rem 0;
}

nav#TOC a {
  color: var(--text);
  border-bottom-color: transparent;
}

nav#TOC a:hover {
  color: var(--accent-hover);
  border-bottom-color: rgba(11, 87, 208, 0.25);
}

/* Mermaid (KB diagrams in AI section; script injected by build-resume.csx) */
.mermaid {
  margin: 0.9rem 0 1.1rem 0;
  padding: 0.75rem 0.5rem;
  overflow-x: auto;
  text-align: center;
  font-size: 0.92rem;
}

/* Sidebar TOC on wide screens (keep inline TOC on narrow/mobile) */
@media screen and (min-width: 1100px) {
  body {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    column-gap: 1.6rem;
  }

  header#title-block-header {
    grid-column: 1 / -1;
  }

  nav#TOC {
    grid-column: 1;
    margin: 0;
    align-self: start;
    position: sticky;
    top: 1.25rem;
    max-height: calc(100vh - 2.5rem);
    overflow: auto;
  }

  /* Put the rest of the document into the main column */
  body > :not(header#title-block-header):not(nav#TOC) {
    grid-column: 2;
    min-width: 0;
  }
}

body > header ~ p:first-of-type,
body > header ~ p:nth-of-type(2),
body > header ~ p:nth-of-type(3),
body > header ~ p:nth-of-type(4),
body > header ~ p:nth-of-type(5) {
  font-size: 0.98rem;
}

h1:not(.title) {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

h2 {
  font-size: 1.08rem;
  font-weight: 650;
  margin: 1.35rem 0 0.55rem 0;
  padding: 0.25rem 0 0.35rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--section);
  letter-spacing: 0.02em;
}

h2:first-of-type {
  margin-top: 0.85rem;
}

h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0.85rem 0 0.2rem 0;
  color: var(--text);
}

p {
  margin: 0.4rem 0;
}

p em {
  color: var(--text-muted);
  font-size: 0.95em;
}

ul {
  margin: 0.35rem 0 0.5rem 0;
  padding-left: 1.2rem;
}

li {
  margin: 0.22rem 0;
  padding-left: 0.15rem;
}

li::marker {
  color: var(--border-strong);
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  border-bottom-color: rgba(11, 87, 208, 0.35);
}

/* Мета-строка (если появится в шаблоне) */
.resume-meta {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

@media print {
  body {
    display: block;
  }

  nav#TOC {
    position: static;
    max-height: none;
    overflow: visible;
  }

  html {
    padding: 0;
    max-width: none;
  }

  a {
    color: #000;
    border-bottom: none;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  ul {
    break-inside: avoid;
  }
}
