/* ═══════════════════════════════════════════
   8020 Data Ghost Theme — Style
   Monochrome · Minimal · Apple/Linear inspired
   ═══════════════════════════════════════════ */

/* ─── RESET & BASE ─── */

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

:root {
  --white: #ffffff;
  --zinc-50: #fafafa;
  --zinc-100: #f4f4f5;
  --zinc-200: #e4e4e7;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;
  --zinc-600: #52525b;
  --zinc-800: #27272a;
  --zinc-900: #18181b;
  --zinc-950: #09090b;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --max-width: 1200px;
  --content-width: 720px;
  --nav-height: 64px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--zinc-950);
  background: var(--white);
}

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

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

/* ─── NAVIGATION ─── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  border-bottom: 1px solid var(--zinc-100);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 16px;
  font-weight: 600;
  color: var(--zinc-950);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--zinc-500);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--zinc-950);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--white) !important;
  background: var(--zinc-950);
  border-radius: 9999px;
  transition: background 0.15s;
}

.nav-cta:hover {
  background: var(--zinc-800);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--zinc-950);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-cta-desktop {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
}

/* ─── LAYOUT ─── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.content-width {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* ─── HOMEPAGE / POST LISTING ─── */

.site-header {
  padding: 96px 0;
  text-align: center;
}

.site-header h1 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--zinc-950);
}

.site-header p {
  margin-top: 12px;
  font-size: 18px;
  color: var(--zinc-500);
}

.post-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
  padding-bottom: 96px;
}

.post-card {
  border: 1px solid var(--zinc-200);
  border-radius: 16px;
  background: var(--white);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.post-card:hover {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.post-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.post-card-content {
  padding: 24px;
}

.post-card-tag {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--zinc-400);
}

.post-card-title {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--zinc-950);
}

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

.post-card-title a:hover {
  text-decoration: underline;
}

.post-card-excerpt {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--zinc-500);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--zinc-400);
}

.post-card-meta span::after {
  content: "·";
  margin-left: 8px;
}

.post-card-meta span:last-child::after {
  content: "";
}

/* ─── SINGLE POST ─── */

.post-header {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 80px 24px 0;
  text-align: center;
}

.post-tag {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--zinc-400);
}

.post-title {
  margin-top: 16px;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--zinc-950);
}

@media (min-width: 768px) {
  .post-title {
    font-size: 44px;
  }
}

.post-meta {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  color: var(--zinc-500);
}

.post-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 2px solid var(--zinc-100);
  object-fit: cover;
}

.post-meta-text span::after {
  content: "·";
  margin: 0 6px;
}

.post-meta-text span:last-child::after {
  content: "";
}

/* Feature image */
.post-feature-image {
  max-width: 960px;
  margin: 48px auto 0;
  padding: 0 24px;
}

.post-feature-image img {
  width: 100%;
  border-radius: 16px;
}

/* Article body — Ghost content */
.post-content {
  max-width: var(--content-width);
  margin: 48px auto 0;
  padding: 0 24px 96px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--zinc-600);
}

.post-content h2 {
  margin-top: 48px;
  margin-bottom: 16px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--zinc-950);
}

.post-content h3 {
  margin-top: 36px;
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--zinc-950);
}

.post-content p {
  margin-bottom: 20px;
}

.post-content strong {
  color: var(--zinc-950);
  font-weight: 600;
}

.post-content a {
  color: var(--zinc-950);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--zinc-300);
  transition: text-decoration-color 0.15s;
}

.post-content a:hover {
  text-decoration-color: var(--zinc-950);
}

.post-content blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--zinc-200);
  font-style: italic;
  color: var(--zinc-500);
}

.post-content ul,
.post-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 2px 6px;
  background: var(--zinc-50);
  border: 1px solid var(--zinc-200);
  border-radius: 4px;
}

.post-content pre {
  margin: 24px 0;
  padding: 20px;
  background: var(--zinc-950);
  color: var(--zinc-200);
  border-radius: 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
}

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

.post-content figure {
  margin: 32px 0;
}

.post-content figcaption {
  margin-top: 8px;
  font-size: 13px;
  text-align: center;
  color: var(--zinc-400);
}

.post-content hr {
  margin: 48px auto;
  border: none;
  border-top: 1px solid var(--zinc-200);
  max-width: 120px;
}

/* ─── GHOST KOENIG EDITOR CARDS ─── */

.post-content .kg-card {
  margin: 32px 0;
}

/* Required by Ghost: wide and full-width image support */
.kg-width-wide {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.kg-width-full {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.kg-width-wide img,
.kg-width-full img {
  width: 100%;
}

.post-content .kg-image-card img {
  border-radius: 12px;
}

.kg-width-full img {
  border-radius: 0;
}

.post-content .kg-bookmark-card {
  border: 1px solid var(--zinc-200);
  border-radius: 12px;
  overflow: hidden;
}

/* Ghost gallery card */
.kg-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kg-gallery-row {
  display: flex;
  gap: 12px;
}

.kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* Ghost callout card */
.kg-callout-card {
  padding: 20px 24px;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.kg-callout-card-grey {
  background: var(--zinc-50);
}

/* Ghost toggle card */
.kg-toggle-card {
  border: 1px solid var(--zinc-200);
  border-radius: 12px;
  padding: 20px;
}

.kg-toggle-heading {
  cursor: pointer;
  font-weight: 600;
  color: var(--zinc-950);
}

/* Ghost button card */
.kg-button-card {
  text-align: center;
}

.kg-button-card a {
  display: inline-flex;
  padding: 12px 28px;
  background: var(--zinc-950);
  color: var(--white) !important;
  text-decoration: none !important;
  border-radius: 9999px;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s;
}

.kg-button-card a:hover {
  background: var(--zinc-800);
}

/* ─── AUTHOR CARD (end of article) ─── */

.author-card {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px 48px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  border: 2px solid var(--zinc-100);
  object-fit: cover;
  flex-shrink: 0;
}

.author-info h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--zinc-950);
}

.author-info p {
  font-size: 14px;
  color: var(--zinc-500);
  margin-top: 2px;
}

/* ─── ARTICLE CTA ─── */

.article-cta {
  max-width: var(--content-width);
  margin: 0 auto 96px;
  padding: 0 24px;
}

.article-cta-inner {
  background: var(--zinc-950);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}

.article-cta-inner h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--white);
}

.article-cta-inner p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--zinc-400);
}

.article-cta-inner a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 12px 28px;
  background: var(--white);
  color: var(--zinc-950);
  font-size: 14px;
  font-weight: 500;
  border-radius: 9999px;
  transition: background 0.15s;
}

.article-cta-inner a:hover {
  background: var(--zinc-100);
}

/* ─── NEWSLETTER SIGNUP ─── */

.newsletter-section {
  background: var(--zinc-50);
  padding: 80px 24px;
  text-align: center;
}

.newsletter-section h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--zinc-950);
}

.newsletter-section p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--zinc-500);
}

.newsletter-form {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
  font-family: var(--font-sans);
  border: 1px solid var(--zinc-200);
  border-radius: 9999px;
  background: var(--white);
  outline: none;
  color: var(--zinc-950);
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--zinc-400);
}

.newsletter-form button {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--white);
  background: var(--zinc-950);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s;
}

.newsletter-form button:hover {
  background: var(--zinc-800);
}

@media (max-width: 480px) {
  .newsletter-form {
    flex-direction: column;
  }
}

/* ─── PAGINATION ─── */

.pagination {
  padding: 0 24px 96px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.pagination a {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--zinc-200);
  border-radius: 9999px;
  color: var(--zinc-950);
  transition: all 0.15s;
}

.pagination a:hover {
  background: var(--zinc-50);
}

/* ─── FOOTER ─── */

.site-footer {
  background: var(--zinc-950);
  border-top: 1px solid var(--zinc-800);
  padding: 80px 0 40px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.footer-col p,
.footer-col a {
  font-size: 14px;
  color: var(--zinc-400);
  line-height: 1.6;
}

.footer-col a {
  display: block;
  margin-top: 8px;
  transition: color 0.15s;
}

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

.footer-bottom {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--zinc-800);
}

.footer-bottom p {
  font-size: 12px;
  color: var(--zinc-600);
}

/* ─── GHOST PORTAL OVERRIDE ─── */

/* Make Ghost's Portal signup button match our monochrome */
:root {
  --ghost-accent-color: #09090b !important;
}

/* ─── MEMBERSHIP CONTENT GATE ─── */

.post-content .kg-nft-card,
.post-content .gh-post-upgrade-cta {
  border-radius: 16px;
  border: 1px solid var(--zinc-200);
}
