/* ── Design tokens (mirrors selectedwithtrust.com) ── */
:root {
  --bg:          #f2f6f5;
  --ink:         #14231a;
  --muted:       #415145;
  --surface:     #ffffff;
  --surface-2:   #eff4f3;
  --line:        #d3dbd9;
  --brand:       #1f7f5e;
  --brand-hover: #196a4e;
  --brand-2:     #d7922f;
  --danger:      #9f3e35;
  --ok-light:    #d9f0e5;
  --ok-dark:     #0f593d;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #141a16;
    --ink:         #e4e0d6;
    --muted:       #9fa89c;
    --surface:     #1c2420;
    --surface-2:   #222b26;
    --line:        #3a4a40;
    --brand:       #3dba8a;
    --brand-hover: #4dd19c;
    --brand-2:     #e5a843;
    --ok-light:    #1a3328;
    --ok-dark:     #6ae4b0;
  }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ── Layout ── */
.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

.container--narrow {
  width: min(720px, 100% - 2.5rem);
  margin-inline: auto;
}

.site-main {
  flex: 1;
  padding-block: 3rem 4rem;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(28, 36, 32, 0.92); }
}

.site-header-inner {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.7rem;
}

.site-logo {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.logo-mark { color: var(--brand); flex-shrink: 0; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 1.5rem;
  flex: 1;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover { color: var(--ink); background: var(--surface-2); }

.nav-sep {
  width: 1px;
  height: 1.1rem;
  background: var(--line);
  margin-left: auto;
  margin-right: 0.3rem;
  flex-shrink: 0;
}

.nav-user { font-weight: 600; color: var(--brand) !important; }

.btn-nav {
  color: #fff !important;
  background: var(--brand) !important;
  padding: 0.4rem 0.85rem !important;
  border-radius: 8px !important;
}

.btn-nav:hover { background: var(--brand-hover) !important; }

.hamburger {
  display: none;
  background: none;
  border: none;
  padding: 0.6rem;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 720px) {
  .hamburger { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1rem;
    margin-left: 0;
    gap: 0;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.6rem 0.5rem; width: 100%; }
  .nav-sep { display: none; }
  .btn-nav { margin-top: 0.5rem; text-align: center; }
}

/* ── Page header ── */
.page-header {
  padding-block: 2.5rem 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

.page-title {
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.page-description {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.6;
}

/* ── Post feed (card grid) ── */
.post-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* ── Post card ── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s var(--ease-out-expo), transform 0.2s var(--ease-out-expo);
}

.post-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.post-card-image-link { display: block; overflow: hidden; }

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s var(--ease-out-expo);
}

.post-card:hover .post-card-image { transform: scale(1.03); }

.post-card-content {
  padding: 1.25rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.post-card-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.post-tag {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  background: var(--ok-light);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s;
}

.post-tag:hover { background: var(--line); color: var(--ink); }

.post-card-title {
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.post-card-title a {
  text-decoration: none;
  color: inherit;
  transition: color 0.15s;
}

.post-card-title a:hover { color: var(--brand); }

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.meta-sep { opacity: 0.5; }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.pagination a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s;
}

.pagination a:hover { background: var(--surface-2); border-color: var(--brand); }

.pagination .page-number {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Single post ── */
.post-header {
  padding-block: 2.5rem 1.5rem;
}

.post-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.post-title {
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.post-excerpt {
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.post-feature-image {
  margin-bottom: 2rem;
}

.post-feature-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

/* ── Post content typography ── */
.post-content {
  padding-bottom: 3rem;
}

.gh-content > * + * { margin-top: 1.4em; }

.gh-content h2 {
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-top: 2.5rem;
  margin-bottom: 0.6rem;
}

.gh-content h3 {
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.gh-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 1.5rem;
}

.gh-content p { font-size: 1.05rem; line-height: 1.75; color: var(--ink); }

.gh-content a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.gh-content a:hover { color: var(--brand-hover); }

.gh-content strong { font-weight: 700; }
.gh-content em { font-style: italic; }

.gh-content ul,
.gh-content ol {
  padding-left: 1.6rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.gh-content li + li { margin-top: 0.35rem; }

.gh-content blockquote {
  border-left: 3px solid var(--brand);
  padding: 0.8rem 1.2rem;
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
  font-style: italic;
  font-size: 1.05rem;
}

.gh-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin-block: 2rem;
}

.gh-content code {
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.88em;
  background: var(--surface-2);
  color: var(--brand);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.gh-content pre {
  background: var(--ink);
  color: #e4e0d6;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

.gh-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}

.gh-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-block: 1.5rem;
}

.gh-content th,
.gh-content td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.gh-content th {
  background: var(--surface-2);
  font-weight: 600;
}

.gh-content img {
  border-radius: var(--radius-md);
  max-width: 100%;
}

/* Ghost Koenig card widths — standalone selectors required by GScan */
.kg-width-wide {
  width: min(960px, 100vw - 2.5rem);
  margin-inline: calc(50% - min(480px, (100vw - 2.5rem) / 2));
}

.kg-width-full {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}

.gh-content .kg-image-card img { border-radius: var(--radius-md); }

.gh-content .kg-card figcaption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.gh-content .kg-callout-card {
  display: flex;
  gap: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.gh-content .kg-callout-emoji { font-size: 1.2rem; flex-shrink: 0; }

.gh-content .kg-toggle-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

/* ── Post footer ── */
.post-footer {
  padding-bottom: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.post-footer-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-footer-tags-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.back-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover { color: var(--brand-hover); }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--brand);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
  border: none;
}

.btn-primary:hover { background: var(--brand-hover); color: #fff; }

/* ── Error page ── */
.error-page {
  text-align: center;
  padding-block: 6rem;
  max-width: 480px;
  margin-inline: auto;
}

.error-code {
  font-family: 'Spectral', Georgia, serif;
  font-size: 5rem;
  font-weight: 700;
  color: var(--line);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-title {
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.error-message {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.6);
  margin-top: auto;
}

@media (prefers-color-scheme: dark) {
  .site-footer { background: rgba(28, 36, 32, 0.6); }
}

.site-footer-top {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-block: 2.5rem 2rem;
}

.footer-logo-text {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  display: block;
  margin-bottom: 0.6rem;
}

.footer-tagline {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 26ch;
}

.footer-col { display: flex; flex-direction: column; gap: 0.5rem; }

.footer-col-heading {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.35rem;
}

.footer-col a {
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col a:hover { color: var(--brand); }

.site-footer-bottom {
  border-top: 1px solid var(--line);
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding-block: 1rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.footer-trust { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.footer-trust-badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ok-dark);
  background: var(--ok-light);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.55rem;
}

@media (max-width: 860px) {
  .site-footer-top { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .footer-brand { grid-column: span 2; }
}

@media (max-width: 600px) {
  .site-footer-top { grid-template-columns: 1fr; gap: 1rem; padding-block: 1.5rem 1.2rem; }
  .footer-brand { grid-column: span 1; }
  .footer-tagline { max-width: none; }
  .post-feed { grid-template-columns: 1fr; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Syntax highlighting (Prism) ──────────────────────────────────
   The self-hosted Prism bundle is loaded in default.hbs and auto-
   highlights any <pre><code class="language-…">. These token colours
   are tuned for the always-dark code surface defined just below. */

/* Keep code blocks dark in BOTH colour schemes. The original rule used
   `background: var(--ink)`, which flips to a light fill in dark mode and
   made the cream text unreadable — pin it to a fixed dark surface. */
.gh-content pre,
.gh-content pre[class*="language-"] {
  background: #14231a;
  color: #e4e0d6;
  text-shadow: none;
}
.gh-content pre code { color: inherit; }
.gh-content pre[class*="language-"]::selection,
.gh-content pre[class*="language-"] ::selection { background: rgba(61, 186, 138, 0.30); }

.gh-content .token.comment,
.gh-content .token.prolog,
.gh-content .token.doctype,
.gh-content .token.cdata { color: #7e9488; font-style: italic; }

.gh-content .token.punctuation { color: #9fa89c; }

.gh-content .token.property,   /* JSON keys / object properties */
.gh-content .token.tag,
.gh-content .token.key,        /* YAML keys */
.gh-content .token.atrule,
.gh-content .token.attr-name,
.gh-content .token.symbol,
.gh-content .token.deleted { color: #3dba8a; }

.gh-content .token.boolean,
.gh-content .token.number,
.gh-content .token.constant { color: #79c0e8; }

.gh-content .token.string,
.gh-content .token.char,
.gh-content .token.attr-value,
.gh-content .token.selector,
.gh-content .token.regex,
.gh-content .token.inserted { color: #e5a843; }

.gh-content .token.operator,
.gh-content .token.entity,
.gh-content .token.url,
.gh-content .token.variable { color: #cfd6c8; }

.gh-content .token.keyword { color: #6ae4b0; font-weight: 600; }

.gh-content .token.function,
.gh-content .token.class-name,
.gh-content .token.builtin { color: #8fe3bf; }

.gh-content .token.important,
.gh-content .token.bold { font-weight: 600; }
.gh-content .token.italic { font-style: italic; }
