/* ==========================================================================
   Минимальный CSS: главные блоки [row] и [col], остальные — модификаторы.
   Только пиксели (px) и em. Никаких rem.
   ========================================================================== */

/* --- Переменные и базовый сброс --- */
:root {
  --text: #24292f;
  --bg: #ffffff;
  --muted: #57606a;
  --link: #0969da;
  --border: #d0d7de;
  --code-bg: #f6f8fa;
}

* {
  box-sizing: border-box;
}

body {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 20px 60px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ==========================================================================
   Главные блоки разметки
   ========================================================================== */
[row] {
  display: flex;
  flex-direction: row;
}

[col] {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Модификаторы блоков
   ========================================================================== */

/* Перенос строк */
[wrap] {
  flex-wrap: wrap;
}
[nowrap] {
  flex-wrap: nowrap;
}

/* Выравнивание по поперечной оси (align-items) */
[align],
[align="center"] {
  align-items: center;
}
[align="start"] {
  align-items: flex-start;
}
[align="end"] {
  align-items: flex-end;
}
[align="stretch"] {
  align-items: stretch;
}
[align="baseline"] {
  align-items: baseline;
}

/* Выравнивание по главной оси (justify-content) */
[justify],
[justify="center"] {
  justify-content: center;
}
[justify="start"] {
  justify-content: flex-start;
}
[justify="end"] {
  justify-content: flex-end;
}
[justify="between"],
[justify="space-between"] {
  justify-content: space-between;
}
[justify="around"],
[justify="space-around"] {
  justify-content: space-around;
}

/* Отступы (gap) */
[gap],
[gap="md"] {
  gap: 16px;
}
[gap="xs"] {
  gap: 4px;
}
[gap="sm"] {
  gap: 8px;
}
[gap="lg"] {
  gap: 24px;
}
[gap="none"] {
  gap: 0;
}

/* Модификаторы дочерних элементов */
[grow] {
  flex-grow: 1;
}
[shrink] {
  flex-shrink: 1;
}
[no-shrink] {
  flex-shrink: 0;
}

/* ==========================================================================
   Минимальная типографика контента
   ========================================================================== */
header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

pre {
  background: var(--code-bg);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 85%;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

pre code {
  padding: 0;
  background: none;
  border: none;
}

blockquote {
  margin: 1em 0;
  padding: 0 1em;
  color: var(--muted);
  border-left: 0.25em solid var(--border);
}

/* --- Обнуление внешних отступов у крайних элементов контейнера --- */
h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child,
h5:first-child,
h6:first-child,
p:first-child,
ul:first-child,
ol:first-child,
pre:first-child,
blockquote:first-child {
  margin-top: 0;
}

h1:last-child,
h2:last-child,
h3:last-child,
h4:last-child,
h5:last-child,
h6:last-child,
p:last-child,
ul:last-child,
ol:last-child,
pre:last-child,
blockquote:last-child {
  margin-bottom: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
}

th, td {
  border: 1px solid var(--border);
  padding: 6px 13px;
}

tr:nth-child(2n) {
  background-color: var(--code-bg);
}
