/* Un blog exutoire: a French school notebook. One bold element, the red margin line;
   everything else is ink on paper. No web fonts, no JS. */

:root {
  --paper: #fbfcfe;
  --ink: #1d2433;
  --ink-soft: #545e73;
  --pen: #2541a8;
  --margin: #d6455f;
  --rule: #d3ddee;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --gutter: 7.5rem; /* width of the margin that holds the dates on wide screens */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131b2e;
    --ink: #dce3f0;
    --ink-soft: #9aa5bb;
    --pen: #9fb5ff;
    --margin: #f0768c;
    --rule: #26314b;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.15rem/1.65 var(--serif);
  font-kerning: normal;
  hanging-punctuation: first;
}

a { color: var(--pen); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--margin); outline-offset: 3px; border-radius: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Header and footer sit above and below the notebook page. */
.site-header, .site-footer, main {
  max-width: calc(65ch + var(--gutter));
  margin-inline: auto;
  padding-inline: 1rem;
}
.site-header {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.5rem 1rem;
  border-bottom: 1px solid var(--rule);
}
.site-name {
  font-size: 1.6rem; font-style: italic; color: var(--ink); text-decoration: none;
}
.site-header nav { display: flex; gap: 1.25rem; }
.site-footer {
  padding-block: 2rem 3rem; font-size: 0.95rem; color: var(--ink-soft);
}

/* The page: content right of the red margin line. */
main {
  padding-block: 2.5rem 3rem;
  padding-left: calc(var(--gutter) + 2.25rem);
  background: linear-gradient(var(--margin), var(--margin)) no-repeat calc(var(--gutter) + 1rem) 0 / 2px 100%;
}

h1, h2 { font-weight: 600; font-style: italic; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 2.2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.45rem; margin: 0; }
h2 a { color: var(--ink); text-decoration: none; }
h2 a:hover { color: var(--pen); text-decoration: underline; }

.prose { margin-top: 2rem; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1.1em; }
.prose blockquote { margin-left: 0; padding-left: 1rem; border-left: 2px solid var(--rule); color: var(--ink-soft); font-style: italic; }
.prose hr { border: 0; border-top: 1px dashed var(--rule); margin: 2rem 0; }
.prose img { max-width: 100%; height: auto; }

.byline, .intro, .count, .empty, .post-list .by { color: var(--ink-soft); margin: 0.25rem 0 0; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0.75rem 0 0; font-size: 0.95rem; }
.tags a { text-decoration: none; padding: 0 0.45rem; border: 1px solid var(--rule); border-radius: 3px; }
.tags a:hover { border-color: var(--pen); }

/* Lists of posts: the date is written in the margin, left of the red line. */
.post-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.post-list li { position: relative; margin-bottom: 2.25rem; }
.post-list .date {
  position: absolute; right: 100%; width: var(--gutter); margin-right: 2.25rem; top: 0.35rem;
  text-align: right; font-size: 0.9rem; font-style: italic; color: var(--margin); line-height: 1.3;
}
.post-list p { margin: 0.3rem 0 0; }

.more { margin-top: 2.5rem; font-style: italic; }

/* Previous/next post links: the two directions, one on each side. */
.prev-next {
  display: flex; justify-content: space-between; gap: 1.5rem;
  margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
}
.prev-next a { display: flex; flex-direction: column; max-width: 48%; text-decoration: none; }
.prev-next span { font-size: 0.9rem; color: var(--ink-soft); }
.next { margin-left: auto; text-align: right; }

/* Search form: a row of fields, stacking on narrow screens. */
.search { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: end; margin: 1.5rem 0 2rem; }
.search .field { display: flex; flex-direction: column; margin: 0; flex: 1 1 8rem; }
.search .field-q { flex-basis: 100%; }
.search label { font-size: 0.9rem; color: var(--ink-soft); }
.search input, .search select, .search button {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 3px; padding: 0.35rem 0.5rem; min-width: 0;
}
.search input:focus, .search select:focus { border-color: var(--pen); }
.search .actions { display: flex; gap: 1rem; align-items: center; margin: 0; }
.search button { background: var(--pen); color: var(--paper); border-color: var(--pen); cursor: pointer; padding-inline: 1rem; }

/* Narrow screens: the margin shrinks to the left edge, dates move above titles. */
@media (max-width: 48rem) {
  :root { --gutter: 0rem; }
  main { padding-left: 2rem; background-position: 1rem 0; }
  h1 { font-size: 1.8rem; }
  .post-list .date { position: static; display: block; width: auto; margin: 0 0 0.2rem; text-align: left; }
}
