/* thedundies.com
   Self-hosted, no framework. Replaces Bootstrap 4 + jQuery + Popper,
   which together cost about 300KB of render-blocking requests to style
   a search box and a list. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  /* Cards and chips, so they read against a white page. */
  --surface-alt: #f7f8fa;
  --fg: #1f2124;
  --muted: #6b7280;
  --line: #e4e7eb;
  /* Button fill. Carries white label text at 8.4:1. */
  --accent: #1d4e89;
  --accent-soft: #e9f0f8;
  --link: #1d4e89;
  --focus: #2f6db5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191c;
    --surface: #17191c;
    --surface-alt: #1f2226;
    --fg: #e6e8ea;
    --muted: #9aa1a9;
    --line: #2c3035;
    --accent: #7fb3e8;
    --accent-soft: #1d2733;
    --link: #7fb3e8;
    --focus: #7fb3e8;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap { width: 100%; max-width: 54rem; margin: 0 auto; padding: 0 1.25rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header ------------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.5rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}
.brand span { color: var(--muted); font-weight: 400; }

.site-nav { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-left: auto; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); text-decoration: underline; }

/* Headings and copy -------------------------------------------------- */

main { padding: 2rem 0 3rem; }

h1 {
  font-size: clamp(1.6rem, 1.15rem + 2vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.75rem;
}

.lead { color: var(--muted); margin: 0 0 1.5rem; font-size: 1.02rem; }

.breadcrumb {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumb li + li::before { content: "/"; margin-right: 0.4rem; color: var(--line); }
.breadcrumb a { color: var(--muted); }

/* Search ------------------------------------------------------------- */

.search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 2rem;
}

.search-input, .search-select {
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  min-width: 0;
}

.search-input { flex: 3 1 16rem; }
.search-select { flex: 1 1 10rem; }
.search-input:focus, .search-select:focus { border-color: var(--focus); }

.btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { border-color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) { .btn-primary { color: #17191c; } }
.btn-primary:hover { filter: brightness(1.08); }

/* Quotes ------------------------------------------------------------- */

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

.quote {
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}
.quote:first-child { border-top: 0; }

.quote-speaker {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.quote-text { margin: 0 0 0.4rem; font-size: 1.05rem; }
.quote-text a { color: inherit; text-decoration-color: var(--line); }
.quote-text a:hover { text-decoration-color: var(--accent); }

.quote-meta { margin: 0; font-size: 0.85rem; color: var(--muted); }
.quote-meta a { color: var(--muted); }

/* A single quote's own page */

.quote-feature {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 0 0 1.5rem;
}
.quote-feature .quote-text { font-size: 1.3rem; line-height: 1.45; }

.quote-nav {
  display: flex;
  gap: 1rem;
  margin: 0 0 1.5rem;
}
.quote-nav .btn { font-size: 0.92rem; padding: 0.45rem 0.9rem; }
/* Holds each button to its own side whether or not the other one exists. */
.quote-nav .btn-prev { margin-right: auto; }
.quote-nav .btn-next { margin-left: auto; }

/* Card grids and link rows ------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card-grid h2, .card-grid h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.card-grid p { margin: 0; font-size: 0.88rem; color: var(--muted); }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.chip {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--fg);
}
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: 0.55rem 0; border-top: 1px solid var(--line); }
.link-list li:first-child { border-top: 0; }
.link-list .count { color: var(--muted); font-size: 0.85rem; margin-left: 0.4rem; }

/* Pagination --------------------------------------------------------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}
.pagination a, .pagination span {
  display: block;
  min-width: 2.4rem;
  text-align: center;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.92rem;
}
.pagination a:hover { border-color: var(--accent); }
.pagination .is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) { .pagination .is-current { color: #17191c; } }
.pagination .is-gap { border-color: transparent; color: var(--muted); }

/* Footer ------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.site-footer p { margin: 0 0 0.6rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--fg); }

/* About -------------------------------------------------------------- */

.prose p { margin: 0 0 1.1rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

.notice { color: var(--muted); }

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

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }



/* Landing page ------------------------------------------------------- */

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 58vh;
  padding: 2rem 0 3rem;
}

.home h1 {
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.2rem);
  margin: 0 0 0.5rem;
}

.home .lead { margin: 0 0 2rem; }

.home .search {
  width: 100%;
  max-width: 34rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
/* Box on its own line, controls centred underneath. */
.home .search-input { flex: 1 1 100%; }
.home .search-select { flex: 0 1 13rem; }
.home .search .btn { flex: 0 0 auto; }

.home-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.25rem;
  font-size: 0.92rem;
}
.home-links a { color: var(--muted); }
.home-links a:hover { color: var(--fg); }

/* Narrow screens ----------------------------------------------------- */

@media (max-width: 34rem) {
  .site-nav { margin-left: 0; gap: 1rem; }
  .search-input, .search-select { flex: 1 1 100%; }
  .search .btn { flex: 1 1 auto; }
  /* Last in the file so it beats the equally specific .home rules. */
  .home .search-select { flex: 1 1 100%; }
  .home .search .btn { flex: 1 1 auto; }
  .quote-feature { padding: 1.1rem; }
}
