/* Flea Market Time: warm paper, dark ink, a brass accent. System fonts only, no external requests. */

:root {
  --paper: #fbf8f2;
  --card: #fffdf8;
  --ink: #2f2821;
  --muted: #6d6256;
  --line: #e4dccf;
  --brass: #8a5a14;
  --brass-soft: #f1e4cc;
  --measure: 40rem;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1915;
    --card: #25211c;
    --ink: #ece3d6;
    --muted: #b3a796;
    --line: #3a342c;
    --brass: #e0b56c;
    --brass-soft: #3a3024;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
}

a {
  color: var(--brass);
  text-underline-offset: 0.18em;
}

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

a:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
  border-radius: 2px;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--card);
  padding: 0.4rem 0.8rem;
}

.skip:focus {
  left: 1rem;
}

/* Header and navigation */

.site-header,
main,
.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  padding-top: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-tagline {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.95rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav a:hover,
nav a[aria-current='page'] {
  color: var(--brass);
  text-decoration: underline;
}

/* Home page */

.intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 2rem 0 1rem;
}

.intro img {
  justify-self: center;
}

@media (min-width: 40rem) {
  .intro {
    grid-template-columns: 11rem 1fr;
    align-items: start;
  }
}

.section-title {
  font-size: 1.15rem;
  font-family: var(--sans);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 2rem 0 0.5rem;
}

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

.card {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.card h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.35;
}

.card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.card h2 a:hover {
  color: var(--brass);
}

.card p {
  margin: 0.3rem 0 0;
}

/* Posts and pages */

.post {
  margin: 2rem 0;
}

.post h1,
main > h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin: 0 0 0.4rem;
}

.meta,
.crumb,
.count {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
}

.meta {
  margin: 0;
}

.cover {
  margin: 1.5rem 0;
}

.cover img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.prose h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.5rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

.closed {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
}

.neighbours {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 3rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}

.neighbours a[rel='next'] {
  margin-left: auto;
  text-align: right;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.95rem;
}

caption {
  text-align: left;
  color: var(--muted);
  font-size: 0.85rem;
  padding-bottom: 0.4rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}

thead th {
  background: var(--brass-soft);
}

tbody th {
  font-weight: 600;
}

/* Archive and tags */

.archive,
.tags {
  list-style: none;
  padding: 0;
}

.archive li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem;
  padding: 0.2rem 0;
}

.archive time {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  padding-bottom: 2.5rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0.25rem 0;
}

@media (prefers-reduced-motion: no-preference) {
  a {
    transition: color 0.15s ease;
  }
}

.contact {
  font-family: var(--sans);
  overflow-wrap: anywhere;
}
