/*
 * Mirrors the podbrief.io marketing palette and surfaces. Values were measured
 * from the live site (getComputedStyle on /, /pricing, /privacy) rather than
 * guessed from the Tailwind tokens, because the rendered result is what matters.
 *
 * Type is a deliberate divergence: the marketing site sets page titles in
 * Instrument Serif, but this is a blog, so everything here is Google Sans.
 * Display sizes are smaller than the serif ones they replaced — a sans reads
 * visually larger and heavier at the same pixel size.
 *
 * Google Sans comes from the Google Fonts CDN, the same source the marketing
 * site uses. (It additionally self-hosts a 9.3MB variable TTF; the CDN's woff2
 * subsets are the same face at a fraction of the weight.)
 */
:root {
  --bg-root: rgb(8, 8, 8);
  --bg-card: rgb(12, 10, 9);
  --bg-secondary: rgb(26, 26, 26);

  --text: rgb(244, 239, 230);
  --text-dim: rgba(244, 239, 230, 0.62);
  --text-soft: rgba(244, 239, 230, 0.7);
  --text-faint: rgba(244, 239, 230, 0.45);

  --gold: rgb(224, 182, 82);
  --gold-end: rgb(218, 132, 11);
  --gold-gradient: linear-gradient(to right, var(--gold), var(--gold-end));

  --border: rgb(51, 51, 51);
  --border-soft: rgba(51, 51, 51, 0.5);

  --font-body: 'Google Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: var(--font-body);
  --font-mono: 'SF Mono', Monaco, Inconsolata, 'Fira Code', monospace;

  --shell: 1280px; /* marketing header container */
  --measure: 44rem; /* reading column */
  --header-h: 65px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg-root);
}

body {
  margin: 0;
  padding-top: var(--header-h); /* header is fixed */
  background: var(--bg-root);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gold);
  text-decoration-color: rgba(224, 182, 82, 0.35);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--gold);
}

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

strong {
  font-weight: 700;
  color: var(--text);
}

.shell {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.gold {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(8, 8, 8, 0.6);
}

.site-header__inner {
  max-width: var(--shell);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* 150px matches the marketing site's <Logo /> component exactly. */
.site-header__logo img {
  width: 150px;
  height: auto;
  display: block;
}

@media (max-width: 32rem) {
  .site-header__logo img {
    width: 118px;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 1rem;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--gold);
}

/* Solid gold, not a gradient — matches the marketing "Download App" pill. */
.site-nav a.cta {
  background: var(--gold);
  color: #000;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
}

.site-nav a.cta:hover {
  color: #000;
  filter: brightness(1.07);
}

@media (max-width: 32rem) {
  .site-nav {
    gap: 1rem;
    font-size: 0.9375rem;
  }
  .site-nav a.cta {
    font-size: 0.8125rem;
    padding: 0.45rem 0.85rem;
  }
}

/* ---------- listing ---------- */

.page-intro {
  padding: 4rem 0 2.5rem;
}

.page-intro h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.page-intro p {
  color: var(--text-dim);
  font-size: 1.0625rem;
  line-height: 1.6;
  margin: 0;
  max-width: 34rem;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

/* .glass-card equivalent */
.post-card {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease;
}

.post-card:hover {
  border-color: rgba(224, 182, 82, 0.5);
}

.post-card__thumb {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card h2 {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.35;
  margin: 0 0 0.4rem;
}

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

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

.post-card__excerpt {
  color: var(--text-dim);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  color: var(--text-faint);
  font-size: 0.8125rem;
  margin: 0; /* drop the UA <p> margin so cards don't gain trailing space */
}

@media (max-width: 36rem) {
  .post-card {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem;
  }
}

/* ---------- pagination ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  font-size: 0.9375rem;
}

.pagination a {
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
}

.pagination a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.pagination__spacer {
  flex: 1;
}

/* ---------- article ---------- */

.article {
  padding-top: 3.5rem;
}

.article__header {
  margin-bottom: 2rem;
}

.article__header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.875rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0.6rem 0 0;
}

.article__feature {
  margin: 0 0 2.5rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.article__feature img {
  display: block;
  width: 100%;
}

.article__body {
  font-size: 1rem;
  line-height: 1.65;
}

/* Ghost's exported HTML carries UA <p>/<h*> margins. Zero the bottom edge and
   drive all rhythm from margin-top, so spacing is set in one place. */
.article__body > * {
  margin-bottom: 0;
}

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

.article__body > * + * {
  margin-top: 1.25rem;
}

/* Section headings are sans, per podbrief.io/privacy — the display serif is
   reserved for page titles. */
.article__body h2,
.article__body h3,
.article__body h4 {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}

.article__body h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-top: 3rem;
}

.article__body h3 {
  font-size: 1.1875rem;
  line-height: 1.4;
  margin-top: 2.25rem;
}

.article__body h4 {
  font-size: 1rem;
  margin-top: 1.75rem;
}

.article__body img {
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}

.article__body figure {
  margin: 2.25rem 0;
}

.article__body figcaption {
  color: var(--text-faint);
  font-size: 0.8125rem;
  text-align: center;
  margin-top: 0.65rem;
}

.article__body blockquote {
  margin: 2.25rem 0;
  padding: 0.25rem 0 0.25rem 1.35rem;
  border-left: 3px solid var(--gold);
  color: var(--text-dim);
  font-style: italic;
}

.article__body ul,
.article__body ol {
  padding-left: 1.4rem;
}

.article__body li + li {
  margin-top: 0.5rem;
}

.article__body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-secondary);
  padding: 0.15em 0.4em;
  border-radius: 5px;
}

.article__body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
}

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

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

.article__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  display: block;
  overflow-x: auto;
}

.article__body th,
.article__body td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
}

.article__body th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.article__body iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* Ghost card classes present in the exported HTML */
.kg-card {
  margin: 2.25rem 0;
}

.kg-image-card img,
.kg-embed-card iframe {
  margin-inline: auto;
}

.kg-bookmark-card a {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-decoration: none;
}

/* ---------- tags ---------- */

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
}

.tag-row li a {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-soft);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}

.tag-row li a:hover {
  border-color: var(--gold);
  color: var(--text);
}

/* ---------- end-of-post CTA ---------- */

.post-cta {
  margin-top: 4rem;
  padding: 2.25rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.post-cta h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.625rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
}

.post-cta p {
  color: var(--text-dim);
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

.post-cta a {
  display: inline-block;
  background: var(--gold);
  color: #000;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
}

.post-cta a:hover {
  color: #000;
  filter: brightness(1.07);
}

/* ---------- related ---------- */

.related-heading {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 4rem 0 1.25rem;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 5rem;
  padding: 3rem 0;
}

.site-footer__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.site-footer a {
  color: var(--text-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

/* ---------- 404 ---------- */

.notfound {
  padding: 7rem 0 5rem;
  text-align: center;
}

.notfound h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.5rem;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.notfound p {
  color: var(--text-dim);
}
