/* ============================================================
   1. Reset
   ============================================================ */

* {
  box-sizing: border-box;
}

/* ============================================================
   2. Colours — every colour used on the site is defined here
   ============================================================ */

:root {
  color-scheme: light dark;

  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #55606b;
  --color-border: #000000;
  --color-link: #0645ad;
  --color-link-visited: #551a8b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #16181d;
    --color-text: #e6e6e6;
    --color-text-muted: #9aa4ac;
    --color-border: #4d4d4d;
    --color-link: #6cb2eb;
    --color-link-visited: #b48ead;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #55606b;
  --color-border: #000000;
  --color-link: #0645ad;
  --color-link-visited: #551a8b;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #16181d;
  --color-text: #e6e6e6;
  --color-text-muted: #9aa4ac;
  --color-border: #4d4d4d;
  --color-link: #6cb2eb;
  --color-link-visited: #b48ead;
}

/* ============================================================
   3. Font sizes — a small scale instead of one-off magic numbers
   ============================================================ */

:root {
  --size-xs: 0.8125rem;
  --size-sm: 0.875rem;
  --size-base: 1rem;
  --size-md: 1.0625rem;
  --size-lg: 1.25rem;
  --size-2xl: 2.5rem;
}

/* ============================================================
   4. Base — small set of deliberately site-wide element defaults
   ============================================================ */

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
}

a {
  color: var(--color-link);
}

a:visited {
  color: var(--color-link-visited);
}

h1 {
  font-weight: 900;
  font-size: var(--size-2xl);
  line-height: 1;
  text-decoration-thickness: 1px;
  text-underline-offset: .1em;
  margin-top: .2em;
}

figcaption {
  font-weight: 400;
  font-size: var(--size-xs);
  line-height: 1.33333333;
  color: var(--color-text-muted);
}

iframe {
  width: 100%;
  aspect-ratio: 640 / 360;
  border: 0;
  display: block;
}

table,
th,
td {
  border: 1px solid var(--color-border);
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

/* ============================================================
   5. Components — each scoped to its own class, none should
   override another
   ============================================================ */

.page-wrapper {
  max-width: 70rem;
  margin: 0 auto;
  padding: 1rem;
}

header .p-category {
  font-weight: 700;
  line-height: 1.25;
  text-decoration-thickness: 1px;
  text-underline-offset: .15em;
  text-transform: uppercase;
}

.byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  line-height: 2rem;
}

.byline>*+*::before {
  content: "•";
  margin: 0 0.4em;
  color: var(--color-text-muted);
}

.byline a {
  text-decoration: none;
}

.byline .h-card:hover {
  text-decoration: underline;
}

.e-content {
  max-width: 50rem;
  margin: 0 auto;
  font-weight: 400;
  font-size: var(--size-md);
  line-height: 1.5;
  letter-spacing: -.0125em;
  text-decoration-thickness: 1px;
  text-underline-offset: .1em;
}

.feature-image {
  border: 1px solid var(--color-border);
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 0.5rem;
  z-index: 100;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 0.5rem 1rem;
  transition: top 0.1s ease-in-out;
}

.skip-link:focus {
  top: 0.5rem;
}

.site-header {
  margin-bottom: 2rem;
}

.site-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-weight: bold;
  font-size: var(--size-lg);
}

.theme-toggle {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  padding: 0.25rem 0.75rem;
  font-size: var(--size-sm);
  cursor: pointer;
}

nav {
  font-size: var(--size-base);
  line-height: 1rem;
}

.nav-links,
.nav-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  list-style: none;
  margin: 0 0 0.5rem 0;
  padding: 0;
}

@media (max-width: 30rem) {

  .nav-links,
  .nav-social {
    gap: 0 1rem;
  }
}

.u-photo {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.post-list-item time {
  min-width: 8rem;
  opacity: 0.7;
}