/* ============================================================
   Constitutional Observer — Ghost Theme Stylesheet
   ============================================================ */

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

:root {
  --ink: #1a1a1a;
  --ink-light: #4a4a4a;
  --ink-faint: #8a8a8a;
  --paper: #faf9f6;
  --paper-warm: #f5f1eb;
  --accent: #c0392b;
  --accent-hover: #a5311f;
  --accent-faint: rgba(192, 57, 43, 0.08);
  --rule: #d4c9b8;
  --rule-light: #e8e0d4;
  --max-width: 680px;
  --wide-width: 1080px;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-sans: 'Source Sans 3', 'Helvetica Neue', Helvetica, sans-serif;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

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

/* ── Utility ── */
.gh-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.gh-inner--wide {
  max-width: var(--wide-width);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ============================================================
   Header / Navigation
   ============================================================ */
.gh-head {
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(250, 249, 246, 0.92);
}

.gh-head-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gh-head-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gh-head-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.gh-head-logo img {
  max-height: 32px;
  width: auto;
}

.gh-head-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
}

.gh-head-menu a {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-light);
  transition: color 0.2s;
}

.gh-head-menu a:hover {
  color: var(--accent);
}

.gh-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gh-btn {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 20px;
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  line-height: 1.4;
}

.gh-btn:hover {
  background: var(--accent);
  color: #fff;
}

.gh-btn--fill {
  background: var(--accent);
  color: #fff;
}

.gh-btn--fill:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

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

.gh-burger svg {
  width: 20px;
  height: 20px;
  stroke: var(--ink);
}

/* ============================================================
   Homepage / Post Feed
   ============================================================ */

/* Hero section on homepage */
.gh-hero {
  padding: 80px 0 60px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}

.gh-hero-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.gh-hero-description {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-light);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

/* Feed */
.gh-feed {
  padding: 40px 0 80px;
}

.gh-feed-title {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-light);
}

/* Post card */
.gh-card {
  padding: 32px 0;
  border-bottom: 1px solid var(--rule-light);
}

.gh-card:last-child {
  border-bottom: none;
}

.gh-card-link {
  display: block;
  color: inherit;
}

.gh-card-link:hover .gh-card-title {
  color: var(--accent);
}

.gh-card-meta {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gh-card-meta .meta-dot {
  color: var(--rule);
}

.gh-card-tag {
  color: var(--accent);
}

.gh-card-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.gh-card-excerpt {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Featured post */
.gh-card--featured {
  padding: 48px 0;
}

.gh-card--featured .gh-card-title {
  font-size: 2rem;
}

.gh-card--featured .gh-card-excerpt {
  font-size: 1.05rem;
}

/* Post card with image */
.gh-card--image {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 32px;
  align-items: start;
}

.gh-card-image {
  aspect-ratio: 3/2;
  object-fit: cover;
  border: 1px solid var(--rule-light);
}

/* ============================================================
   Single Post
   ============================================================ */
.gh-article {
  padding: 0 0 60px;
}

/* Post header */
.gh-article-header {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 40px;
}

.gh-article-tag {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 20px;
  display: inline-block;
}

.gh-article-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 20px;
}

.gh-article-excerpt {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-light);
  line-height: 1.55;
  margin-bottom: 28px;
}

.gh-article-meta {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.gh-article-meta .meta-dot { color: var(--rule); }

.gh-article-author-image {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 4px;
}

.gh-article-reading-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Feature image */
.gh-article-image {
  margin: 0 auto 40px;
  max-width: var(--wide-width);
  padding: 0 24px;
}

.gh-article-image img {
  width: 100%;
  border: 1px solid var(--rule-light);
}

.gh-article-image figcaption {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-align: center;
  margin-top: 12px;
  font-style: italic;
}

/* Post body / Ghost content */
.gh-content {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.78;
  color: var(--ink);
}

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

.gh-content p {
  hyphens: auto;
}

/* Drop cap on first paragraph */
.gh-content > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 4.2rem;
  font-weight: 700;
  line-height: 0.78;
  padding: 4px 10px 0 0;
  color: var(--accent);
}

/* Headings in content */
.gh-content h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 2.4em;
  margin-bottom: 0.6em;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.gh-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.5em;
  line-height: 1.35;
}

.gh-content h4 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2em;
  margin-bottom: 0.4em;
}

/* Blockquotes / Pull quotes */
.gh-content blockquote {
  margin: 2.2em 0;
  padding: 28px 0 28px 28px;
  border-left: 3px solid var(--accent);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--ink-light);
}

.gh-content blockquote p {
  margin: 0;
}

.gh-content blockquote em {
  font-style: normal;
}

/* Links in content */
.gh-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(192, 57, 43, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.gh-content a:hover {
  text-decoration-color: var(--accent);
}

/* Lists */
.gh-content ul, .gh-content ol {
  padding-left: 1.6em;
}

.gh-content li {
  margin-bottom: 0.5em;
}

/* Horizontal rule — section dividers */
.gh-content hr {
  border: none;
  text-align: center;
  margin: 2.4em 0;
}

.gh-content hr::after {
  content: '✦  ✦  ✦';
  color: var(--rule);
  font-size: 0.9rem;
  letter-spacing: 0.3em;
}

/* Images in content */
.gh-content .kg-image-card,
.gh-content .kg-gallery-card {
  margin-top: 2em;
  margin-bottom: 2em;
}

.gh-content .kg-image-card img {
  border: 1px solid var(--rule-light);
}

.gh-content .kg-image-card.kg-width-wide {
  max-width: var(--wide-width);
  margin-left: calc(50% - min(var(--wide-width)/2, 50vw) + 24px);
  margin-right: calc(50% - min(var(--wide-width)/2, 50vw) + 24px);
}

.gh-content .kg-image-card.kg-width-full {
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.gh-content figcaption {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-align: center;
  margin-top: 12px;
  font-style: italic;
}

/* Embedded content / cards */
.gh-content .kg-bookmark-card {
  margin: 2em 0;
  border: 1px solid var(--rule);
  background: var(--paper-warm);
  transition: border-color 0.2s;
}

.gh-content .kg-bookmark-card:hover {
  border-color: var(--accent);
}

.gh-content .kg-bookmark-container {
  display: flex;
  text-decoration: none;
  color: inherit;
}

.gh-content .kg-bookmark-content {
  flex: 1;
  padding: 20px;
}

.gh-content .kg-bookmark-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.gh-content .kg-bookmark-description {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gh-content .kg-bookmark-metadata {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 10px;
}

.gh-content .kg-bookmark-thumbnail {
  width: 180px;
  min-height: 100%;
}

.gh-content .kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Code blocks */
.gh-content pre {
  background: var(--ink);
  color: #e0ddd5;
  padding: 20px 24px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 2em 0;
  border-radius: 2px;
}

.gh-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88em;
}

.gh-content p code {
  background: var(--accent-faint);
  padding: 2px 6px;
  border-radius: 2px;
}

/* Tables */
.gh-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.9rem;
}

.gh-content th {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--rule);
}

.gh-content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule-light);
}

/* Footnotes */
.gh-content .footnotes-sep {
  margin-top: 3em;
}

.gh-content .footnotes {
  font-size: 0.85rem;
  color: var(--ink-light);
}

.gh-content .footnotes ol {
  padding-left: 1.4em;
}

.gh-content .footnotes li {
  margin-bottom: 0.8em;
}

/* ============================================================
   Post Tags (bottom of post)
   ============================================================ */
.gh-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--rule-light);
}

.gh-article-tags a {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  background: var(--accent-faint);
  color: var(--accent);
  font-weight: 600;
  transition: all 0.2s;
}

.gh-article-tags a:hover {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   Author Box
   ============================================================ */
.gh-author-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 32px 0;
  margin-top: 32px;
  border-top: 1px solid var(--rule);
}

.gh-author-box-image {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.gh-author-box-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.gh-author-box-bio {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--ink-light);
  line-height: 1.6;
}

/* ============================================================
   Subscribe / CTA Section
   ============================================================ */
.gh-subscribe {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  padding: 48px 32px;
  text-align: center;
  margin: 48px 0;
}

.gh-subscribe-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.gh-subscribe-description {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--ink-light);
  margin-bottom: 24px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.gh-subscribe-form {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.gh-subscribe-input {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 10px 16px;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}

.gh-subscribe-input:focus {
  border-color: var(--accent);
}

.gh-subscribe-input::placeholder {
  color: var(--ink-faint);
}

/* ============================================================
   Pagination
   ============================================================ */
.gh-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 40px 0;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.gh-pagination a {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

/* ============================================================
   Tag / Author Archive Pages
   ============================================================ */
.gh-archive-header {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0;
}

.gh-archive-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.gh-archive-description {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink-light);
  line-height: 1.6;
}

.gh-archive-count {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 12px;
}

/* ============================================================
   Error Page
   ============================================================ */
.gh-error {
  text-align: center;
  padding: 120px 24px;
}

.gh-error-code {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 800;
  color: var(--rule);
  line-height: 1;
}

.gh-error-message {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--ink-light);
  margin: 16px 0 32px;
}

/* ============================================================
   Footer
   ============================================================ */
.gh-foot {
  border-top: 1px solid var(--rule);
  padding: 40px 0;
  margin-top: 0;
}

.gh-foot-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.gh-foot-copyright {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.gh-foot-nav {
  list-style: none;
  display: flex;
  gap: 20px;
}

.gh-foot-nav a {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.gh-foot-nav a:hover {
  color: var(--accent);
}

/* ============================================================
   Members / Portal Integration
   ============================================================ */
.gh-post-upgrade-cta {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  padding: 40px 32px;
  text-align: center;
  margin: 2em 0;
}

.gh-post-upgrade-cta h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.gh-post-upgrade-cta p {
  font-size: 0.92rem;
  color: var(--ink-light);
  margin-bottom: 20px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  html { font-size: 16px; }

  .gh-hero-title { font-size: 2rem; }
  .gh-article-title { font-size: 2rem; }
  .gh-article-header { padding: 40px 0 28px; }

  .gh-card--image {
    grid-template-columns: 1fr;
  }

  .gh-card--image .gh-card-image {
    order: -1;
    max-height: 200px;
  }

  .gh-head-menu { display: none; }
  .gh-burger { display: block; }

  .gh-head.is-open .gh-head-menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 20px 24px;
    gap: 16px;
  }

  .gh-subscribe-form {
    flex-direction: column;
  }

  .gh-foot-inner {
    flex-direction: column;
    text-align: center;
  }

  .gh-content blockquote {
    margin: 1.6em 0;
    padding-left: 20px;
    font-size: 1.05rem;
  }

  .gh-author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .gh-article-title { font-size: 1.7rem; }
  .gh-card-title { font-size: 1.3rem; }
  .gh-hero-title { font-size: 1.7rem; }
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.gh-article-header,
.gh-content > *,
.gh-card {
  animation: fadeUp 0.5s ease both;
}
