/* =====================================================================
   FishFly Ghost theme
   Chrome ported byte-for-byte from fishfly.ai homepage.
   Article body is editorial / reading-tuned.
   ===================================================================== */

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

:root {
  --bg: #f7f3ec;
  --bg-alt: #efe9df;
  --card-bg: #ffffff;
  --text: #1a1f2e;
  --text-soft: #4a5568;
  --text-muted: #8b8478;
  --accent: #1e3a5f;
  --accent-soft: #2a4d7a;
  --sand: #c89668;
  --sand-soft: #e8c9a3;
  --rust: #8b3a3a;
  --rule: #d8d2c4;
  --rule-soft: #e8e4dc;

  /* Reading-tuned scale */
  --reading-max: 68ch;
  --reading-body: 19px;
  --reading-leading: 1.75;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.serif { font-family: "Playfair Display", Georgia, serif; }
.mono  { font-family: "JetBrains Mono", monospace; }

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; height: auto; display: block; }

/* =====================================================================
   NAV  (verbatim from fishfly.ai)
   ===================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 243, 236, 0.88);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
}
.brand-mark { width: 44px; height: 44px; display: block; }
.brand-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.85rem;
  letter-spacing: -0.005em;
  color: var(--accent);
}
.brand-name .dot {
  color: var(--sand);
  font-weight: 500;
  padding: 0 0.08em;
}
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.cta {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 2px;
}
.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}
@media (max-width: 560px) {
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.84rem; }
  .brand-name { display: none; }
}

/* =====================================================================
   PAGE FRAME
   ===================================================================== */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page > main {
  flex: 1;
}

/* =====================================================================
   INDEX (post listing — Field Notes)
   ===================================================================== */

.index-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 6vw 32px;
  text-align: center;
}
.index-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.index-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--accent);
  margin-bottom: 16px;
}
.index-subtitle {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-soft);
  margin: 0 auto 16px;
  max-width: 540px;
}
.index-rule {
  width: 60px;
  height: 1px;
  background: var(--sand);
  margin: 24px auto 0;
}

.post-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 6vw 80px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 36px;
}

/* --- Post card --- */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 58, 95, 0.08);
}
.post-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-alt);
}
.post-card-body {
  padding: 24px 26px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-card-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 12px;
}
.post-card-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  line-height: 1.18;
  color: var(--accent);
  margin-bottom: 12px;
}
.post-card-excerpt {
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 20px;
}
.post-card-meta {
  margin-top: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.post-card-meta .dot { color: var(--sand); margin: 0 0.5em; }

/* =====================================================================
   PAGINATION
   ===================================================================== */

.pagination {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 6vw 96px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.pagination a {
  color: var(--text-soft);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 2px;
  transition: color 0.15s ease;
}
.pagination a:hover { color: var(--accent); }
.pagination .page-of { letter-spacing: 0.1em; }

/* =====================================================================
   POST / PAGE — reading-tuned
   ===================================================================== */

.article {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 6vw 24px;
}
.article-header {
  text-align: center;
  margin-bottom: 48px;
  padding: 0 4vw;
}
.article-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.article-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--accent);
  margin-bottom: 20px;
}
.article-subtitle {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--text-soft);
  max-width: 640px;
  margin: 0 auto 28px;
}
.article-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.article-meta .dot { color: var(--sand); margin: 0 0.6em; }
.article-rule {
  width: 60px;
  height: 1px;
  background: var(--sand);
  margin: 32px auto 0;
}

.article-feature {
  max-width: 1100px;
  margin: 0 auto 56px;
  padding: 0 6vw;
}
.article-feature img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  border-radius: 4px;
}
.article-feature-caption {
  margin-top: 12px;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
}

/* Reading-tuned body */
.article-body {
  max-width: var(--reading-max);
  margin: 0 auto;
  padding: 0 6vw 80px;
  font-size: var(--reading-body);
  line-height: var(--reading-leading);
  color: var(--text);
}
.article-body > * + * { margin-top: 1.3em; }
.article-body p { line-height: var(--reading-leading); }

.article-body h2,
.article-body h3,
.article-body h4 {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--accent);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-top: 2.2em;
}
.article-body h2 { font-size: 1.9rem; font-weight: 600; }
.article-body h3 { font-size: 1.45rem; font-weight: 600; }
.article-body h4 { font-size: 1.18rem; font-weight: 600; }

.article-body a {
  color: var(--accent);
  border-bottom: 1px solid var(--sand);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.article-body a:hover {
  color: var(--rust);
  border-bottom-color: var(--rust);
}

.article-body blockquote {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.45;
  color: var(--accent);
  border-left: 3px solid var(--sand);
  padding: 0.2em 0 0.2em 1.4em;
  margin: 1.6em 0;
}
.article-body blockquote p { line-height: 1.45; }
.article-body blockquote cite,
.article-body blockquote footer {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1em;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
}
.article-body li + li { margin-top: 0.5em; }
.article-body li::marker { color: var(--sand); }

.article-body hr {
  border: none;
  height: 1px;
  background: var(--rule);
  margin: 2.5em auto;
  width: 40%;
}

.article-body code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88em;
  background: var(--bg-alt);
  color: var(--rust);
  padding: 2px 6px;
  border-radius: 3px;
}
.article-body pre {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88em;
  background: #1a1f2e;
  color: #efe9df;
  padding: 18px 22px;
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.55;
}
.article-body pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.article-body figure {
  margin: 2em 0;
}
.article-body figure img {
  width: 100%;
  border-radius: 4px;
}
.article-body figcaption {
  margin-top: 10px;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
}

/* Ghost figure / Koenig card overrides */
.article-body .kg-image-card,
.article-body .kg-gallery-card,
.article-body .kg-embed-card {
  margin: 2em -2em;
}
@media (min-width: 900px) {
  .article-body .kg-width-wide  { margin-left: -8vw; margin-right: -8vw; }
  .article-body .kg-width-full  { margin-left: -16vw; margin-right: -16vw; }
}
.article-body .kg-image-card figcaption,
.article-body .kg-gallery-card figcaption {
  margin-top: 10px;
}

/* Bookmark card */
.article-body .kg-bookmark-card {
  margin: 2em 0;
}
.article-body .kg-bookmark-container {
  display: flex;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--card-bg);
}
.article-body .kg-bookmark-content {
  flex: 1 1 75%;
  padding: 22px 24px;
}
.article-body .kg-bookmark-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.article-body .kg-bookmark-description {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 12px;
}
.article-body .kg-bookmark-metadata {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.article-body .kg-bookmark-thumbnail img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.article-body .kg-bookmark-icon {
  width: 22px;
  height: 22px;
  margin-right: 8px;
  vertical-align: text-bottom;
}

/* Callout / Toggle / etc — light touch */
.article-body .kg-callout-card {
  background: var(--bg-alt);
  border-left: 3px solid var(--sand);
  padding: 18px 22px;
  border-radius: 0 4px 4px 0;
  margin: 2em 0;
}

/* =====================================================================
   POST FOOTER — share / read next
   ===================================================================== */

.post-end {
  max-width: var(--reading-max);
  margin: 0 auto;
  padding: 24px 6vw 64px;
}
.post-end-rule {
  width: 60px;
  height: 1px;
  background: var(--sand);
  margin: 0 auto 28px;
}
.post-tags {
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.post-tags a {
  color: var(--text-soft);
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  margin: 0 4px;
}
.post-tags a:hover { color: var(--accent); border-color: var(--accent-soft); }

/* Subscribe nudge (links to fishfly.ai/#signup, not native form) */
.subscribe-nudge {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 6vw 80px;
  text-align: center;
}
.subscribe-nudge-rule {
  width: 60px;
  height: 1px;
  background: var(--sand);
  margin: 0 auto 28px;
}
.subscribe-nudge-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.subscribe-nudge-title {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 22px;
  line-height: 1.35;
}
.subscribe-nudge-button {
  display: inline-block;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 12px 28px;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 3px;
  transition: background 0.15s ease, color 0.15s ease;
}
.subscribe-nudge-button:hover {
  background: var(--accent-soft);
}

/* =====================================================================
   ERROR
   ===================================================================== */

.error-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 120px 6vw;
  text-align: center;
}
.error-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 24px;
}
.error-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  line-height: 1.1;
}
.error-message {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-soft);
  margin-bottom: 40px;
}
.error-back {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 2px;
}

/* =====================================================================
   FOOTER (verbatim from fishfly.ai)
   ===================================================================== */

.footer {
  border-top: 1px solid var(--rule);
  padding: 60px 6vw 48px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.footer-copy { margin-bottom: 16px; }
.footer-links a {
  color: var(--text-soft);
  margin: 0 4px;
  transition: color 0.15s ease;
}
.footer-links a:hover { color: var(--accent); }
.footer-links .sep { color: var(--rule); margin: 0 6px; }
