/* indersen.com — Typography & Layout
   Spec: src/typography.org */

/* --- Self-hosted fonts --- */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/fonts/fraunces-latin-normal.woff2') format('woff2');
  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: 'Fraunces';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url('/fonts/fraunces-latin-italic.woff2') format('woff2');
  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: 'Roboto Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/roboto-mono-latin-normal.woff2') format('woff2');
  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: 'Roboto Mono';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/roboto-mono-latin-italic.woff2') format('woff2');
  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;
}

/* --- Color variables --- */
:root {
  --color-default: #1a1a1a;
  --color-strong: #1a1a1a;
  --color-faded: #6b6560;
  --color-salient: #8b4513;
  --color-popout: #c05020;
  --color-subtle: #f0ede8;
  --color-critical-fg: #ffffff;
  --color-critical-bg: #c0392b;
  --color-bg: #faf9f7;
  --spacing-rule: 1.5em;
}

/* --- Base --- */
html {
  font-size: 18px;
}

body {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  line-height: 1.6;
  color: var(--color-default);
  background: var(--color-bg);
  margin: 0;
  padding: 0;
}

/* --- Layout --- */
#content {
  max-width: 65ch;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Site header --- */
#preamble {
  max-width: 65ch;
  margin: 0 auto;
  padding: 1.5rem 24px 0;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--color-default);
}

.site-identity {
  display: flex;
  align-items: center;
  gap: 0.6ch;
  text-decoration: none;
  color: var(--color-strong);
}

.site-identity:hover {
  color: var(--color-salient);
}

.site-identity:hover .site-title {
  color: var(--color-salient);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}

.site-title {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-strong);
}

.site-nav {
  display: flex;
  gap: 1.8ch;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--color-salient);
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* --- Site footer --- */
#postamble {
  max-width: 65ch;
  margin: 0 auto;
  padding: 0 24px 2.5rem;
}

.site-footer {
  border-top: 1px solid var(--color-default);
  padding-top: 0.6rem;
  margin-top: 3rem;
}

.site-footer nav {
  display: flex;
  gap: 1.5ch;
}

.site-footer nav a {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-faded);
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--color-salient);
  text-decoration: underline;
}

/* --- Headings --- */
h1, .title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-strong);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h2 {
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-strong);
  margin-top: 1.5em;
  margin-bottom: 0.4em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-strong);
  margin-top: 1.3em;
  margin-bottom: 0.3em;
}

h4, h5, h6 {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-strong);
}

/* --- Body text --- */
p, li, dd, dt {
  font-size: 1rem;
  line-height: 1.6;
}

/* --- Links --- */
a {
  color: var(--color-salient);
  font-weight: 300;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Secondary / faded text --- */
.subtitle, .timestamp, .tag, .footref, .footpara {
  font-size: 0.85rem;
  color: var(--color-faded);
  font-weight: 300;
}

/* --- Code --- */
code, .org-src-container pre {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.82rem;
  color: var(--color-faded);
  background: var(--color-subtle);
}

code {
  font-size: 0.82em;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.org-src-container pre, pre.example {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--color-faded);
  background: var(--color-subtle);
  padding: 1em;
  border-radius: 4px;
  overflow-x: auto;
  border: none;
}

/* --- Blockquotes --- */
blockquote {
  border-left: 3px solid var(--color-subtle);
  margin: 1.2em 0;
  padding: 0.4em 1em;
  color: var(--color-faded);
  font-weight: 300;
}

blockquote p {
  margin: 0.4em 0;
}

/* --- Tables --- */
table {
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.9rem;
}

th, td {
  padding: 0.4em 0.8em;
  border: 1px solid var(--color-subtle);
  text-align: left;
}

th {
  font-weight: 400;
  color: var(--color-strong);
  background: var(--color-subtle);
}

/* --- Table of contents --- */
#table-of-contents {
  font-size: 0.9rem;
  margin: 1.5em 0;
}

#table-of-contents h2 {
  font-size: 1rem;
}

/* --- Postamble (footer) — see site footer above --- */

/* --- Lists --- */
ul, ol {
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.3em;
}

/* --- Images --- */
img {
  max-width: 100%;
  height: auto;
}

/* --- Post footer (linkblog timestamp) --- */
.post-footer {
  margin-top: var(--spacing-rule);
  padding-top: var(--spacing-rule);
  border-top: 1px solid var(--color-subtle);
  font-size: 0.85rem;
  color: var(--color-faded);
}

.post-footer p {
  margin: 0;
}

/* --- Mobile --- */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  h1, .title {
    font-size: 1.3rem;
  }

  #preamble, #content, #postamble {
    padding-left: 16px;
    padding-right: 16px;
  }
}
