/* Colors mirror gooddate.org: the #248 -> #125 page gradient, a gray-800 top bar,
   and daisyUI 5's default light/dark themes (which follow the OS preference). */
:root {
  --bg-top: #224488;
  --bg-bottom: #112255;
  --topbar: #1f2937;
  --topbar-text: #f5f5f5;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --code-bg: #f3f4f6;
  --primary: #432dd7;
  --primary-hover: #3723b8;
  --primary-text: #ffffff;
  --link: #432dd7;
  --tag-bg: #eef2ff;
  --footer: #09090b;
  --footer-text: #e4e4e7;
  --radius: 0.75rem;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1d232a;
    --text: #ecf2fb;
    --muted: #9ca3af;
    --border: #374151;
    --code-bg: #15191e;
    --primary: #605dff;
    --primary-hover: #7472ff;
    --link: #a5b4fc;
    --tag-bg: #2a3140;
  }
}

*,
*::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(--font);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg-bottom);
  background-image: linear-gradient(var(--bg-top), var(--bg-bottom));
  background-attachment: fixed;
}

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

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

/* Top bar */

.topbar {
  background: var(--topbar);
  color: var(--topbar-text);
  border-bottom: 1px solid #000;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.2);
}

.topbar-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

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

.brand-blog {
  font-weight: 400;
  opacity: 0.7;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-links a:not(.btn):hover {
  text-decoration: underline;
}

/* Buttons */

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

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

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

.btn-ghost {
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--tag-bg);
}

/* Content */

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.25);
}

.intro h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  line-height: 1.2;
}

.intro p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.summary h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.3;
}

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

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

.read-more {
  font-weight: 600;
  text-decoration: none;
}

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

.post {
  padding: 2rem;
}

.post > header {
  margin-bottom: 1.5rem;
}

.post h1 {
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.2;
}

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

/* Post body */

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

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

.prose h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

.prose h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.25rem;
}

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

.prose li {
  margin: 0.25rem 0;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 4px solid var(--primary);
  color: var(--muted);
  font-style: italic;
}

.prose img,
.prose figure {
  margin: 1.5rem 0;
  border-radius: 0.5rem;
}

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

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

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

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

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

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

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

/* 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.7rem;
  border-radius: 999px;
  background: var(--tag-bg);
  font-size: 0.9rem;
  text-decoration: none;
}

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

/* Call to action */

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

.cta p {
  margin: 0.5rem 0;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem !important;
}

/* Pagination */

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

.pager a {
  color: #fff;
  font-weight: 600;
}

/* Footer */

.footer {
  background: var(--footer);
  color: var(--footer-text);
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.95rem;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1rem;
}

.footer a {
  color: inherit;
}

.footer nav a {
  text-decoration: none;
}

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

.footer p {
  max-width: 40rem;
  margin: 0.5rem auto;
}

/* 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: 1.75rem;
  }

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

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

  .post {
    padding: 1.25rem;
  }

  .post h1 {
    font-size: 1.75rem;
  }
}

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

.draft-banner {
  background: #fde68a;
  color: #1f2937;
  text-align: center;
  font-weight: 600;
  padding: 0.5rem 1rem;
}

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