/* «Что я ем»: school notebook in squares. Blue ink = written by me as is; graphite = computed. */

@font-face {
  font-family: "PT Sans";
  src: url("fonts/pt-sans-cyrillic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PT Sans";
  src: url("fonts/pt-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "PT Sans";
  src: url("fonts/pt-sans-cyrillic-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PT Sans";
  src: url("fonts/pt-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "PT Serif";
  src: url("fonts/pt-serif-cyrillic-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PT Serif";
  src: url("fonts/pt-serif-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #fbfcfe;
  --grid: #dfe8f2;
  --ink: #22398a;
  --graphite: #2a2e33;
  --muted: #69737e;
  --margin-line: #d2493f;
  --cell: 0.75rem;
  --line: 1.5rem;
  --margin: 3.75rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  color: var(--graphite);
  font-family: "PT Sans", "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: var(--line);
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--margin-line);
  outline-offset: 2px;
}

/* The page is a notebook sheet: everything is written to the right of the red margin line,
   and the margin itself holds the time of each entry. */
.sheet {
  position: relative;
  max-width: 44rem;
  margin: 0 auto;
  padding: calc(var(--line) * 2) 1rem calc(var(--line) * 3) calc(var(--margin) + 1.25rem);
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 calc(var(--margin) + 0.5rem);
  border-left: 1px solid var(--margin-line);
}

.masthead {
  margin-bottom: calc(var(--line) * 2);
}

.masthead-title {
  display: inline-block;
  font-family: "PT Serif", Georgia, serif;
  font-weight: 700;
  font-size: 2.25rem;
  line-height: calc(var(--line) * 2);
  color: var(--graphite);
  text-decoration: none;
}

.masthead-lede {
  max-width: 34rem;
  margin: calc(var(--line) / 2) 0 0;
  color: var(--muted);
}

.day {
  margin-top: calc(var(--line) * 2);
}

.day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 1rem;
}

.day-title {
  margin: 0;
  font-family: "PT Serif", Georgia, serif;
  font-weight: 700;
  font-size: 1.375rem;
  line-height: calc(var(--line) * 1.5);
}

.day-title::first-letter {
  text-transform: uppercase;
}

.day-title a {
  color: inherit;
  text-decoration: none;
}

.day-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.day-complete {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.log {
  list-style: none;
  margin: calc(var(--line) / 2) 0 0;
  padding: 0;
}

.log-line {
  position: relative;
  display: flex;
  gap: 0.5rem;
  padding: calc(var(--line) / 4) 0;
}

/* Time sits in the margin, left of the red line. */
.log-time {
  position: absolute;
  left: calc(-1 * (var(--margin) + 1rem));
  width: var(--margin);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.9375rem;
  color: var(--muted);
}

.log-kind {
  flex: none;
  width: 1.5rem;
  text-align: center;
  font-size: 1rem;
}

.log-text {
  margin: 0;
  max-width: 36rem;
  color: var(--ink);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.day-pending,
.day-empty {
  margin: calc(var(--line) / 4) 0 0 2rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.empty {
  max-width: 34rem;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: calc(var(--line) * 2);
}

.prose {
  max-width: 36rem;
}

.prose h2 {
  margin: 0 0 calc(var(--line) / 2);
  font-family: "PT Serif", Georgia, serif;
  font-weight: 700;
  font-size: 1.375rem;
  line-height: calc(var(--line) * 1.5);
}

.prose p {
  margin: 0 0 var(--line);
}

.ink {
  color: var(--ink);
}

.credits {
  font-size: 0.9375rem;
  color: var(--muted);
}

.colophon {
  margin-top: calc(var(--line) * 3);
  font-size: 0.9375rem;
}

@media (max-width: 30rem) {
  :root {
    --margin: 3rem;
  }

  body {
    font-size: 1rem;
  }

  .sheet {
    padding-right: 0.75rem;
  }

  .masthead-title {
    font-size: 1.875rem;
  }
}
