/* Colors, type, and rules mirror gooddate.org's "paper, ink, crimson, and a quiet blue" theme
   (opendate service/handlers/static/style.css). Like the main site, it's light only. */

/* Self-hosted fonts (SIL OFL, licenses in /assets/fonts). Variable files, so one file per style covers every weight,
   and Source Serif's optical sizes. The latin files are preloaded in base.html; latin-ext only downloads when a page
   uses one of its characters. */
@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/figtree-latin-ext-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/figtree-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: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/figtree-latin-ext-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/figtree-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: "Source Serif 4";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-latin-ext-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-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: "Source Serif 4";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-latin-ext-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-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;
}

:root {
  color-scheme: light;
  --paper: #fbfbf9;
  --ink: #151515;
  --muted: rgb(21 21 21 / 0.62);
  --primary: #bd3a5c;
  --primary-hover: #a3304e;
  --primary-text: #ffffff;
  --blue: #2b69ab;
  --rule: #d6e6f7;
  --accent: #e4eefa;
  /* Cards: translucent, like tracing paper over the grid */
  --sheet: rgb(255 255 255 / 0.6);
  --code-bg: #f1f1ed;
  --radius: 0.875rem;
  --radius-field: 0.5rem;
  --sans: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --serif: "Source Serif 4", ui-serif, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  line-height: 1.6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  /* Faint graph-paper grid */
  background-image:
    linear-gradient(to right, rgb(31 79 176 / 0.018) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(31 79 176 / 0.018) 1px, transparent 1px);
  background-size: 22px 22px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.tag-line {
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}

/* Top bar: the wordmark over a pale blue rule, like gooddate.org */

.topbar {
  padding: 0 1rem;
}

.topbar-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 2px solid var(--rule);
}

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

.brand .logo {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  color: var(--primary);
}

.wordmark {
  font-family: var(--serif);
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.brand .tag-line {
  align-self: flex-end;
  margin-left: 0.5rem;
  padding-bottom: 0.15rem;
  font-size: 1rem;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  white-space: nowrap;
}

.topbar-links a:not(.btn) {
  font-size: 1.0625rem;
}

/* Search (trunkcms search.js fills .site-search-results and unhides the form once it runs) */

.site-search {
  position: relative;
  flex: 0 1 18rem;
  margin-left: auto;
}

.site-search[hidden],
.site-search-results[hidden] {
  display: none;
}

.site-search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.site-search input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.1rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-field);
}

.site-search input::placeholder {
  color: var(--muted);
}

.site-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(189 58 92 / 0.15);
}

.site-search-results {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: min(28rem, calc(100vw - 2rem));
  max-height: 70vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgb(21 21 21 / 0.12);
  z-index: 20;
}

.site-search-results ol {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}

.site-search-results a {
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
}

.site-search-results a:hover,
.site-search-results a:focus {
  background: var(--accent);
  outline: none;
}

.site-search-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.site-search-date,
.site-search-summary {
  display: block;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

.site-search-summary {
  margin-top: 0.15rem;
}

.site-search-empty {
  margin: 0;
  padding: 0.75rem 1rem;
  color: var(--muted);
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-field);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--primary-text);
}

/* Content */

.container {
  flex: 1;
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 3rem 1rem 3rem;
}

.card {
  background: var(--sheet);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

.intro {
  margin-bottom: 2.5rem;
}

.intro h1 {
  margin: 0;
  font-size: clamp(2.75rem, 7vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.intro .eyebrow + h1 {
  margin-top: 1rem;
}

.intro > p:not(.eyebrow) {
  margin: 1.5rem 0 0;
  max-width: 40rem;
  font-family: var(--serif);
  font-size: 1.375rem;
  line-height: 1.4;
}

/* Post list: entries ruled apart, like the landing page's points */

.summaries {
  border-top: 2px solid var(--rule);
  margin-bottom: 2rem;
}

.summary {
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}

.summary h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
}

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

.summary h2 a:hover {
  color: var(--primary);
}

.summary > p:not(.meta) {
  margin: 0.75rem 0;
  font-size: 1.125rem;
  line-height: 1.65;
}

.read-more {
  font-weight: 500;
}

.empty {
  margin: 0;
  padding: 2rem 0;
  color: var(--muted);
}

.meta {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.meta a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}

.meta a:hover {
  text-decoration: underline;
}

.post {
  padding: 2.5rem;
}

.post > header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--rule);
}

.post h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.post > footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--rule);
}

/* Post body */

.prose {
  font-size: 1.125rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.prose h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
}

.prose p,
.prose ul,
.prose ol {
  margin: 1.25rem 0;
}

.prose li {
  margin: 0.35rem 0;
}

.prose li::marker {
  color: var(--primary);
}

.prose blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--primary);
  font-family: var(--serif);
  font-size: 1.3em;
  line-height: 1.45;
}

.prose img,
.prose figure {
  margin: 2rem 0;
  border-radius: var(--radius);
}

.prose figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.prose hr {
  border: 0;
  border-top: 2px solid var(--rule);
  margin: 2.5rem 0;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
}

.prose pre {
  background: var(--code-bg);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-field);
  overflow-x: auto;
  font-size: 0.9rem;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 1rem;
}

.prose th,
.prose td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.prose th {
  font-weight: 600;
  border-bottom-width: 2px;
}

/* Tags */

.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.tag:hover {
  background: var(--rule);
}

.tag .count {
  color: var(--muted);
  margin-left: 0.35rem;
}

.tag-cloud {
  padding-top: 2rem;
  border-top: 2px solid var(--rule);
}

/* Call to action */

.cta {
  padding: 2rem 2.5rem;
}

.cta h2 {
  margin: 0 0 0.5rem;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
}

.cta p {
  margin: 0.5rem 0;
  font-size: 1.0625rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.25rem !important;
}

/* Pagination */

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.pager a {
  font-weight: 500;
}

/* Footer */

.footer {
  padding: 0 1rem;
  margin-top: 1rem;
}

.footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 0 2.5rem;
  border-top: 2px solid var(--rule);
}

.footer-motto {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-align: center;
}

.footer-row {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
}

/* Bullets between links, like gooddate.org. Inline-block keeps the link underline off them. */
.footer nav a:not(:last-child)::after {
  content: "\2022";
  display: inline-block;
  margin-left: 0.75rem;
  color: rgb(21 21 21 / 0.7);
  text-decoration: none;
}

.footer-legal {
  margin: 1.5rem 0 0;
  max-width: 42rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Header and footer content sits in from the ends of their rules, like gooddate.org. */
@media (min-width: 641px) {
  .topbar-inner,
  .footer-inner {
    padding-inline: 1.5rem;
  }

  .topbar,
  .footer {
    padding-inline: 2.5rem;
  }
}

/* Larger reading size and a wider column on desktop (post text is ~865px, about 85 characters a line). */
@media (min-width: 1024px) {
  .container {
    max-width: 60rem;
  }

  .prose {
    font-size: 1.25rem;
  }

  .prose h2 {
    font-size: 2rem;
  }

  .prose h3 {
    font-size: 1.5rem;
  }
}

@media (max-width: 640px) {
  .hide-sm {
    display: none;
  }

  .topbar-inner {
    flex-wrap: wrap;
    row-gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .brand .logo {
    width: 2.25rem;
    height: 2.25rem;
  }

  .wordmark {
    font-size: 2rem;
  }

  .brand .tag-line {
    margin-left: 0.25rem;
  }

  /* Search drops to its own full-width row under the brand and Sign up button. */
  .site-search {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
  }

  .site-search input {
    font-size: 1rem; /* 16px keeps iOS from zooming in on focus */
  }

  .site-search-results {
    left: 0;
    width: 100%;
  }

  .container {
    padding-top: 2rem;
  }

  .card,
  .post,
  .cta {
    padding: 1.5rem 1.25rem;
  }

  .summary h2 {
    font-size: 1.625rem;
  }

  .footer-row {
    flex-direction: column;
  }
}

/* trunkcms extras: the draft banner editors see, and author pages */

.draft-banner {
  background: color-mix(in oklab, #d99a1e 16%, white);
  border-bottom: 1px solid color-mix(in oklab, #d99a1e 45%, white);
  color: #3d2c06;
  text-align: center;
  font-weight: 600;
  padding: 0.5rem 1rem;
}

.author .avatar {
  float: right;
  margin: 0 0 1rem 1rem;
  border-radius: 50%;
}

.author .prose {
  margin-top: 1.5rem;
}
